selfhost icon indicating copy to clipboard operation
selfhost copied to clipboard

SMTP email service is not working

Open evojewel opened this issue 2 years ago • 8 comments

Configured Email Server Settings (SMTP) from from admin panel through Customization/Config with mailgun as service provider. After inviting a member it showed "The invite has been sent to the user's email." but the email did not received and in backend there is a timeout error happening

Steps to reproduce the behaviour :

  1. Go to '/admin/customization/config'
  2. Configured Email Server Settings (SMTP) with mailgun as service provider (Authentication:Plain, Port:465)
  3. Got to '/admin/member_manager/invitations/new' submit email address and it will show the email was sent
  4. Go to the instance console of your cloud provider where the forem is hosted and hit 'journalctl -f -u forem-rails.service' there will be a timeout error
  5. Error log : Error log.txt

Expected behaviour : The email should receive

OS : Linux

Cloud Provider : AWS

Additional context : Tried with Sendgrid and same timeout error is occurring, Changing port is not making any changes

evojewel avatar Nov 10 '22 09:11 evojewel

Hello there, I'm not sure how much this matters but could you please try lowercase plain and restart the server? What did you use for the mailgun address?

maestromac avatar Nov 21 '22 19:11 maestromac

@maestromac It is already plain and the address is smtp.eu.mailgun.org

evojewel avatar Nov 23 '22 12:11 evojewel

What's your from and reply email address? I see the following email in your log [email protected] which looks like an autogenerated email address.

maestromac avatar Nov 29 '22 15:11 maestromac

any updates? got same problem

Dani4kor avatar Jan 11 '23 13:01 Dani4kor

I also have the some problem, after testing out 'journalctl -f -u forem-rails.service' it also print out this error:

