mirror of
https://github.com/cypht-org/cypht.git
synced 2026-04-25 04:56:03 +03:00
[GH-ISSUE #773] Use proxy to connect to mail servers #473
Labels
No labels
2fa
I18N
PGP
Security
Security
account
advanced_search
advanced_search
announcement
api_login
authentication
awaiting feedback
blocker
bug
bug
bug
calendar
config
contacts
core
core
devops
docker
docs
duplicate
dynamic_login
enhancement
epic
feature
feeds
framework
github
github
gmail_contacts
good first issue
help wanted
history
history
imap
imap_folders
inline_message
installation
keyboard_shortcuts
keyboard_shortcuts
ldap_contacts
mobile
need-ssh-access
new module set
nux
pop3
profiles
pull-request
question
refactor
release
research
saved_searches
smtp
strategic
tags
tests
themes
website
wordpress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/cypht#473
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @tianze0926 on GitHub (Sep 19, 2023).
Original GitHub issue: https://github.com/cypht-org/cypht/issues/773
🚀 Feature
Is it possible to make cypht connect to IMAP and SMTP servers through proxies such as SOCKS5? There are occasions when the client cannot directly access the mail server. So proxies such as SOCKS5 can be used to proxy TCP payload, like IMAP.
Design, Layout, Architecture
Since I am not familiar with php, a golang implementation reference can be found at https://stackoverflow.com/a/71182894.
The procedure can be roughly described as:
@jasonmunro commented on GitHub (Sep 21, 2023):
Currently Cypht cannot use SOCKS5. PHP has no built in support for SOCKS5, though it looks like some user written libraries exist. This is possible to implement but would need some dev resources to understand the SOCKS5 protocol and implement the request/response process. We do already support enabling TLS on an open socket since that is how STARTTLS works.
@marclaporte commented on GitHub (Sep 23, 2023):
@tianze0926 Is this something Cypht should do vs something done via the server? (and transparent to Cypht)
@tianze0926 commented on GitHub (Sep 23, 2023):
@marclaporte Cypht should support the client side of SOCKS protocol.
Taking IMAP TLS for example, Cypht currently executes the TCP and TLS handshakes with the IMAP server in one function call. However in order to use SOCKS proxy, Cypht should:
Here is a example sequence diagram: (replies from the proxy server and the IMAP server are omitted)
As you can see, the TCP and TLS handshakes should be seperated instead of done by single function call. The SOCKS5 protocol is very simple and can be easily implemented even from scratch. It's the TLS part that troubles me since I couldn't find appropriate methods to perform TLS after a plain TCP connection is established.
@marclaporte commented on GitHub (Sep 23, 2023):
Ok, but for the record, here are some options: https://packagist.org/?query=SOCKS
@marclaporte commented on GitHub (Sep 1, 2025):
@tianze0926 This is a good topic for our monthly Cypht community meetings: https://github.com/cypht-org/cypht/wiki/Monthly-Community-Meetings
@marclaporte commented on GitHub (Sep 26, 2025):
@tianze0926 We discussed a bit at the meeting today, but if you could come to the meeting next month, it would be great!
@marclaporte commented on GitHub (Oct 31, 2025):
@tianze0926 We are ready to discuss when you are :-)
https://github.com/cypht-org/cypht/wiki/Monthly-Community-Meetings