| Linode Forum https://forum.linode.com/ |
|
| Postfix mydestination question https://forum.linode.com/viewtopic.php?f=11&t=4747 |
Page 1 of 1 |
| Author: | pmmenneg [ Mon Oct 19, 2009 10:51 pm ] |
| Post subject: | Postfix mydestination question |
Having looked at the Postfix documentation, it looks like the standard practice for Postfix configuration is to have your mydestination entry point to your localhost: http://www.postfix.org/postconf.5.html#mydestination Mine in my main.cf looks like this (domain names faked so that if I have a big hole in the server I'm not pointing spammers at my server): Code: #this resolves to the mail server I have a few virtual domains & mailboxes that PHP is sending email to users from, and I've got them listed as follows: Code: virtual_mailbox_domains = example.net, example.com My question relates to the email headers that are sent with the email from my PHP scripts. In the header, as expected based on the above settings, a few of the headers are as follows: Code: Return-Path: <www-data@liXX-XX.members.linode.com> So, it would be great to be able to have the return-path be the same email account that is sending the email via PHP (specified in the email from, reply-to headers) for each virtual domain (i.e. webmaster@example.com, listmaster@eample.net, etc) rather than the default PHP user with the full path to the server (the linode dns path). But since I can't specify virtual domains in mydestination, is this even possible? Second question, the Received field indicates the hostname of the server. Again, would be great to have this be the same domain as the virtual domain that sends the email, rather than the linode domain name... again, is this possible with virtual domains? Thanks for any info, Paul |
|
| Author: | mjrich [ Mon Oct 19, 2009 11:26 pm ] |
| Post subject: | Re: Postfix mydestination question |
pmmenneg wrote: it would be great to be able to have the return-path be the same email account that is sending the email via PHP (specified in the email from, reply-to headers) for each virtual domain (i.e. webmaster@example.com, listmaster@eample.net, etc) rather than the default PHP user with the full path to the server (the linode dns path). Check out the php mail docs -- you can set the From: header either individually in the additional_headers, or globally via php.ini. pmmenneg wrote: Second question, the Received field indicates the hostname of the server. Again, would be great to have this be the same domain as the virtual domain that sends the email, rather than the linode domain name... again, is this possible with virtual domains?
Easy enough on Exim, but not sure of the best way on Postfix. Undoubtedly someone else will pipe up. |
|
| Author: | pmmenneg [ Mon Oct 19, 2009 11:33 pm ] |
| Post subject: | |
I have set the From, Reply-To in the additional headers... Return-Path is the one I'd like to 'clean up' if possible, but thought that was likely more of a Postfix issue than PHP. I've tried setting it from PHP and no luck. |
|
| Author: | mjrich [ Tue Oct 20, 2009 12:12 am ] |
| Post subject: | |
Fair enough. My assumption had been that you weren't setting anything in mail(), and hence that your MTA was then cleaning up the headers (inserting defaults) in their absence. Presumably you put \r\n, or similar between the headers, and have tried the -f option also. But yes, you are probably correct in thinking that it's a Postfix/MTA issue. |
|
| Author: | pmmenneg [ Tue Oct 20, 2009 10:04 am ] |
| Post subject: | Figured it out, I think |
Figured it out I believe. Passing Postfix the sender email via the -f parameter from the PHP mail() function changed the sender envelope so that the email now appears to originate from the actual sender. paul |
|
| Author: | pmmenneg [ Tue Oct 20, 2009 11:48 am ] |
| Post subject: | Re: Figured it out, I think |
pmmenneg wrote: Figured it out I believe. Passing Postfix the sender email via the -f parameter from the PHP mail() function changed the sender envelope so that the email now appears to originate from the actual sender.
paul Actually, this just solved the issue related to the destination, but not the other 'issue' related to the mail server domain from Postfix's myhostname setting. Anyone aware of a way to have the Postfix MTA domain set to your virtual domain (say mx.example.com, mx.example.net, etc all of which would resolve to the server and would be a FQDN) rather than having it hardcoded to a single 'universal' domain name? Thanks, Paul |
|
| Page 1 of 1 | All times are UTC-04:00 |
| Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |
|