Ticket #3486 (closed defect: worksforme)
Opened 6 years ago
Last modified 6 years ago
notify has no support for smtplib local_host parameter
| Reported by: | panewman@… | Owned by: | mgood |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | ticket system | Version: | 0.9.5 |
| Severity: | normal | Keywords: | notification, smtp |
| Cc: | |||
| Release Notes: | |||
| API 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
Change History
comment:1 Changed 6 years ago by eblot
- Component changed from general to ticket system
comment:2 Changed 6 years ago by anonymous
Actually it was outdated…
I wish I had looked there first. Thanks for the reminder!
comment:3 Changed 6 years ago by eblot
Please close the bug as worksforme if the trouble is fixed on your computer.
comment:4 Changed 6 years ago by mgood
- Milestone set to 0.10
- Owner changed from jonas to mgood
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 Changed 6 years ago by eblot
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 Changed 6 years ago by mgood
- Milestone 0.10 deleted
- Resolution set to worksforme
- Status changed from new to closed
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.



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