简体   繁体   中英

Sending SMTP GMail through a proxy with Rails

I am running an nginx webserver with unicorn_rails running happily in production at the moment but the Actionmailer cannot send when I try to use my gmail account through the proxy.

My gmail is set up as shown in this link: http://guides.rubyonrails.org/action_mailer_basics.html#action-mailer-configuration-for-gmail

SSH, webmin, https and everything else I have open work fine, just not smtp in actionmailer. It is possible something is strange with the interfaces as ping uses lo by default and trying telnet smtp.gmail.com 587 does nothing.

I fixed it by changing the line in /etc/network/interfaces that reads auto lo to auto eth0 then used ifconfig lo down and shutdown -r now and ifconfig lo up . For some reason this made ping 8.8.8.8 actually work without setting an interface and telnet smtp.gmail.com 587 to return the correct code.

Still unsure as to how my network interfaces defaulted to lo but the mail server is working now. It had nothing to do with my proxy in the end which I rightly thought was set up correctly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM