Sometimes you need to remove some mail from queue or do other things in shell. For experienced administrators this is not a problem, but I decided to write some usable shell commands and scripts for less experienced users.
Here are few commands to remove mail from Postfix queue. Don’t ask me why – just for example. This time i will describe it step by step. This is mail queue:
# mailq
-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
571AAC45 48204 Tue Dec 21 07:52:39 MAILER-DAEMON
(connect to example.com[221.X.X.70]:25: Connection refused)
datadm@example.com
...