[New-bugs-announce] [issue29687] smtplib does not support proxy

Rares Vernica report at bugs.python.org
Wed Mar 1 12:29:32 EST 2017


New submission from Rares Vernica:

smtplib does not support connections through a proxy. The accepted workaround is something like:

```
import smtplib
import socks

socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS4, proxy_host, proxy_port)
socks.wrapmodule(smtplib)

smtp = smtplib.SMTP()
```

The side-effects of `socks.wrapmodule` impact other libraries which don't need to use the proxy, like `requests`. See here for a disucssion https://github.com/kennethreitz/requests/issues/3890

----------
components: Library (Lib)
messages: 288765
nosy: rares
priority: normal
severity: normal
status: open
title: smtplib does not support proxy

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29687>
_______________________________________


More information about the New-bugs-announce mailing list