[SOLVED] dovecot/postfix relay access denied

hello guys im kinda stuck and would be nice if u can give me a hand with that, ive used this guide to set up the mail server: ~~[https://www.linode.com/docs/email/postfix/email-with-postfix-dovecot-and-mysql" target="_blank">](https://www.linode.com/docs/email/postf … -and-mysql">https://www.linode.com/docs/email/postfix/email-with-postfix-dovecot-and-mysql]( but something is wrong, also ive replaced

smtpd_recipient_restrictions =
          permit_sasl_authenticated,
          permit_mynetworks,
          reject_unauth_destination

with

 smtpd_relay_restrictions =
    permit_mynetworks
    permit_sasl_authenticated
    reject_unauth_destination

but nothing changed. i cant receive/send emails at all.

ubuntu 14.04, postfix 2.11.0, dovecot 2.2.9

mail.log

May  7 20:38:23 raczarnia postfix/smtpd[4175]: connect from hosting0.xxx.xx[123.22.333.44]
May  7 20:38:23 raczarnia postfix/smtpd[4175]: NOQUEUE: reject: RCPT from hosting0.xxx.xx[123.22.333.44]: 454 4.7.1 <login@host.com>: Relay access denied; from= <test@xxx.xx>to= <login@host.com>proto=ESMTP helo= <vv1-xeon.xxx.xx>May  7 20:38:23 raczarnia postfix/smtpd[4175]: disconnect from hosting0.xxx.xx[123.22.333.44]</vv1-xeon.xxx.xx></login@host.com></test@xxx.xx></login@host.com> 

main.cf

 # See /usr/share/postfix/main.cf.dist for a commented, more complete version

  # Debian specific:  Specifying a file name will cause the first
  # line of that file to be used as the name.  The Debian default
  # is /etc/mailname.
  #myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
  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_tls_cert_file=/etc/dovecot/dovecot.pem
  smtpd_tls_key_file=/etc/dovecot/private/dovecot.pem
  smtpd_use_tls=yes
  smtpd_tls_auth_only = yes

  #Enabling SMTP for authenticated users, and handing off authentication to Dovecot
  smtpd_sasl_type = dovecot
  smtpd_sasl_path = private/auth
  smtpd_sasl_auth_enable = yes

  smtpd_relay_restrictions =
    permit_mynetworks
    permit_sasl_authenticated
    reject_unauth_destination
  # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
  # information on enabling SSL in the smtp client.

  myhostname = raczarnia
  alias_maps = hash:/etc/aliases
  alias_database = hash:/etc/aliases
  myorigin = /etc/mailname
  #mydestination = example.com, hostname.example.com, localhost.example.com, localhost
  mydestination = 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

  #Handing off local delivery to Dovecot's LMTP, and telling it where to store mail
  virtual_transport = lmtp:unix:private/dovecot-lmtp

  #Virtual domains, users, and aliases
  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

2 Replies

Have you followed the steps in the troubleshooting guide?

What does your mail log say when you restart Postfix and Dovecot? Your main.cf looks very broken - any line that starts with whitespace (a space or tab) is treated as a continuation of the previous line.

Why did you change smtpdrecipientrestrictions to smtpdrelayrestrictions?

What is the fully qualified domain name of the server (for example, foo.example.com)?

1. yes

2.

root@raczarnia:/home/rak# service postfix restart
 * Stopping Postfix Mail Transport Agent postfix                                                                                                                                                                                      [ OK ]
 * Starting Postfix Mail Transport Agent postfix                                                                                                                                                                                      [ OK ]
root@raczarnia:/home/rak# service dovecot restart
dovecot stop/waiting
dovecot start/running, process 8176
root@raczarnia:/home/rak# tail /var/log/mail.log
May  8 09:30:42 raczarnia postfix/smtpd[8020]: connect from unknown[unknown]
May  8 09:30:42 raczarnia postfix/smtpd[8020]: lost connection after CONNECT from unknown[unknown]
May  8 09:30:42 raczarnia postfix/smtpd[8020]: disconnect from unknown[unknown]
May  8 09:32:26 raczarnia postfix/master[6034]: terminating on signal 15
May  8 09:32:27 raczarnia postfix/master[8162]: daemon started -- version 2.11.0, configuration /etc/postfix
May  8 09:32:31 raczarnia dovecot: ssl-params: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
May  8 09:32:31 raczarnia dovecot: auth: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
May  8 09:32:31 raczarnia dovecot: log: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
May  8 09:32:31 raczarnia dovecot: master: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
May  8 09:32:31 raczarnia dovecot: master: Dovecot v2.2.9 starting up (core dumps disabled)

3. it was google found for the 551 relay access denied

4. domain is example.com, smtp/imap/pop3 is under mail.example.com and mail subdomain is mail.example.com

i will check the main.cf in a few hours maybe theres the problem with whitespaces or tabs and ill let you know, also i do a check with smtpdrecipientrestrictions cause it was first thing ive changed and there was other stuff to fix after but i forgot about that

–-edit---

so now it works but theres still issue with smtp, imap works i can receive mails but i cant send the mails though, you were right there was mess in my main.cf and also there was missing line in dovecot.conf - postmaster_address

weird cause telnet to my smtp works

root@raczarnia:~# telnet localhost 465
Trying 127.0.0.1...
Connected to mail.example.com.
Escape character is '^]'.
220 example.com ESMTP Postfix (Ubuntu)

current main.cf

# See /usr/share/postfix/main.cf.dist for a commented, more complete version

# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
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_tls_cert_file=/etc/dovecot/dovecot.pem
smtpd_tls_key_file=/etc/dovecot/private/dovecot.pem
smtpd_use_tls = yes
smtpd_tls_auth_only = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

#smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = raczarnia
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
#mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all

virtual_transport = lmtp:unix:private/dovecot-lmtp

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

–-edit---

everything works flawless now, seems like thunderbird had some issues with secure smtp - solved it by using roundcube instead

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct