Hello!

I'm trying to setup a mail server with postfix, dovecot and MySQL. At this
point dovecot seems to work (pop3, imap), but I'm unable to receive mails.
The postfix error is (replaced user/domains):

Jan 28 23:04:22 k002867vsa postfix/smtpd[22830]: NOQUEUE: reject: RCPT
from node-mec2.wormly.com[184.72.226.23]: 454 4.7.1
<m...@mydomain.com>: Relay access denied;
from=<f...@example.com> to=<m...@mydomain.com> proto=ESMTP
helo=<www.wormly.com>

What I found out so far is, that postfix doesn't feel responsible for
mydomain.com. When I change mydestination to mydomain.com, postfix accepts
mails.

But I want postfix to lookup the domain against mysql. I've read all the
tutorials around and I'm still getting this error. I tested my SQL queries
with postmap -q and they seem to work fine.

So I enabled verbose logging on smtpd and I didn't find any SQL query, so
I think postfix isn't even accessing the database. So here is a syslog
(real names replaced):

Jan 28 23:04:22 k002867vsa postfix/smtpd[22830]: <
node-mec2.wormly.com[184.72.226.23]: MAIL FROM:<f...@example.com>
...
Jan 28 23:04:22 k002867vsa postfix/smtpd[22830]: >
node-mec2.wormly.com[184.72.226.23]: 250 2.1.0 Ok
Jan 28 23:04:22 k002867vsa postfix/smtpd[22830]: <
node-mec2.wormly.com[184.72.226.23]: RCPT TO:<m...@mydomain.com>
Jan 28 23:04:22 k002867vsa postfix/smtpd[22830]: extract_addr: input:
<m...@mydomain.com>
Jan 28 23:04:22 k002867vsa postfix/smtpd[22830]: smtpd_check_addr:
addr=m...@mydomain.com
Jan 28 23:04:22 k002867vsa postfix/smtpd[22830]: ctable_locate: move
existing entry key m...@mydomain.com
Jan 28 23:04:22 k002867vsa postfix/smtpd[22830]: extract_addr: in:
<m...@mydomain.com>, result: m...@mydomain.com
Jan 28 23:04:22 k002867vsa postfix/smtpd[22830]: >>> START
Recipient address RESTRICTIONS <<<
Jan 28 23:04:22 k002867vsa postfix/smtpd[22830]: generic_checks:
name=permit_mynetworks
Jan 28 23:04:22 k002867vsa postfix/smtpd[22830]: permit_mynetworks:
node-mec2.wormly.com 184.72.226.23
Jan 28 23:04:22 k002867vsa postfix/smtpd[22830]: match_hostname:
node-mec2.wormly.com ~? 127.0.0.0/8
Jan 28 23:04:22 k002867vsa postfix/smtpd[22830]: match_hostaddr:
184.72.226.23 ~? 127.0.0.0/8
Jan 28 23:04:22 k002867vsa postfix/smtpd[22830]: match_hostname:
node-mec2.wormly.com ~? 93.189.*.*/26
Jan 28 23:04:22 k002867vsa postfix/smtpd[22830]: match_hostaddr:
184.72.226.23 ~? 93.189.*.*/26
Jan 28 23:04:22 k002867vsa postfix/smtpd[22830]: match_hostname:
node-mec2.wormly.com ~? 172.20.0.0/24
Jan 28 23:04:22 k002867vsa postfix/smtpd[22830]: match_hostaddr:
184.72.226.23 ~? 172.20.0.0/24
Jan 28 23:04:22 k002867vsa postfix/smtpd[22830]: match_hostname:
node-mec2.wormly.com ~? [::1]/128
Jan 28 23:04:22 k002867vsa postfix/smtpd[22830]: match_hostaddr:
184.72.226.23 ~? [::1]/128
Jan 28 23:04:22 k002867vsa postfix/smtpd[22830]: match_hostname:
node-mec2.wormly.com ~? [fe80::]/64
Jan 28 23:04:22 k002867vsa postfix/smtpd[22830]: match_hostaddr:
184.72.226.23 ~? [fe80::]/64
Jan 28 23:04:22 k002867vsa postfix/smtpd[22830]: match_list_match:
node-mec2.wormly.com: no match
Jan 28 23:04:22 k002867vsa postfix/smtpd[22830]: match_list_match:
184.72.226.23: no match
Jan 28 23:04:22 k002867vsa postfix/smtpd[22830]: generic_checks:
name=permit_mynetworks status=0
Jan 28 23:04:22 k002867vsa postfix/smtpd[22830]: generic_checks:
name=permit_sasl_authenticated
Jan 28 23:04:22 k002867vsa postfix/smtpd[22830]: generic_checks:
name=permit_sasl_authenticated status=0
Jan 28 23:04:22 k002867vsa postfix/smtpd[22830]: generic_checks:
name=defer_unauth_destination
Jan 28 23:04:22 k002867vsa postfix/smtpd[22830]:
reject_unauth_destination: m...@mydomain.com
Jan 28 23:04:22 k002867vsa postfix/smtpd[22830]: permit_auth_destination:
m...@mydomain.com
Jan 28 23:04:22 k002867vsa postfix/smtpd[22830]: ctable_locate: leave
existing entry key m...@mydomain.com
Jan 28 23:04:22 k002867vsa postfix/smtpd[22830]: NOQUEUE: reject: RCPT
from node-mec2.wormly.com[184.72.226.23]: 454 4.7.1
<m...@mydomain.com>: Relay access denied;
from=<f...@example.com> to=<m...@mydomain.com> proto=ESMTP
helo=<www.wormly.com>
Jan 28 23:04:22 k002867vsa postfix/smtpd[22830]: generic_checks:
name=defer_unauth_destination status=2
Jan 28 23:04:22 k002867vsa postfix/smtpd[22830]: >>> END
Recipient address RESTRICTIONS <<<
...

and postconf -d output:
        
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/lib/postfix
data_directory = /var/lib/postfix
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd
$daemon_directory/$process_name $process_id & sleep 5
html_directory = no
local_recipient_maps =
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
mydestination =
newaliases_path = /usr/bin/newaliases
readme_directory = /usr/share/doc/postfix
sample_directory = /usr/share/doc/postfix/examples
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
unknown_local_recipient_reject_code = 550
virtual_gid_maps = static:8
virtual_mailbox_base = /var/vmail
virtual_mailbox_maps = mysql:/etc/postfix/virtual_mailbox_maps.cf
virtual_uid_maps = static:999

postmap -q returns the mail location:

root@k002867vsa:/etc/postfix# postmap -q m...@mydomain.com
mysql:/etc/postfix/virtual_mailbox_maps.cf
mydomain.com/me/

Now why postfix doesn't lookup mydomain.com over MySQL?

Best regards,
Andreas


Reply via email to