LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   changing Sendmail from address (apache) to other depending on the virtual host (https://www.linuxquestions.org/questions/linux-server-73/changing-sendmail-from-address-apache-to-other-depending-on-the-virtual-host-4175556954/)

rolty 10-23-2015 06:18 AM

changing Sendmail from address (apache) to other depending on the virtual host
 
I have a server with many virtual domains.
Several of these have forms and alert emails which are sent via php and sendmail.
Currently these all have headers of the form:

Code:

Return-Path: <apache@xxx.com>
Received: from xxx.com (localhost.localdomain [127.0.0.1])
        by xxx.com (8.14.4/8.14.4) with ESMTP id t9NAHgLJ031067
        for <mail@blah.co.uk>; Fri, 23 Oct 2015 11:17:42 +0100
Received: (from apache@localhost)
        by xxx.com (8.14.4/8.14.4/Submit) id t9NAHgES031066;

This is causing a lot of problems with spam classification and blocks.
Ive tried adding relevant domains to the trusted domains list, and using php with the -f feature , eg

PHP Code:

mail("jim@blah.co.uk""Rolty's Form"$message$headers"-fmail@blah.co.uk"); 

This has no effect..
Ive also looked into using the generics table, but as the actual sender of the email is always apache, it looks like I could only rewrite that to one other address, is that correct?

Several hours on google has me going round in circles, can anyone point the way?

Thanks!

ceyx 10-23-2015 11:50 AM

If you were using Postfix, "virtual-alias-maps" might do the trick.

rolty 10-24-2015 05:45 AM

Sadly I'm not using Postfix, and it's not very likely that this situation will change.. Anyone have an idea for sendmail?

ceyx 10-24-2015 10:23 AM

Postfix has its own sendmail compatible interface - you probably won't know the difference.
Depending on your distro, if Postfix is installed it will install the sendmail interface too.


rolty 10-25-2015 02:14 PM

OK I will look into this... the mail server is live with over 100 active users so I will have to be very careful not to interrupt anyones service, its a shame there doesnt seem to be another way to do this!, will report back when Ive done some study, thanks!


All times are GMT -5. The time now is 06:19 PM.