jjoerg has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks,
I know there is something very basic that your deep knowledge and wisdom will see immediately. I am a broken and imperfect vessel and cannot see. Please help me.
I get many emails with attachments to a user account that need automated extracting on a regular basis. They come in at irregular times, and the mail gets checked 1x/month or so. I have not used MIME::Parser before, and wrote the following:
use MIME::Parser; $mailfile = "$mailspool/[username]"; $parser = new MIME::Parser; $head = new MIME::Head; open(IN, "$mailfile"); $parser->output_under("$basedir/INCOMING"); $entity = $parser->parse(\*IN);
This works nicely, but only for the first message in the mailbox. The attachments of that message get saved and the program exits. How do I keep it going through all the messages in the mail spool?
I thank you for your kind assistance.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: mime parser multiple emails
by roboticus (Chancellor) on Mar 27, 2019 at 18:06 UTC | |
Re: mime parser multiple emails
by thanos1983 (Parson) on Mar 28, 2019 at 08:34 UTC | |
by parv (Parson) on Mar 28, 2019 at 08:46 UTC | |
by thanos1983 (Parson) on Mar 28, 2019 at 09:12 UTC |