Comment 3 for bug 372800

Revision history for this message
Vincent Ladeuil (vila) wrote : Re: Wrong behavior of SMTP authentication when port is specified

I think imposing extracting an optional port to AuthenticationConfig is not the right approach, trying to handle the default port ourself is not either, we tried that and fail (see bug #150860).

The simplest approach seems to be to extract the port in smtp_connection.py just before calling auth.get_user() (auth.get_password() can reuse that).

The relevant tests are in bzrlib/tests/test_smtp_connection.py and that's where you could add a test that reproduce the bug. You can then fix the code and the test will prove that your fix is correct.