Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am currently setting up a new virtual private server with Debian Wheezy. I managed to install postfix, dovecot (IMAP) and MySQL.

Up to now, I can successfully login via SSL with an external mail client like Thunderbird or my Android Mail client and receive mails. Sending however does not work yet as I am getting this error when trying to send:

Nov 13 13:35:30 vmd3299 dovecot: auth-worker(7819): mysql(127.0.0.1): Connected to database mailserver
Nov 13 13:35:30 vmd3299 dovecot: imap-login: Login: user=<kontakt@mydomain.de>, method=PLAIN, rip=109.44.0.191, lip=91.205.173.36, mpid=7821, TLS, session=<1/JfMw7rqABtLADF>
Nov 13 13:35:42 vmd3299 postfix/smtpd[7822]: connect from ip-109-44-0-191.web.vodafone.de[109.44.0.191]
Nov 13 13:35:43 vmd3299 postfix/smtpd[7822]: NOQUEUE: reject: RCPT from ip-109-44-0-191.web.vodafone.de[109.44.0.191]: 554 5.7.1 <kontakt@mydomain.de>: Recipient address rejected: Access denied; from=<kontakt@mydomain.de> to=<kontakt@mydomain.de> proto=ESMTP helo=<[10.149.184.22]>
Nov 13 13:35:43 vmd3299 postfix/smtpd[7822]: disconnect from ip-109-44-0-191.web.vodafone.de[109.44.0.191]

As far as I can see, the TLS login seems to work, but that's it. I can't send mails to any recipient, neither to external recipients nor to local mail accounts on the same domain.

My exact versions are:

  • Postfix 2.9.6
  • Debian Wheezy (3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64 GNU/Linux)

Here's my postfix main.cf:

#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_recipient_restrictions = permit_sasl_authenticated, reject

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
myhostname = vmd3299.myhoster.net
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = vmd3299.myhoster.net, localhost.myhoster.net, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf,mysql:/etc/postfix/mysql-email2email.cf
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1

After hours of googling I reached the point where I don't know what to do now. Can anybody help me with this and maybe walk me through the last steps? I somehow have the feeling that there's just a tiny bit to be done here. Thanks in advance!

Update:

After changing this line:

smtpd_recipient_restrictions = permit_sasl_authenticated, reject

to that:

smtpd_recipient_restrictions =
   permit_mynetworks
   permit_sasl_authenticated
   reject_unauth_destination

I was able to send a test mail to myself, recpipient was the same user that sent the mail. Other existing external recipients are still rejected:

Nov 13 14:19:45 vmd3299 postfix/smtpd[8240]: NOQUEUE: reject: RCPT from ip-109-44-0-191.web.vodafone.de[109.44.0.191]: 554 5.7.1 <ed.external@outside.com>: Relay access denied; from=<kontakt@mydomain.de> to=<eddie.external@outside.com> proto=ESMTP helo=<[10.149.184.191]>

Update:

I resolved this issue by adding these two lines into /etc/postfic/main.cf

smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth

Now everything works fine with TLS and authentication.

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.