procmail
[Top] [All Lists]

Re: set a different exitcode for each mailbox

2007-09-27 10:54:57
Am 2007-09-24 06:01:16, schrieb M. Fioretti:
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

If you run procmail from the BASH script you can use
something like:

     TMPLOG=$(mktemp blubbefoobar.XXXXXX)
     cat ${MSG} |procmail procmailrc
     FOLDER=$(grep "^  Folder:" ${TMPLOG} |sed 's|^  Folder: ||')
     rm -f ${TMPLOG}

and in the "procmailrc" you use

     LOGFILE=${TMPLOG}

     :0
     ...

which mean, the script create a temporary logfile name which is first
used pby procmail and then after this by grep to get the Folder and
the it will be deleted...

Since you are processing maildir the logfile will containg normaly
ONLY one "  Folder: " line.

Thanks, Greetings and nice Day
    Michelle Konzack
    Systemadministrator
    Tamay Dogan Network
    Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack   Apt. 917                  ICQ #328449886
                   50, rue de Soultz         MSN LinuxMichi
0033/6/61925193    67100 Strasbourg/France   IRC #Debian (irc.icq.com)
____________________________________________________________
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