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

--proxy doesn't work with SOCKS5 proxy #13

Closed
yegor256 opened this issue Mar 26, 2019 · 9 comments
Closed

--proxy doesn't work with SOCKS5 proxy #13

yegor256 opened this issue Mar 26, 2019 · 9 comments

Comments

@yegor256
Copy link
Owner

yegor256 commented Mar 26, 2019

I'm trying to send an email via Gmail SMTP and can't do that. The authentication doesn't go through. I reported to the gem we are using, but no response so far: camertron/net-smtp-proxy#2 Also asked in SO: https://stackoverflow.com/questions/55287305/cant-send-smtp-via-socks-proxy-authentication-required

The list of SOCKS5 proxies can be found, for example, here: http://free-proxy.cz/en/proxylist/country/all/socks5/ping/all

Tried with a bounty: https://www.bountysource.com/issues/71936008-proxy-doesn-t-work-with-socks5-proxy

@kazcw
Copy link

kazcw commented Apr 3, 2019

It looks like that library is for HTTP proxies. Square peg, round hole. You will need to either use an HTTP proxy, or use a library that is for SOCKS proxies.

@yegor256
Copy link
Owner Author

yegor256 commented Apr 28, 2019

@kazcw do you think it's possible to send SMTP via an HTTP proxy?

@kazcw
Copy link

kazcw commented Apr 29, 2019

@yegor256 That's what camertron/net-smtp-proxy is:

What is this Thing?

This gem allows you to connect to an SMTP server by way of an HTTP proxy. Why would you want to do that? I'm sure a number of use-cases exist, but I specifically needed to connect to the Gmail SMTP relay service in order to send an email from a company-wide alias. Normally, Gmail requires you to provide the credentials for the sender's account when sending an email. The relay service however replaces the usual password authentication with IP whitelisting. You provide Google with a static IP address that all your SMTP requests will come from. The SMTP relay service also allows you to send email from company-wide email aliases, i.e. accounts that don't have a login. In our case, we wanted to send an email from the Platform Engineering Team as opposed to one specific member of that team. We already had Squid set up as a reverse proxy with a static IP, so we whitelisted the IP with Google and wrote this gem to send SMTP requests through the proxy.

@yegor256
Copy link
Owner Author

yegor256 commented May 9, 2019

@kazcw it seems that camertron/net-smtp-proxy uses ruby-proxifier for proxifying, which supports both HTTP and SOCKS proxies.

Maybe the problem is in this line: https://github.com/camertron/net-smtp-proxy/blob/master/lib/net/smtp/proxy.rb#L27 It doesn't use the prefix of the proxy (like socks or http and only provides the hostname and the port).

@yegor256
Copy link
Owner Author

@rultor release, tag is 0.5.2

yegor256 added a commit that referenced this issue May 10, 2019
@rultor
Copy link
Collaborator

rultor commented May 10, 2019

@rultor release, tag is 0.5.2

@yegor256 OK, I will release it now. Please check the progress here

@rultor
Copy link
Collaborator

rultor commented May 10, 2019

@rultor release, tag is 0.5.2

@yegor256 Done! FYI, the full log is here (took me 4min)

@0crat
Copy link
Collaborator

0crat commented May 10, 2019

Job gh:yegor256/rumble#13 is not assigned, can't get performer

@0crat
Copy link
Collaborator

0crat commented May 10, 2019

This job is not in scope

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants