Merge lp:~futatuki/mailman/2.1-add-smtp-timeout into lp:mailman/2.1
Proposed by
Yasuhito FUTATSUKI at POEM
Status: | Needs review |
---|---|
Proposed branch: | lp:~futatuki/mailman/2.1-add-smtp-timeout |
Merge into: | lp:mailman/2.1 |
Diff against target: |
46 lines (+18/-1) 2 files modified
Mailman/Defaults.py.in (+6/-0) Mailman/Handlers/SMTPDirect.py (+12/-1) |
To merge this branch: | bzr merge lp:~futatuki/mailman/2.1-add-smtp-timeout |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mailman Coders | Pending | ||
Review via email: mp+337353@code.launchpad.net |
Description of the change
This add a feature to specify timeout for SMTP response to avoid waiting response forever, to SMTPDirect Handler. To specify timeout, set SMTP_TIMEOUT in mm_cfg.py.
By default, this is disabled(waiting response until respond the MTA).
To test this feature, set mm_cfg.SMTP_TIMEOUT to small value and setup MTA to wait responding (by using greet pause feature, etc) and run smtp test or post message to mailing list to deliver it.
To post a comment you must log in.
Unmerged revisions
- 1745. By Yasuhito FUTATSUKI at POEM
-
Add SMTP timeout feature to SMTPDirect handler
Thank you for this contribution. I'm still considering how to handle this. I'd like to make Python 2.7 or at least Python 2.6 a minimum requirement, but that's not really an issue as your code handles older versions.
But there is an issue in how socket.timeout is handled in OutgoingRunner. Currently, OutgoingRunner treats all socket exceptions as a failure to connect. I think I'd want to catch socket.timeout in SMTPDirect, log the fact and then raise SomeRecipientsF ailed instead.
Also I think it would be appropriate to set the default other than None. Maybe something like one minute or five minutes, but I'm not sure what a good value would be.