how to set smtp-client -> submission_relay_host for IPv4 only?

PGNet Dev pgnet.dev at gmail.com
Thu Oct 15 23:04:50 EEST 2020


In dovecot conf, for submission relay, I've config'd

	submission_relay_host       = lan.example.com
	submission_relay_port       = 465

hostname -- not IP -- must be used, to inform relay for cert verification match.

Here,

	host lan.example.com
		lan.example.com has address 10.0.1.47
		lan.example.com has IPv6 address fd80:25:01::47

The receiving smtp relay listens only on IPv4 -- no IPv6 service,

	telnet 10.0.1.47 465
		Trying 10.0.1.47...
		Connected to 10.0.1.47.
		Escape character is '^]'.

	telnet -6 fd80:25:01::47 465
		Trying fd80:25:01::47...
		telnet: connect to address fd80:25:01::47: Connection refused

On the lan, all boxes are set, in "/etc/gai.conf", for IPv6 to take precedence over IPv4.

On submission to dovecot submission port, after login/auth, dovecot smtp-client subsequently connects to the relay

	lan.example.com:465

IPv6 1st, & fails

	2020-10-15 12:51:45 submission(mua at example.com)<8OJP+rqxuvho7Z95>: Error: smtp-client: conn lan.example.com:465 ([fd80:25:01::47]:465) [1]: connect(lan.example.com:465) failed: Connection refused

then falls back to IPv4, and continues OK

	2020-10-15 12:51:45 submission(mua at example.com)<8OJP+rqxuvho7Z95>: Info: Successfully relayed message: from=<test at remote.example.com>, size=84, id=LMe...Aw, nrcpt=1, reply=`247 2.0.0 Ok: queued as 4CC0KY1wXNzWf93'

not fatal, but wasted effort, and noise in the logs.

how/where do I configure (just) the dovecot smtp-client -> submission_relay_host to only connect IPv4?





More information about the dovecot mailing list