Mailing List Archive

How to change message failure strings?
I've been trying to change the messages that exim4 issues when
routers fail. For instance, if exim runs through all the routers, the
last being the localuser router it will normally send back
'unrouteable address' as the error message (exim3 used to say 'no
such local part' I think). I wanted to change this string.

I managed to do it by adding another router as the last one:

localuser:
driver = accept
check_local_user
transport = local_delivery

faillocaluser:
driver = redirect
allow_fail
data = :fail: No such local address could be found

.. which works but somehow seems overkill. I would have thought it
would be possible to add a log_message or error_message option to the
router which specifies the message to return to the sender. Since any
router can have the no_more option I was expecting a generic option
but couldn't see one. Although I can do what I want for the case
when I run out of routers, I don't know how to change the error text
for a router which fails and has no_more as an option.

I had a look through the spec & archive but didn't come up with
anything (other than hacking the code 8-).

Thanks
Glenn
Re: How to change message failure strings? [ In reply to ]
On Tue, 23 Jul 2002, Glenn Carver wrote:

> faillocaluser:
> driver = redirect
> allow_fail
> data = :fail: No such local address could be found
>
> .. which works but somehow seems overkill. I would have thought it
> would be possible to add a log_message or error_message option to the
> router which specifies the message to return to the sender.

But *which* router? A router doesn't know that it's the last one. There
may be another one after it that handles the address.

> Since any
> router can have the no_more option I was expecting a generic option
> but couldn't see one. Although I can do what I want for the case
> when I run out of routers, I don't know how to change the error text
> for a router which fails and has no_more as an option.

That's when a router declines. Yes, it could perhaps specify a message
in that case, and I'll think about that. But for the "run out of
routers" case, I think the message has to be specified separately. After
all, the final router may have a "domains" setting (for example) and so
would be skipped for some domains.

I could add a separate option this_message_for_run_out_of_routers, I
suppose, for tidiness.


--
Philip Hazel University of Cambridge Computing Service,
ph10@cus.cam.ac.uk Cambridge, England. Phone: +44 1223 334714.
Re: How to change message failure strings? [ In reply to ]
At 8:46pm +0100 23/7/02, Philip Hazel wrote:
>On Tue, 23 Jul 2002, Glenn Carver wrote:
>
>> faillocaluser:
>> driver = redirect
>> allow_fail
>> data = :fail: No such local address could be found
>>
>> .. which works but somehow seems overkill. I would have thought it
>> would be possible to add a log_message or error_message option to the
>> router which specifies the message to return to the sender.
>
>But *which* router? A router doesn't know that it's the last one. There
>may be another one after it that handles the address.

Doesn't matter. If the router doesn't match and testing moves to the
next router the failure message option for that router is not used.
Some routers might be doing very specific things and it would be nice
to tailor the error message if a router fails & no_more is given.

>
>> Since any
>> router can have the no_more option I was expecting a generic option
>> but couldn't see one. Although I can do what I want for the case
>> when I run out of routers, I don't know how to change the error text
>> for a router which fails and has no_more as an option.
>
>That's when a router declines. Yes, it could perhaps specify a message
>in that case, and I'll think about that. But for the "run out of
>routers" case, I think the message has to be specified separately. After
>all, the final router may have a "domains" setting (for example) and so
>would be skipped for some domains.

Agreed. I guess what I had in mind is similar to how the ACLs work
with a : 'deny message = no such luck' at the end. The analogy I
guess is a set of routers at the very end which use :fail: to give a
specific message for whatever condition you like and that's all they
do (message for a virtual domain, cancelled users etc).

Part of my reason for wanting to do this is that the current
'unrouteable address' message is not specific enough (i.e. could mean
an internal network failure?). I was hoping that if I made it
blindingly obvious there's no-one here with that address, the spam
merchants might actually take the address off their lists (one day).
You never know..

Thanks
Glenn