procmail
[Top] [All Lists]

Re: set a different exitcode for each mailbox

2007-09-23 14:54:09
On Sun, Sep 23, 2007 at 09:43:27PM +0200, M. Fioretti wrote:

I need to:

- run procmail, with a special procmailrc, on messages already
  delivered into a temporary maildir by the main procmailrc when they
  arrive. There is no need for another copy of them, is there?

- do the above inside a bash loop, one message at a time. So the
  script calling this procmailrc (with the "cat ${MSG} |procmail
  above_procmail_rc" line) already knows where the message is. It just
  needs to know from procmail which of many recipes matched against
  it.

Given this, isn't is enough to use the EXITCODE / HOST trick mentioned
earlier?

I didn't see your earlier message, but am unclear on why you think
EXITCODE will be helpful to you here.  I'd do something like this:


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

 :0
 * conditions
 {
   MYRECIPE = 1
   HOST = byebye
 }

 :0
 * conditions
 {
   MYRECIPE = 2
   HOST = byebye
 }

 :0
 * conditions
 {
   MYRECIPE = 3
   HOST = byebye
 }

 :0
 * conditions
 {
   MYRECIPE = 4
   HOST = byebye
 }

-- 
dman
____________________________________________________________
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