Mailing List Archive

Unexpected 're-routed to' in require verify = recipient?
Hi list,

I try to send a message to 'info@email.postcodeloterij.nl', but Exim
unexpectedly changes that to 'info@postcodeloterij.slgnt.eu', based on
some DNS queries it seems?

| $ exim -f ssmeenk@freshdot.net -bt info@email.postcodeloterij.nl
| info@postcodeloterij.slgnt.eu
| <-- info@email.postcodeloterij.nl
| router = remote_batv, transport = remote_smtp_batv
| host mx1.slgnt.eu [194.213.114.251] MX=10

Some relevant '-d+route' logging:

| calling remote_batv router
| remote_batv router called for info@email.postcodeloterij.nl
| domain = email.postcodeloterij.nl
| email.postcodeloterij.nl in "*"? yes (matched "*")
| DNS lookup of email.postcodeloterij.nl (MX) succeeded
| DNS lookup of mx1.slgnt.eu (AAAA) gave NO_DATA
| returning DNS_NODATA
| faking res_search(AAAA) response length as 65535
| writing neg-cache entry for mx1.slgnt.eu-AAAA-800041, ttl 180
| DNS lookup of mx1.slgnt.eu (A) succeeded
| 194.213.114.251 in "<; 0.0.0.0 ; 127.0.0.0/8 ; ::1 ; 64.94.110.11"? no
| (end of list)
| fully qualified name = postcodeloterij.slgnt.eu
| host_find_bydns yield = HOST_FOUND (3); returned hosts:
| mx1.slgnt.eu 194.213.114.251 MX=10
| domain changed to postcodeloterij.slgnt.eu
| rewriting header lines
| re-routed to info@postcodeloterij.slgnt.eu

I'd rather it did not do this. Since the addres *i gave it* works, and
the address *it made up itself* fails delivery with '550 user unknown'.

Now, email.postcodeloterij.nl is a CNAME to postcodeloterij.slgnt.eu,
but why would that mean Exim decides to change the To:-address?
And why does it stop there instead of following the next CNAME chain to
postcodeloterij.slgnt.eu.cdn.cloudflare.net?

The fine docs at https://www.exim.org/exim-html-current/doc/html/spec_html/ch-address_rewriting.html
state that "One situation in which Exim does _not_ automatically rewrite a
domain is when it is the name of a CNAME record in the DNS."

Yet, here we are. Am i missing something obvious? The address isn't
unqualified nor is it 'abbreviated' (imo, weird term?) and there isn't
any explicit 'begin rewrite ..' in my config either.

I tried to play around with dnslookup router settings like
'rewrite_headers' and 'qualify_single' but that doesnt seem to do
anything.

Any tips? Greatly appreciated!

Thanks!
-Sander.
--
| If nothing sticks to Teflon, how did they stick it onto the pan?
| 4096R/20CC6CD2 - 6D40 1A20 B9AA 87D4 84C7 FBD6 F3A9 9442 20CC 6CD2

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Unexpected 're-routed to' in require verify = recipient? [ In reply to ]
On 23/05/2023 12:21, Sander Smeenk via Exim-users wrote:
> I try to send a message to 'info@email.postcodeloterij.nl', but Exim
> unexpectedly changes that to 'info@postcodeloterij.slgnt.eu',

> | re-routed to info@postcodeloterij.slgnt.eu
>
> I'd rather it did not do this. Since the addres *i gave it* works, and
> the address *it made up itself* fails delivery with '550 user unknown'.

You have some explicit coding in your config to do this.
Your config is making the decision to change the domain.
If you don't want it, don't do it.
--
Cheers,
Jeremy


