Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have postfix v2.6.6 running on CentOS 6.3, hostname priest.ocsl.local (private, internal domain) with a number of aliases

requests: "|/opt/rt4/bin/rt-mailgate --queue 'general' --action  correspond --url http://localhost/", supportpeople
help: "|/opt/rt4/bin/rt-mailgate --queue 'help' --action correspond --url http://localhost/", supportpeople

If I leave postfix with its default configuration, then the aliases are resolved correctly/as I expect, so that incoming mail to, say, will be piped through the rt-mailgate mailgate command and also be delivered (via the mail server for (a publicly resolvable domain)) to, user2, etc.

The problem comes when I define mydomain = in /etc/postfix/ (with the intention that outgoing mail come from, for example, When I do this, postfix continues to run the piped command correctly, however it no longer expands the nested aliases as I expect: instead of trying to deliver to, user2 etc, it tries to send to, which does not exist on the upstream mail server and generates NDRs. postconf -n for the non-working configuration follows (the working configuration differs only by the "mydomain" line.

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost
mydomain =
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
unknown_local_recipient_reject_code = 550

We did have things working as we expected/wanted previously on an older system running Sendmail.

share|improve this question
up vote 1 down vote accepted

The supportpeople values do not have a domain part in your $alias_maps, thus Postfix appends $mydomain to them (because of $append_dot_mydomain). With mydomain = Postfix expands supportpeople to and tries to route the mail to the MX for that domain. To avoid that, change the right-hand supportpeople values to a full address for which your Postfix is the final destination, e.g. supportpeople@localhost.

Besides, for changing the sender address you'd use $myorigin, not $mydomain.

share|improve this answer
I thought $myorigin was by default, set to $mydomain. Obviously it affects others things too. – Norky Oct 9 '12 at 8:11
Thank you @Angsar, setting the alias destination to made things work as I wanted. – Norky Oct 9 '12 at 8:35
The above is incorrect. $mydomain is never appended to localparts, it is appended to bare hostnames. $myorigin is appended to bare locaparts if append_at_myorigin is set. – adaptr Oct 9 '12 at 8:36
@adaptr Hmm... weird. I re-checked and it turns out you're right. However, the OP's setup should have worked then even with mydomain =, since $myorigin defaults to $myhostname, which is a final destination according to his config. – Ansgar Wiechers Oct 9 '12 at 17:31
mydomain != myhostname != myorigin – adaptr Oct 11 '12 at 8:25

Your Answer


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.