Re: [exim] How to execute a php script if delivery mail fail…

Góra strony
Delete this message
Reply to this message
Autor: Chris Lightfoot
Data:  
Dla: Michalski Luc
CC: exim-users
Temat: Re: [exim] How to execute a php script if delivery mail failed
On Wed, Sep 06, 2006 at 01:38:23PM -0700, Michalski Luc wrote:
>
> Hello,
>
> I am sending a newsletter every weeks to my user and some users have email
> addresses which don t exist anymore or are full...And i receive a mail
> delivery warning for each one...
>
> I d like to write a router in the exim.conf which send the invalid address
> to a file for treatment :
>
> invalid_from_local:
> driver = accept
> condition = ${if eq {$sender_address}{XXXXXXXXXXXXXXXXXXXXXXXXX}}
> transport = prune_recipient
>
> prune_recipient:
> driver = pipe
> command = /usr/local/bin/prune.pl
>
> What should I write as condition for routing all these bad emails ?


The classic answer to this problem is to originate each of
your mails with a unique envelope sender and make each
delivery to exactly one recipient. Then you handle any
messages you receive *to* those unique addresses by
passing them to a script which verifies that the mail it's
received is a bounce, works out the address for which the
bounce was received from the unique information in the
address, and marks that address as broken in your database
(or deletes it, or whatever). Note that you really should
distinguish bounces resulting from temporary failure
conditions from those resulting from permanent ones, but
this is quite hard to do mechanically and temporary
failure bounces seem to be relatively rare now.

You can do all of this withwith the normal alias |command
mechanism, as long as the UID sending the mail is trusted
(so that they can set the return-path) or it is submitted
by SMTP -- no significant changes to your Exim
configuration are needed.

--
``One of the advantages of being disorderly is that
one is constantly making exciting discoveries.''
(A. A. Milne)