--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Unexpected 're-routed to' in require verify = recipient? [ In reply to ]
On 2023-05-23, Jeremy Harris via Exim-users <exim-users@lists.exim.org> wrote:
> On 23/05/2023 12:21, Sander Smeenk via Exim-users wrote:
>> I try to send a message to 'info@email.postcodeloterij.nl', but Exim
>> unexpectedly changes that to 'info@postcodeloterij.slgnt.eu',
>
>> | re-routed to info@postcodeloterij.slgnt.eu
>>
>> I'd rather it did not do this. Since the addres *i gave it* works, and
>> the address *it made up itself* fails delivery with '550 user unknown'.
>
> You have some explicit coding in your config to do this.
> Your config is making the decision to change the domain.
> If you don't want it, don't do it.

I tried the same debugging line on my system, with the same result.
I have no header rewriting mentioned in my config, apart from one rule
in a router that does not apply to this address.

So it's very unobvious what the "explicit coding" might be.

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Unexpected 're-routed to' in require verify = recipient? [ In reply to ]
Quoting Julian Bradfield via Exim-users (exim-users@lists.exim.org):

> >> I'd rather it did not do this. Since the addres *i gave it* works, and
> >> the address *it made up itself* fails delivery with '550 user unknown'.
> > You have some explicit coding in your config to do this.
> > Your config is making the decision to change the domain.
> > If you don't want it, don't do it.

> I tried the same debugging line on my system, with the same result.
> I have no header rewriting mentioned in my config, apart from one rule
> in a router that does not apply to this address.
>
> So it's very unobvious what the "explicit coding" might be.

Thanks for confirming this, Julian.

--
| What would it profit a man to gain the world, and loose his soul...
| 4096R/20CC6CD2 - 6D40 1A20 B9AA 87D4 84C7 FBD6 F3A9 9442 20CC 6CD2

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Unexpected 're-routed to' in require verify = recipient? [ In reply to ]
On 2023-05-23, Julian Bradfield via Exim-users <exim-users@lists.exim.org> wrote:
> On 2023-05-23, Jeremy Harris via Exim-users <exim-users@lists.exim.org> wrote:
>> On 23/05/2023 12:21, Sander Smeenk via Exim-users wrote:
>>> I try to send a message to 'info@email.postcodeloterij.nl', but Exim
>>> unexpectedly changes that to 'info@postcodeloterij.slgnt.eu',
>>
>>> | re-routed to info@postcodeloterij.slgnt.eu
>>>
>>> I'd rather it did not do this. Since the addres *i gave it* works, and
>>> the address *it made up itself* fails delivery with '550 user unknown'.
>>
>> You have some explicit coding in your config to do this.
>> Your config is making the decision to change the domain.
>> If you don't want it, don't do it.
>
> I tried the same debugging line on my system, with the same result.
> I have no header rewriting mentioned in my config, apart from one rule
> in a router that does not apply to this address.
>
> So it's very unobvious what the "explicit coding" might be.

Just having a quick look at the source code, what does line 415 of
dnslookup.c (in git master) do, since ob->rewrite_headers is true?

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Unexpected 're-routed to' in require verify = recipient? [ In reply to ]
On 23/05/2023 13:21, Sander Smeenk via Exim-users wrote:

> I try to send a message to 'info@email.postcodeloterij.nl', but Exim
> unexpectedly changes that to 'info@postcodeloterij.slgnt.eu', based on
> some DNS queries it seems?

> | $ exim -f ssmeenk@freshdot.net -bt info@email.postcodeloterij.nl
> | info@postcodeloterij.slgnt.eu

I'm definitely not an expert, but is this not expected behaviour based on
RFC5321 section 5.1 [1]?

"The lookup first attempts to locate an MX record associated with the
name. If a CNAME record is found, the resulting name is processed as
if it were the initial name."

> And why does it stop there instead of following the next CNAME chain to
> postcodeloterij.slgnt.eu.cdn.cloudflare.net?

I don't know the answer to this, but perhaps it's also defined behaviour in an
RFC somewhere? (or out of spec => undefined?)

Tim

