![]() |
|
There's more than one way to do things | |
PerlMonks |
Parse a Unix Mailbox for unknown users or hostsby maksl (Pilgrim) |
on Apr 08, 2003 at 10:37 UTC ( #248875=CUFP: print w/replies, xml ) | Need Help?? |
Dear fellow monks, After sending out a newsletter to subscribed readers, some emails or their hosts no longer exists. therefor i need a fast and quick parser for above messages not taking in account any "mailbox is full" or other garbage autoreply messages. Limbic~Region pointed to Mail::MboxParser. It's a fast read only access to an unix mailbox and the module is easy to understand! $msg->header->{from} or $msg->header->{to} is no use for the job because they both show the server where the newsletter was sent from. The body has to be parsed for unknown users or hosts. The print statements prints out the wrong email adress preceded with the corresponding message: user unknown or host unknown. My use was slightly different, as i connected to the database for the unknown users in order to flag their emails as unsubscribed and left the unknown hosts for handcraft as shown here. So here is the code :)
again cpan is a great help and this job was fast and fun Update:
Back to
Cool Uses for Perl
|
|