4 messages in net.sourceforge.lists.courier-maildropRe: [maildropl] xfilter question
FromSent OnAttachments
Chris PetersenMar 4, 2005 10:18 am 
Devin RubiaMar 4, 2005 10:41 am 
Chris PetersenMar 7, 2005 10:31 am 
Devin RubiaMar 8, 2005 10:58 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [maildropl] xfilter questionActions...
From:Devin Rubia (dev@thezone.net)
Date:Mar 8, 2005 10:58:31 am
List:net.sourceforge.lists.courier-maildrop

On Mon, Mar 07, 2005 at 10:30:52AM -0800, Chris Petersen wrote:

You don't want xfilter, you want cc.

Since you want to trap errors, use an exception:

exception { cc "| /local/bin/somescript" }

cc will set $EXITCODE for you when sending to a program so you can still parse on it.

So just to clarify, there's no way to grab STDERR from my script, but exception will at least let it run and bypass the error message so I can parse $EXITCODE and recreate the error string if needed?

There may be another way...

I just realized from reading the maildropfilter manpage that the message is supposed to be available on STDIN when using backticks. Thus you should be able to use:

exception { OUTPUT=`/local/bin/somescript` }

If you only want the STDERR and not STDOUT, try:

exception { OUTPUT=`/local/bin/somescript 2>&1 > /dev/null` }

In either case $RETURNCODE will contain the exit code of the script. The exceptions are probably not needed; remove at your discretion.