[1] https://www.rfc-editor.org/rfc/rfc5321#section-5.1

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Unexpected 're-routed to' in require verify = recipient? [ In reply to ]
On 23/05/2023 21:01, Julian Bradfield via Exim-users wrote:
> On 2023-05-23, Julian Bradfield via Exim-users <exim-users@lists.exim.org> wrote:
>> So it's very unobvious what the "explicit coding" might be.
>
> Just having a quick look at the source code, what does line 415 of
> dnslookup.c (in git master) do, since ob->rewrite_headers is true?

As you found, I assume, ob->rewrite_headers comes from the
router configuration, option "rewrite_headers", which defaults
to true.


The block comment on that function says:

/* When a router wants to change the address that is being routed, it is like a
redirection. We insert a new parent of the current address to hold the original
information, and change the data in the original address, which is now the
child. The child address is put onto the addr_new chain. Pick up the local part
from the "address" field so as to get it in external form - caseful, and with
any quoting retained.

Arguments:
addr the address block
domain the new domain
rewrite TRUE if headers lines are to be rewritten
addr_new the new address chain

The porting using the "rewrite" arg goes:

/* Rewrite header lines if requested */

if (rewrite)
{
DEBUG(D_route|D_rewrite) debug_printf("rewriting header lines\n");
for (header_line * h = header_list; h != NULL; h = h->next)
{
header_line *newh =
rewrite_header(h, parent->domain, domain,
global_rewrite_rules, rewrite_existflags, TRUE);

The "global_rewrite_rules" are (a list) developed from reading the
configuration. See
https://exim.org/exim-html-current/doc/html/spec_html/ch-address_rewriting.html


In summary, if the router option value is true then the global rewrite
rules are applied to the result of the DNS lookup done by the dnslookup
router.

--
Cheers,
Jeremy


--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Unexpected 're-routed to' in require verify = recipient? [ In reply to ]
On Tue, 23 May 2023, Tim Jackson via Exim-users wrote:

> On 23/05/2023 13:21, Sander Smeenk via Exim-users wrote:
>
>> I try to send a message to 'info@email.postcodeloterij.nl', but Exim
>> unexpectedly changes that to 'info@postcodeloterij.slgnt.eu', based on
>> some DNS queries it seems?
>
>> | $ exim -f ssmeenk@freshdot.net -bt info@email.postcodeloterij.nl
>> | info@postcodeloterij.slgnt.eu
>
> I'm definitely not an expert, but is this not expected behaviour based on
> RFC5321 section 5.1 [1]?
>
> "The lookup first attempts to locate an MX record associated with the
> name. If a CNAME record is found, the resulting name is processed as
> if it were the initial name."
>
>> And why does it stop there instead of following the next CNAME chain to
>> postcodeloterij.slgnt.eu.cdn.cloudflare.net?
>
> I don't know the answer to this, but perhaps it's also defined behaviour in
> an RFC somewhere? (or out of spec => undefined?)

That bit is easy:
# host -t mx email.postcodeloterij.nl
email.postcodeloterij.nl is an alias for postcodeloterij.slgnt.eu.
postcodeloterij.slgnt.eu is an alias for postcodeloterij.slgnt.eu.cdn.cloudflare.net.
postcodeloterij.slgnt.eu.cdn.cloudflare.net mail is handled by 10 mx1.slgnt.eu.

So it does follow the chain through and beyond
postcodeloterij.slgnt.eu.cdn.cloudflare.net

--
Andrew C. Aitchison Kendal, UK
andrew@aitchison.me.uk

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Unexpected 're-routed to' in require verify = recipient? [ In reply to ]
On 2023-05-23, Tim Jackson via Exim-users <exim-users@lists.exim.org> wrote:
> On 23/05/2023 13:21, Sander Smeenk via Exim-users wrote:
>
>> I try to send a message to 'info@email.postcodeloterij.nl', but Exim
>> unexpectedly changes that to 'info@postcodeloterij.slgnt.eu', based on
>> some DNS queries it seems?
>
>> | $ exim -f ssmeenk@freshdot.net -bt info@email.postcodeloterij.nl
>> | info@postcodeloterij.slgnt.eu
>
> I'm definitely not an expert, but is this not expected behaviour based on
> RFC5321 section 5.1 [1]?
>
> "The lookup first attempts to locate an MX record associated with the
> name. If a CNAME record is found, the resulting name is processed as
> if it were the initial name."

No. That section is about finding the target host, not about changing the
recipient address.

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Unexpected 're-routed to' in require verify = recipient? [ In reply to ]
OK, Jeremy, here's a minimal example. Please tell me where I'm asking
exim to rewrite the envelope-to address :)

Command line:
exim4 -C exim4-min.conf -f ssmeenk@freshdot.net -bt -d+route+rewrite info@email.postcodeloterij.nl

---< exim4-min.conf
begin routers

dnslookup:
driver = dnslookup
transport = remote_smtp
user = Debian-exim
same_domain_copy_routing = yes
no_more

begin transports

remote_smtp:
driver = smtp
--->

Command output:
Exim version 4.94.2 uid=0 gid=0 pid=531705 D=f7715cfd
Support for: crypteq iconv() IPv6 GnuTLS move_frozen_messages DANE DKIM DNSSEC Event I18N OCSP PIPE_CONNECT PRDR SOCKS TCP_Fast_Open
Lookups (built-in): lsearch wildlsearch nwildlsearch iplsearch cdb dbm dbmjz dbmnz dnsdb dsearch nis nis0 passwd
Authenticators: cram_md5 plaintext
Routers: accept dnslookup ipliteral manualroute queryprogram redirect
Transports: appendfile/maildir/mailstore autoreply lmtp pipe smtp
Fixed never_users: 0
Configure owner: 0:0
Size of off_t: 8
Compiler: GCC [10.2.1 20210110]
Library version: Glibc: Compile: 2.31
Runtime: 2.31
Library version: BDB: Compile: Berkeley DB 5.3.28: (September 9, 2013)
Runtime: Berkeley DB 5.3.28: (September 9, 2013)
Library version: GnuTLS: Compile: 3.7.1
Runtime: 3.7.1
Library version: IDN2: Compile: 2.3.0
Runtime: 2.3.0
Library version: Stringprep: Compile: 1.33
Runtime: 1.33
Library version: PCRE: Compile: 8.39
Runtime: 8.39 2016-06-14
Total 14 lookups
WHITELIST_D_MACROS: "OUTGOING"
TRUSTED_CONFIG_LIST: "/etc/exim4/trusted_configs"
changed uid/gid: forcing real = effective
uid=0 gid=0 pid=531705
auxiliary group list: <none>
configuration file is exim4-min.conf
log selectors = 00000ffc 19005022 00000007
trusted user
admin user
dropping to exim gid; retaining priv uid
seeking password data for user "Debian-exim": using cached result
getpwnam() succeeded uid=108 gid=114
originator: uid=0 gid=0 login=root name=
sender address = ssmeenk@freshdot.net
Address testing: uid=0 gid=114 euid=0 egid=114
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Testing info@email.postcodeloterij.nl
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Considering info@email.postcodeloterij.nl
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
routing info@email.postcodeloterij.nl
--------> dnslookup router <--------
local_part=info domain=email.postcodeloterij.nl
calling dnslookup router
dnslookup router called for info@email.postcodeloterij.nl
domain = email.postcodeloterij.nl
email.postcodeloterij.nl in "*"? yes (matched "*")
DNS lookup of email.postcodeloterij.nl (MX) succeeded
DNS lookup of mx1.slgnt.eu (AAAA) gave NO_DATA
returning DNS_NODATA
faking res_search(AAAA) response length as 65535
writing neg-cache entry for mx1.slgnt.eu-AAAA-800041, ttl 180
DNS lookup of mx1.slgnt.eu (A) succeeded
fully qualified name = postcodeloterij.slgnt.eu
host_find_bydns yield = HOST_FOUND (3); returned hosts:
mx1.slgnt.eu 194.213.114.251 MX=10
domain changed to postcodeloterij.slgnt.eu
rewriting header lines
re-routed to info@postcodeloterij.slgnt.eu
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Considering info@postcodeloterij.slgnt.eu
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
routing info@postcodeloterij.slgnt.eu
--------> dnslookup router <--------
local_part=info domain=postcodeloterij.slgnt.eu
calling dnslookup router
dnslookup router called for info@postcodeloterij.slgnt.eu
domain = postcodeloterij.slgnt.eu
postcodeloterij.slgnt.eu in "*"? yes (matched "*")
DNS lookup of postcodeloterij.slgnt.eu (MX) succeeded
DNS lookup of mx1.slgnt.eu-AAAA: using cached value DNS_NODATA
DNS lookup of mx1.slgnt.eu (A) succeeded
fully qualified name = postcodeloterij.slgnt.eu
host_find_bydns yield = HOST_FOUND (3); returned hosts:
mx1.slgnt.eu 194.213.114.251 MX=10
set transport remote_smtp
queued for remote_smtp transport: local_part = info
domain = postcodeloterij.slgnt.eu
errors_to=NULL
domain_data=NULL local_part_data=NULL
routed by dnslookup router
envelope to: info@postcodeloterij.slgnt.eu
transport: remote_smtp
host mx1.slgnt.eu [194.213.114.251] MX=10 dnssec=no
search_tidyup called
>>>>>>>>>>>>>>>> Exim pid=531705 (fresh-exec) terminating with rc=0 >>>>>>>>>>>>>>>>
info@postcodeloterij.slgnt.eu
<-- info@email.postcodeloterij.nl
router = dnslookup, transport = remote_smtp
host mx1.slgnt.eu [194.213.114.251] MX=10

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Unexpected 're-routed to' in require verify = recipient? [ In reply to ]
On Tue, May 23, 2023 at 10:27:19PM +0200, Tim Jackson via Exim-users wrote:
> On 23/05/2023 13:21, Sander Smeenk via Exim-users wrote:
>
> > I try to send a message to 'info@email.postcodeloterij.nl', but Exim
> > unexpectedly changes that to 'info@postcodeloterij.slgnt.eu', based on
> > some DNS queries it seems?
>
> > | $ exim -f ssmeenk@freshdot.net -bt info@email.postcodeloterij.nl
> > | info@postcodeloterij.slgnt.eu
>
> I'm definitely not an expert, but is this not expected behaviour based on
> RFC5321 section 5.1 [1]?
>
> "The lookup first attempts to locate an MX record associated with the
> name. If a CNAME record is found, the resulting name is processed as
> if it were the initial name."

Section 5.1 of RFC5321 is named as "Locating the Target Host", it describes
how sender should obtain a list of ip-addresses to connect using target
domain name. Note that ip address lives on the 3-d OSI level, and domain
name is on 5-th or higher, they are different entities. Section 5.1 does not
describe whether original domain name should be transformed during
name-to-address resolution sequence, to send intermediate or final alias
to relay.

IMHO, the best practice is to keep original domain name regardless of
aliases chain. I don't know was it regulated by some RFC or not.
Historically, Sendmail has another behaviour, it leads to problems with
virtualhosts for mail service providers.

I treat the change of target domain as Exim's bug and tried to reproduce it
for test alias chains, with no success. But it definitely triggers for
email.postcodeloterij.nl, that's intriguing.
--
Eugene Berdnikov

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Unexpected 're-routed to' in require verify = recipient? [ In reply to ]
Quoting Julian Bradfield via Exim-users (exim-users@lists.exim.org):

> dnslookup:
> driver = dnslookup
> transport = remote_smtp
> user = Debian-exim
> same_domain_copy_routing = yes
> no_more

Thanks again, Julian. I was about to post this minimal example myself. ;)

