Mailing List Archive

system filter to catch bounce messages
This is a multi-part message in MIME format.
--
[ Picked text/plain from multipart/alternative ]
Hi,

I want to catch bounces messages and deliver them to a certain address.
Reason for this is I have a server sending mail out from a certain address
and if any recipients cause a bounce I need it to be sent to a different
mail address than the original from address. This is because if the original
mails are delivered correctly they may be replied to and yet a different
alias is then used to direct the mail elsewhere.

hope this makes sense.

Anyway I though of doing this in the system_filter file I have in /usr/exim
with the following syntax.

Ignore the #

#if $local_part matches <>
#then
# deliver address@somedomain.com
#endif


----------------------------------------------------------------------------
------
Dave Markham ( Internet Systems Engineer )
( Internal - 7241 4805
( External - 01782 794805
* David.Markham@services.fujitsu.com
Fujitsu Services,
Westfields House, West Avenue, Kidsgrove,
Stoke-On-Trent, ST7 1TL
----------------------------------------------------------------------------
------

--
Re: system filter to catch bounce messages [ In reply to ]
On Tue, 16 Jul 2002, David Markham wrote:

> I want to catch bounces messages and deliver them to a certain address.
> Reason for this is I have a server sending mail out from a certain address
> and if any recipients cause a bounce I need it to be sent to a different
> mail address than the original from address.

Why not get the server to send out the messages with an appropriate
envelope sender (return path) in the first place?

> This is because if the original
> mails are delivered correctly they may be replied to and yet a different
> alias is then used to direct the mail elsewhere.

Replies go to addresses in the headers, not the envelope. So you can
have them different.

> Anyway I though of doing this in the system_filter file I have in /usr/exim
> with the following syntax.
>
> Ignore the #
>
> #if $local_part matches <>
> #then
> # deliver address@somedomain.com
> #endif

That won't work at all. With respect, you seem to be very confused about
the way bounce messages and system filters work.

1. In a system filter $local_part is never set (because a message may
have many recipients).

2. When $local_part is set (e.g. in routers) it is never empty - after
all, the message has to be addressed to some recipient!

3. A bounce message has an empty SENDER address.


--
Philip Hazel University of Cambridge Computing Service,
ph10@cus.cam.ac.uk Cambridge, England. Phone: +44 1223 334714.
RE: system filter to catch bounce messages [ In reply to ]
Yes after posting i realised I should be using $sender_address_local_part.

the reason I cannot use a different address to send mail out from the server
is that its an application thing that I have no control over. A different
department.

They send mails out to the internet as info@domain

Any bounce messages generated from this mail needs to be captured and mailed
to a certain person.
The messages which are delivered successfully may reply in which case I have
aliases for info@domain to forward to some real address somewhere.

I know replies go to header address and not envelopes but software such as
outlook sends its from address you set in the options as the envelope
address I think anyway ( please correct if wrong ).

So Is there an easier way to capture actually bounce messages as opposed to
just catching mail sent to or from certain addresses.

I have tried below now, but still no joy.

if $sender_address_local_part contains "<>"
then
deliver xxxx@domain2.com
endif


-----Original Message-----
From: Philip Hazel [mailto:ph10@cus.cam.ac.uk]
Sent: 16 July 2002 14:19
To: David Markham
Cc: Exim User (E-mail)
Subject: Re: [Exim] system filter to catch bounce messages


On Tue, 16 Jul 2002, David Markham wrote:

> I want to catch bounces messages and deliver them to a certain address.
> Reason for this is I have a server sending mail out from a certain address
> and if any recipients cause a bounce I need it to be sent to a different
> mail address than the original from address.

Why not get the server to send out the messages with an appropriate
envelope sender (return path) in the first place?

> This is because if the original
> mails are delivered correctly they may be replied to and yet a different
> alias is then used to direct the mail elsewhere.

Replies go to addresses in the headers, not the envelope. So you can
have them different.

> Anyway I though of doing this in the system_filter file I have in
/usr/exim
> with the following syntax.
>
> Ignore the #
>
> #if $local_part matches <>
> #then
> # deliver address@somedomain.com
> #endif

That won't work at all. With respect, you seem to be very confused about
the way bounce messages and system filters work.

1. In a system filter $local_part is never set (because a message may
have many recipients).

2. When $local_part is set (e.g. in routers) it is never empty - after
all, the message has to be addressed to some recipient!

3. A bounce message has an empty SENDER address.


--
Philip Hazel University of Cambridge Computing Service,
ph10@cus.cam.ac.uk Cambridge, England. Phone: +44 1223 334714.
Re: system filter to catch bounce messages [ In reply to ]
--
On Tue, Jul 16, 2002 at 03:35:51PM +0100, David Markham wrote:
| Yes after posting i realised I should be using $sender_address_local_part.
|
| the reason I cannot use a different address to send mail out from the server
| is that its an application thing that I have no control over. A different
| department.
|
| They send mails out to the internet as info@domain
|
| Any bounce messages generated from this mail needs to be captured and mailed
| to a certain person.

What you want to do is set the following on the outgoing SMTP router :

errors_to = ${if eq {$sender_address_local_part}{info} {the_bounce_receiver@your_domain.example} {$sender_address}}

this will change the envelope so that bounces go to the desired address.

| The messages which are delivered successfully may reply in which case I have
| aliases for info@domain to forward to some real address somewhere.
|
| I know replies go to header address and not envelopes but software such as
| outlook sends its from address you set in the options as the envelope
| address I think anyway ( please correct if wrong ).

You can change the envelope (see above). It doesn't matter that
outlook (or whatever) sets the envelope undesirably. It also doesn't
matter that they are in a different department.

HTH,
-D

--
"...In the UNIX world, people tend to interpret `non-technical user' as
meaning someone who's only ever written one device driver."
--Daniel Pead

http://dman.ddts.net/~dman/
--
[ Content of type application/pgp-signature deleted ]
--