ERROR -- : [ActiveJob] [ActionMailer::MailDeliveryJob] [4126839f-55da-4ac1-874d-cbff56dfe42f] Error performing ActionMailer::MailDeliveryJob (Job ID: 4126839f-55da-4ac1-874d-cbff56dfe42f) from Async(default) in 5033.56ms: Net::ReadTimeout (Net::ReadTimeout with #<Socket:(closed)>):

igrir avatar Apr 28 '23 02:04 igrir

@Dani4kor @igrir may I please know which email services are you both using?

maestromac avatar May 01 '23 14:05 maestromac

@Dani4kor @igrir may I please know which email services are you both using?

I am using mailgun, I tried all the ports and the result is the same. I also tried to use Amazon's SES and looks like it also return the same error

igrir avatar May 01 '23 19:05 igrir

this is the result from my journalctl logs

May 16 04:08:45 www.gimid.dev forem-rails[239274]: I, [2023-05-16T04:08:45.003233 #7]  INFO -- : [eb1eadd0-1e6b-4ba9-aa33-2d22f43cf6db] [dd.env=production dd.service=rails-production dd.trace_id=1537542653877818210 dd.span_id=0] Started POST "/admin/member_manager/users/3/send_email" for 185.213.83.248 at 2023-05-16 04:08:45 +0000
May 16 04:08:45 www.gimid.dev forem-rails[239274]: I, [2023-05-16T04:08:45.015927 #7]  INFO -- : [eb1eadd0-1e6b-4ba9-aa33-2d22f43cf6db] [dd.env=production dd.service=rails-production dd.trace_id=1537542653877818210 dd.span_id=0] Processing by Admin::UsersController#send_email as HTML
May 16 04:08:45 www.gimid.dev forem-rails[239274]: I, [2023-05-16T04:08:45.016738 #7]  INFO -- : [eb1eadd0-1e6b-4ba9-aa33-2d22f43cf6db] [dd.env=production dd.service=rails-production dd.trace_id=1537542653877818210 dd.span_id=0]   Parameters: {"utf8"=>"✓", "authenticity_token"=>"[FILTERED]", "user_id"=>"3", "email_subject"=>"[FILTERED]", "email_body"=>"[FILTERED]", "button"=>"[FILTERED]", "locale"=>nil, "id"=>"3"}
May 16 04:08:45 www.gimid.dev forem-rails[239274]: I, [2023-05-16T04:08:45.031756 #7]  INFO -- : [eb1eadd0-1e6b-4ba9-aa33-2d22f43cf6db] [dd.env=production dd.service=rails-production dd.trace_id=1537542653877818210 dd.span_id=0]   Rendered mailers/notify_mailer/user_contact_email.html.erb within layouts/mailer (Duration: 0.5ms | Allocations: 175)
May 16 04:08:45 www.gimid.dev forem-rails[239274]: I, [2023-05-16T04:08:45.041357 #7]  INFO -- : [eb1eadd0-1e6b-4ba9-aa33-2d22f43cf6db] [dd.env=production dd.service=rails-production dd.trace_id=1537542653877818210 dd.span_id=0]   Rendered layout layouts/mailer.html.erb (Duration: 10.1ms | Allocations: 1796)
May 16 04:08:45 www.gimid.dev forem-rails[239274]: I, [2023-05-16T04:08:45.042816 #7]  INFO -- : [eb1eadd0-1e6b-4ba9-aa33-2d22f43cf6db] [dd.env=production dd.service=rails-production dd.trace_id=1537542653877818210 dd.span_id=0]   Rendered mailers/notify_mailer/user_contact_email.text.erb within layouts/mailer (Duration: 0.3ms | Allocations: 35)
May 16 04:08:45 www.gimid.dev forem-rails[239274]: I, [2023-05-16T04:08:45.043760 #7]  INFO -- : [eb1eadd0-1e6b-4ba9-aa33-2d22f43cf6db] [dd.env=production dd.service=rails-production dd.trace_id=1537542653877818210 dd.span_id=0]   Rendered layout layouts/mailer.text.erb (Duration: 1.2ms | Allocations: 160)
May 16 04:08:50 www.gimid.dev forem-rails[239274]: I, [2023-05-16T04:08:50.062942 #7]  INFO -- : [eb1eadd0-1e6b-4ba9-aa33-2d22f43cf6db] [dd.env=production dd.service=rails-production dd.trace_id=1537542653877818210 dd.span_id=0] Delivered mail [email protected] (5015.7ms)
May 16 04:08:50 www.gimid.dev forem-rails[239274]: I, [2023-05-16T04:08:50.065530 #7]  INFO -- : [eb1eadd0-1e6b-4ba9-aa33-2d22f43cf6db] [dd.env=production dd.service=rails-production dd.trace_id=1537542653877818210 dd.span_id=0] Completed 500 Internal Server Error in 5048ms (ActiveRecord: 2.8ms | Allocations: 9262)
May 16 04:08:50 www.gimid.dev forem-rails[239274]: F, [2023-05-16T04:08:50.067642 #7] FATAL -- : [eb1eadd0-1e6b-4ba9-aa33-2d22f43cf6db] [dd.env=production dd.service=rails-production dd.trace_id=1537542653877818210 dd.span_id=0]
May 16 04:08:50 www.gimid.dev forem-rails[239274]: [eb1eadd0-1e6b-4ba9-aa33-2d22f43cf6db] [dd.env=production dd.service=rails-production dd.trace_id=1537542653877818210 dd.span_id=0] Net::ReadTimeout (Net::ReadTimeout with #<Socket:(closed)>):
May 16 04:08:50 www.gimid.dev forem-rails[239274]: [eb1eadd0-1e6b-4ba9-aa33-2d22f43cf6db] [dd.env=production dd.service=rails-production dd.trace_id=1537542653877818210 dd.span_id=0]
May 16 04:08:50 www.gimid.dev forem-rails[239274]: [eb1eadd0-1e6b-4ba9-aa33-2d22f43cf6db] [dd.env=production dd.service=rails-production dd.trace_id=1537542653877818210 dd.span_id=0] app/controllers/admin/users_controller.rb:258:in `send_email'
May 16 04:08:50 www.gimid.dev forem-rails[239274]: [eb1eadd0-1e6b-4ba9-aa33-2d22f43cf6db] [dd.env=production dd.service=rails-production dd.trace_id=1537542653877818210 dd.span_id=0] app/lib/middlewares/set_cookie_domain.rb:12:in `call'
May 16 04:08:50 www.gimid.dev forem-rails[239274]: E, [2023-05-16T04:08:50.074478 #7] ERROR -- honeybadger: ** [Honeybadger] Unable to send error report: API key is missing. id=ed8742be-78b2-479f-a995-25783eec945f level=3 pid=7

igrir avatar May 16 '23 04:05 igrir