Managing Postfix

April 17th, 2012 | Posted by cahpct in Postfix - (0 Comments)

Delete an Email from the Queue

For Example – sending an email to someone and it bounces. Defauly retry is for 3 days. To remove it manually :

postsuper -d queue_id

Tons more info at: http://www.postfix.org/postsuper.1.html

Delete all Deferred Emails from the Queue

If spam emails are been sent and/or your mail queue fills up, you can delete all deferred emails with the following:

postsuper -d ALL deferred

Checking Mail logs with pflogsumm

pflogsumm shows all the essential information from mail.log. It groups information into the following headings:

  • Grand Totals – messages sent and recieved.
  • Per-Day Traffic Summary
  • Per-Hour Traffic Daily Average
  • Host/Domain Summary: Message Delivery
  • Host/Domain Summary: Messages Received
  • Senders by message count
  • Recipients by message count
  • Senders by message size
  • Recipients by message size
  • message deferral detail
  • message reject detail
  • message reject warning detail
  • smtp delivery failures
  • Warnings
apt-get install pflogsumm
pflogsumm /var/log/mail.log | less

It is a very useful tool and shows an excellent insight into mail delivery and sending on your server.

Show Mail Queue

If mails are deferred etc. and you want to see a list of them:

postqueue -p

Postmap

October 20th, 2010 | Posted by cahpct in Postfix - (0 Comments)

postmap
The purpose of this command is to build indexed maps from flat files. In the example a virtual_mailbox_recipients database is created.

Create this file /etc/postfix/virtual_mailbox_recipients with these contents.

tom.smith@example.com     tomsmith
jane.smith@example.com    jane

# postmap hash:/etc/postfix/virtual_mailbox_recipients

Postqueue

October 20th, 2010 | Posted by cahpct in Postfix - (0 Comments)

postqueue

This command has several uses.

Flush the Queue

# postqueue -f

Print the Contents of the Queue
# postqueue -p

Deliver Queued Mail for a Domain
# postqueue -s myexample.com

Though you may not have mail in the queue run these commands so you are familiar with them.