It appears that Grant Taylor <
[email protected]> said:
On 5/15/21 8:03 PM, John Levine wrote:
I would like what I think is a pretty normal setup: SMTP on port 25,
submission on port 587 which only allows relay after STARTTLS and
AUTH PLAIN or AUTH LOGIN.
That definitely sounds normal enough.
Well, I'm pretty close. I have O'Reilly's Sendmail Cookbook from 2003, and stared at a certain
amount of source code.
First I built sendmail with the PLAIN and LOGIN auth methods by overriding the AUTH_MECHANISMS define.
To my surprise, this worked:
dnl for sasl
APPENDDEF(`conf_sendmail_ENVDEF', `-DSASL=2')
APPENDDEF(`conf_sendmail_LIBS', `-lsasl2')
dnl include all SASL methods APPENDDEF(`conf_sendmail_ENVDEF',`-DAUTH_MECHANISMS="\"EXTERNAL GSSAPI KERBEROS_V4 DIGEST-MD5 CRAM-MD5 PLAIN LOGIN\""')
Then I instaled the FreeBSD packages for cyrus-sasl and cyrus-saslauthd. It turns out that the nearly undocumented
/usr/local/lib/sasl2/Sendmail.conf already contains "pwcheck_method: saslauthd", so I started
the sasl daemon with args "-a sasldb" rather than the default "-a pam".
Then I set up sendmail.mc to do just LOGIN and PLAIN after STARTTLS on port 587, no auth on port 25:
dnl Enable port 25 for both IPv4 and IPv6 with no auth DAEMON_OPTIONS(`Name=IPv4, Family=inet, M=A')
DAEMON_OPTIONS(`Name=IPv6, Family=inet6, M=A')
FEATURE(`no_default_msa')
DAEMON_OPTIONS(`Name=MSA, Port=587, M=Eac')
dnl require STARTTLS
define(`confAUTH_OPTIONS', `p')
define(`confAUTH_MECHANISMS', `LOGIN PLAIN')
Now I can connect to port 587, log in, and authenticate. The only thing I can't do is send mail:
At my end:
21:53:10.618705 send: 'AUTH PLAIN AGVhaXRlewyc3Hh4\r\n'
21:53:10.665909 reply: b'235 2.0.0 OK Authenticated\r\n'
21:53:10.666115 reply: retcode (235); Msg: b'2.0.0 OK Authenticated'
logged in as eaitest
On the server:
May 20 01:53:10 xn--5nq21jyu9d1ta sm-mta[49767]: STARTTLS=server, relay=[64.246.232.221], version=TLSv1.3, verify=NO, cipher=TLS_AES_256_GCM_SHA384, bits=256/256
May 20 01:53:10 xn--5nq21jyu9d1ta sm-mta[49767]: AUTH=server, relay=[64.246.232.221], authid=eaitest, mech=PLAIN, bits=0
May 20 01:53:10 xn--5nq21jyu9d1ta sm-mta[49767]: 14K1rAnE049767: ruleset=check_rcpt, arg1=<
[email protected]>, relay=[64.246.232.221], reject=550 5.7.1 <
[email protected]>... Relaying denied. IP name lookup failed [64.246.232.221]
May 20 01:53:10 xn--5nq21jyu9d1ta sm-mta[49767]: 14K1rAnE049767: from=<
[email protected]>, size=44, class=0, nrcpts=0, proto=UTF8SMTPSA, daemon=MSA, relay=[64.246.232.221]
I presume I have to tweak check_rcpt to allow me to send mail once authenticated. Uh, a hint or two would be appreciated.
-- not urgent question --
Is there a way to do submits on port 465? It's like the MSA on 587 but does the TLS handshake when it connects, like https does.
--- Sort of bug report ---
The default config for AUTH allows CRAM-MD5 and DIGEST-MD5 but not
LOGIN or PLAIN, presumably because 20 years ago few SMTP sessions used
TLS and you can't recover the password by snooping. But now everyone
does TLS, and those two methods require that the server store the
plaintext passwords or a fragile prehash of them.
The IETF has considered CRAM-MD5 to be obsolete since 2008, and
DIGEST-MD5 obsolete since 2011, see RFC 6331. These days the preferred
AUTH is LOGIN or PLAIN protected by STARTTLS, so it would be a
kindness to future sendmail users to make that the default, or at
least compile in LOGIN and PLAIN, and package up the settings as an
easy to find option.
--
Regards,
John Levine,
[email protected], Primary Perpetrator of "The Internet for Dummies",
Please consider the environment before reading this e-mail.
https://jl.ly
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)