contrib/ksmtpproxy: Fix sending mail to IPv6 smarthost
commit7e29cc3ab7ecb9c1610fa301822c85e060c0b346
authorKirill Smelkov <kirr@navytux.spb.ru>
Tue, 17 Mar 2015 18:41:45 +0000 (17 21:41 +0300)
committerKirill Smelkov <kirr@navytux.spb.ru>
Tue, 17 Mar 2015 18:47:26 +0000 (17 21:47 +0300)
treeae5804a5393a8105c625a5ef5d6244d295f05914
parentf2f9f5bb17923b0a2a49cfbe3be5aa660fe8016f
contrib/ksmtpproxy: Fix sending mail to IPv6 smarthost

For AF_INET address info is

    (host, port)

but for AF_INET6 address info is

    (host, port, flowinfo, scopeid)

and thus for IPv6 original

    host, port = sk.getpeername()

would crash with 'ValueError: too many values to unpack'

We need peer address only for printing, so get it as a whole and print
it as a whole, and this way fix ksmtpproxy working with IPv6 connection
to smarthosts.

Signed-off-by: Kirill Smelkov <kirr@navytux.spb.ru>
contrib/ksmtpproxy