I have been trying to get my postfix server to relay all of my message to a local SMTP server. As far as I can tell I have everything set up right, but I get a 550 Authentication error. My local SMTP server works fine when i send a message with something like send mail, just not when I relay a message using postfix. ( I changed my credentials/relay host name)

Here is my main.cf file

# See /usr/share/postfix/main.cf.dist for a commented, more complete version
debug_peer_list =
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
readme_directory = no
myhostname = evconnect.info
alias_maps = hash:/etc/aliases
virtual_alias_maps = hash:/etc/postfix/virtual
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = localhost
mynetworks = [::ffff:]/104 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
local_recipient_maps =
recipient_delimiter = +
inet_interfaces = all
transport_maps = hash:/etc/postfix/transport

smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/saslpasswd
smtp_always_send_ehlo = yes
relayhost = [localhost]:587

inet_protocols = all

Here is my /etc/postfix/saslpasswd file prehash.

[localhost]:587      user:password
localhost            user:password

Here is the mail log when trying to send a message to my relayhost

Jan 14 16:20:51 ip-10-251-110-190 postfix/smtp[5056]: 9A01B24436: to= 
<driver8lpqh2mrx@host.info>, relay=host.info[xx.xxx.xxx.xxx]:587, delay=0.69, 
delays=0.2/0.01/0.48/0, dsn=5.0.0, status=bounced (host host.info[xx.xxx.xxx.xxx] said: 550  
Authentication required (in reply to MAIL FROM command))

Log from raalyhost (Haraka smtp server):

[NOTICE] [A0BFEE28-79CE-4719-B23A-05B9990AA397] [core] connect ip= port=44974 
local_ip=:: local_port=587
[DEBUG] [A0BFEE28-79CE-4719-B23A-05B9990AA397] [core] running lookup_rdns hooks
[DEBUG] [A0BFEE28-79CE-4719-B23A-05B9990AA397] [core] running connect hooks
[DEBUG] [A0BFEE28-79CE-4719-B23A-05B9990AA397] [core] running connect hook in dnsbl plugin
[DEBUG] [-] [dnsbl] looking up:
[DEBUG] [A0BFEE28-79CE-4719-B23A-05B9990AA397] [core] hook=connect plugin=dnsbl function=connect_first params="" retval=CONT msg=""
[DEBUG] [A0BFEE28-79CE-4719-B23A-05B9990AA397] [core] running connect hook in max_unrecognized_commands plugin
[DEBUG] [A0BFEE28-79CE-4719-B23A-05B9990AA397] [core] hook=connect plugin=max_unrecognized_commands function=hook_connect params="" retval=CONT msg=""
[PROTOCOL] [A0BFEE28-79CE-4719-B23A-05B9990AA397] [core] S: 220 ip-10-251-110-190 ESMTP Haraka 2.5.0 ready
[PROTOCOL] [A0BFEE28-79CE-4719-B23A-05B9990AA397] [core] C: EHLO evconnect.info state=1
[DEBUG] [A0BFEE28-79CE-4719-B23A-05B9990AA397] [core] running ehlo hooks
[DEBUG] [A0BFEE28-79CE-4719-B23A-05B9990AA397] [core] running capabilities hooks
[PROTOCOL] [A0BFEE28-79CE-4719-B23A-05B9990AA397] [core] S: 250-ip-10-251-110-190 Hello ec2-54-184-245-135.us-west-2.compute.amazonaws.com [], Haraka is at your service.
[PROTOCOL] [A0BFEE28-79CE-4719-B23A-05B9990AA397] [core] S: 250-PIPELINING
[PROTOCOL] [A0BFEE28-79CE-4719-B23A-05B9990AA397] [core] S: 250-8BITMIME
[PROTOCOL] [A0BFEE28-79CE-4719-B23A-05B9990AA397] [core] S: 250 SIZE 500000
[PROTOCOL] [A0BFEE28-79CE-4719-B23A-05B9990AA397] [core] C: MAIL FROM:<> SIZE=5035 state=1
[PROTOCOL] [A0BFEE28-79CE-4719-B23A-05B9990AA397] [core] S: 550 Authentication required
[PROTOCOL] [A0BFEE28-79CE-4719-B23A-05B9990AA397] [core] C: RCPT TO:<DoNotReply@evconnect.com> state=1
[PROTOCOL] [A0BFEE28-79CE-4719-B23A-05B9990AA397] [core] S: 503 Use MAIL before RCPT
[PROTOCOL] [A0BFEE28-79CE-4719-B23A-05B9990AA397] [core] C: DATA state=1
[PROTOCOL] [A0BFEE28-79CE-4719-B23A-05B9990AA397] [core] S: 503 MAIL required first
[PROTOCOL] [A0BFEE28-79CE-4719-B23A-05B9990AA397] [core] C: RSET state=1
[DEBUG] [A0BFEE28-79CE-4719-B23A-05B9990AA397] [core] running rset hooks
[PROTOCOL] [A0BFEE28-79CE-4719-B23A-05B9990AA397] [core] S: 250 OK
[PROTOCOL] [A0BFEE28-79CE-4719-B23A-05B9990AA397] [core] C: QUIT state=1
[DEBUG] [A0BFEE28-79CE-4719-B23A-05B9990AA397] [core] running quit hooks
[PROTOCOL] [A0BFEE28-79CE-4719-B23A-05B9990AA397] [core] S: 221 ip-10-251-110-190 closing connection.          Have a jolly good day.
[DEBUG] [A0BFEE28-79CE-4719-B23A-05B9990AA397] [core] running disconnect hooks

