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

How use http proxy to send mails? #287

Closed
gowthamsadasivam opened this issue Mar 1, 2018 · 1 comment
Closed

How use http proxy to send mails? #287

gowthamsadasivam opened this issue Mar 1, 2018 · 1 comment
Labels
status: duplicate duplicate issue

Comments

@gowthamsadasivam
Copy link

Issue Summary

My rails web application runs behind a corporate firewall which doesn't allow direct internet access. The usual tools like apt, curl are just working fine by setting the environment variable "http_proxy" and "https_proxy".

The rails application uses "sendgrid-ruby" gem to send emails, unfortunately the application doesn't respect the "http_proxy" variable and always tries to send the emails by directly connecting to the internet. which eventually fails due to no direct internet connections are allowed.

I would like to know, Is there a way to use the proxy servers to send emails using SendGrid API.

I have searched on other SendGrid packages and could relate to the following issues:

Java Example:
sendgrid/sendgrid-java#138
sendgrid/sendgrid-java#182

CSharp Example:
sendgrid/sendgrid-csharp#197

Is there a similar solution exists for SendGrid-ruby library?

Steps to Reproduce

  1. Disconnect direct internet access from the server.
  2. Setup a working portforward/proxy server and set "http_proxy" and "https_proxy" environment variables using "/etc/environment" and source it to the current shell.
  3. Try sending email using SendGrid API.
  4. Now you will be able to see that mail sending failed in either stdout/stderr or the log file.

Technical details:

  • sendgrid-ruby Version: sendgrid-ruby-5.2.0
  • Ruby Version: 2.2.6p396 (2016-11-15 revision 56800) [x86_64-linux]
  • RVM Version: 1.29.3
@thinkingserious
Copy link
Contributor

Hi @gowthamsadasivam,

Thanks for the heads up, I have created an issue (please follow along there) to allow for setting a proxy.

With Best Regards,

Elmer

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

No branches or pull requests

3 participants