procmail
[Top] [All Lists]

Re: Help with recipts.

2008-09-23 11:58:12
On Tue, Sep 23, 2008 at 05:18:24PM +0200, Joel Serrano De Castro wrote:

I am having problems with the following receipt:

Thanks at least for stating what your goal was.  It would be better
still to state that above rather than below.  (When I look at your
recipes, the first thing I think is, "WTF is this guy trying to
do with that mess?"  No offense intended.)

So I will cut-and-paste your goals above the code:

1-      Have a variable with the Message-ID header

2-      Create a dir inside /tmp with the name of the Message-ID
        (for further purposes).

3-      Extract the attached files from the email into the newly
        created dir inside /tmp ; script.sh renames the attached
        file to a special name ; delete the created dir inside
        /tmp.

4-      Send a copy of the email after all the processing to the
        domain admin.


:0
* ^Subject:.*DETAILED_SUBJECT
* ^To:(_dot_)*user1(_at_)domain(_dot_)com|user2(_at_)domain(_dot_)com

The second condition should be:

    * ^To:.*(user1(_at_)domain[(_dot_)]com|user2(_at_)domain[(_dot_)]com)
or
    * ^To:.*(user1|user2)@domain[.]com


        {
                :0
                * ^Message-ID:
                { MESSAGEID=`${FORMAIL} -cX "Message-ID:" |sed -e 's/[ 
\t]\{1,\}//g' | cut -d'<' -f2 | cut -d'@' -f1` }

You don't need all of that.  Just do this:

    :0
    * ^Message-ID:.*<\/[^(_at_)]+
    { MESSAGEID = $MATCH }



                :0E
                { MESSAGEID='none' }

                :0
                { CREATEDIR=`mkdir /tmp/$MESSAGEID` }

There are other ways to do this; for example, just:

   DUMMY = `mkdir /tmp/"$MESSAGEID"`

but OK.

                :0w
                | ripmime -i - -d /tmp/$MESSAGEID --syslog --no-nameless ; \
                /usr/bin/script.sh /tmp/$MESSAGEID $MESSAGEID 1 ; \
                rmdir /tmp/$MESSAGEID

                :0
                ! admin(_at_)domain(_dot_)com
        }


[Order of your email slightly rearranged again:]

It doesn't execute the last receipt, and that's not the only
problem, sometimes it stops earlier.

Your ripmime recipe is a "delivering" recipe.  So procmail delivers to
the pipe and exits.  That's what you told it you wanted.
I can't tell what you do want.  Maybe it's

     :0 cwi

or maybe it's

     :0 fwi

Also, don't send us your long two-language legal-mumbo-jumbo
disclaimer footer, please.  This list gets archived in perpetuity.
All we want to see is properly formed text.

Regards,
Dallman Ross
____________________________________________________________
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

<Prev in Thread] Current Thread [Next in Thread>