Also, if you do add explicit 'rewrite_headers = no' to this, the address
still gets 'rerouted'. As i also stated in my original email.

> DNS lookup of mx1.slgnt.eu (A) succeeded
> fully qualified name = postcodeloterij.slgnt.eu
> domain changed to postcodeloterij.slgnt.eu
> rewriting header lines
> re-routed to info@postcodeloterij.slgnt.eu

--
| Jesus saves! .. Passes to Moses .. TOUCHDOWN!!!!
| 4096R/20CC6CD2 - 6D40 1A20 B9AA 87D4 84C7 FBD6 F3A9 9442 20CC 6CD2

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Unexpected 're-routed to' in require verify = recipient? [ In reply to ]
Quoting Tim Jackson via Exim-users (exim-users@lists.exim.org):

> > I try to send a message to 'info@email.postcodeloterij.nl', but Exim
> > unexpectedly changes that to 'info@postcodeloterij.slgnt.eu', based on
> > some DNS queries it seems?
>
> I'm definitely not an expert, but is this not expected behaviour based on
> RFC5321 section 5.1 [1]?
>
> "The lookup first attempts to locate an MX record associated with the
> name. If a CNAME record is found, the resulting name is processed as
> if it were the initial name."

https://exim.org/exim-html-current/doc/html/spec_html/ch-address_rewriting.html

