I've got a postfix virtual setup with MySQL and dovecot. Everything is working fine, the only problem currently is that mails to root are not delivered locally as it should be. Instead, postfix expands mails sent to "root" to "[email protected]". As there's no virtual mailbox for [email protected], they can't be delivered:
Nov 17 03:20:26 xxx postfix/qmgr[16914]: E49903AB4045: from=<[email protected]>, size=783, nrcpt=1 (queue active)
Nov 17 03:20:26 xxx postfix/pipe[17901]: E49903AB4045: to=<[email protected]>, orig_to=<root>, relay=dovecot, delay=626, delays=625/0.01/0/0.17, dsn=4.1.1, status=SOFTBOUNCE (user unknown)
To get this fixed, I've tried what is described at
http://www.postfix.org/STANDARD_CONFIGURATION_README.html#some_local
and added a root alias to my sql virtual alias maps:
| address | goto | domain | created | modified | active |
+---------------+------------------+---------------+---------------------+---------------------+--------+
| root | root@localhost | localhost | 2013-11-18 11:20:00 | 2013-11-18 11:20:00 | 1 |
At least it has changed a bit now, but it's still not working, as it seems the domainname is expanded to [email protected] now:
Nov 18 11:36:39 xxx postfix/qmgr[16914]: 0741763B6001: from=<[email protected]>, size=316, nrcpt=1 (queue active)
Nov 18 11:36:39 xxx postfix/smtp[30046]: 0741763B6001: to=<[email protected]>, orig_to=<root>, relay=none, delay=11, delays=11/0/0.52/0, dsn=4.4.6, status=SOFTBOUNCE (mail for localhost.example.com loops back to myself)
From my main.cf:
mydestination = localhost.localdomain, localhost
mydomain = example.com
myhostname = mail.example.com
myorigin = $mydomain
smtpd_recipient_restrictions = permit_mynetworks,reject_non_fqdn_recipient,permit_sasl_authenticated,reject_unauth_destination,reject_rbl_client zen.spamhaus.org,pcre:/etc/postfix/dspam_filter_access
virtual_alias_maps = mysql:/etc/postfix/sql_virtual_alias_maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/sql_virtual_domain_maps.cf
virtual_mailbox_maps = mysql:/etc/postfix/sql_virtual_mailbox_maps.cf
As far as I understand, Postfix should check the sql_virtual_alias_maps, forward mails to root
to root@localhost
, and try to deliver this locally.
What am I doing wrong and how do I get postfix to deliver these root-mails locally?
OK, I fixed it. The problem was the parameter
which is set to
yes
per default. After setting, in
main.cf
, it's working as it should.It looks like its trying to forward to it self, do you by any chance define that the "goto" field in your db, is the forwarding address? if so, try to delete that forward and see if that helps