Le 19/11/2010 21:14, Stan Hoeppner a écrit :
Why is Postfix ignoring the alias entry for root?
First, /etc/aliases only applies to "local" domains. but OP has
mydestination =
local_transport = error:local mail delivery is disabled
Second, non fqdn addresses get "fixed" by postfix. In particular, OP has
# postconf myorigin
myorigin = $myhostname
# postconf myhostname
myhostname = mail.example.org
so mail for <root> goes to <r...@mail.example.org>
I have run newaliases and restarted postfix and I can see that the
aliases.db has been updated.
This is really hard to say without seeing the actual contents of
/etc/aliases, /usr/bin/newaliases.postfix, and
/etc/postfix/relay_recipients, and unobfuscated log entries.
OP has (at least) two options:
Option 1)
deliver mail for root to a remote account (j...@example.net). This is
achieved by adding the following entry to virtual_alias_maps:
r...@mail.example.org j...@example.net
This way, mail for <root> will get sent to <j...@example.net>
Option 2)
deliver such mail to a local account.
for this, OP needs to remove his local_transport setting and set
mydestination = localhost.example.com
and keep
relay_domains =
and the virtual alias would be
r...@mail.example.org r...@localhost.example.com
addon:
to avoid accepting mail for *...@localhost.example.com via smtp, simply add
an access check to smtpd restrictions. for example:
smtpd_sender_restrictions =
check_recipient_access pcre:/etc/postfix/access_recipient.pcre
== access_recipient.pcre
/@localhost\.example\.com$/ REJECT blah blah
# block mail to our IPs
/@\[127/ REJECT blah blah
/@\[10\./ REJECT blah blah
This won't stop mail to j...@[local.ip]
you can use a pcre access check if that really matters...