Problem
I would like to establish forwarding via /etc/aliases such that all incoming mail messages to a particular account are stripped of attachments before delivery. Where I'm having a problem is what module(s) to use to accomplish it.
What I've tried
- Installed Mail-Tools, MIME-tools and IO::Stringy.
- Read the perldocs for MIME::Parser, MIME::ParserBase, and MIME::Entity.
- Written some test programs using Data::Dumper to try and understand the various "entity" structures.
- I've Super Searched the site and come up with some small snippets that glean a little information about using the above modules but nothing quite fits what I want to do.
I'm not asking for anyone to do this for me, just to give me some ideas on how to proceed.
For instance, will this strategy work:
- parse the incoming message via \*STDIN using MIME::Parser (?).
I gather this also decodes the message.
- delete references to unwanted attachments
- reassemble the message using MIME::Lite (?) and feed to STDOUT? Since I probably need to re-encode the message.
The main difficulty I think, is determining how the parts I need to delete are being referenced and how to insure that everything except the attachments gets forwarded. Am I overlooking some module that would simplify this task?
Thanks for any help, pointers.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.