Download: http://www.artica.fr/postfix-resend.zip (all linux distributions)
Postfix-resend is a tool designed to perform these operations:
- get status of the number of mails stored in all postfix /var/spool/postfix/ queues.
- Perform resend operations by parsing all mails in a defined queue.
Resend operations: read queue -> resolve MX, parse /etc/hosts -> resend all mails even without postfix running.
it sould be used when the postfix spool is over or for postfix migrations.
PURGE resend postfix files
-----------------------------------------
--purge...............: purge queue directory
--queue-path=path.....: change queue path from default to specific path
--nameserver=IP/name..: Define nameserver other than default (127.0.0.1)
--no-delete-source....: Do not delete files sources
--just-count..........: Just output the number of files
--backup=path.........: Target path for backup files (if not define, use /tmp as backup)
--timeout=value.......: Define timeout in smtp sessions
--watch=value.........: How many mails must reach to start operation
--fork................: Send one process for each mail
verbose,debug,output..: output debugs infos
Read
-----------------------------------------
--read path..........: Read a postfix file
STATS
----------------------------------------------------
--stats...............: Get number of mails stored in each queue
--in-line.............: All values in same line
Examples:
- resend all mails stored in "active" queue :
postfix-resend --purge -queue-path=active --nameserver=127.0.0.1 --backup=/var/backup --timeout=1 --fork
- Adding postfix-resend in cron and execute resend operation when queue exceeds a maximum 10000 emails (the postfix daemon is automatically stopped and started during the operation)
postfix-resend --purge -queue-path=active --nameserver=127.0.0.1 --backup=/var/backup --timeout=1 --watch=10000 --fork
- Get number of emails in queue:
postfix-resend --stats



Postfix-resend tool
