Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I was running into the common problem that mail for "root" on my system was having $mydomain appended, and because $mydomain is not in $mydestination, the mail was being sent to our central mail server as "root@domain."

I cannot add $mydomain to $mydestination, because if I understand it correctly, that would mean all mail addressed to $mydomain would be looked up locally, and if an alias does not exist, delivery would fail.

So, I followed these instructions:

Delivering some, but not all accounts locally

which seems to have resolved the problem. Mail for "root" is now expanded according to /etc/aliases and delivered to the non-local address I desire. The one oddity however is that the "To:" address still reads "root@domain." Is there any way I can get the "To" address to be the one that the alias directed its delivery? So for example, if my alias says that mail for "root" should go to "hostname-admin@domain" is there any way the "To" address can be rewritten as "hostname-admin@domain?" Currently it still shows as "root@domain."

share|improve this question
add comment

1 Answer

You need to use the smtp_generic_maps Postfix feature.

The steps to achieve this are explained here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.