SMTP? Postfix + Dovecot, "Relay Access.." SOLVED

I've followed the postfix guide (~~[http://library.linode.com/email/postfix/dovecot-mysql-ubuntu-10.04-lucid" target="_blank">](http://library.linode.com/email/postfix … 0.04-lucid">http://library.linode.com/email/postfix/dovecot-mysql-ubuntu-10.04-lucid]() to the letter (I think) and installed postfix, dovecot and saslauthd. I've setup my domains and users and I can receive emails perfectly fine, but I can't send them. I think there's problems trying to connect to the SMTP server or something?

In Roundcube I get this error message:

SMTP Error (554): Failed to add recipient "email@example.com" (5.7.1 : Relay access denied)

I've also tried using two other (windows) email clients which can both receive emails fine but can't connect to the SMTP server.

Here's the results of a telnet:

telnet localhost 25
ehlo localhost
250-li244-40.members.linode.com
250-PIPELINING
250-SIZE 30720000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN

Here's my postfix main.cf file:

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

append_dot_mydomain = no

smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.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

myhostname = li244-40.members.linode.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = li244-40.members.linode.com, localhost, localhost.localdomain
relayhost = 
mynetworks = 127.0.0.0/8
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
html_directory = /usr/share/doc/postfix/html
message_size_limit = 30720000
virtual_alias_domains = 
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_mailbox_base = /home/vmail
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
virtual_create_maildirsize = yes
virtual_maildir_extended = yes
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1

Am I doing something wrong here? Or perhaps I'm using wrong settings in my mail client?

I've trying something like this:

SMTP server: li244-40.members.linode.com

SMTP Port: 25

SMTP Auth: Yes

Authentication: PLAIN

It doesn't even seem to connect to the smtp server…

Any help would be greatly appreciated. Thanks!

9 Replies

I've now managed to connect to the smtp server from my desktop mail client, but I get the same message as I got from roundcube "Relay Access Denied" when it tries to send an email

It looks like your sasl isn't working - what do your logs say when you try to send an email?

Here's a something from /var/log/mail.log

Feb  6 19:29:19 li244-40 postfix/smtpd[10658]: warning: 88.191.65.117: hostname 88-191-65-117.rev.dedibox.fr verification failed: Name or service not known
Feb  6 19:29:19 li244-40 postfix/smtpd[10658]: connect from unknown[88.191.65.117]
Feb  6 19:29:19 li244-40 postfix/smtpd[10658]: warning: non-SMTP command from unknown[88.191.65.117]: GET / HTTP/1.1
Feb  6 19:29:19 li244-40 postfix/smtpd[10658]: disconnect from unknown[88.191.65.117]

Otherwise there's lots of entries like this

Feb  6 19:14:06 li244-40 dovecot: imap-login: Login: user=<eman@onlythebible.com>, method=PLAIN, rip=173.255.234.40, lip=173.255.234.40, secured
Feb  6 19:14:06 li244-40 dovecot: IMAP(eman@onlythebible.com): Disconnected: Logged out bytes=63/492</eman@onlythebible.com>

Ah!, this bit could be what we're looking for:

Feb  6 19:07:14 li244-40 postfix/smtpd[10266]: connect from c114-77-115-211.chirn2.vic.optusnet.com.au[114.77.115.211]
Feb  6 19:07:16 li244-40 postfix/smtpd[10266]: warning: SASL authentication failure: cannot connect to saslauthd server: No such file or directory
Feb  6 19:07:16 li244-40 postfix/smtpd[10266]: warning: c114-77-115-211.chirn2.vic.optusnet.com.au[114.77.115.211]: SASL LOGIN authentication failed: gener$
Feb  6 19:07:17 li244-40 postfix/smtpd[10266]: NOQUEUE: reject: RCPT from c114-77-115-211.chirn2.vic.optusnet.com.au[114.77.115.211]: 554 5.7.1 <emmanuelhi$ 6="" 554="" feb="" 19:07:19="" li244-40="" postfix="" smtpd[10266]:="" disconnect="" from="" c114-77-115-211.chirn2.vic.optusnet.com.au[114.77.115.211]="" 19:09:21="" dovecot:="" sighup="" received="" -="" reloading="" configuration="" 19:09:22="" auth-worker(default):="" mysql:="" connected="" to="" 127.0.0.1="" (mail)="" 19:09:31="" smtpd[10319]:="" connect="" 19:09:33="" warning:="" sasl="" authentication="" failure:="" cannot="" saslauthd="" server:="" no="" such="" file="" or="" directory="" c114-77-115-211.chirn2.vic.optusnet.com.au[114.77.115.211]:="" login="" failed:="" gener$="" noqueue:="" reject:="" rcpt="" 5.7.1="" <emmanuelhi$="" 19:09:35="" 19:09:53="" (mail)<e=""></emmanuelhi$>

This bit > Feb 6 19:07:16 li244-40 postfix/smtpd[10266]: warning: SASL authentication failure: cannot connect to saslauthd server: No such file or directory looks like the problem.

So there must be something wrong with the saslauthd server?

Looks like it, first try

service saslauthd restart

if that doesn't work try running through http://library.linode.com/email/postfix … _use_mysql">http://library.linode.com/email/postfix/dovecot-mysql-ubuntu-10.04-lucid#configuresaslauthdtousemysql again

Okay, Tried "service saslauthd restart", which did this:

 * Stopping SASL Authentication Daemon saslauthd                    [ OK ]
 * Starting SASL Authentication Daemon saslauthd                    [ OK ]

Yes, and then I carefully went through that section of the tutorial, but nothing has changed :(

Well that about covers the extent of my mail server knowledge (don't run one, never have), so I'll have to defer to someone who does.

Okay, well thanks for trying.

I still haven't figured it out. :(

Okay, now I'm getting another slightly different error message. Probably related to the same problem though:

Feb  7 06:53:11 li244-40 postfix/smtpd[16108]: warning: c114-77-115-211.chirn2.vic.optusnet.com.au[114.77.115.211]: SASL LOGIN authentication failed: authentication failure

Problem Solved!

Ended up uncommenting the following lines from the /etc/postfix/master.cf file

  -o smtpd_sasl_auth_enable=yes
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject

As well as adding this new line

submission inet n - n - - smtpd

Now it works like a charm, the host rejected error was just because I had the wrong password.

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