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:

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.


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 =, localhost, localhost.localdomain, localhost
myhostname = DEV-SMTP-TEST11.compute-1.internal
mynetworks = [::ffff:]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost =
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) UUUUUUU:PPPPPPPPPPPPPP UUUUUUU:PPPPPPPPPPPPPP


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

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

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 :

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 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 :

Thank you! That does solve my issue.