Discussion:
transport map not working
(too old to reply)
jeffrey j donovan
2013-08-20 14:45:44 UTC
Permalink
Greetings

i have an old osx server that was working fine and I noticed that the transport maps listed in the config are not being followed.

I have one domain name and several imap servers.

first i checked if the format for the map was correct in main.cf , hash:/etc/postfix/k12_tm_imap2
I verified that user(s) in question had the correct entry in the map.
***@mydomain.com smtp:sub1.mydomain.com:25
***@mydomain.com smtp:sub1.mydomain.com:25
***@mydomain.com smtp:support.mydomain.com:25
***@mydomain.com smtp:elemail.mydomain.com:25

did a postmap

postmap /etc/postfix/k12_tm_imap2

postfix reload


sent email to user1 , the message re-wrote the header as being local, as if I had an incorrect entry. I double checked my transport map and it all points to ***@sub1.mydomain.com

sample
Aug 20 10:36:41 imap2 postfix/pipe[3641]: 536D3DC23DA: to=<***@imap2.mydomain.com>, orig_to=<***@mydomain>, relay=dovecot, delay=0.02, delays=0.01/0/0/0.01, dsn=2.0.0, status=sent (delivered via dovecot service)

So it's delivering it locally when it should deliver it to the system specified in the transport map.

what should I be looking for ? what would stop the transport lookup and deliver locally ? is there something that overrides the transport map ?
main.cf on this machine is abnormally huge, most of it is set by default I usually adjust very little.

thanks for any insight
-j

postconf -n | grep transport
address_verify_default_transport = $default_transport
address_verify_local_transport = $local_transport
address_verify_relay_transport = $relay_transport
address_verify_transport_maps = $transport_maps
address_verify_virtual_transport = $virtual_transport
best_mx_transport =
default_transport = smtp
defer_transports =
fallback_transport =
fallback_transport_maps =
local_transport = local:$myhostname
mailbox_transport = dovecot
mailbox_transport_maps =
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $sender_bcc_maps $recipient_bcc_maps $smtp_generic_maps $lmtp_generic_maps
relay_transport = relay
transport_maps = hash:/etc/postfix/k12_tm_imap2, hash:/etc/postfix/bethsd_tm_imap2
transport_retry_time = 60s
virtual_transport = virtual
Viktor Dukhovni
2013-08-20 14:52:08 UTC
Permalink
As documented, transport resolution happens after address rewriting. So
you need to change the virtual alias (or other) rewrite rules that rewrite
this recipient to ***@imap2.$mydomain.

http://www.postfix.org/ADDRESS_REWRITING_README.html
--
Viktor.
Wietse Venema
2013-08-20 15:08:11 UTC
Permalink
That is not ***@imap2.mydomain.com

You need to update your virtual aliases or your transport map.

Wietse
jeffrey j donovan
2013-08-20 15:25:22 UTC
Permalink
Post by Wietse Venema
You need to update your virtual aliases or your transport map.
Wietse
thanks for the reply,

I do have a virtual alias map that i am using for some redirected mail list. is it because i have no user entry that it delivers locally ? i thought that it would step down to transport if it did not find anything.

virtual_alias_maps = hash:/etc/postfix/virtualmm

***@smtp1.mydomain.com ***@news.mydomain.com
***@smtp1.mydomain.com ***@news.mydomain.com
asapacker-***@smtp1.mydomain.com asapacker-***@news.mydomain.com
basd-***@smtp1.mydomain.com basd-***@news.mydomain.com


which I believe comes before transport.
Do I need to add entry's for the user into the virtual_alias_maps & transport_maps ? or will one be okay.

this would make sense because I did not have this virtual map before. it is a recent add.
thanks for the help.
-j
Wietse Venema
2013-08-20 15:39:33 UTC
Permalink
Post by jeffrey j donovan
I do have a virtual alias map that i am using for some redirected
mail list. is it because i have no user entry that it delivers
locally ? i thought that it would step down to transport if it did
not find anything.
virtual_alias_maps = hash:/etc/postfix/virtualmm
If you rewrite an envelope recipient address X with virtual_alias_maps
(or otherwise) into envelope recipient address Y, then Postfix will
use envelope recipient address Y for transport map lookups.

Therefore you will use envelope recipient address Y on the transport
map left-hand side, not X.

Wietse
jeffrey j donovan
2013-08-20 15:59:38 UTC
Permalink
Post by Wietse Venema
If you rewrite an envelope recipient address X with virtual_alias_maps
(or otherwise) into envelope recipient address Y, then Postfix will
use envelope recipient address Y for transport map lookups.
Therefore you will use envelope recipient address Y on the transport
map left-hand side, not X.
Wietse
got it.

it works now.
i adjusted my virtual alias map and added the users to it.

Aug 20 11:47:54 imap2 postfix/smtp[7793]: E898BDC42FD: to=<***@sub1.mydomain.com>, orig_to=<***@mydomain.com>, relay=sub1.mydomain.com[10.1.1.1]:25, delay=0.04, delays=0.01/0.01/0.01/0.01, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as F116F122AFBF)

question --
If I do not use a virtual alias map, is a transport map sufficient by itself or should I always use the two together ? I only ask this because this was working before I added the alias map. I just want to be clear that these two work together.

thanks again
-j
Wietse Venema
2013-08-20 16:17:37 UTC
Permalink
Post by jeffrey j donovan
If I do not use a virtual alias map, is a transport map sufficient
by itself or should I always use the two together ? I only ask
this because this was working before I added the alias map. I just
want to be clear that these two work together.
That depends.

First, Postfix needs to know what domains to receive mail for
(otherwise mail is rejected with "relay access denied"). You specify
each domain in one of the four domain lists: mydestination,
relay_domains, virtual_alias_domains, or virtual_mailbox_domains.

Then, Postfix needs to know what recipients exist in those domains
(otherwise mail is rejected with "user unknown"). Depending on the
domain list, you specify the recipient in one of the corresponding
recipient lists: local_recipient_maps, relay_recipient_maps,
virtual_alias_maps or virtual_mailbox_maps.

All the above is detailed on ADDRESS_CLASS_README.

If the recipient is does not exist in any of the four recipient
lists, then you must specify them in virtual_alias_maps.

(this is approximate; I have left out canonical mapping to avoid
overwhelming you with detail).

Wietse
jeffrey j donovan
2013-08-20 17:26:58 UTC
Permalink
Post by Wietse Venema
That depends.
First, Postfix needs to know what domains to receive mail for
(otherwise mail is rejected with "relay access denied"). You specify
each domain in one of the four domain lists: mydestination,
relay_domains, virtual_alias_domains, or virtual_mailbox_domains.
Then, Postfix needs to know what recipients exist in those domains
(otherwise mail is rejected with "user unknown"). Depending on the
domain list, you specify the recipient in one of the corresponding
recipient lists: local_recipient_maps, relay_recipient_maps,
virtual_alias_maps or virtual_mailbox_maps.
All the above is detailed on ADDRESS_CLASS_README.
If the recipient is does not exist in any of the four recipient
lists, then you must specify them in virtual_alias_maps.
(this is approximate; I have left out canonical mapping to avoid
overwhelming you with detail).
Wietse
much thanks for the clarification. Where does the transport map fit in ?
I think you mentioned it before " use envelope recipient address Y on the transport
map left-hand side". Ill assume that if i specify a virtual user that i also need to specify a transport for that entry, is that a correct assumption ?

-j
Wietse Venema
2013-08-20 17:44:06 UTC
Permalink
Post by jeffrey j donovan
Post by Wietse Venema
First, Postfix needs to know what domains to receive mail for
(otherwise mail is rejected with "relay access denied"). You specify
each domain in one of the four domain lists: mydestination,
relay_domains, virtual_alias_domains, or virtual_mailbox_domains.
In addition, mail for $mydestination is given to $local_transport,
mail for $relay_domains is given to $relay_transport, and mail for
$virtual_mailbox_domains is given to $virtual_transport. Other
mail is given to $default_transport, or returned as undeliverable.

The transport map is needed ONLY when Postfix chooses one of
($local_transport, $relay_transport, $virtual_transport,
$default_transport) and you want it to be different.

If this is an issue with all recipients in the same domain, then
you have put that domain in the wrong domain list (and recipient
list as outlined in the next paragraph).

Wietse
Post by jeffrey j donovan
Post by Wietse Venema
Then, Postfix needs to know what recipients exist in those domains
(otherwise mail is rejected with "user unknown"). Depending on the
domain list, you specify the recipient in one of the corresponding
recipient lists: local_recipient_maps, relay_recipient_maps,
virtual_alias_maps or virtual_mailbox_maps.
All the above is detailed on ADDRESS_CLASS_README.
If the recipient is does not exist in any of the four recipient
lists, then you must specify them in virtual_alias_maps.
(this is approximate; I have left out canonical mapping to avoid
overwhelming you with detail).
much thanks for the clarification. Where does the transport map fit in ?
Loading...