[BlueOnyx:17379] Re: webhosting only, email hosted on another server

Michael Stauber mstauber at blueonyx.it
Fri Mar 27 20:10:01 -05 2015


Hi Ken,

> What is the recommended way to configure BlueOnyx for webhosting only, where 
> email for the domains is hosted separately?  Yet websites may want to use 
> sendmail to email form data.

"Site Management" / "Site" / "Services" / "Email". Tick the checkbox for
"Disable Email for Domain" and save.

That way emails that arrive locally for that domain are sent to the MX
for the domain instead of terminating it at a local mailbox of the Vsite.

For this to work you also must make sure that the DNS server on the box
is either disabled or does not have an MX for the domain that says
"terminate locally". If you have "Auto-DNS" enabled for the Vsite you
could have an auto generated MX entry in your DNS that would prevent the
email from reaching the mailserver where it's supposed to go.

> 1)  Some legacy websites have contact forms that use a CGI script and 
> sendmail to send an email.  And of course the recipient address is at the 
> same domain as the website.

Generally speaking you'll have two problems with such scripts: The
sender address usually won't match the MX for the Vsite, because the MX
is pointing to the extra mailserver. So the mail might get tagged as
SPAM by recipients.

The second problem is: If the recipient email address is the same as the
name of the Vsite, then it'll only end up at that other mailserver if
you followed all the above steps.

> 2)  New problem, I think this started with a yum update some time within the 
> past month or two.  Unless I modify the customer's CGI script to use the 
> sendmail -f option, the envelope sender is apache at server_hostname.domain.com 
> which sendmail rejects because that's not a valid sender address.

That is intended and that is how Apache and PHP (if used as DSO) handle
things. The PHP mail() function will always use the owner of the script
(the UID who runs it!) as sender. Which is "apache" if you use PHP as DSO.

If you use suPHP instead, then it will use the siteAdmin as sender who
owns /web of the Vsite.

On 5209R you also have some more options on how to use PHP. Such as PHP
(DSO) + mod_ruid2, which also lets you set a siteAdmin as owner. Of
PHP-FPM, which also allows to set a siteAdmin as owner.

Lastly: Regardless which PHP implementation you use, you can always use
"-f" to set the sender address manually.

> Luckily newer sites use PHP libraries to send email rather than sendmail. 

Yes, it is superior to use a PHP library (or Perl library) that allows
you to use SMTP-Auth for sending emails from scripts. That makes things
a lot easier and adds more flexibility.

-- 
With best regards

Michael Stauber



More information about the Blueonyx mailing list