smtpdfix icon indicating copy to clipboard operation
smtpdfix copied to clipboard

SMTP AUTH extension not supported by server.

Open jwodder opened this issue 4 years ago • 1 comments

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()

jwodder avatar Feb 26 '21 20:02 jwodder

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.

jwodder avatar Feb 26 '21 22:02 jwodder