If you are having issues sending emails with the Postfix SMTP server, the two best places to look to diagnose the issue, are the log files, and the mail queues.
Any emails that don’t get sent successfully, or that haven’t been sent yet, will be stored in the queue waiting for transmission/re-transmission.
To view the Postfix mail queue, you can use the following command:
-p = Produce a traditional sendmail-style queue listing.
After the Queue ID field in the output from the above command, there may appear on optional identifier that will tell you if the email is in the ‘active’ queue, or the ‘hold queue’. One of the two examples below contains the * identifier.
* = The message is in the active queue, i.e. the message is selected for delivery.
! = The message is in the hold queue, i.e. no further delivery attempt will be made until the mail is taken off hold.
postqueue -p -Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient------- CE20DF0282 2333 Wed Apr 4 16:29:58 firstname.lastname@example.org (connect to mail.destinationdomainname.local[aaa.bbb.ccc.ddd]:25: Connection timed out) email@example.com -- 2 Kbytes in 1 Request.
-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient------- EC753D0D00* 328 Thu Apr 5 14:34:09 firstname.lastname@example.org email@example.com -- 0 Kbytes in 1 Request.
To flush the queue and attempt to send/resend any outstanding emails, use the “postqueue -f” command which is outlined in more detail in the article titled “Flush the Postfix mail queue to force retry“.