Re: Checking for attachments in an email and storing to a seperate file
Mark Overmeer <[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.mail-box |
|---|---|
| Organization | MARKOV Solutions |
| Message-ID | <[email protected]> |
* Anthony Seddon ([email protected]) [040325 17:27]: > I use procmail to pipe email to a perl script. At the moment the script > can only handle simple text messages without attachments. However I > would like to be able to be able to accept attachments, strip them out > save them to a seperate file. Would be something like: my $msg = Mail::Message->read(\*STDIN); ... be smart ... foreach my $part ($msg->parts) { if($part->size > 1E6) { $part->body->write(...); $part->delete; } } $msg->send(...); But also have a look at rebuild() Mail::Message::Construct::Rebuild I have thought to implement this as default feature, however: how to name these files? Where to locate them? How do you get this in sync with the folders? -- MarkOv ------------------------------------------------------------------------ drs Mark A.C.J. Overmeer MARKOV Solutions [email protected] [email protected] http://Mark.Overmeer.net http://solutions.overmeer.net