I'm trying to use the smtplib python library in combination with proxies. The way I tried is to use PySocks library like so:
socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, 'hostname', port, True, 'login','password')
socks.wrapmodule(smtplib)
smtp = smtplib.SMTP('smtp.server.com', 465)
However, after the authorization, it returns this error:
socks.GeneralProxyError: Socket error: 0x02: Connection not allowed by ruleset
The proxies are working as otherwise it'd return this error:
socks.GeneralProxyError: Socket error: SOCKS5 authentication failed
Is there anything I'm missing or is it the proxy's issue? I've already contacted their sys admin to assist me with this issue to see if it's truly on my side
Or is there any other way to connect the current Python script to a proxy and tunnel all of it's requests through it?