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

SMTP settings ignored again #7

Open
ralyodio opened this issue Aug 13, 2019 · 1 comment
Open

SMTP settings ignored again #7

ralyodio opened this issue Aug 13, 2019 · 1 comment

Comments

@ralyodio
Copy link

ralyodio commented Aug 13, 2019

app_1_a021a68d583a | sendmail: can't connect to remote host (127.0.0.1): Connection refused
app_1_a021a68d583a | script/mail_new_activity.rb:184:in `write': Broken pipe (Errno::EPIPE)
app_1_a021a68d583a |    from script/mail_new_activity.rb:184:in `puts'
app_1_a021a68d583a |    from script/mail_new_activity.rb:184:in `block (3 levels) in <main>'
app_1_a021a68d583a |    from script/mail_new_activity.rb:178:in `popen'
app_1_a021a68d583a |    from script/mail_new_activity.rb:178:in `block (2 levels) in <main>'
app_1_a021a68d583a |    from script/mail_new_activity.rb:159:in `each'
app_1_a021a68d583a |    from script/mail_new_activity.rb:159:in `block in <main>'
app_1_a021a68d583a |    from /lobsters/.bundle/gems/activerecord-5.2.3/lib/active_record/relation/delegation.rb:71:in `each'
app_1_a021a68d583a |    from /lobsters/.bundle/gems/activerecord-5.2.3/lib/active_record/relation/delegation.rb:71:in `each'
app_1_a021a68d583a |    from script/mail_new_activity.rb:153:in `<main>'
```

The enviroment variables appear to not be set inside email.rb

```
ActionMailer::Base.smtp_settings = {
  :address => ENV.fetch("SMTP_HOST", "127.0.0.1"),
  :port => Integer(ENV.fetch("SMTP_PORT", 25)),
  :domain => Rails.application.domain,
  :enable_starttls_auto => (ENV["SMTP_STARTTLS_AUTO"] == "true"),
  :user_name => ENV.fetch("SMTP_USERNAME", ""),
  :password => ENV.fetch("SMTP_PASSWORD", ""),
}
```
@anon238
Copy link

anon238 commented Mar 7, 2021

That's because you cannot use localhost for a mailserver, you need to resolve that to your webmail.

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

2 participants