This states, as quoted in my original email, that "One situation in
which Exim does not automatically rewrite a domain is when it is the
name of a CNAME record in the DNS. The older RFCs suggest that such a
domain should be rewritten using the “canonical” name, and some MTAs do
this. The new RFCs do not contain this suggestion."

--
| I doubt, therefore I might be.
| 4096R/20CC6CD2 - 6D40 1A20 B9AA 87D4 84C7 FBD6 F3A9 9442 20CC 6CD2

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Unexpected 're-routed to' in require verify = recipient? [ In reply to ]
Quoting Evgeniy Berdnikov via Exim-users (exim-users@lists.exim.org):

> I treat the change of target domain as Exim's bug and tried to reproduce it
> for test alias chains, with no success. But it definitely triggers for
> email.postcodeloterij.nl, that's intriguing.

Another example: 'foobar@em.groei.nl' also gets the same treatment and
reroutes to 'foobar@em.v495619.c307441667.e.marketingautomation.services'.

The commonality in DNS here is the MX-lookup returns:
originaldomain IN CNAME newdomain
newdomain IN CNAME otherdomain
otherdomain IN MX targethost

-Sndr.
--
| Why is a package sent by road transport called a 'shipment', and
| a package transported over sea called 'cargo'?
| 4096R/20CC6CD2 - 6D40 1A20 B9AA 87D4 84C7 FBD6 F3A9 9442 20CC 6CD2

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Unexpected 're-routed to' in require verify = recipient? [ In reply to ]
On Wed, May 24, 2023 at 01:07:06PM +0200, Sander Smeenk via Exim-users wrote:
> Quoting Evgeniy Berdnikov via Exim-users (exim-users@lists.exim.org):
>
> > I treat the change of target domain as Exim's bug and tried to reproduce it
> > for test alias chains, with no success. But it definitely triggers for
> > email.postcodeloterij.nl, that's intriguing.
>
> Another example: 'foobar@em.groei.nl' also gets the same treatment and
> reroutes to 'foobar@em.v495619.c307441667.e.marketingautomation.services'.
>
> The commonality in DNS here is the MX-lookup returns:
> originaldomain IN CNAME newdomain
> newdomain IN CNAME otherdomain
> otherdomain IN MX targethost

