Open coiby opened 4 years ago
@coiby Question1 : Why are you using proxy? Are you trying to bypass the GFW in China? Question 2: Did you set these settings? A. proxy: https://github.com/OfflineIMAP/offlineimap/blob/master/offlineimap.conf#L439 B. authproxy: https://github.com/OfflineIMAP/offlineimap/blob/master/offlineimap.conf#L503 C. ipv6: https://github.com/OfflineIMAP/offlineimap/blob/master/offlineimap.conf#L665
@chris001 Thanks for the reply!
Question 1: Yes, I'm trying to bypass the GFW. But as long as proxy is enabled, this issue will occur.
Question 2: I've set proxy/authproxy/ipv6 in the configuration file.
Question 1: Yes, I'm trying to bypass the GFW. But as long as proxy is enabled, this issue will occur.
As test, are you able to connect to https://mail.google.com thru the machine's browser, using the same proxy config?
Question 2: I've set proxy/authproxy/ipv6 in the configuration file.
Are you pointing to a SOCKS or HTTP client on localhost (local machine), which is configured to connect thru your VPN subscription's server?
Question 1: Yes, I'm trying to bypass the GFW. But as long as proxy is enabled, this issue will occur.
As test, are you able to connect to https://mail.google.com thru the machine's browser, using the same proxy config?
Yes, I could access mail.google.com with the same proxy in the browser.
Question 2: I've set proxy/authproxy/ipv6 in the configuration file.
Are you pointing to a SOCKS or HTTP client on localhost (local machine), which is configured to connect thru your VPN subscription's server?
I've trid both SOCKS and HTTP proxy which are provided by the same VPN client. While composing this email, I give another VPN provider a try and find out it works. So this SSL handshake issue should be cause by previous VPN service although I don't know why brower with the same proxy config works.
Question 1: Yes, I'm trying to bypass the GFW. But as long as proxy is > enabled, this issue will occur. As test, are you able to connect to https://mail.google.com thru the machine's browser, using the same proxy config? Yes, I could access mail.google.com with the same proxy in the browser.
Can you successfully compete the login to https://mail.google.com thru the browser, using the original (problematic) VPN service ? Because the gmail login process will redirect you to https://accounts.google.com which might fail...
Question 2: I've set proxy/authproxy/ipv6 in the configuration file. Are you pointing to a SOCKS or HTTP client on localhost (local machine), which is configured to connect thru your VPN subscription's server? I've trid both SOCKS and HTTP proxy which are provided by the same VPN client. While composing this email, I give another VPN provider a try and find out it works. So this SSL handshake issue should be cause by previous VPN service although I don't know why brower with the same proxy config works.
That's great news, you got offlineimap to work thru the second VPN service.
I suspect the reason for the fail on one VPN, and success with the other VPN, is because possibly GFW is an aggressive blocker, combined with the fact that we're still leaking DNS queries in plaintext, which I intend to fix ASAP, by adding private encrypted DNS lookups feature, enabled by default.
Question 1: Yes, I'm trying to bypass the GFW. But as long as proxy is > enabled, this issue will occur. As test, are you able to connect to https://mail.google.com thru the machine's browser, using the same proxy config? Yes, I could access mail.google.com with the same proxy in the browser.
Can you successfully compete the login to https://mail.google.com thru the browser, using the original (problematic) VPN service ? Because the gmail login process will redirect you to https://accounts.google.com which might fail...
Yes, I could access mail.google.com in private browsing mode.
Question 2: I've set proxy/authproxy/ipv6 in the configuration file. Are you pointing to a SOCKS or HTTP client on localhost (local machine), which is configured to connect thru your VPN subscription's server? I've trid both SOCKS and HTTP proxy which are provided by the same VPN client. While composing this email, I give another VPN provider a try and find out it works. So this SSL handshake issue should be cause by previous VPN service although I don't know why brower with the same proxy config works.
That's great news, you got offlineimap to work thru the second VPN service.
I suspect the reason for the fail on one VPN, and success with the other VPN, is because possibly GFW is an aggressive blocker, combined with the fact that we're still leaking DNS queries in plaintext, which I intend to fix ASAP, by adding private encrypted DNS lookups feature, enabled by default.
Thank you! I'm looking forward to this private encrypted DNS lookups feature.
Thank you! I'm looking forward to this private encrypted DNS lookups feature.
It's preferred (but not required) to encrypt the DNS lookups at the operating system level. Some OS already have this feature built in and available. Which operating system are you running on?
Thank you! I'm looking forward to this private encrypted DNS lookups feature.
It's preferred (but not required) to encrypt the DNS lookups at the operating system level. Some OS already have this feature built in and available. Which operating system are you running on?
I'm using Linux. I tried dnscrypt-proxy but it produced the same SSL handshake error. I also tried putting the correct DNS record of (the one used by the working VPN) imap.gmail.com into /etc/hosts which failed too. By the way, I tried sending email using the not-working VPN in neomutt and neomutt gave an SMTP session error. So I guess there may be something wrong with the not-working VPN.
@coiby Try this with the not-working VPN, and post back with the output, just to test if encrypted DNS would work on that VPN:
apt install -y git
yum install -y git
git clone https://github.com/stamparm/python-doh
cd python-doh
python
import client
print(client.query("mail.google.com"))
print(client.query("mail.google.com", "AAAA"))
print(client.query("accounts.google.com"))
print(client.query("accounts.google.com", "AAAA"))
quit()
Try this with the not-working VPN just to test if encrypted DNS would work with it:
apt install -y git yum install -y git git clone https://github.com/stamparm/python-doh cd python-doh python import client print(client.query("mail.google.com")) print(client.query("mail.google.com", "AAAA")) print(client.query("accounts.google.com")) print(client.query("accounts.google.com", "AAAA")) quit()
Thank you for the instructions! Here is the result,
$ proxychains python
[proxychains] config file found: /etc/proxychains.conf
[proxychains] preloading /usr/lib/libproxychains4.so
Python 3.8.1 (default, Jan 22 2020, 06:38:00)
[GCC 9.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import client
>>> print(client.query("mail.google.com"))
['216.58.200.37']
>>> print(client.query("mail.google.com", "AAAA"))
['googlemail.l.google.com.']
>>> print(client.query("accounts.google.com"))
['216.58.200.237']
>>> print(client.query("accounts.google.com", "AAAA"))
['2404:6800:4008:801::200d']
>>> quit()
@coiby Your results:
print(client.query("mail.google.com", "AAAA")) ['googlemail.l.google.com.']
My results:
print(client.query("mail.google.com", "AAAA"))
['googlemail.l.google.com.', '2607:f8b0:4009:805::2005']
Besides the fact you're getting the google IPs which are geolocated in Taiwan, closest to you, in China, and I'm getting the IPs in Chicago US, geographically nearest to me, the only difference I see, is when I query for the IPb6 address of mail.google.com
, I get an array containing the hostname, googlemail.l.google.com
, and the closest geolocated IPv6 address of the hostname, 2607:f8b0:4009:805::2005
, while you got only the hostname, googlemail.l.google.com
, and no IP address for the hostname. This lack of IPv6 address, when your offlineimap
client app is configured to use IPv6 only, might, or might not, cause a problem in the code at runtime. Needs more investigation.
it works with config ipv6=False
# ** general
[general]
accounts = gmail
maxsyncaccounts = 5
pythonfile = ~/.offlineimap.py
# ** gmail
# *** account
[Account gmail]
localrepository = gmail-local
remoterepository = gmail-remote
proxy = SOCKS5:localhost:2080
# *** local
[Repository gmail-local]
type = Maildir
localfolders = ~/Mail/gmail
# *** remote
[Repository gmail-remote]
type = Gmail
remoteuser = xxx@gmail.com
remotepasseval = get_pass("gmail.com/xxx")
sslcacertfile = /etc/ssl/certs/ca-certificates.crt
ipv6 = False
General informations
offlineimap -V
): offlineimap v7.3.2, imaplib2 v2.101 (bundled), Python v2.7.17, OpenSSL 1.1.1d 10 Sep 2019Configuration file offlineimaprc
pythonfile (if any)
Logs, error
Steps to reproduce the error