Mailing List Archive

smarthost Outsmarting me so Far
Jasen Betts via Exim-users <exim-users@exim.org> writes:
> you probably need encryption to use authentication.

True.
>
> openssl s_client -connect smtp.suddenlink.net:25 -starttls=smtp

That gives me what I see the beginning of in
/var/log/exim4/mainlog.

> Use ESMTP "ehlo" instead of "helo":

Thanks. I didn't realize the difference until I began
digging more.

The ehlo screen is a bit more helpful when one sends the
ehlo command

$ telnet smtp.suddenlink.net 587
Trying 208.180.40.68...
Connected to smtp.mx-altice.prod.cloud.synchronoss.net.
Escape character is '^]'.
220 omta04.suddenlink.net ESMTP server (InterMail vM.8.04.03.22.02 201-2389-100-169-20190213) ready Mon, 9 May 2022 06:52:02 -0500
ehlo martin.m
250-omta04.suddenlink.net
250-HELP
250-XREMOTEQUEUE
250-ETRN
250-AUTH=LOGIN PLAIN
250-AUTH LOGIN PLAIN
250-PIPELINING
250-DSN
250-8BITMIME
250-SIZE 52428800
250 STARTTLS

I send the starttls command.

starttls
220 Ready to start TLS

There are about 10 seconds between that and:

Connection closed by foreign host. I am not good at doing TLS
calculations in my brain so I am taking it on faith that if I had
spoken TLS, it would have picked right up.

I noticed that one can also call for starttls from port
25 and we get

220 Ready to start TLS

exit

In that respect helo and ehlo behave the same in that one could
starttls from either P25 or P587 so the starttls request could be
sent but 587 is the port mentioned first in the skimpy
documentation I have found.

I also tried
openssl s_client -connect smtp.suddenlink.net:465 -starttls=smtp

That gets you:

Didn't find STARTTLS in server response, trying anyway...
write:errno=32
CONNECTED(00000003)
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 0 bytes
Verification: OK
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
Early data was not sent
Verify return code: 0 (ok)
---

That used to be the port one used until March 13 when we
morphed in to the quagmire that exists now.

The opacity of this process is astounding but tshark has
been helpful here and has made this chew toy give up some secrets
that may point to the solution although this has been 2 months of
I wish + coulda' woulda' shoulda' and very little progress.

If I capture net traffic from and to the system in
question, I see a couple of differences between when swaks
successfully delivers a message and exim almost but not quite
does.

With swaks, the ehlo capture is:

192.168.1.64 ? 208.180.40.68 SMTP 82 C: EHLO localhost

When I send through a normal exim4 delivery, the ehlo
capture looks like:
192.168.1.64 ? 208.180.40.68 SMTP 79 C: EHLO wb5agz

wb5agz is my amateur radio call which is the hostname for
this computer and I bet it should actually read "localhost" as in
the swaks capture.

both are also giving the starttls request at the end of
the suddenlink menu of authentication options.

The trouble appears to start after the TLS key exchange.

With swaks, I see a clear message from smtp.suddenlink
that authentication was successful.

With exim4, things grind and grind with incrypted traffic
going back and forth only to see a clear message:

208.180.40.68 ? 192.168.1.64 TLSv1.2 617 Certificate,
Server Key Exchange, Server Hello Done. That looks good but
then there's more encrypted fog and then:

208.180.40.68 TLSv1.2 192 Client Key Exchange, Change Cipher
Spec, Encrypted Handshake Message

I feel like I am fighting World War III with a dried-out
rubber band and a wad of paper.

The interesting observation I can remember from past
examination of logs, etc, is that I think the ehlo or helo
strings have had the host computer's name in the past when things
were working. It could be that smtp.suddenlink.net tightened
their authentication requirements in an upgrade recently and this
is what changed. Ya' got to love these complex operations that
have but one good outcome and infinite permutations of failures.
It will be two months and counting as of May 14 when the last
normal email was sent.

Hopefully, the next email I send will be through exim4 in
the normal manner.

Martin McCormick
Re: smarthost Outsmarting me so Far [ In reply to ]
On 10/05/2022 14:34, Martin McCormick via Exim-users wrote:
> It could be that smtp.suddenlink.net tightened
> their authentication requirements in an upgrade recently and this
> is what changed.

Have you asked them?
--
Cheers,
Jeremy

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: smarthost Outsmarting me so Far [ In reply to ]
On 2022-05-10 at 09:34:14 UTC-0400 (Tue, 10 May 2022 08:34:14 -0500)
Martin McCormick via Exim-users <martin.m@suddenlink.net>
is rumored to have said:

[...]
> I also tried
> openssl s_client -connect smtp.suddenlink.net:465 -starttls=smtp
>
> That gets you:
>
> Didn't find STARTTLS in server response, trying anyway...

Well, yes: on port 465 you do not use '-starttls=smtp' because port 465
is 'implicit TLS' or 'wrapper-mode TLS' and starts the handshake at
connect, like HTTPS on port 443. You CAN use '-starttls=smtp' on port 25
or 587.



--
Bill Cole
bill@scconsult.com or billcole@apache.org
(AKA @grumpybozo and many *@billmail.scconsult.com addresses)
Not Currently Available For Hire

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
smarthost Outsmarting me so Far [ In reply to ]
Jeremy Harris via Exim-users <exim-users@exim.org> writes:
> Have you asked them?

That was the first thing I tried as this is an excellent
question.

The people I talk to are helpful but not knowledgeable.
There are no email support addresses that connect to the actual
people who are running the server. I suspect they have tuned it
to work with Outlook but nowhere have I heard anybody say or read
in a document that "your mail client must do XYZ to successfully authenticate.
I have figured out by trial and lots of error that it looks like
you can stay on port 587 after starttls so Port 465 appears to
not be necessary anymore.

Martin



--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
smarthost Outsmarting me so Far [ In reply to ]
for some reason, I had it in my head that the verbose form of
send did not report much. It reports a lot with the -snoop and
-watch flags set so here is what is always happening these days
as seen by exim, itself and nmh. Some of us still use it;-)

I send a message and here's the log with comments.

LOG: MAIN
Warning: No server certificate defined; will use a selfsigned one.
Suggested action: either install a certificate or change tls_advertise_hosts option

#I did generate a cert and it is in /etc/exim4 and I still get
this warning, but one thing at a time.

LOG: address_rewrite MAIN
"martin@localhost" from env-from rewritten as "martin.m@suddenlink.net" by rule 1

#so far, so good.

LOG: MAIN
<= martin.m@suddenlink.net U=martin P=local S=487 M8S=0 RT=0.009s
LOG: MAIN

delivering 1nolOX-0005He-Bd
R: smarthost for martin@okstate.edu
T: remote_smtp_smarthost for martin@okstate.edu
Transport port=25 replaced by host-specific port=587

#Again, good.

Connecting to smtp.mx-altice.prod.cloud.synchronoss.net [208.180.40.68]:587 ... connected
SMTP<< 220 omta02.suddenlink.net ESMTP server (InterMail vM.8.04.03.22.02 201-2389-100-169-20190213) ready Wed, 11 May 2022 07:24:45 -0500
SMTP>> EHLO wb5agz
SMTP<< 250-omta02.suddenlink.net
250-HELP
250-XREMOTEQUEUE
250-ETRN
250-AUTH=LOGIN PLAIN
250-AUTH LOGIN PLAIN
250-PIPELINING
250-DSN
250-8BITMIME
250-SIZE 52428800
250 STARTTLS

#hinse forth, this will be #Banner.

SMTP>> STARTTLS
SMTP<< 220 Ready to start TLS

#This looks right so far but What could possibly go wrong?

SMTP>> EHLO wb5agz

#Banner once again but the script marches on

SMTP>> MAIL FROM:<martin.m@suddenlink.net> SIZE=1524

I think we just saw what goes wrong. There probably should have
been an "auth login" response sent followed by the authentication
sequence but no such luck.

SMTP<< 553 Authentication is required to send mail as <martin.m@suddenlink.net>

#exim doesn't realise that this isn't what should be sent and is
proceeding as if all is well.


SMTP<< 503 Bad sequence of commands (specify MAIL first)
SMTP<< 503 No sender specified
SMTP>> QUIT

So, the question is, Does this look like I can rearrange
things somewhere to correct what is happening?

In the slightly less opaque world of text-based expect
scripts and thelike, one just makes sure not to get ahead of the
responses from the remote site so as to send the appropriate response
or envoke a case or switch module. In this case, we seem to be
totally missing what SMTP is asking for next.

When trying to read the network traffic, all that key
changing and restarting was the remains of the broken mail
transfer sequence and smtp.suddenlink's server dropping the
connection several times.

When Suddenlink.net upgraded something around March 14,
the banner changed and the server doesn't appear to use Port 465
in any way. I've fixed that situation in that I call for 587 in
/etc/exim4/localmacros by editing the appropriate line as shown:

MAIN_TLS_ENABLE = 1
REMOTE_SMTP_SMARTHOST_HOSTS_REQUIRE_TLS = *
TLS_ON_CONNECT_PORTS = 587
REQUIRE_PROTOCOL = smtps

