Opened 19 years ago
Closed 19 years ago
#3486 closed defect (worksforme)
notify has no support for smtplib local_host parameter
| Reported by: | 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 , 19 years ago
| Component: | general → ticket system |
|---|
comment:2 by , 19 years ago
Actually it was outdated…
I wish I had looked there first. Thanks for the reminder!
comment:3 by , 19 years ago
Please close the bug as worksforme if the trouble is fixed on your computer.
comment:4 by , 19 years ago
| Milestone: | → 0.10 |
|---|---|
| Owner: | changed from to |
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 , 19 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 , 19 years ago
| Milestone: | 0.10 |
|---|---|
| Resolution: | → worksforme |
| Status: | new → 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?