On Mon, 5 Apr 2004 16:10:17 +0200,
PHP2 <> wrote:
> I wish read email headers... how do it with Perl?
Mail::Header, which comes as part of the MailTools package. It's
available from CPAN.
> I wish send email from server to
> and if is invalid after some time I'll receive
> 'nodelivery' message... how I can read 'nodelivery' email header?
First of all, you'll have to get the messages from your mailbox. It
depends on where that is stored on how you do that. There are Perl
modules available for POP and IMAP, as well as modules to parse
various mailbox file formats.
http://search.cpan.org/
Let me give you a little warning though: while 90% of the bounce
messages are reasonably formatted, and easy to parse, and fall in a
few categories, there are some cutesy mail admins out there, who've
customised the crap out of their mail gateway, with the result that
their bounce messages are almost impossible to recognise as such.
The best thing to do for this sort of thing, is to set up a dedicated
email address that you send your "probe" email from. That way, you
will get all replies on that account. You will still have some email
that you will need to deal with manually: the ones I mentioned above,
and the ones from real people who reply to your message themselves.
Martien
--
|
Martien Verbruggen |
Trading Post Australia |
|