Putting localmacros in or taking it out has no effect
and, of course, I am running dpkg-reconfigure exim4-config each
time after the change.

I must admit that I strangely feel a bit satisfied that
one can actually see the place where things go wrong. It's just
as important to know what doesn't need tweaking as what does.

Again thanks for any and all constructive ideas.

Martin McCormick



--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: smarthost Outsmarting me so Far [ In reply to ]
On 11/05/2022 14:34, Martin McCormick via Exim-users wrote:
> #Banner once again but the script marches on

Actually, it should have been different, no longer
advertising STARTTLS once you are using TLS. Mind, they
advertised cleartext AUTH methods *on a cleartext connection*
so they are obviously Deficient In Clue.

So we need to see if they did advertise AUTH once
TLS was wrapping the connection (after a successful STARTTLS).
We'd also wonder if your transport and authenticators are
configured to attempt auth.

The docs are at
http://exim.org/exim-html-current/doc/html/spec_html/
--
Cheers,
Jeremy

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: smarthost Outsmarting me so Far [ In reply to ]
D?a 11. mája 2022 13:34:47 UTC používate? Martin McCormick via Exim-users <exim-users@exim.org> napísal:

> So, the question is, Does this look like I can rearrange
>things somewhere to correct what is happening?

You can even do auth with swaks...

> When Suddenlink.net upgraded something around March 14,
>the banner changed and the server doesn't appear to use Port 465
>in any way. I've fixed that situation in that I call for 587 in
>/etc/exim4/localmacros by editing the appropriate line as shown:

Proper file depends on chhosen config type -- split vs one file (i forged
exact name), if you use split config place them eg. in
/etc/exim4/conf.d/main/00-localmacros (doesn't exists by default)

>Again thanks for any and all constructive ideas.

Did you setup passw.client file?

See https://manpages.debian.org/bullseye/exim4-config/exim4_passwd_client.5.en.html

You have to uses smarthost's PTR name, eventually with wildcards, eg:

*.example.org:username:password

While i do not suggest it, you can start with full wildcard and then go to more precise
definition:

*:username:password

regards

--
Slavko

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: smarthost Outsmarting me so Far [ In reply to ]
D?a 11. mája 2022 13:34:47 UTC používate? Martin McCormick via
Exim-users <exim-users@exim.org> napísal:

> So, the question is, Does this look like I can rearrange
>things somewhere to correct what is happening?

You can even do auth with swaks...

> When Suddenlink.net upgraded something around March 14,
>the banner changed and the server doesn't appear to use Port 465
>in any way. I've fixed that situation in that I call for 587 in
>/etc/exim4/localmacros by editing the appropriate line as shown:

Proper file depends on chhosen config type -- split vs one file (i
forged exact name), if you use split config place them eg. in
/etc/exim4/conf.d/main/00-localmacros (doesn't exists by default)

>Again thanks for any and all constructive ideas.

Did you setup passwd.client file? See
https://manpages.debian.org/bullseye/exim4-config/exim4_passwd_client.5.en.html

You have to uses smarthost's PTR name, eventually with wildcards, eg:

*.example.org:username:password

While i do not suggest it, you can start with full wildcard and then go
to more precise definition:

*:username:password

regards

--
Slavko
https://www.slavino.sk
Re: smarthost Outsmarting me so Far [ In reply to ]
D?a 11. mája 2022 13:34:47 UTC používate? Martin McCormick via Exim-users <exim-users@exim.org> napísal:

>Connecting to smtp.mx-altice.prod.cloud.synchronoss.net [208.180.40.68]:587 ... connected
> SMTP<< 220 omta02.suddenlink.net ESMTP server (InterMail vM.8.04.03.22.02 201-2389-100-169-20190213) ready Wed, 11 May 2022 07:24:45 -0500

It seems, as you are connecting to CNAME, which points to smtp.suddenlink.net. For now
i am not sure, which name will be took to search in passwd.client, try to use name which
you setup for smarthost (the lookup uses $host variable).

You can try to setup smtp.suddenlink.net as smarthost name or vive versa, use
smtp.mx-altice.prod.cloud.synchronoss.net (or wildcard of some level) in passwd.client.
It seems, that you mix these two, but i can be wrong, as it is many years ago, when i used
remote smarthost.

BTW, i test both ports (465 & 587) on that address with openssl s_client, and both works
for me, while 465 hangs for first time after inital TLS handshake, but it was sucess at
repeat. IMO you can do packet capture (to demonstrate that it doesn't wo?k for you) and
post it to suddenlink.net for investigation.

regards
Slavko

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/