N
N
Nikolay2016-05-22 22:11:57
Ruby on Rails
Nikolay, 2016-05-22 22:11:57

How to set up iptables to send mail from a rails application?

There is an application written in Ruby on Rails, through which emails are sent when a user registers.
Help, pliz, set up rules for iptables so that these messages are sent and reach the addressee.
Settings in config/environments/production.rb

config.action_mailer.smtp_settings = {
      address:               'smtp.gmail.com',
      port:                   587,
      user_name:             '[email protected]',
      password:              'mypass123',
      domain:                'mydomain.ru',
      authentication:        :plain,
      #:openssl_verify_mode  => 'none',
      enable_starttls_auto:  true
  }

Now all INPUT and OUTPUT policies are in DROP.
As soon as I do:
iptables -P OUTPUT ACCEPT
iptables -P INPUT ACCEPT

everything is sent (with one ACCEPT another DROP, could not set it up either).
Already like all the rules tried, and my ideas ran out. :(
Like those, iptables -A OUTPUT -p tcp --sport 587 -j ACCEPT
both on input and output, and on sport, dport and tcp, udp.
How to configure iptables, what rules to prescribe with DROP policies so that mail goes to recipients.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question