Yes, it seems bug is triggered by chain longer then one alias, and if
dnslookup router is encountered in router chain. Here is my example:

# host email.tedisk.ru.
email.tedisk.ru is an alias for email.protva.ru.
email.protva.ru is an alias for email.ascit.ru.
email.ascit.ru is an alias for tedisk.ru.
tedisk.ru has address 176.32.35.178
tedisk.ru mail is handled by 10 mx2.tedisk.ru.
tedisk.ru mail is handled by 20 mx3.tedisk.ru.

# exim4 -bt dummy@email.tedisk.ru
...
dummy@email.ascit.ru
<-- dummy@email.tedisk.ru
router = dnslookup, transport = remote_smtp
host mx2.tedisk.ru [176.32.35.178] MX=10
host mx3.tedisk.ru [45.144.2.235] MX=20

--
Eugene Berdnikov

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Unexpected 're-routed to' in require verify = recipient? [ In reply to ]
Quoting Evgeniy Berdnikov via Exim-users (exim-users@lists.exim.org):

> Yes, it seems bug is triggered by chain longer then one alias, and if
> dnslookup router is encountered in router chain. Here is my example:
>
> # exim4 -bt dummy@email.tedisk.ru
> dummy@email.ascit.ru
> <-- dummy@email.tedisk.ru

