-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
New requirement: Need all purpose ACL in configuration #571
Comments
you mean you need. the first user in my 13 years of maintaining this program that needs such functionality, and you expect i immediately implement it. |
Thank you so much for your immediate reply. The usage conditions are:
So my
That's been working fine for year, but I hope to proxy access to only port 25 for the delivery server. I believe 'proxychains-ng` would be more comprehensive with the ACLs. Thanks again! |
you can use exactly that config with the proxified socks5 server in the iptables-based solution i suggested. |
@rofl0r I'm sorry for my unclear description, which might've led to misunderstanding. I'm running an email server("the server"), which should deliver the users' email to dest addresses by accessing the dest servers' port 25. But the server is banned by its ISP from connections to any port 25, so I've had to set up 3 socks5 servers outside the ISP's network for email delivery. Suppose the server is
This has been working fine for years. I'm not a sophisticated iptables/nftables user, but how to redirect the outgoing connections(dest port 25), and to where or to what process that is listening and will act as the socks5 server's client? |
As my assumption,
And the source code might change like:
Thus |
there's dozen of results searching for "iptables redirect outgoing port to socks5". the quintessence is that you need a transparent socks5 proxy like redsocks, iptables rules forwarding not all traffic, but only port 25 traffic there, and instruct redsocks to connect to a local socks5 proxy like microsocks which you run via proxychains, as mentioned in my last comment. |
I never knew there's something like redsocks/redsocks2/ipt2socks in the world! "In doing I learn." Thanks again! I followed this, using nftables, ipt2socks and shadowsocks to achieve my requirement: Still I wish |
the main difficulty here is to create a design that's intuitive, covers all bases and is extensible. and lastly it should be possible to implement with a minimum of changes. |
Here we go. |
Inspired by the comment, I've found a graceful way to redirect outgoing port 25 to 3 outside proxy servers via nftables and shadowsocks-rust:
It's working perfectly! By the way, have to say |
I've got this problem: my ISP blocks access to any destinations' port 25, so my SMTP delivery server doesn't work. With the help of proxychains-ng the server can work well via outside proxy servers, but I cannot precisely define that only non-localnet:25 should be proxied. In fact the current configuration's rule is "proxy_all" except the "localnet". For precise control, we need all purpose ACL rules like this: https://github.com/shadowsocks/shadowsocks-rust?tab=readme-ov-file#acl
That is:
--
Looking forward eagerly to this new upgrade! Thanks!
The text was updated successfully, but these errors were encountered: