Mailing List Archive

error code on redirect router for exceeding max msg size
Hi

I restrict the msg size per user with a sql query in a redirect router. The default error code for failed messages is „550“. This code is interpreted on the other mailserver as „recipient unknown“. Thats confusing people who sends to big mails. So I want an error code „552“. According to the manual it should be possible - but I can’t get it work

Chapter 22 - The redirect router: … "By default, Exim sends a 451 SMTP code for a :defer:, and 550 for :fail:. However, if the message starts with three digits followed by a space, optionally followed by an extended code of the form n.n.n, also followed by a space, and the very first digit is the same as the default error code, the code from the message is used instead."

I configured:

driver = redirect
condition = ${if >{$message_size}{${lookup pgsql{MAX_MSG}{${value}K}fail}} {true}{false}}
data = :fail: 552 Your message is too big.\n \


but it does not work. Error code is still „550“. What’s wrong with that item?

Thanks for your help
Nicola
Re: error code on redirect router for exceeding max msg size [ In reply to ]
On 01/10/2018 22:29, Nicola Tiling via Exim-users wrote:
> data = :fail: 552 Your message is too big.\n \
>
>
> but it does not work. Error code is still „550“. What’s wrong with that item?

It works for me. Are you sure you're running that change? Running
through that specific router?
--
Cheers,
Jeremy


--
## List details at https://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/
Re: error code on redirect router for exceeding max msg size [ In reply to ]
Yes. It’s the only item that proofs the message size and I’ve testet with a restriction of 1KB thats rejected the mail correct. And I proof it with exim in non daemon debugging mode.

I’ve seen my error code in my own exim (intern) log. But sending a bigger mail with an extern address to this exim server sends me a rejection with a "550 - recipient unknow“ in the info message from the external mailserver. There I also want the correct code because a „recipient unknown“ is confusing the sending people

> Am 02.10.2018 um 10:45 schrieb Jeremy Harris via Exim-users <exim-users@exim.org>:
>
> On 01/10/2018 22:29, Nicola Tiling via Exim-users wrote:
>> data = :fail: 552 Your message is too big.\n \
>>
>>
>> but it does not work. Error code is still „550“. What’s wrong with that item?
>
> It works for me. Are you sure you're running that change? Running
> through that specific router?
> --
> Cheers,
> Jeremy
>
>
> --
> ## List details at https://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/
Re: error code on redirect router for exceeding max msg size [ In reply to ]
On 4 Oct 2018, at 22:50, Nicola Tiling via Exim-users <exim-users@exim.org> wrote:
> Yes. It’s the only item that proofs the message size and I’ve testet with a restriction of 1KB thats rejected the mail correct. And I proof it with exim in non daemon debugging mode.
>
> I’ve seen my error code in my own exim (intern) log. But sending a bigger mail with an extern address to this exim server sends me a rejection with a "550 - recipient unknow“ in the info message from the external mailserver. There I also want the correct code because a „recipient unknown“ is confusing the sending people

Your router is:

driver = redirect
condition = ${if >{$message_size}{${lookup pgsql{MAX_MSG}{${value}K}fail}} {true}{false}}
data = :fail: 552 Your message is too big.\n \

(that trailing backslash looks a bit suspicious to me; I don’t think that should be there).

When your ACLs are doing recipient verification - more than likely before the DATA phase, so $message_size is empty *unless* the SIZE command has been passed - if the router fails, the address won’t verify and a 550 will be the result from the ACL.

You should be doing your message size check in ACLs rather than in a router, or you should set ‘no_verify’ on the router so that it’s not used before DATA.

Graeme
--
## List details at https://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/