Can not send a test Email

When I tried to send a test email to myself, :scream:
I encountered an error, and the Discourse was reported as follows

Started POST "/admin/email/test" for 124.42.83.34 at 2020-01-06 08:27:20 +0000
Processing by Admin::EmailController#test as */*
  Parameters: {"email_address"=>"guox@goodrain.com"}
  Rendering layouts/email_template.html.erb
  Rendered layouts/email_template.html.erb (Duration: 0.3ms | Allocations: 139)
Started GET "/" for 127.0.0.1 at 2020-01-06 08:27:21 +0000
Started GET "/" for 127.0.0.1 at 2020-01-06 08:27:24 +0000
Failed to process hijacked response correctly : execution expired
Started GET "/" for 127.0.0.1 at 2020-01-06 08:27:27 +0000
Sent file /var/www/discourse/tmp/avatar_proxy/9fe312e4bd053bde564fb6bc22fc2f370d4fcf73.png (0.2ms)
Sent file /var/www/discourse/tmp/avatar_proxy/9fe312e4bd053bde564fb6bc22fc2f370d4fcf73.png (0.2ms)
Started GET "/" for 127.0.0.1 at 2020-01-06 08:27:30 +0000
Started GET "/" for 127.0.0.1 at 2020-01-06 08:27:33 +0000
Delivered mail 2b8e708d-43f4-4231-b907-172523b9d966@t.goodrain.com (30003.7ms)
Job exception: execution expired

  Rendering user_notifications/digest.html.erb within layouts/email_template
  Rendered user_notifications/digest.html.erb within layouts/email_template (Duration: 43.5ms | Allocations: 13817)
  Rendering user_notifications/digest.text.erb
  Rendered user_notifications/digest.text.erb (Duration: 86.9ms | Allocations: 18787)
Delivered mail 2c563496-332e-4a1a-b07f-a74b7d056ddf@t.goodrain.com (30003.3ms)
Job exception: execution expired

  Rendering user_notifications/digest.html.erb within layouts/email_template
  Rendered user_notifications/digest.html.erb within layouts/email_template (Duration: 43.0ms | Allocations: 13773)
  Rendering user_notifications/digest.text.erb
  Rendered user_notifications/digest.text.erb (Duration: 55.8ms | Allocations: 18752)
Delivered mail 1e65250b-1294-4469-89de-ee691c6e8e65@t.goodrain.com (30003.7ms)
Job exception: execution expired

  Rendering user_notifications/digest.html.erb within layouts/email_template
  Rendered user_notifications/digest.html.erb within layouts/email_template (Duration: 45.0ms | Allocations: 13773)
  Rendering user_notifications/digest.text.erb
  Rendered user_notifications/digest.text.erb (Duration: 50.8ms | Allocations: 18752)
Delivered mail ea5724f6-e683-4ba2-8ca1-50bc6e663cea@t.goodrain.com (30003.5ms)
Job exception: execution expired

  Rendering user_notifications/digest.html.erb within layouts/email_template
  Rendered user_notifications/digest.html.erb within layouts/email_template (Duration: 45.5ms | Allocations: 13774)
  Rendering user_notifications/digest.text.erb
  Rendered user_notifications/digest.text.erb (Duration: 55.0ms | Allocations: 19021)
Delivered mail a01ada98-0146-495d-93b8-cb3b77f15e3c@t.goodrain.com (30009.7ms)
Job exception: execution expired

My mailbox configuration is as follows

DISCOURSE_SMTP_ADDRESS = smtp.ym.163.com
DISCOURSE_SMTP_USER_NAME = t@goodrain.com
DISCOURSE_SMTP_PASSWORD = mypass
DISCOURSE_SMTP_AUTHENTICATION = LOGIN
DISCOURSE_SMTP_PORT = 25

My company has already used the corporate mailbox of netease, so I don’t want to try to use Mailgun immediately. Can my problem be solved?

:smiley: Waiting on line.

1 Like

so registration email was send as shown in the guide discourse/INSTALL-cloud.md at master · discourse/discourse · GitHub?
So the setup should be correct.

Have you tried to send an email doing telnet/openssl as described in Troubleshooting email on a new Discourse install

2 Likes

Thanks for your reply. According to the guidelines, I tried to use SWAKS to manually test my configuration, and it worked. I want to know how to set up in Discourse, which can work like this.

PS: I must admit that I used MAILGUN without binding credit card to complete the registration process of Discourse.

1 Like

I work in Beijing China. Does this have anything to do with the time zone? Just a guess :thinking:

have you tried the same from with the container as explained in Advanced Troubleshooting with Docker

quote of command
1 Like

Yes, I tried, but it didn’t solve my problem.
But this gives me a new idea on whether I can send an email in a Rails shell and debug it.
I should comment on the quoted post to explain my thoughts. :smiley:

(moved from Advanced Troubleshooting with Docker)

Hello, I need some help.
Please give me an example of sending mail in Rails c shell for me to debug my mail sending problems.
see also
Can not send a test Email

You can run

./discourse-doctor 

Did you look at Troubleshooting email on a new Discourse install?

There is also

rake emails:test[user@domain]
1 Like

Thanks for your reply.
Following your instructions, I tried the new configuration, and doctor replied to me with the following error. I think my request has reached the SMTP provider.

root@iZj6chkije5xk0gfyvcrzyZ:~/discourse_docker# docker exec -w /var/www/discourse -i web_only rake emails:test[guox@goodrain.com]
Testing sending to guox@mydomain using user@mydomain:mypass@smtp.ym.163.com:587.
======================================== ERROR ========================================
                                    UNEXPECTED ERROR

500 5.5.1 Invalid command


====================================== SOLUTION =======================================
This is not a common error. No recommended solution exists!

Please report the exact error message above to https://meta.discourse.org/
(And a solution, if you find one!)
=======================================================================================

My current configuration

DISCOURSE_SMTP_ADDRESS: smtp.ym.163.com
  DISCOURSE_SMTP_PORT: 587
  DISCOURSE_SMTP_USER_NAME: user@mydomain
  DISCOURSE_SMTP_PASSWORD: password
  DISCOURSE_SMTP_ENABLE_START_TLS: false        # (optional, default true)
  DISCOURSE_SMTP_OPENSSL_VERIFY_MODE: none
  DISCOURSE_SMTP_AUTHENTICATION: login

How did you install discourse?

Using an Opensource PaaS product, in fact,Eventually it runs on aliyun-cloud.
I have not yet tried to translate the deployment document I wrote into English, if you are interested, you can have a look at this :smile:


I hope you don’t mind what i did.

But even though I deployed discourse in the way of docker in the aliyun cloud VM, I still encountered the same problem.

Hmm. Well, I would stick with a standard install while you figure this out. You might get more clues using the web interface and looking at the rails production log.

I see, i will still do with this problem.I will be back, once I reslove it.

1 Like