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
myhostname = liXX-XX.members.linode.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
# this is a debian system, and this file has an entry liXX-XX.members.linode.com
myorigin = /etc/mailname
mydestination = liXX-XX.members.linode.com, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
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
virtual_mailbox_base = /mail
virtual_mailbox_maps = mysql:/etc/postfix/mysql/virtualmailboxes.cf
virtual_minimum_uid = 5000
virtual_uid_maps = static:5000
virtual_gid_maps = static:100
virtual_alias_maps = mysql:/etc/postfix/mysql/virtualaliases.cf
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>
Received: by liXX-XX.members.linode.com (Postfix, from userid 33)
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