Modify

Opened 5 years ago

Closed 5 years ago

#10484 closed defect (invalid)

SMTPServerDisconnetion while using SMTPS/SSL

Reported by: Stefano Cailotto Owned by: Steffen Hoffmann
Priority: high Component: AnnouncerPlugin
Severity: normal Keywords: TracNotification smtps SMTP_SSL SMTPServerDisconnetion
Cc: Trac Release: 0.12

Description (last modified by Ryan J Ollos)

Hello, I'm using the Italian ISP Aruba smtps server to send ticket notifications.

I get the following error (email address is obfuscated):

2012-10-15 10:55:50,420 Trac[notification] INFO: Sending notification through SMTP at smtps.aruba.it:465 to [u'xxxxxxxxx@xxxxxxxx']

2012-10-15 11:00:51,398 Trac[web_ui] ERROR: Failure sending notification on creation of ticket #1: SMTPServerDisconnected: Connection unexpectedly closed

After investigating a bit, I discovered that stmps.aruba.it is not compatible with the starttls option, but requires anyway an encrypted connection.

For this purpose, smtp server from smtplib must be an instance of SMTP_SSL without setting use_tls in the config page.

Please find the modified version in attachment.

Regards, Stefano

Attachments (2)

notification.py (18.4 KB) - added by Stefano Cailotto 5 years ago.
Modified version of notification.py
smtp_ssl.patch (1.5 KB) - added by Stefano Cailotto 5 years ago.
Patch for smtp_ssl. Apply with patch -p0 < smtp_ssl.patch

Download all attachments as: .zip

Change History (11)

Changed 5 years ago by Stefano Cailotto

Attachment: notification.py added

Modified version of notification.py

comment:1 Changed 5 years ago by Ryan J Ollos

Component: TracHacksAnnouncerPlugin
Description: modified (diff)
Owner: changed from Michael Renzmann to Robert Corsaro

comment:2 Changed 5 years ago by Ryan J Ollos

Would you kindly attach your patch as a unified diff? Thanks.

Changed 5 years ago by Stefano Cailotto

Attachment: smtp_ssl.patch added

Patch for smtp_ssl. Apply with patch -p0 < smtp_ssl.patch

comment:3 in reply to:  2 Changed 5 years ago by Stefano Cailotto

Replying to rjollos:

Would you kindly attach your patch as a unified diff? Thanks.

Here is the patch, apply to original code from outside Trac-0.12.4 directory with

patch -p0 < smtp_ssl.patch

comment:4 Changed 5 years ago by Steffen Hoffmann

Keywords: needinfo added
Owner: changed from Robert Corsaro to Steffen Hoffmann

I'm confused. Your patches are against TracNotification code. No mentioning of the AnnouncerPlugin here.

Are you sure, that you've written to the right Trac, and that it shouldn't go to the tracker for Trac itself (trac.edgewall.org)?

comment:5 Changed 5 years ago by Ryan J Ollos

I was confused by this ticket as well, but failed to investigate further. AnnouncerPlugin does have separate TLS and SSL configuration options (see AnnouncerPlugin#EmailConfig). So while it appears that Trac does not separate these configuration directives (t:TracIni#notification-section), you at least have the option of switching to AnnouncerPlugin to satisfy your need, if you don't with to push your patch in the Trac core.

comment:6 Changed 5 years ago by Ryan J Ollos

One more point to back the suggestion of closing this ticket: AnnouncerPlugin already implements the equivalent of this patch:

smtpclass = smtplib.SMTP
if self.use_ssl:
   smtpclass = smtplib.SMTP_SSL

comment:7 in reply to:  4 Changed 5 years ago by Jun Omae

Replying to hasienda:

Are you sure, that you've written to the right Trac, and that it shouldn't go to the tracker for Trac itself (trac.edgewall.org)?

The same issue has been reported at trac:#4931 and the similar patch has been suggested.

comment:8 Changed 5 years ago by Stefano Cailotto

Hello, I suggested this patch basically because I didn't want to be forced to switch to AnnouncerPlugin to be able to use smtp_ssl feature.

As I'm really a newbie with Trac and it's components (even if I'm "passively" using its since 3 years ago), I didn't exactly know to which component associate the ticket to.

So, feel free to move the ticket where you consider it to be correct.

comment:9 Changed 5 years ago by Steffen Hoffmann

Keywords: TracNotification added; needinfo notification removed
Resolution: invalid
Status: newclosed

So this is actually a cant-fix for being reported against the wrong code base.

Hint: Wait a bit longer, you should see a release of announcer-1.0 announced around years end or so. Then install it like other Trac plugins, disable TracNotification and enjoy greater flexibility of TracAnnouncer.

Thanks for taking care to report it anyway. I've cross-referenced this ticket at trac.edgewall.org now, the place, where you complaint and suggestions regarding TracNotification really belongs to.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Steffen Hoffmann.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.