I have been dealing with a PHP + SMTP problem during the last few days. I got to the point where I needed to delete old (malformed) messages from the queues I had in my Linux box. Basically, the implementation of the message notifications worked this way: PHP BB -> PHP -> sendmail -> postfix -> mail.authsmtp.com
So, first I had to check the sendmail queue and then the postfix queue. Then, delete the malformed messages. So here is how I did it.
To check the sendmail queues, use the sendmail command:
[etagwerker@host ~]$ sudo /usr/sbin/sendmail -bp
/var/spool/mqueue is empty
Total requests: 0
To check the postfix queues, use the postqueue command:
[etagwerker@host etagwerker]# /usr/sbin/postqueue -p
-Queue ID- –Size– —-Arrival Time—- -Sender/Recipient——-
F41C2958D7 1218 Tue Nov 25 10:30:53 donotreply@aycron.com
(host mail.authsmtp.com[62.13.128.189] said: 502 5.0.0 One (or more) of the message ‘From’ addresses is not registered – login at: http://control.authsmtp.com (in reply to end of DATA command))
ernesto.tagwerker@aycron.com
16E00958CF 1679 Mon Nov 24 19:06:25 apache@ip-10-251-43-207.ec2.internal
(host mail.authsmtp.com[62.13.128.189] said: 502 5.0.0 One (or more) of the message ‘From’ addresses is not registered – login at: http://control.authsmtp.com (in reply to end of DATA command))
etagwerker@aycron.com
To clear the postfix deferred queue, use the postsuper command:
[root@ip-10-251-43-207 etagwerker]# /usr/sbin/postsuper -d ALL deferred
postsuper: Deleted: 37 messages
“deferred” in the last example identifies the queue name.
[root@ip-10-251-43-207 etagwerker]# /usr/sbin/postqueue -p
Mail queue is empty
This post came from many google searches, a bunch of man pages (postqueue, sendmail and postsuper) and this thread: http://lists.freebsd.org/pipermail/freebsd-questions/2003-July/013112.html

One Trackback
[...] postfix deferred queue were full with wrongly constructed email requests. After clearing that (see previous post); the problem was [...]