procmail
[Top] [All Lists]

Re: set a different exitcode for each mailbox

2007-09-23 20:57:11
On Sun, Sep 23, 2007 23:52:26 PM +0200, Dallman Ross
(dman(_at_)nomotek(_dot_)com) wrote:

I didn't see your earlier message, but am unclear on why you think
EXITCODE will be helpful to you here.

This is a procmailrc file to be used in a shell script that looks
again at messages already delivered into a maildir via a bash "for"
loop and, with each message does one or more of:

1) delete it
2) move it to another maildir
3) run other scripts, maybe more than one, and do other file-system
   related operations depending on the status of the system in that
   moment, including what happened with previous messages

To decide what to do with each message, the script must know which
procmail recipe matched on that specific file. I have decided to use
procmail from bash, rather than calling commands from procmail
recipes, because the kind of things I need in 3) is quite complex, may
require lots of time, and I feel it will be easier for me to maintain
it this way.

But the "conditions" which make the script decide among 1, 2 and 3
above are all tested procmail recipes I've already written or adapted
from the Internet, so why not use them as they are?

In this scenario, do I really need to do this:

 MYLOG = /some/file
 TRAP = 'echo $MYRECIPE >> "$MYLOG"'

isn't

 {
   EXITCODE = 1
   HOST = byebye
 }

the same thing, just faster as it doesn't require grabbing the last
line of MYLOG, but only looking at "$?" ?

Marco

-- 
Help *everybody* love Free Standards and Free Software
http://digifreedom.net/
____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail