]> git.proxmox.com Git - pmg-api.git/commit
fix rendering of ipv(4|6) literal lmtp transports
authorStoiko Ivanov <s.ivanov@proxmox.com>
Wed, 18 Mar 2020 10:23:42 +0000 (11:23 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 24 Mar 2020 11:54:00 +0000 (12:54 +0100)
commit0280ecd45e07dad0817ced8c8dc7b6beba6c198a
tree903a96635f74cb973bc8392e410b9a828dafb8f5
parent6739c1232fabe65d1c9a4dabf3dee698faf415d5
fix rendering of ipv(4|6) literal lmtp transports

While reviewing support for lmtp as transport one thing I forgot to
test was adding a lmtp-transport pointing to an IPv6 address.

Using the use_mx flag (which only makes sense for domain-names) to
provide the information of whether the next-hop/hostname should be
written out in square brackets or not is a bit confusing, and leads
to ambiguous results when providing ipv6 literal addresses:
> host: 2001:db8:25::25
> port: 24
> gets rendered as
> lmtp:inet:2001:db8:25::25:24

Which postfix oddly enough parses 'correctly'; postfix splits on ':'
and uses the last part as port. For ip4 literals and dns-names this
works for ip6 literals it only works if you provide a port so it
makes more sense to always write ip(4|6) literals in brackets

By introducing a explicit flag "$bracket_host" and reordering the
conditions lmtp and smtp entries get rendered correctly (see `man
smtp`).

Additionally fixes an indentation glitch in read_transport_map.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Reviewed-By: Dominik Csapak <d.csapak@proxmox.com>
src/PMG/Config.pm