Postfix SASL SMTP Client Failure

Asked by Mark Trimmer

I am trying to configure ubuntu 12.04 to send email using Amazon AWS Simple Email Service (SES) which requires using TLS and SASL. Our existing 10.04 instances all do this without a problem.

Here are the instructions Amazon provides: http://docs.amazonwebservices.com/ses/latest/DeveloperGuide/SMTP.MTAs.Postfix.html

I have run an strace on the smtp client as it runs, and have installed any libs it tries to load but can't find. This has not resolved the issue. The one possible outstanding issue I noticed in the strace is that the libs can't find the following directory: /usr/etc/gss/mech

I have run the smtp command with the -v flag, and there are no additional log lines regarding the failure.

I have also looked in the postfix source code, and it appears that the error is happening in the sasl lib, not the postfix lib, but the sasl lib is not writing any error messages.

Configs:

postconf -n

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
inet_interfaces = all
mailbox_size_limit = 0
mydestination = dev.dpn.inmar.com, localhost, localhost.localdomain, localhost
myhostname = DEV-SMTP-TEST11.compute-1.internal
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost = email-smtp.us-east-1.amazonaws.com:25
smtp_always_send_ehlo = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl/passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
smtp_tls_note_starttls_offer = yes
smtp_tls_security_level = encrypt
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
transport_maps = hash:/etc/postfix/transport

Contents of: /etc/postfix/sasl/passwd (sanitised)

email-smtp.us-east-1.amazonaws.com:25 UUUUUUU:PPPPPPPPPPPPPP
ses-smtp-prod-335357831.us-east-1.elb.amazonaws.com:25 UUUUUUU:PPPPPPPPPPPPPP

LOG:

Aug 8 19:51:04 DEV-SMTP-TEST11 postfix/master[14470]: daemon started -- version 2.9.3, configuration /etc/postfix
Aug 8 19:51:06 DEV-SMTP-TEST11 postfix/pickup[14473]: 9F78A322F: uid=0 from=<root>
Aug 8 19:51:06 DEV-SMTP-TEST11 postfix/cleanup[14479]: 9F78A322F: message-id=<email address hidden>
Aug 8 19:51:06 DEV-SMTP-TEST11 postfix/qmgr[14474]: 9F78A322F: from=<email address hidden>, size=371, nrcpt=1 (queue active)
Aug 8 19:51:06 DEV-SMTP-TEST11 postfix/smtp[14482]: warning: per-session SASL client initialization: generic failure
Aug 8 19:51:06 DEV-SMTP-TEST11 postfix/smtp[14482]: fatal: SASL per-connection initialization failed
Aug 8 19:51:07 DEV-SMTP-TEST11 postfix/qmgr[14474]: warning: private/smtp socket: malformed response
Aug 8 19:51:07 DEV-SMTP-TEST11 postfix/qmgr[14474]: warning: transport smtp failure -- see a previous warning/fatal/panic logfile record for the problem description
Aug 8 19:51:07 DEV-SMTP-TEST11 postfix/master[14470]: warning: process /usr/lib/postfix/smtp pid 14481 exit status 1
Aug 8 19:51:07 DEV-SMTP-TEST11 postfix/master[14470]: warning: /usr/lib/postfix/smtp: bad command startup -- throttling
Aug 8 19:51:07 DEV-SMTP-TEST11 postfix/error[14484]: 9F78A322F: to=<email address hidden>, relay=none, delay=1.3, delays=0.05/1.2/0/0.02, dsn=4.3.0, status=deferred (unknown mail transport error)

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu postfix Edit question
Assignee:
No assignee Edit question
Solved by:
Mark Trimmer
Solved:
Last query:
Last reply:
Revision history for this message
Eran Rundstein (eranrund) said :
#1

After experiencing the same crappy issue and digging for hours, I finally found out that in my case I had to make sure 'hostname -f' executes properly (and it didn't, as my /etc/hosts file didn't have an entry for my hostname set inside /etc/hostname)
After fixing /etc/hosts and restarting postfix, everything started to work!

Hope this helps...

Revision history for this message
Christopher Hall (hsw) said :
#2

thanks @erranrund for the hint

postfix was giving these errors:
  warning: per-session SASL client initialization: generic failure
  fatal: SASL per-connection initialization failed

/etc/hostname /etc/mailname were the correct hostname

after adding the 127.0.0.1 entry for the hostname and checking that
hostname -f responded, postfix is working again

(this occured sometime after a hostname change so I did not
immediately associate the postfix failure with with it, and the
error message wa no help)

Revision history for this message
Mark Trimmer (mark-trimmer) said :
#3

Thank you! That does solve my issue.