Opened 17 years ago
Closed 17 years ago
#3560 closed defect (fixed)
use_tls not actually used in AnnouncerPlugin
| Reported by: | Leonardo Rochael Almeida | Owned by: | Stephen Hansen |
|---|---|---|---|
| Priority: | normal | Component: | AnnouncerPlugin |
| Severity: | major | Keywords: | |
| Cc: | Trac Release: | 0.11 |
Description
in distributors/email_distributor.py, the use_tls configuration setting is read from the configuration file, but never actually used.
Patch attached.
Without this patch, configuring AnnouncerPlugin for use with, say, gmail, while specifying user and password for authentication, will cause messages not to be sent. The log will report:
2008-08-15 11:57:19,644 Trac[api] ERROR: AnnouncementSystem failed.
Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/AnnouncerPlugin-0.2-py2.5.egg/announcerplugin/api.py", line 377, in _real_send
distributor.distribute(transport, packages[transport], evt)
File "/usr/lib/python2.5/site-packages/AnnouncerPlugin-0.2-py2.5.egg/announcerplugin/distributors/email_distributor.py", line 194, in distribute
self._do_send(transport, event, format, messages[format], formats[format], None, to, public_cc)
File "/usr/lib/python2.5/site-packages/AnnouncerPlugin-0.2-py2.5.egg/announcerplugin/distributors/email_distributor.py", line 276, in _do_send
self._transmit(*package)
File "/usr/lib/python2.5/site-packages/AnnouncerPlugin-0.2-py2.5.egg/announcerplugin/distributors/email_distributor.py", line 285, in _transmit
smtp.login(self.smtp_user, self.smtp_password)
File "/usr/lib/python2.5/smtplib.py", line 554, in login
raise SMTPException("SMTP AUTH extension not supported by server.")
SMTPException: SMTP AUTH extension not supported by server.
Attachments (1)
Change History (10)
Changed 17 years ago by
| Attachment: | announcerplugin-actually-enable-tls.diff added |
|---|
comment:3 Changed 17 years ago by
This attachment on #2503 fixes both this bug and the proper declaration of international chars on e-mail messages.
comment:4 Changed 17 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
(In [4154]) fixes #2503 and #3560, thanks leorochael
comment:5 Changed 17 years ago by
| Resolution: | fixed |
|---|---|
| Status: | closed → reopened |
You need another smtp.ehlo() AFTER smtp.starttls() (yes, two calls to smtp.ehlo(), one before, and one after starttls)
comment:6 Changed 17 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | reopened → closed |
Actually, you don't need another .ehlo().
If you read the documentation for the `.login()` and .sendmail() methods, you'll see they both call .ehlo() if it hasn't been called before.
comment:7 Changed 17 years ago by
| Resolution: | fixed |
|---|---|
| Status: | closed → reopened |
I'm running a system using gmail with TLS -- it works with the two .ehlo(), without the second .ehlo() it fails claiming the server doesn't support authentication.
If I understand the linked documentation correctly, .login() won't call .ehlo() again if it has already been called during the current session... but .ehlo() is called once before .starttls(), therefore .login() won't trigger another .ehlo().
Also, see trac's implementation of smtplib with TLS -- they call .ehlo() twice.
comment:8 Changed 17 years ago by
Yes, I agree. It should be implemented the same way as trac. If trac changes, we will change.
comment:9 Changed 17 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | reopened → closed |
fixed in -r4240
connection establishment now matches the trac notification impl so behavior shouldn't change when using announcerplugin.



Patch to actually enable use_tls on AnnouncerPlugin