Thanks!

Indeed it seems to be related to CNAME chains like in your situation and
the ones discussed before this. Another test i built myself, with just
one CNAME works just as expected:

| foo@www.yottabit.nl
| router = remote_nobatv, transport = remote_smtp
| host mx.yottabit.nl [213.136.8.74] MX=100

Where the MX-lookup looks like this:
| www.yottabit.nl. 286 IN CNAME yottabit.nl.
| yottabit.nl. 286 IN MX 100 mx.yottabit.nl.

Add another CNAME to the mix and presto:

| www.yottabit.nl. 300 IN CNAME quux.yottabit.nl.
| quux.yottabit.nl. 300 IN CNAME yottabit.nl.
| yottabit.nl. 300 IN MX 100 mx.yottabit.nl.

| $ exim4 -bt foo@www.yottabit.nl
| foo@quux.yottabit.nl
| <-- foo@www.yottabit.nl

--
| If a chemist dies, you barium.
| 4096R/20CC6CD2 - 6D40 1A20 B9AA 87D4 84C7 FBD6 F3A9 9442 20CC 6CD2

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Unexpected 're-routed to' in require verify = recipient? [ In reply to ]
On Wed, 24 May 2023, Sander Smeenk via Exim-users wrote:

Hi!

> Indeed it seems to be related to CNAME chains like in your situation and
> the ones discussed before this.

Same here:

$ exim -bt info@email.postcodeloterij.nl
info@postcodeloterij.slgnt.eu
<-- info@email.postcodeloterij.nl
router = dns_lookup, transport = remote_smtp
host mx1.slgnt.eu [194.213.114.251] MX=10

$ host -t MX email.postcodeloterij.nl
email.postcodeloterij.nl is an alias for postcodeloterij.slgnt.eu.
postcodeloterij.slgnt.eu is an alias for
postcodeloterij.slgnt.eu.cdn.cloudflare.net.
postcodeloterij.slgnt.eu.cdn.cloudflare.net mail is handled by 10
mx1.slgnt.eu.

And addressed to the first CNAME:

$ exim -bt info@postcodeloterij.slgnt.eu
info@postcodeloterij.slgnt.eu
router = dns_lookup, transport = remote_smtp
host mx1.slgnt.eu [194.213.114.251] MX=10

ciao
Markus
--
/ Markus Reschke \
\ madires@theca-tabellaria.de /


--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Unexpected 're-routed to' in require verify = recipient? [ In reply to ]
Quoting Sander Smeenk via Exim-users (exim-users@lists.exim.org):

> I try to send a message to 'info@email.postcodeloterij.nl', but Exim
> unexpectedly changes that to 'info@postcodeloterij.slgnt.eu', based on
> some DNS queries it seems?

I've reopened https://bugs.exim.org/show_bug.cgi?id=1383 for this.

--
| Dopeler effect: The tendency of stupid ideas to seem smarter when they
| come at you rapidly.
| 4096R/20CC6CD2 - 6D40 1A20 B9AA 87D4 84C7 FBD6 F3A9 9442 20CC 6CD2

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/