Edgewall Software
Modify

Opened 18 years ago

Closed 18 years ago

#3486 closed defect (worksforme)

notify has no support for smtplib local_host parameter

Reported by: panewman@… Owned by: Matthew Good
Priority: normal Milestone:
Component: ticket system Version: 0.9.5
Severity: normal Keywords: notification, smtp
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

The constructor for an SMTP object in smtplib takes an optional 3rd parameter, 'local_hostname', otherwise it will execute the following line in smtplib.py:

addr = socket.gethostbyname(socket.gethostname())

which always fails on my system, because my hostname is not fully-qualified. I've only been able to successfully send mail using smtplib when I set the local_hostname parameter.

However, Notify.py, has no way of setting this:

def begin_send(self):
    self.server = smtplib.SMTP(self.smtp_server, self.smtp_port)

(only the first two parameters are used)

It should be possible to specify the third parameter of this constructor from trac.ini.

Attachments (0)

Change History (6)

comment:1 by Emmanuel Blot, 18 years ago

Component: generalticket system

Did you try to add your local IP address in your '/etc/hosts' file?

comment:2 by anonymous, 18 years ago

Actually it was outdated…

I wish I had looked there first. Thanks for the reminder!

comment:3 by Emmanuel Blot, 18 years ago

Please close the bug as worksforme if the trouble is fixed on your computer.

comment:4 by Matthew Good, 18 years ago

Milestone: 0.10
Owner: changed from Jonas Borgström to Matthew Good

Since smtplib supports this as a parameter it would still be good to add. I've seen other people encounter the same issue.

comment:5 by Emmanuel Blot, 18 years ago

Did the issue actually come from this missing parameter or from a faulty server setting?
There are a lot of parameters in the smtplib that we (hopefully) do not support.

I don't mind adding an extra parameter (although this means just another parameter to add to the documentation), but is this setting really required for sane environments? - just asking.

comment:6 by Matthew Good, 18 years ago

Milestone: 0.10
Resolution: worksforme
Status: newclosed

Actually I think that previous problem I had seen related to IP resolution were with BaseHTTPServer, so maybe this isn't a common issue.

So, I'll go ahead and close this ticket. If someone has a reason this is still needed please reopen it.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Matthew Good.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Matthew Good to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.