Hi Andy,
A short while ago I wrote a script which does this. It handles
unsubscriptions, undeliverables and also automatically emails people if they
have sent a message to the automatic mailer address (have to be careful here
as there are plenty of hazards in the 'moronic' autoresponder business - see
Auto-Generated and Content-Type Headers!!!!!!!):-)
As we use Linux here I actually created an alias in the /etc/aliases file
which points to the above script, so I wouldn't need to scroll through a
mailbox.
I used Mail::Header. To help recognise the originator address etc...
You also need to check if your sendmail (or simillar) process which
initially handles the incoming message maps <> addresses to POSTMASTER or
MAILER-DAEMON. Basically any mail you get from a Mailer-Daemon or
postmaster or root address could be an undeliverable.
One of the hardest things is that depending on which email system returns an
undeliverable mail, depends on the format of the undeliverable message.
About the only common element is that most systems return the top 'x' amount
of lines of the original email address.
Therefore when I generated my original emails I placed an X-Header in there
which corresponded to a User ID contained in our local database, and thus if
the message undelivered I could search for the X-Header line in a returned
message first and then I'd know which email address the mail had been
returned from. I used my own modified version of Mail::Bulkmail to generate
messages.
If however the X-Header isn't returned I would use the
Mail::Header ->{msg_hdr_list} to split the incoming message into header/body
and then took the slightly shaky approach of assuming that the first email
address that appears in the body of the message is the original destination
address which undelivered.
It didn't matter if the address it found was in fact a message ID, I was
only interested in rough statistics. Also some mail systems will actually
return a list of undeliverable addresses. This would then make it even more
difficult.
Anyway hope that gives you a few ideas,
Regards
Marty
> Hi all,
> we have an application here that e-mails out information to
> subscribers. However some e-mails will not reach their intended
> destination. These will be 'bounced'. Our intention is to have a script
> running regular scans of the inbox handling returned messages. Does
anybody
> know a sure fire way of being able to recognize which individual addresses
> have failed so that ultimately we can stop sending to these addresses?
>
---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
[EMAIL PROTECTED]
For non-automated Mailing List support, send email to
[EMAIL PROTECTED]