Postfix – SMTP – PAM – MYSQL Server Troubles

Hey guys,

I had few days fight with a mail server. I am trying to configure my dedicated server and mail server is an important part in this setup. It was hard, because I am not SysAdmin and I didn’t have any clue at all.

Anyway finally I managed and I am very proud with this installation.
I am not going to describe the whole process, because there are many how-tos. These are the articles which I followed during the install:

http://flurdy.com/docs/postfix/ – this one I followed
https://help.ubuntu.com/community/Postfix
http://postfix.wiki.xs4all.nl/index.php?title=Virtual_Users_and_Domains_with_Courier-IMAP_and_MySQL

Everything was fine except that I couldn’t send mails through authenticated smtp. 🙁

Following these articles the problem wasn’t sorted and I start digging over the net about the solution.

The error in the SquirrelMail was:
Authentication failed
535 5.7.8 Error: authentication failed: authentication failure

Which meant that the passwords doesn’t match, but in fact I didn’t have a clue what could cause the error. When I test the login with telnet I had the following response:

#telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 my.server.com ESMTP Postfix (Ubuntu)
250-my.server.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH NTLM CRAM-MD5 DIGEST-MD5 LOGIN PLAIN --Note this row
250-AUTH=NTLM CRAM-MD5 DIGEST-MD5 LOGIN PLAIN --Note this row
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN

I’ve read in a forum /unfortunately I can’t remember where it was because I visited probably 10000 pages and tutorials/ that in the /etc/postfix/mail.conf instead of:

smtpd_sasl_path = /etc/postfix/sasl:/usr/lib/sasl2

The variable should be:

smtpd_sasl_path = smtpd

after changing this authentication start working as a charm. I’ve removed this setting completely and the system still works perfectly. What was the difference? When I test with telnet I’ve seen:

#telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 my.server.com ESMTP Postfix (Ubuntu)
250-my.server.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH LOGIN PLAIN --Note this row
250-AUTH=LOGIN PLAIN --Note this row
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN

So, the difference is that auth method is different. The problem was exactly in that setting and by removing it everything start working. So the advise: don’t set this variable – it cause troubles!

Update: this article is really straight forward and making smtp authentication really easy!

Hopefully this will hope someone!

Share it:
  • Facebook
  • Twitter
  • Digg
  • StumbleUpon
  • del.icio.us
  • Google Bookmarks
  • Yahoo! Buzz
  • Add to favorites
  • Identi.ca

Leave a Reply

Your email address will not be published. Required fields are marked *