hostname in HELO wrong

15 views
Skip to first unread message

Wolfgang Breyha

unread,
Jun 16, 2016, 5:22:37 AM6/16/16
to R2Mail2 BETA Test
Hi!

R2mail sent an email to my servers using
Received: from eduroam-003-137.wlan.univie.ac.at ([77.80.3.137] helo=[IPv6:fe80::a0cb:fdff:fe7c:20ca])
	by justin.univie.ac.at with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256)

This HELO is wrong. It should be the PTR available in DNS and if there is none it should be the IPv4 literal if IPv4 is used.
The IPv6 link local address looks problematic. It's only a matter of IPv6 deployment and the first postmasters will block HELOs like this as [127.0.0.1] or localhost for IPv4.

Greetings, Wolfgang

Wolfgang Breyha

unread,
Jun 16, 2016, 5:36:28 AM6/16/16
to R2Mail2 BETA Test
I just tested the full IPv6 case as well
Received: from [2001:62a:4:42d:xxxx:xxxx:xxxx:xxxx] (helo=[IPv6:fe80::a0cb:fdff:xxxx:xxxx])
	by joan.univie.ac.at with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256)

again the link local address is used as literal instead of the global address.


Stefan Selbitschka

unread,
Jun 23, 2016, 7:27:30 AM6/23/16
to R2Mail2 BETA Test
Hi Wolfgang,

the usage of a correct address or hostname is not that simple in Android, since as developer you has no possibility to get the currently used network interface.

To determine the correct EHLO hostname I do the following:
- Iterate over all network interfaces
-> For each interface iterate over all addresses
--> Skip address if its a loopback address
--> If address is not loopback get hostname
--> If hostname is not equal to the hostaddress use it otherwise use the address enclosed in bracketts

The iteration stops for the first valid result and use this in the EHLO command.

This could lead to such problems, but I simply didn't found a better solution by now.

regards
stefan
Reply all
Reply to author
Forward
0 new messages