Modify

Opened 2 years ago

Closed 23 months ago

#10154 closed defect (invalid)

Announcement sending email failed SMTPServerDisconnected("Connection unexpectedly closed")

Reported by: admin Owned by: hasienda
Priority: high Component: AnnouncerPlugin
Severity: normal Keywords: configuration support
Cc: rjollos, doki_pen Trac Release: 0.12

Description

Trunk version has a problem with sending mail. Announcer exits with an error:

2012-07-16 13:30:25,427 Trac[api] DEBUG: action controllers for ticket workflow: ['ConfigurableTicketWorkflow']
2012-07-16 13:30:25,524 Trac[api] DEBUG: Adding (xxxxx [1]) for 'always' on rule (AllTicketSubscriber) for (email)
2012-07-16 13:30:25,525 Trac[api] DEBUG: AnnouncementSystem has found the following subscriptions: [xxxx (authenticated) via email]
2012-07-16 13:30:25,525 Trac[mail] DEBUG: EmailDistributor has found the following formats capable of handling 'email' of 'ticket': text/html, text/plain
2012-07-16 13:30:25,526 Trac[mail] DEBUG: EmailDistributor determined the preferred format for 'xxxx (authenticated)' is: text/html
2012-07-16 13:30:25,527 Trac[mail] DEBUG: EmailDistributor found the address 'yyyy@o2.pl' for 'xxxx (authenticated)' via: SpecifiedEmailResolver
2012-07-16 13:30:25,527 Trac[mail] DEBUG: EmailDistributor is sending event as 'text/html' to: yyyy@o2.pl
2012-07-16 13:30:25,789 Trac[mail] DEBUG: Content of recip_adds: [u'yyyy@o2.pl', '""']
2012-07-16 13:35:26,431 Trac[api] ERROR: AnnouncementSystem failed.
Traceback (most recent call last):
  File "build/bdist.linux-i686/egg/announcer/api.py", line 561, in _real_send
    evt)
  File "build/bdist.linux-i686/egg/announcer/distributors/mail.py", line 353, in distribute
    self._do_send(transport, event, k, v, fmtdict[k])
  File "build/bdist.linux-i686/egg/announcer/distributors/mail.py", line 525, in _do_send
    self.send(*package)
  File "build/bdist.linux-i686/egg/announcer/distributors/mail.py", line 534, in send
    self.email_sender.send(from_addr, recipients, message)
  File "build/bdist.linux-i686/egg/announcer/distributors/mail.py", line 604, in send
    smtp.sendmail(from_addr, recipients, message)
  File "/opt/bitnami/python/lib/python2.6/smtplib.py", line 712, in sendmail
    self.rset()
  File "/opt/bitnami/python/lib/python2.6/smtplib.py", line 438, in rset
    return self.docmd("rset")
  File "/opt/bitnami/python/lib/python2.6/smtplib.py", line 363, in docmd
    return self.getreply()
  File "/opt/bitnami/python/lib/python2.6/smtplib.py", line 340, in getreply
    raise SMTPServerDisconnected("Connection unexpectedly closed")
SMTPServerDisconnected: Connection unexpectedly closed

Interestingly, I copied the code from mail.py (function _do_send and send SmtpEmailSender class) and this code works fine, that sends mail.

This is my trac.ini

[announcer]
default_email_format = text / plain
email_address_resolvers = SessionEmailResolver, SpecifiedEmailResolver
email_enabled = true
email_from = xxxx @ hitron.pl
email_from_name =
email_replyto =
email_sender = SmtpEmailSender
email_subject_prefix = __ default__
email_to =
mime_encoding = qp
use_public_cc = false
use_threaded_delivery = false
admit_domains =
always_notify_owner = true
always_notify_reporter = true
always_notify_updater = true
never_notify_author = false
set_message_id = false
ambiguous_char_width = single
ignore_domains =
sendmail_path = sendmail
smtp_always_bcc =
smtp_always_cc = zzzz@hitron.pl
smtp_default_domain =
smtp_password =
smtp_port =
smtp_server =
smtp_user =
ticket_subject_template = $ prefix # $ ticket.id: $ summary
use_short_addr = false
use_tls = true
use_ssl = false
rcpt_local_regexp = $ ^

[smtp]
debuglevel = 0
server = hitron.pl
timeout = 300
port = 25
user = xxxx @ hitron.pl
password = ***
use_tls = true
use_ssl = false

[sendmail]
sendmail_path = sendmail

Without line

rcpt_local_regexp = $ ^

Announcer try doing local delivery...

Annex code that works. I'm using Trac 0.12.3 version. Trac is configured for WSGI (this is generally Bitnami package) with the common trac.ini file for different projects.

My address is admin on server like in trac.ini

Attachments (1)

smtp.py (2.7 KB) - added by anonymous 2 years ago.
Cut and paste from mail.py that works on my server.

Download all attachments as: .zip

Change History (3)

Changed 2 years ago by anonymous

Cut and paste from mail.py that works on my server.

comment:1 in reply to: ↑ description Changed 23 months ago by hasienda

  • Cc rjollos doki_pen added
  • Keywords configuration support added
  • Owner changed from doki_pen to hasienda

Replying to admin:

Trunk version has a problem with sending mail. Announcer exits with an error:
...
Interestingly, I copied the code from mail.py (function _do_send and send SmtpEmailSender class) and this code works fine, that sends mail.

This is my trac.ini

[announcer]
...
use_ssl = false
rcpt_local_regexp = $ !^
...

I see.

Without line

rcpt_local_regexp = $ !^

Announcer try doing local delivery...

Annex code that works.

Sure, expected. Seems like you don't know much about regular expressions, do you? So why bother with setting it differently than the default ('' - empty string)? You configuration is total non-sense because it translates to:
<end-of-address><space><start-of-address> (see i.e. http://docs.python.org/release/2.6.5/library/re.html#module-re for reference). This will never match any email address.

comment:2 Changed 23 months ago by hasienda

  • Resolution set to invalid
  • Status changed from new to closed

Plugin maintainer was inactive for many months now, so your weak bug claim got largely unnoticed, you see? Try inquiring at the mailing-list first, before opening a ticket for a local installation/configuration issue, what is highly depreciated for a number of reasons.

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.