I'm using sendmail to send Mails from PHP and also forward some mails addressed to the server to a list of external mail-providers. The forwarding is done via an entry in /etc/mail/virtusertable:
test@domain.com testuser
In my /etc/aliases I include the mail list file:
testuser: ":include:/home/mail-list"
This setup works so far but I wanted to ask how it is possible to change the Reply-To Header of mails sent to the virtual user testuser
via sendmail.mc? And if not is there another way to do this?
Best Answer
The proper way to set Reply-To is to do it in the MUA (PHP in your case), not in the MTA.
Example:
More info: http://php.net/manual/en/function.mail.php
If you insist on rewriting addresses through sendmail, you shall use genericstable (see http://www.sendmail.com/sm/open_source/docs/m4/features.html#genericstable)
Add the following lines to sendmail.mc and recompile it:
GENERICS_DOMAIN('name.of.localhost')dnl
FEATURE(`genericstable')dnl
create a map in /etc/genericstable to translate outgoing addresses. The file looks like this:
localuser newuser@newdomain
makemap hash /etc/genericstable.db < genericstable