P4DTI issue job000197

TitleP4DTI doesn't do ESMTP authentication
Statussuspended
Priorityoptional
Assigned userNick Barnes
OrganizationRavenbrook
DescriptionSome ESMTP servers (e.g. Microsoft Exchange) may be configured to require authentication (RFC 2554). The P4DTI doesn't do this, so can not send email via these servers. This won't stop it working, but conflicts and failures won't be reported to the administrator or relevant users.
AnalysisPython's smtplib library now (Python 2.2) supports ESMTP AUTH, with the login() method. We should support the use of this via advanced configuration. Under older versions of smtplib, one could do something like this:
    def auth(username, password):
        import base64
        (code,repl) = smtp.docmd("auth login")
        if code == 334:
                u64 = base64.encodestring(username)[:-1]
                (code,repl) = smtp.docmd(u64)
                u64 = base64.encodestring(password)[:-1]
                (code,repl) = smtp.docmd(u64)
                if code != 235:
                    raise ("SMTP authentication error %d: %s" % (code, repl))
        return (code,repl)
How foundcustomer
Evidence<URL: http://info.ravenbrook.com/mail/2001/02/03/01-52-33/0.txt>
Observed in0.4.2
Created byNick Barnes
Created on2001-02-08 14:24:17
Last modified byNick Barnes
Last modified on2018-07-05 17:27:29
History2001-02-08 NB Created.
2001-02-19 GDR Downgraded to 'optional'.
2001-03-02 NB Changed description
2003-05-19 NB Updated to reflect current Python smtplib status.
       2018-07-05 NB Suspended because the P4DTI is obsolete.
Support

Advice for all releases.

Symptom. The replicator fails to start, reporting an authentication failure from its SMTP server. (It would be nice to have the actual error message here, but I didn't record it at the time.)

Cause. The mail server is using the ESMTP protocol and requires clients to authenticate themselves. The P4DTI doesn't support ESMTP authentication.

Workarounds. You can stop the replicator from attempting to send e-mail by setting the smtp_server configuration parameter to None. But this is a bad idea because users won't be informed when they make illegal changes in Perforce, and the administrator won't be informed when the replicator can't replicate. A better alternative would be to run an ordinary SMTP server especially for the replicator to use.