OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: Making postfix hand old deferred messages somewhere else?

From: Gary Mort (gmlugsaplings.us)
Date: Mon Jul 02 2007 - 05:29:22 CDT


Michael Loftis wrote:
> It might not be at all possible inside of postfix, but, is there a way
> to get it to take deferred messages that are older than say a day and
> send them to a designated MTA? I'd like to get the big chunks of mail
> for dead domains or slow domains off my main mail servers and onto a
> small(er) set of retry/redelivery machines.
>

I was looking for something else and ran across this site
http://www.arschkrebs.de/postfix/scripts/ with this perl script:
http://www.arschkrebs.de/postfix/scripts/delete-from-mailq

The script is designed to go through the mailq and delete mail matching
a particular criteria(using a regular expression).

I would imagine the same script could be used, changing the regular
expression for a time value, change checking the message body to
checking the file creation date, and change the delete to some sort of
move(move the message file to a seperate directory and delete the last
delivery information file?)

Than you could run a second script to periodically check that directory
and make an SMTP connection to your designated MTA and pipe through the
messages to be sent)