Mail filtering problem

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: David.Osborne
Dátum:  
Címzett: exim-users
Tárgy: Mail filtering problem
I've just started to use mail filtering. I'm trying to use it for those cases
where some of our users get an error message from exim for an incorrect
address, then re-send that error message to a second address, which they also
get wrong. At present, the second error message is returned to mailer-daemon
(as the sender of the first error message), but it should really go to the
re-sending user. Using an exim filter, an exim error message which is
From:mailer-daemon and To:mailer-daemon should be piped to a Perl script which
rewrites the To address in the second error message then mails it to the
address in the first Resent-from field. I hope that explanation is
understandable!

I have mailer-daemon aliased to exim, and exim's .forward file is:
# Exim filter
if $header_from: contains "mailer-daemon@???" and
$header_to: contains "mailer-daemon@???" and
$message_body contains "created automatically by mail delivery software"
then
pipe "$home/bin/resend-dr"
else
deliver "postmaster@???"
endif

The .forward file checks out using -bf when given a sample message:

pat{166}%exim -v -bf .forward -f mailer-daemon@??? < junk
Testing Exim filter file .forward
Condition is true: $header_from: contains "mailer-daemon@???" and
$header_to: contains "mailer-daemon@???" and
$message_body contains "created automatically by mail delivery software"

Pipe message to: $home/bin/resend-dr
At the end of filtering "delivered" is true

But if I use -bt to test what happens on delivery to exim, I get this:

pat{167}% exim -bt exim
exim@??? cannot be resolved at this time:
<exim@???> - error in forward file: missing or malformed local
part (expected word or "<") in "if $header_from: contains
"mailer-daemon@???" and"

What's wrong?

--
David Osborne                          email: David.Osborne@???
Cripps Computing Centre                             tel: +44 (0)115 951 3397
   (and Department of Geography)                    fax: +44 (0)115 951 3358
University of Nottingham
Nottingham NG7 2RD, UK              Web: http://www.nottingham.ac.uk/~cczdao