Ahh... yess.... This gives me flashbacks to when I worked for a major financial company just prior to Y2K. I was given the assignment to write a script similar to what you are describing. This was part of the paranoia that existed around Y2K in that management was concerned that viruses contained within binary attachments would infiltrate the network and wanted attachements "jailed" until January 5, 2000 after being virus inspected. I named the script "mailStripper" and collaborating with my bretheren in the messaging group we put the script on two machines named "chip" and "dale". I announced this in a meeting with senior VPs with an absolute straight face by my manager at the time absolutely lost it. (I didn't warn him!)
Anyway enough of the war story! This is certainly a case of TIMTOWTDI! I echo what Brother Roger says in suggesting that you look at Mail::Message::Attachment::Stripper but also look at the whole family of MIME:: modules on CPAN. Psuedocode for how my script worked looked like:
Open the message. Does it have attachments? Yes: Inspect each attachment is it one of the allowed types? Yes: leave attachment intact No: Strip the attachment replace it with a note to the end user that it has been stripped and jailed. No: send message on without being molested.
Unfortunately I didn't keep a copy of the script around so I can't post it here.
| Peter L. Berghold -- Unix Professional Peter at Berghold dot Net | |
| Dog trainer, dog agility exhibitor, brewer of fine Belgian style ales. Happiness is a warm, tired, contented dog curled up at your side and a good Belgian ale in your chalice. | |
In reply to Re: Remove Email Attachments
by blue_cowdawg
in thread Remove Email Attachments
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |