I've eventually solved it like that way:
mailerdaemon_filter:
driver = accept
domains = ! +local_domains : ! +relay_to_domains
condition = "${if and{\
{eq{$sender_address}{mailer-daemon@???}}\
{!eq{$received_protocol}{mailerdaemon-filter-scanned-ok}}\
}\
{1}{0}}"
transport = mailerdaemon_filter
mailerdaemon_purge:
driver = accept
domains = ! +local_domains : ! +relay_to_domains
condition = ${if eq{$h_X-PurgeMailerDaemon:}{YES} {1}{0}}
transport = mailerdaemon_purge
The mailerdaemon_filter parses the message, looking for specific strings ("host XX.XX.XX.XX \[XX.XX.XX.XX\]: .* Message rejected as spam by Content Filtering" for example). If found, it adds the X-PurgeMailerDaemon SMTP header which triggers the mailerdaemon_purge router.
----- Original Message ----
From: Christian Gregoire <cgregoir99@???>
To: exim-users@???
Sent: Wednesday, January 21, 2009 5:25:35 PM
Subject: [exim] How to tell Exim not to issue mailer daemons
Hello,
My Exim server acts as a virus scanner and an SMTP relay for some domains. When those remote MTA refuse emails - because they are spam for example -. Exim gets a 5xx code and so issues a MD back to the sender.
I'd like to disable mailer-daemon when Exim gets some kind of 5xx codes. Is this possible ?
Christian
--
## List details at
http://lists.exim.org/mailman/listinfo/exim-users
## Exim details at
http://www.exim.org/
## Please use the Wiki with this list -
http://wiki.exim.org/