Log when sending emails using swaks(it works)

=== Trying localhost:587...
=== Connected to localhost.
<-  220 ip-10-251-110-190 ESMTP Haraka 2.5.0 ready
 -> EHLO host.com
<-  250-ip-10-251-110-190 Hello Unknown [], Haraka is at your service.
<-  250-8BITMIME
<-  250-SIZE 500000
<-  235 Authentication successful
-> MAIL FROM:<12345@host.info>
<-  250 sender <12345@host> OK
 -> RCPT TO:<host@me.com>
<-  250 recipient <host@me.com> OK
 -> DATA
<-  354 go ahead, make my day
 -> Date: Wed, 14 Jan 2015 17:01:28 +0000
 -> To: host@me.com
 -> From: 12345@host.info
 -> Subject: test Wed, 14 Jan 2015 17:01:28 +0000
 -> X-Mailer: swaks v20111230.0 jetmore.org/john/code/swaks/
 -> This is a test mailing
 -> .
  • Can you get any logs from the relayhost? – NickW Jan 14 '15 at 16:21
  • I added the log form my realyhost, a Haraka smtp server that runs on the same server. It almost seems as if no authentication is being sent over at all. – Marty Griffin Jan 14 '15 at 16:35
  • It certainly does seem to be that way. It also seems like Haraka isn't advertising that it supports AUTH, shouldn't there be a S: 250-AUTH DIGEST-MD5 PLAIN CRAM-MD5 from Haraka? – NickW Jan 14 '15 at 16:42
  • The weird thing is that when I try to send am email with Swaks without authentication I get the same error, but when I added the authentication it works. Although I do get an error saying the host is not advertising authentication. Would this prevent postfix from adding it? – Marty Griffin Jan 14 '15 at 16:53
  • Yes it would, postfix is very fussy about RFCs, and I'm pretty sure it will not send unsolicited anything, be it authorization, or any other information of that sort. – NickW Jan 14 '15 at 16:55

After chatting with Nick, the problems was the Haraka only advertised authentication to requests coming form localhost. I changed my transport file/relayhost in main.cf to from referring my domain to localhost. Everything is working now.

  • Cool, glad it's all working! – NickW Jan 15 '15 at 9:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.