mailpile / Mailpile

A free & open modern, fast email client with user-friendly encryption and privacy features
https://mailpile.is
Other
8.81k stars 1.02k forks source link

Allow Mailpile to work with the socks module (as well as socksipychain) #1806

Closed axelsimon closed 6 years ago

axelsimon commented 7 years ago

Hi everyone, First of all, thanks for making Mailpile, it looks really interested and I look forward to being able to test it out 😃

I've run into a small issue regarding Tor. As suggested on the privacy settings page, I tried to enable Tor, but got this error:

Failed to configure Tor on 127.0.0.1:9050. Is the network down?

I checked (and modified accordingly) my /etc/tor/torrc to make sure localhost can connect to 127.0.0.1:9050. And sure enough, netcat confirms the port is open:

axel@mailpile-host:~ $ nc -vz 127.0.0.1 9050 localhost [127.0.0.1] 9050 (?) open

Mailpile's network log shows:

17:29 Failed to connect to clgs64523yi2bkhz.onion:80: No connection method found 17:29 Connected to 127.0.0.1:9050 over the local network with no encryption.

Am I missing something obvious? Do I need to further configure Tor? That much isn't obvious to me… In any case, I hope this helps make it easier for those who come after me to configure Mailpile :)

Thanks.

axelsimon commented 7 years ago

I updated mailpile to v1.0.0rc0 today with git pull and tried this again. This time, I get this in the logs:

15:55 Failed to connect to clgs64523yi2bkhz.onion:80: set_proxy() got an unexpected keyword argument 'proxytype' 15:55 Connected to 127.0.0.1:9050 over the local network with no encryption.

So, a different error from last time. Tor was started manually using systemctl start tor. This is on Fedora 25, if it matters.

ntrlshrp commented 7 years ago

On Ubuntu Desktop 16.04 (Mailpile 1.0.0rc0 [according to Mailpile browser page Tips and Tricks]), I also clicked "Enable Tor" and "Troubleshoot recent network activity" stated:

Failed to connect to clgs64523yi2bkhz.onion:80: No connection method found
Connected to 127.0.0.1:9050 over the local network with no encryption

I checked my tor service status:

sudo service tor status
● tor.service - Anonymizing overlay network for TCP (multi-instance-master)
   Loaded: loaded (/lib/systemd/system/tor.service; enabled; vendor preset: enabled)
   Active: active (exited) since ...

Fix based on Using Tor or Proxies:

##### Go to Mailpile commandline (visible after "./mp" command)
mailpile> set sys.proxy.protocol=socks5
Elapsed: 0.001s (set: Updated your settings)

{
    "sys.proxy.protocol": "socks5"
}

mailpile> set sys.proxy.host=localhost
Elapsed: 0.001s (set: Updated your settings)

{
    "sys.proxy.host": "localhost"
}

mailpile> set sys.proxy.port=9050
Elapsed: 0.001s (set: Updated your settings)

{
    "sys.proxy.port": "9050"
}

Now, try to "Enable Tor" again and I see new options relevant to a custom proxy. I change radio button here:

When sending and receiving mail, or downloading from the web:
- Prefer anonymous Tor networking for all connections

Maybe that is helpful?

BjarniRunar commented 7 years ago

You probably need to install the Python socksipychain module.

jeroenev commented 7 years ago

installing python2-socksipychain from the AUR fixed it for me on arch linux

BjarniRunar commented 6 years ago

Renaming this issue; it would be nice if Mailpile worked with the normal 'socks' module as well, and I don't think there are any requirements that should prevent that.