Fixed PostfixAdmin error with creating mailboxes on later Postfix versions
Posted in: PostFix
There was always a bug in PostfixAdmin 2.1.0 that prevented the creation of a mailbox when you created a new email address because PostfixAdmin send the incorrect commands to the Postfix mailserver. It was a small error and was also noted at the forum and bugtracker at the PostfixAdmin site. The error was that the smtp_mail function was sending an ‘EHLO’ command instead of the required ‘HELO’ command. I had the change of the function documented in the install notes.
But in the ongoing endeavor to stop spammers in sending emails to us the Postfix developers set stricter rules on their server communications. One of them being the stricter rules on sending multiple commands to the mailserver without listening for an answer from the mailserver after each command, which is typical for spam software. However this was also what PostfixAdmin was doing, sending all these commands to send an email to the newly created mail address without listening properly to the answers Postfix was sending.
The bug is fixed in PostfixAdmin CVS and is, as far as I can tell, scheduled to be released in the 2.1.1 release. But we encounter the bug now, I get remarks from people who are installing PostfixAdmin on top of Postfix 2.2.0 or later.
To help myself and them I copied some of the code that would solve the problem from CVS and put it into the current 2.1.0 source of PostfixAdmin. It solves the problem of Postfix rejecting emails being send from PostfixAdmin with the error:
Data command rejected: Improper use of SMTP command pipelining.
The error is solved by changing the ‘smtp_mail’ function to listen for answers send by the Postfix server in the ‘functions.in.php’ source file.
I didn’t create the fix, I just copied some of the code that was available in CVS and back ported it to the current stable 2.1.0 version.