Modify

#10484 closed defect (invalid)

SMTPServerDisconnetion while using SMTPS/SSL

Reported by: kai Owned by: hasienda
Priority: high Component: AnnouncerPlugin
Severity: normal Keywords: TracNotification smtps SMTP_SSL SMTPServerDisconnetion
Cc: Trac Release: 0.12

Description (last modified by rjollos)

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 kai 23 months ago.
Modified version of notification.py
smtp_ssl.patch (1.5 KB) - added by kai 23 months ago.
Patch for smtp_ssl. Apply with patch -p0 < smtp_ssl.patch

Download all attachments as: .zip

Change History (11)

Changed 23 months ago by kai

Modified version of notification.py

comment:1 Changed 23 months ago by rjollos

  • Component changed from TracHacks to AnnouncerPlugin
  • Description modified (diff)
  • Owner changed from otaku42 to doki_pen

comment:2 follow-up: Changed 23 months ago by rjollos

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

Changed 23 months ago by kai

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

comment:3 in reply to: ↑ 2 Changed 23 months ago by kai

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 follow-up: Changed 22 months ago by hasienda

  • Keywords needinfo added
  • Owner changed from doki_pen to hasienda

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 22 months ago by rjollos

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 22 months ago by rjollos

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 22 months ago by jun66j5

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 22 months ago by kai

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 22 months ago by hasienda

  • Keywords TracNotification added; needinfo notification removed
  • Resolution set to invalid
  • Status changed from new to closed

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.

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.