Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for SOCKS proxy #980

Open
7 tasks
cketti opened this issue Dec 28, 2015 · 24 comments
Open
7 tasks

Add support for SOCKS proxy #980

cketti opened this issue Dec 28, 2015 · 24 comments
Labels
status: help wanted Issues seeking help from the community type: enhancement New features or improvements to existing features. type: security Issues related to security vulnerabilities

Comments

@cketti
Copy link
Member

cketti commented Dec 28, 2015

  • Use proxy for IMAP connections
  • Use proxy for POP3 connections
  • Use proxy for WebDAV connections
  • Use proxy for SMTP connections
  • Use proxy when downloading remote content displayed in WebView
  • Use proxy when downloading remote images (long-press in WebView)
  • Add option to configure SOCKS proxy before setting up the first account

See also https://code.google.com/p/k9mail/issues/detail?id=2834

@cketti cketti added type: enhancement New features or improvements to existing features. status: help wanted Issues seeking help from the community labels Dec 28, 2015
@0xPoly
Copy link

0xPoly commented Jan 2, 2016

Add option to configure SOCKS proxy before setting up the first account

One approach to this would be similar to the twitter app, which has an overflow menu on the account creation screen to that links to proxy settings.

@ghost
Copy link

ghost commented Jan 9, 2016

In proxy settings it'd be nice to have 2 sliders: Enable Tor and Enable proxy like OpenKeychain has. Orbots library allows other apps to start orbot aswell.

@ghost
Copy link

ghost commented Jan 9, 2016

