[Feature Request] SOCKS5 Proxy Support
Closed this issue · 11 comments
Hey @kalekad, I need a bit more information about the use case for this feature.
Are you using the Rust crates or the Android application? If the latter, does setting a proxy through the Android settings work for you?
I need a bit more information about the use case for this feature.
Yes, of course. I have ProtonMail in my Work Profile, which is linked to banking and government applications. All applications access the network through a local VPN to TOR (I use Orbot). I only turn on the Work Profile when I need to do something, like checking emails in ProtonMail.
I have "You Have Mail" in the Main profile, where all apps access the network via a local VPN to the VPN provider. If "You Have Mail" implemented a SOCKS5 Proxy, it could be connected via TOR like ProtonMail in the Work profile and have notifications.
I assume that within a few months ProtonMail will have implemented notifications without the need to send them via Google (Proton Calendar already has them, they don't take any battery and just work). But in the Work Profile, which is almost always off, notifications are useless to me anyway. I don't count that they implemented SOCKS5 Proxy and I could run ProtonMail in the Main profile via TOR. And this is where "You Have Mail" with SOCKS5 Proxy has its place.
Are you using the Rust crates or the Android application? If the latter, does setting a proxy through the Android settings work for you?
Android app
I don't use the system proxy because it has to be set up for each network separately (I'm not sure if it can be set up for mobile data), and applications are not forced to use it and don't indicate if they support it. So I don't know.
Interesting setup, thanks for the suggestion!
I did a quick check on the libraries currently in use and it seems doable to add socks5 support. It may take a bit longer as I didn't consider proxy support in the original architecture 😅.
Once I'm finished with my current activity, I'll start working on this next (provided life doesn't get in the way :))
@kalekad I have added Proxy support for HTTPS and SOCKS5 in https://github.com/LeanderBB/you-have-mail/releases/tag/v0.3.0.
Please let me know if this works for you. I tested the connections against some python libraries and as far as I can tell everything seems to work.
However, I have no "real world" SOCKS5 setup with which I can test this. Would be grateful if you could share your feedback :).
I tried the proxy and it works, thank you so much for implementing it for each account, that's great.
(poll interval 30 s)
In a test with two accounts, each connected via a different proxy:
-1 Both accounts connected and online.
-2 After switching off one proxy, the account connected to it showed offline, after switching on it reconnected.
-3 The other account, with the same steps as above, did not reconnect.
-4 I forcibly stopped the application and after opening it, the account that did not connect in the previous step now connected fine and the other was logged out.
After the third step I sent an email to both accounts, but in the fourth step there was no notification to the reconnected account. (nor for the logged out account, but it's clear there)
And another time when I set the poll interval to 60 m the notifications didn't arrive even after 10 hours, I guess the connection died?
Happy to hear it's working.
It is hard to say what may be going wrong. I didn't want to spam notifications for disconnected/connected to not get annoyed during network connection loss/switches. I could look into adding an option for that 🤔
What I did notice is the status in the Account Details
screen doesn't update properly at the moment, but the general account list should display the correct status.
Do you think you could share the logs? There maybe some more information there that might help diagnose the problem.
In the logs I can see:
observer: Account Error: [redacted] => dev.lbeernaert.youhavemail.ServiceException$Unknown: msg=An error occurred preparing the request
Did you happen to get an error notification for this?
I'm not sure what may have caused this, I will try to get a new build out with more information surrounding this error.
Edit: Digging through the source code of the network library it could be related to connection timeouts.
If you update to v0.3.1 we should have more details about why the request is failing.
Ok. I will need to spend some time to dig deeper into this, but it seems that is related to a network transmission issue such as the connection being lost halfway through the transmission of data.
I will close this issue as the feature itself is complete. I will open a new issue to track improvements for the network transmission.