procmail
[Top] [All Lists]

Recipe to strip attachments

2001-03-25 10:34:02
Hi

I am hoping someone out there can help me. I have written a perl script which 
searches for MIME boundaries in a message and based on the header content will 
strip out the MIME section and replace it with something else or filter out 
certain content from the section (such as HTML script and object tags). The 
perl script reads the message in on STDIN and writes all its data out onto 
STDOUT.

I have incorporated this script into a procmail recipe to which looks like this:
-----------------------------------------------------------------------------------
:0 f
|/usr/local/mimesentry-1.0.4/mimesentry
------------------------------------------------------------------------------------

The recipe works beautifully but sometimes the messages that are filtered are 
delivered into the user's mailbox with the first 1 or 2 lines missing.

Recently I made a modification to the perl script which would save the original 
text of each message into a file. When one of these errors occurs I can then 
find the file that contains the original text (as procmail sent it to the 
script). I can then process it through my perl script (from the command line). 
When I do this the correct content is generated (i.e the first 1 or 2 lines are 
contained in the output). The only thing that I can fathom is that there is a 
problem in the way that my perl script communicates with procmail

Does anyone out there have any suggestions for what the problem could be ????

Regards
  Darryl Beckett
<Prev in Thread] Current Thread [Next in Thread>