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

Fix email generator #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix email generator #1

wants to merge 1 commit into from

Conversation

rikkipitt
Copy link
Member

The email generator attempts to inject SMTP config into config/environments/production.rb after the line config.action_mailer.raise_delivery_errors = false. This line is not found anymore and thus fails (NB: find reference). I propose the code is injected after config.action_mailer.perform_caching = false instead.

In production, you may experience the following error as action mailer attempts to use the default port 25:

Connection refused - connect(2) for "localhost" port 25
/app/vendor/ruby-2.5.1/lib/ruby/2.5.0/net/smtp.rb:539:in `initialize'
/app/vendor/ruby-2.5.1/lib/ruby/2.5.0/net/smtp.rb:539:in `open'
/app/vendor/ruby-2.5.1/lib/ruby/2.5.0/net/smtp.rb:539:in `tcp_socket'
/app/vendor/ruby-2.5.1/lib/ruby/2.5.0/net/smtp.rb:549:in `block in do_start'
/app/vendor/ruby-2.5.1/lib/ruby/2.5.0/timeout.rb:93:in `block in timeout'
/app/vendor/ruby-2.5.1/lib/ruby/2.5.0/timeout.rb:103:in `timeout'
/app/vendor/ruby-2.5.1/lib/ruby/2.5.0/net/smtp.rb:548:in `do_start'
/app/vendor/ruby-2.5.1/lib/ruby/2.5.0/net/smtp.rb:518:in `start'
...
...

The email generator attempts to inject SMTP config into `config/environments/production.rb` after the line `config.action_mailer.raise_delivery_errors = false`. This line is not found anymore and thus fails (NB: find reference). I propose the code is injected after `config.action_mailer.perform_caching = false` instead.

In production, you may experience the following error as action mailer attempts to use the default port 25:

```
Connection refused - connect(2) for "localhost" port 25
/app/vendor/ruby-2.5.1/lib/ruby/2.5.0/net/smtp.rb:539:in `initialize'
/app/vendor/ruby-2.5.1/lib/ruby/2.5.0/net/smtp.rb:539:in `open'
/app/vendor/ruby-2.5.1/lib/ruby/2.5.0/net/smtp.rb:539:in `tcp_socket'
/app/vendor/ruby-2.5.1/lib/ruby/2.5.0/net/smtp.rb:549:in `block in do_start'
/app/vendor/ruby-2.5.1/lib/ruby/2.5.0/timeout.rb:93:in `block in timeout'
/app/vendor/ruby-2.5.1/lib/ruby/2.5.0/timeout.rb:103:in `timeout'
/app/vendor/ruby-2.5.1/lib/ruby/2.5.0/net/smtp.rb:548:in `do_start'
/app/vendor/ruby-2.5.1/lib/ruby/2.5.0/net/smtp.rb:518:in `start'
...
...
```
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

Successfully merging this pull request may close these issues.

1 participant