<div dir="ltr"><div dir="ltr">And in addition, if you want to know which service is already listening to a port, you can use: sudo lsof -nP -iTCP:465 -sTCP:LISTEN<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 17, 2019 at 9:07 AM Peter Pentchev <<a href="mailto:roam@ringlet.net">roam@ringlet.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, May 17, 2019 at 01:54:47PM +1000, James Brown wrote:<br>
> Can anyone tell me why It tries ::1:25 first and fails before connecting to <a href="http://127.0.0.1:25" rel="noreferrer" target="_blank">127.0.0.1:25</a>?<br>
> <br>
> 2019.05.17 13:48:34 LOG5[21]: Service [ssmtp465] accepted connection from ::ffff:<a href="http://192.168.1.76:49170" rel="noreferrer" target="_blank">192.168.1.76:49170</a><br>
> 2019.05.17 13:48:34 LOG3[21]: s_connect: connect ::1:25: Connection refused (61)<br>
> 2019.05.17 13:48:34 LOG5[21]: s_connect: connected <a href="http://127.0.0.1:25" rel="noreferrer" target="_blank">127.0.0.1:25</a><br>
> 2019.05.17 13:48:34 LOG5[21]: Service [ssmtp465] connected remote server from <a href="http://127.0.0.1:56701" rel="noreferrer" target="_blank">127.0.0.1:56701</a><br>
> <br>
> /usr/local/etc/stunnel/stunnel.conf has:<br>
> <br>
> [ssmtp465]<br>
> client = no<br>
> accept = 465<br>
> connect = 25<br>
> options = NO_SSLv2<br>
> #transparent = source<br>
<br>
You have specified only a port number, not an address; thus, stunnel assumes<br>
the local host address. You have not explicitly told it to only use IPv4<br>
addresses, so it tries the IPv6 local host address (::1) first; when that<br>
fails, it falls back to the IPv4 local host address (127.0.0.1).<br>
<br>
If you change the line to "connect = <a href="http://127.0.0.1:25" rel="noreferrer" target="_blank">127.0.0.1:25</a>" like for your other<br>
service, it will go straight to the IPv4 local host address.<br>
<br>
Hope that helps!<br>
<br>
G'luck,<br>
Peter<br>
<br>
-- <br>
Peter Pentchev roam@{<a href="http://ringlet.net" rel="noreferrer" target="_blank">ringlet.net</a>,<a href="http://debian.org" rel="noreferrer" target="_blank">debian.org</a>,FreeBSD.org} <a href="mailto:pp@storpool.com" target="_blank">pp@storpool.com</a><br>
PGP key: <a href="http://people.FreeBSD.org/~roam/roam.key.asc" rel="noreferrer" target="_blank">http://people.FreeBSD.org/~roam/roam.key.asc</a><br>
Key fingerprint 2EE7 A7A5 17FC 124C F115 C354 651E EFB0 2527 DF13<br>
_______________________________________________<br>
stunnel-users mailing list<br>
<a href="mailto:stunnel-users@stunnel.org" target="_blank">stunnel-users@stunnel.org</a><br>
<a href="https://www.stunnel.org/cgi-bin/mailman/listinfo/stunnel-users" rel="noreferrer" target="_blank">https://www.stunnel.org/cgi-bin/mailman/listinfo/stunnel-users</a><br>
</blockquote></div>