procmail
[Top] [All Lists]

Help with recipts.

2008-09-23 11:19:32
Hi everybody,

First of all, i home this is the right place to post!

I am having problems with the following receipt:

:0
* ^Subject:.*DETAILED_SUBJECT
* ^To:(_dot_)*user1(_at_)domain(_dot_)com|user2(_at_)domain(_dot_)com
        {
                :0
                * ^Message-ID:
                { MESSAGEID=`${FORMAIL} -cX "Message-ID:" |sed -e 's/[ 
\t]\{1,\}//g' | cut -d'<' -f2 | cut -d'@' -f1` }

                :0E
                { MESSAGEID='none' }

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

                :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
        }


The idea is:


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.

This is an example log:

procmail: [24971] Tue Sep 23 16:57:21 2008
procmail: Match on "^Subject:.* DETAILED_SUBJECT"
procmail: Match on "^To:.* 
user1(_at_)domain(_dot_)com|user2(_at_)domain(_dot_)com "
procmail: Match on "^Message-ID:"
procmail: Executing "${FORMAIL} -cX "Message-ID:" |sed -e 's/[ \t]\{1,\}//g' | 
cut -d'<' -f2 | cut -d'@' -f1"
procmail: Assigning 
"MESSAGEID=OF76B8CD54.EA695BA3-ONC12574CD.004FD63B-C12574CD.00505F1E"
procmail: Executing 
"mkdir,/tmp/OF76B8CD54.EA695BA3-ONC12574CD.004FD63B-C12574CD.00505F1E"
procmail: Assigning "CREATEDIR="
procmail: Executing " ripmime -i - -d /tmp/$MESSAGEID --syslog --no-nameless ; \
                $RENAME /tmp/$MESSAGEID $MESSAGEID 1 ; \
                rmdir /tmp/$MESSAGEID"
procmail: Assigning "LASTFOLDER= ripmime -i - -d /tmp/$MESSAGEID --syslog 
--no-nameless ; \
                $RENAME /tmp/$MESSAGEID $MESSAGEID 1 ; \
                rmdir /tmp/$MESSAGEID"
From u1(_at_)telefonica(_dot_)es Tue Sep 23 14:57:21 2008
 Subject:  DETAILED_SUBJECT
  Folder:  ripmime -i - -d /tmp/$MESSAGEID --syslog --no-nameless ; \      6191

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

I'm not sure if you need more details to help me out with this...

Thanks in advanced,

Joel.

________________________________

--------------------------------------------------------------------------------

Este mensaje es privado y CONFIDENCIAL y se dirige exclusivamente a su 
destinatario. Si usted ha recibido este mensaje por error, no debe revelar, 
copiar, distribuir o usarlo en ning?n sentido. Le rogamos lo comunique al 
remitente y borre dicho mensaje y cualquier documento adjunto que pudiera 
contener. El correo electr?nico via Internet no permite asegurar la 
confidencialidad de los mensajes que se transmiten ni su integridad o correcta 
recepci?n. JAZZTEL no asume responsabilidad por estas circunstancias. Si el 
destinatario de este mensaje no consintiera la utilizaci?n del correo 
electr?nico via Internet y la grabaci?n de los mensajes, rogamos lo ponga en 
nuestro conocimiento de forma inmediata.Cualquier opini?n expresada en este 
mensaje pertenece ?nicamente al autor remitente, y no representa necesariamente 
la opini?n de JAZZTEL, a no ser que expresamente se diga y el remitente est? 
autorizado para hacerlo.


--------------------------------------------------------------------------------


This message is private and CONFIDENTIAL and it is intended exclusively for its 
addressee. If you receive this message in error, you should not disclose, copy, 
distribute this e-mail or use it in any other way. Please inform the sender and 
delete the message and attachments from your system.Internet e-mail neither 
guarantees the confidentiality nor the integrity or proper receipt of the 
messages sent. JAZZTEL does not assume any liability for those circumstances. 
If the addressee of this message does not consent to the use of Internet e-mail 
and message recording, please notify us immediately.Any views or opinions 
contained in this message are solely those of the author, and do not 
necessarily represent those of JAZZTEL, unless otherwise specifically stated 
and the sender is authorised to do so.


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