1

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

supportpeople: [email protected], [email protected], [email protected]
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, [email protected] will be piped through the rt-mailgate mailgate command and also be delivered (via the mail server for ocsl.co.uk (a publicly resolvable domain)) to [email protected], user2, etc.

The problem comes when I define mydomain = ocsl.co.uk in /etc/postfix/main.cf (with the intention that outgoing mail come from, for example, [email protected]). 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 [email protected], user2 etc, it tries to send to [email protected], 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 = ocsl.co.uk
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.

1 Answer 1

1

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 = ocsl.co.uk Postfix expands supportpeople to [email protected] 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.

10
  • I thought $myorigin was by default, set to $mydomain. Obviously it affects others things too.
    – Norky
    Oct 9, 2012 at 8:11
  • Thank you @Angsar, setting the alias destination to [email protected] made things work as I wanted.
    – Norky
    Oct 9, 2012 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, 2012 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 = ocls.co.uk, since $myorigin defaults to $myhostname, which is a final destination according to his config. Oct 9, 2012 at 17:31
  • 1
    mydomain != myhostname != myorigin
    – adaptr
    Oct 11, 2012 at 8:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .