Email Notification Problem: SMTP Server Unexpectedly Disconnects

798 views
Skip to first unread message

wbranderson

unread,
Oct 4, 2007, 6:43:29 PM10/4/07
to Trac Users
I am running a MS Small Business Server. I have been trying to get
ticket notifications to be sent through the Exchange server. The
following is the notification section of my trac.ini file.

[notification]
always_notify_owner = true
always_notify_reporter = true
always_notify_updater = true
mime_encoding = base64
smtp_always_bcc =
smtp_always_cc = firstname.lastname
smtp_default_domain =
smtp_enabled = true
smtp_from = no-r...@mydomain.local
smtp_password =
smtp_port = 25
smtp_replyto =
smtp_server = localhost
smtp_subject_prefix = [trac]
smtp_user =
use_public_cc = false
use_short_addr = true
use_tls = false

Both the Exchange Server and the Trac server are running on the same
computer. The Exchange server allows anonymous access, hence the lack
of smtp_user and smtp_password fields.

When I attempt to modify (or create, for that matter) a ticket, I get
the following error in the Trac log.

2007-10-04 18:24:23,437 Trac[web_ui] ERROR: Failure sending
notification on change to ticket #1: Connection unexpectedly closed
Traceback (most recent call last):
File "C:\Python24\Lib\site-packages\trac\ticket\web_ui.py", line
562, in _do_save
tn.notify(ticket, newticket=False, modtime=now)
File "C:\Python24\Lib\site-packages\trac\ticket\notification.py",
line 129, in notify
NotifyEmail.notify(self, ticket.id, subject)
File "C:\Python24\Lib\site-packages\trac\notification.py", line 216,
in notify
Notify.notify(self, resid)
File "C:\Python24\Lib\site-packages\trac\notification.py", line 114,
in notify
self.begin_send()
File "C:\Python24\Lib\site-packages\trac\notification.py", line 278,
in begin_send
self.server = smtplib.SMTP(self.smtp_server, self.smtp_port)
File "C:\Python24\lib\smtplib.py", line 244, in __init__
(code, msg) = self.connect(host, port)
File "C:\Python24\lib\smtplib.py", line 311, in connect
(code, msg) = self.getreply()
File "C:\Python24\lib\smtplib.py", line 355, in getreply
raise SMTPServerDisconnected("Connection unexpectedly closed")
SMTPServerDisconnected: Connection unexpectedly closed


Does anyone know how to fix this problem?


Brett

Emmanuel Blot

unread,
Oct 5, 2007, 4:21:20 AM10/5/07
to trac-...@googlegroups.com
> Does anyone know how to fix this problem?

Try with a true SMTP server ? ;-)
Sorry, I can't help but being sarcastic when it comes to M$.

You could try to connect with a telnet client to the SMTP server and
mimic a SMTP session, to see when it fails. Try the following:

telnet localhost 25
EHLO localhost
MAIL FROM: no-r...@mydomain.local
RCPT TO: firstname.lastname
DATA
Subject: Test
Test
.
QUIT

and see if/when you get an error.

HTH,
Manu

Rainer Sokoll

unread,
Oct 5, 2007, 4:26:23 AM10/5/07
to trac-...@googlegroups.com
On Thu, Oct 04, 2007 at 03:43:29PM -0700, wbranderson wrote:
>
> I am running a MS Small Business Server. I have been trying to get
> following is the notification section of my trac.ini file.

[...]

> SMTPServerDisconnected: Connection unexpectedly closed

Consult the Exchange server's log - hopefully there is one ;-)

Rainer

Chris

unread,
Oct 5, 2007, 7:57:46 AM10/5/07
to trac-...@googlegroups.com
wbranderson wbranderson-at-gmail.com |TracMailingList| wrote:
> I am running a MS Small Business Server. I have been trying to get
> ticket notifications to be sent through the Exchange server. The
> following is the notification section of my trac.ini file.
>
> [notification]
> always_notify_owner = true
> always_notify_reporter = true
> always_notify_updater = true
> mime_encoding = base64
> smtp_always_bcc =
> smtp_always_cc = firstname.lastname
> smtp_default_domain =
> smtp_enabled = true
> smtp_from = no-r...@mydomain.local
> smtp_password =
> smtp_port = 25
> smtp_replyto =
> smtp_server = localhost
> ...


We have trac running in a similar configuration, on the same machine as small business server. We have email notification running, but it took a bunch of experimentation with the various settings. Our configuration section ended up like this:

smtp_always_cc = na...@mydomain.com
smtp_from = repl...@mydomain.com
smtp_reply_to = repl...@mydomain.com
smtp_server = machinename.mydomain.local

Hope this helps.

Chris

wbranderson

unread,
Oct 5, 2007, 10:32:33 AM10/5/07
to Trac Users
Chris--

Your solution worked, as well as me turning on the option to resolve
anonymous emails. Thanks for your help!

Brett

On Oct 5, 7:57 am, Chris <dy20lq...@sneakemail.com> wrote:
> wbranderson wbranderson-at-gmail.com |TracMailingList| wrote:
> > I am running a MS Small Business Server. I have been trying to get
> > ticket notifications to be sent through the Exchange server. The
> > following is the notification section of my trac.ini file.
>
> > [notification]
> > always_notify_owner = true
> > always_notify_reporter = true
> > always_notify_updater = true
> > mime_encoding = base64
> > smtp_always_bcc =
> > smtp_always_cc = firstname.lastname
> > smtp_default_domain =
> > smtp_enabled = true

> > smtp_from = no-re...@mydomain.local


> > smtp_password =
> > smtp_port = 25
> > smtp_replyto =
> > smtp_server = localhost
> > ...
>
> We have trac running in a similar configuration, on the same machine as small business server. We have email notification running, but it took a bunch of experimentation with the various settings. Our configuration section ended up like this:
>

> smtp_always_cc = n...@mydomain.com
> smtp_from = replyn...@mydomain.com
> smtp_reply_to = replyn...@mydomain.com

Reply all
Reply to author
Forward
0 new messages