(It's also probably a better Idea to route all traffic through the proxy/tor, This way you can deny internet access to k9mail in your firewall app which prevents exploits from leaking your real ip)

cketti added a commit that referenced this issue Mar 15, 2016
We don't want people to use this incomplete implementation believing the proxy
will be used for all their connections. This could have serious privacy
implications, e.g. when using Tor via SOCKS proxy.

See also #980
cketti added a commit that referenced this issue Mar 15, 2016
We don't want people to use this incomplete implementation believing the proxy
will be used for all their connections. This could have serious privacy
implications, e.g. when using Tor via SOCKS proxy.

See also #980
@philipwhiuk
Copy link
Contributor

When #1181 and #1182 get merged it will mean that WebDAV should support using a proxy for a secure connection.

@philipwhiuk philipwhiuk mentioned this issue Mar 20, 2016
4 tasks
@jonas-lundqvist
Copy link
Contributor

I would like to propose that the proxy can be set on a per server basis.
Let's say we keep the global preference as it is and in each "Incoming server" and "Outgoing server" preferences we add a checkbox: "Use global proxy settings" that is checked by default. If the checkbox is unchecked a user can enter the hostname and port for that specific incoming or outgoing server.

@NHellFire
Copy link

Use proxy when downloading remote content displayed in WebView
Use proxy when downloading remote images (long-press in WebView)

According to various questions on Stack Overflow (such as this), WebView does not support setting a proxy.
Maybe it'd be better to switch to GeckoView which does?
It may say not suitable for production use, but it should be fine for email content.

@philipwhiuk
Copy link
Contributor

philipwhiuk commented Apr 17, 2017

I think we'd be better off using https://guardianproject.info/code/netcipher/ with the added bonus that the library will play well with Orbot. It includes a WebViewProxy, OrbotHelper etc.

@NHellFire
Copy link

That'd definitely be a much better choice since most would probably be using it with Orbot rather than another proxy.

@BoBeR182
Copy link

What are the current roadblocks stopping adoption/development?

@philipwhiuk
Copy link
Contributor

There's been multiple implementation of this - the latest being #2571

It needs rebasing, again ( :/ ) and then merging.

@cketti
Copy link
Member Author

cketti commented Oct 14, 2017

There's no roadblock. It mainly needs someone to implement the functionality mentioned in the first post. But it's a lot of work and needs to be done carefully because of the privacy implications when people start using the feature with Orbot.

But it's not a very important feature to many people and hence not a priority.

If someone wants to work on this feature please make sure to read this comment first: #2571 (comment)

@simplebit3
Copy link

On the contrary @cketti , this is a VERY important privacy feature. But there is another easier way that this could work, without implementing network proxies inside k9mail.

Firstly, to use k9-mail through orbot you need to use AFwall. Its a must. why? because you can force all connections to go through VPN tap adaptor in AFWall settings.

Then you have to configure orbot to be used as a VPN -> switch to VPN-Mode. Then you need to allow the apps you want to pass through orbot, in this case k9-mail.
Once you connect orbot to the network, AFwall forces all connections through to orbot VPN.

Now the only thing that SHOULD be implemented in k9-mail, is account-related VPN toggle switches.
Which means that, say for example you have set up an email account. You want to long press the account and see a setting called Switch VPN adapter. Choose from which VPN this account will pass through permanently so that there are never any leaks (even though AFWall protects against leaks anyway).
This switch would have 3 options. Choose Orbot VPN, Choose OpenVPN Connect and OFF(to use normal traffic)

Basically this switch would read from the same options thats inside the android settings > VPN (under lineageOS atleast) thats where it shows Orbot VPN & OpenVPN Connect(if you have it).

I think account-separated VPN toggle switch would insure that your email account passes through the correct tap adapter.

Can anyone concur?

@ygrek
Copy link

ygrek commented Nov 19, 2018

One more usecase : gmail usually blocks access for me when retrieving mail from new country - this is quite annoying when travelling. I solve this on desktop by proxying through my server and it would be awesome to have same soluiton on android. So for this usecase only support for POP/IMAP/SMTP connections is required. Maybe this is easier milestone to reach.

This was referenced Jan 17, 2019
@mirsamantajbakhsh
Copy link

Check my commit.

SOCKS proxy support added
#3889

@mirsamantajbakhsh
Copy link

@JJohnGreenSr
Copy link

The pull request was rejected, so now what?

Is there still a plan to implement proxy support in K-9 Mail, or should this issue be closed?

@NHellFire
Copy link

@JJohnGreenSr that PR has the major issue of not using the proxy for loading HTML content in messages. If you're using Orbot, you can enable VPN mode for K9.

However, there's now an official way for an app to override the proxy used by WebView: https://developer.android.com/reference/androidx/webkit/ProxyController
That should work on API >= 14 (Android 4.0.1).
I'm no longer using K9, but I'll try to take a look at that sometime in the next few weeks.

@zpcol
Copy link

zpcol commented Feb 22, 2021

google servers will detect unusual activity on your account, because dozens of Gmail accounts are accessed on the same IP, it's useless using Orbot, it's better to insert the proxy code in k9 so that it can be set for each account, proxy settings will be automatically retrieved from the parser txt proxy list, 1st line for 1st account, 2nd line for 2nd account etc. and there is a proxy checking feature is active or not. as I found on this nekoX.

Screenshot_20210223_054757.jpg

@BoBeR182
Copy link

BoBeR182 commented Feb 23, 2021

google servers will detect unusual activity on your account, because dozens of Gmail accounts are accessed on the same IP, it's useless using Orbot, it's better to insert the proxy code in k9 so that it can be set for each account

Not everyone uses Google as they're provider. Many other email servers are tor friendly, some even offer .onion support.

@cunlem
Copy link

cunlem commented Nov 1, 2021

It would be great to have this feature for interoperability with new TorServices app and allow saving VPN slot for other needs

@Pinkolik

This comment was marked as off-topic.

@RedSteel-1
Copy link

I always route all my email clients to Tor (localhost:portnumber),
tried to do the same on the phone with K-9 and didn't find custom proxy setting. :-/

See this issue is very old, from 2015, and is still pending progress
Is there any hope to see it in K-9 in the near future?

@enemybeforeyou

This comment was marked as off-topic.

@lightkey-store
Copy link

I promise a reward of ₿.015 to those who implement it and pass PR, finally...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: help wanted Issues seeking help from the community type: enhancement New features or improvements to existing features. type: security Issues related to security vulnerabilities
Projects
None yet
Development

No branches or pull requests