Em 24/02/2022 14:03, Wietse Venema escreveu:
Nicolas JEAN:
Feb 24 15:18:38 my.domain postfix/smtp[4628]: B08949E76C:
to=<contact@my.domain>, relay=relay2.com[2.2.2.2]:587, delay=0.76,
delays=0.04/0.01/0.38/0.33, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued
as 29A7484FC6)

If I'm correct, thecontact@my.domain  wasn't modified by any alias (as
shown by 'to=<'). But this final email address still doesn't match
against the "my.domain :" entry in /etc/postfix/local_transport_map, for
some reason.
Well there is your problem.
Instead of arguing what should be in the file, look at what is
actually in there.

     postmap -s /etc/postfix/local_transport_map

The database file seems correct also when looking with postmap -s.
I ran some more tests.

### Tests without randmap ###

transport_maps = hash:/etc/postfix/local_transport_map

Having "my.domain :" or "my.domain lmtp:unix:private/dovecot-lmtp" doesn't modify default behaviour (set by virtual_transport = lmtp:unix:private/dovecot-lmtp), and yields such a log line:

    to=<contact@my.domain>, relay=my.domain[private/dovecot-lmtp] ... dsn=2.0.0, status=sent

But having "my.domain virtual:"; for instance, changes the log line to:

    to=<contact@my.domain>, relay=virtual ... dsn=2.0.0, status=sent

So the incoming email's domain /is/ matched against local_transport_map and the transport described there is used.

### Test with randmap ###

transport_maps = hash:/etc/postfix/local_transport_map randmap:{smtp:[relay1.com]:587, smtp:[relay2.com]:587}

Adding randmap after local_transport_map (unchanged "my.domain :" line) results in all incoming email being relayed to one of the randmap relays.

Nico

Attachment: OpenPGP_0x23459069119D37B6.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to