smtpdfix
smtpdfix copied to clipboard
SMTP AUTH extension not supported by server.
On Python 3.9.2 on macOS 11.2.1, using pytest 6.2.2 and smtpdfix 0.2.9, the following test fails with smtplib.SMTPNotSupportedError: SMTP AUTH extension not supported by server.. Uncommenting the line that sets SMTPD_ENFORCE_AUTH does not make a difference. The test succeeds if the client.login() line is removed.
import smtplib
def test_smtpdfix(monkeypatch, smtpd):
#monkeypatch.setenv("SMTPD_ENFORCE_AUTH", "True")
client = smtplib.SMTP()
client.connect(smtpd.hostname, smtpd.port)
client.login("user", "password")
client.quit()
I've realized that AUTH on a non-SSL connection is disabled by default unless the SMTPD_AUTH_REQUIRE_TLS environment variable is set to False. This should be documented in the README.