From: Noel Jones (no email)
Date: Tue Mar 02 2004 - 16:32:03 EST
At 12:43 PM 3/1/04, Stef Mit wrote:
>Could anybody advise me of a small script capable of taking the output of
>postqueue -p and processing specific messages based on the To: field?
>Right now I am putting all emails on hold, and all I want to do is to
>process (script), once in a while (cron) something similar to (pseudo-code):
>
>postqueue -p ==> if in any of the "To" fields there is a specific string
>(e.g. username\@domain\.com), go back and read the message ID, and process
>the message through postqueue -H <msg_ID>
>
>TIA,
>Stef
>
get the delete-from-mailq script from Ralf's web site.
http://www.stahl.bau.tu-bs.de/~hildeb/postfix/scripts/delete-from-mailq
Copy it to release-from-hold or some other convenient name.
Using vi or your favorite text editor, find the line near the end that
looks like:
open(POSTSUPER,"|postsuper -d -") || die "couldn't open postsuper" ;
and change it to:
open(POSTSUPER,"|postsuper -H -") || die "couldn't open postsuper" ;
Then just run it as:
release-from-hold user\@domain\.com
Note this looks at the envelope addresses, which may not be the same as
what is in the To: message header.
-- Noel Jones
|
|
|