procmail
[Top] [All Lists]

easy regexp question?

1996-09-10 00:56:56
Well, after 1 month, I'm still hacking my way through the intricacies
of procmailrc files, and loving every minute of it :-).  A few weeks
ago, I asked if anyone knew of a script to look for incoming messages
containing uuencoded data and convert them to MIME format.  I had no 
luck in my search, so I gave myself a crash course in Perl and wrote 
the script.  Now that it works, I'm trying to make it more robust 
against filtering the wrong messages and detecting failures in the 
Perl filter script.

One thing I search for to determine the _possible_ existence of a
uuencoded block is the line "begin ### filename" and the end of the
block is "end".  How can I combine these 2 conditions (see recipie
below) to at least ensure the line saying "end" comes 1 or more lines
after the "begin" line?  Would this make procmails search less 
efficient if it had to search over 100's of lines for a combined 
begin/end expression as opposed to the seperate ones I have now?

And, is this the proper way to filter the body of a message and append 
the appropriate headers for delivery later in the procmailrc?  It 
seems to work, but I'm always eager to listen to suggestions.

The procmail recipie is:

:0 Bfwb : uu2mime.lock
* ^.*Encoding-Info: *uuencode\
|included.*(attachement|attachment).*Please use UUDECODE)
* ^begin +[0-7][0-7][0-7] +(.*) *$
* ^end *$
| /home/testuser/perl/uu2mime.pl -B$MIME_BOUNDARY

   :0 afwh
   | formail -I"Content-Type: MULTIPART/MIXED; BOUNDARY=\"$MIME_BOUNDARY\"" \
             -I"MIME-Version: 1.0"


Thanks,

Mike

NOTE: We are currently experiencing some sendmail problems.  If you
reply to me, please check my return address to make sure it looks
valid....otherwise the mail might go nowhere :-(.
======================================================================
                          * Mike Blatchley * 
                * email: Mike_Blatchley(_at_)maxtor(_dot_)com *
======================================================================

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