Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks,
I am only a Perl beginner (especially with Object Oriented stuff) and I am having a task of reading an email message piped from /etc/aliases (STDIN that is) with attachments and then saving those attachments into a special directory. I know that the right module for this thing should probably be MIME::Parser but it is OOP and pretty complicated (for me at least). I have searched for examples and/or tutorials for this module here, on CPAN and on google but to no avail. The module itself has some scripts in examples directory but they don't seem to be helping too much.
Currently I have this code:
#!/usr/bin/perl -w use strict; use MIME::Parser; my $parser = new MIME::Parser; $parser->output_under("/some/directory"); my $entity = $parser->parse(\*STDIN) || die "Parse failed";
I guess I could fish out the neccessary files from "/some/directory" with File::Find, but surely, there must be a way with MIME::Parser.
Is there some easy reading (a tutorial? a special manual for reading handling emails?) that I could use to solve this problem? Could you push me into the right direction to solve this problem?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: reading piped email with attachments
by sauoq (Abbot) on Sep 23, 2003 at 22:04 UTC | |
|
Re: reading piped email with attachments
by moxliukas (Curate) on Sep 24, 2003 at 06:31 UTC |