Python - How to send mail via proxy - python

Need help to send mail `(smtp.gmail.com)` through proxy settings.
Not working even after trying multiple libraries (Including socks)
Latest - Using `xsmtplib`.. but getting following error.
The HTTP proxy server may not be supported by PySocks (must be a CONNECT tunnel proxy)
Any help will be really appreciated.
Below code for connecting with SMTP server via Proxy
"""from xsmtplib import SMTP
server = SMTP(proxy_host,proxy_port,host,port,timeout)
server.sendmail("aaaa#gmail.com", "bbbb#gmail.com", "Test Msg")
server.quit()"""

You can use xsmtplib, an extension of standard smtplib, which supports proxy tunneling.

Related

How to connect to SSL/TLS servers with ESNI/ECH in Python?

From what I can see in the Python documentation for the ssl module, there is no control over how the Client Hello is sent to the server. Moreover, since the Encrypted Client Hello extension to the TLS protocol is somewhat experimental, with Firefox only supporting it via a hidden about:config option.
That being said, is there a way to create a connection to an SSL/TLS server with an Encrypted Client Hello from Python today? If possible, I would prefer answers that use the requests library so that it can be immediately applied to connecting to HTTPS endpoints.

Python - SMTP Monitoring

We are using Elasticemail for our SMTP server and running in issues where our server would fail to connect to the SMTP server for various reasons. Currently, we only find out about the issue when a user complains.
We want to monitor the connection to the server on a regular interval and notify Admin if there is a connection failure.
Is there any way to test the connection to the server without sending an actual email using Python3?

Accessing Jira 4.4.5 via JSON-RPC on localhost http port

I am trying to get access to a local JIRA 4.4.5 installation using it's JSON-RPC service. Therefore I wrote a python script utilizing jsonrpclib and trying to connect to http://localhost:8080/jira/rpc/json-rpc/jirasoapservice-v2​ as described on https://developer.atlassian.com/display/JIRADEV/JIRA+JSON-RPC+Overview. Trying to connect from my python script as well as opening this URL in a browser gives me a 404 error.
import jsonrpclib
server = jsonrpclib.Server("http://localhost:8080/jira/rpc/json-rpc/jirasoapservice-v2")
reply = server.someMethod( param1, ... )
Calling someMethod fails with the following error:
xmlrpclib.ProtocolError: <ProtocolError for localhost:8080/jira/rpc/json-rpc/jirasoapservice-v2: 404 Not Found>
Has anyone successfully tried this the same way I did? Do I need to get access via HTTPS somehow instead of HTTP? How would I configure jira to do so?
Btw: Jira's json-rpc plugin is enabled.

Python SimpleHTTPServer able to register connection attempts?

A Python web server started with
python -m SimpleHTTPServer
will print on the console requests it has accepted. Can I get it to print requests that returned a connection refused to the client?
I am trying to debug why it refuses some requests from an Android client.
No. If the client gets a Connection refused, this means that the connection request did not reach the server application. Therefore, the server application cannot possibly register these errors.
Check firewalls, routing, connectivity, and correctness of server address and port.

How to connect pop3 server via http proxy?

I am using poplib to receive email but my computer accesses internet via http proxy. It seems that poplib does not support proxy? How to use poplib using http proxy? Many thanks!

Categories

Resources