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

Email Digest Agent error 'Exception during check. end of file reached:' #2701

Closed
huginnhuginn opened this issue Mar 4, 2020 · 28 comments
Closed

Comments

@huginnhuginn
Copy link

huginnhuginn commented Mar 4, 2020

System Ubuntu 18.04, do not use docker, just have done all things mentioned in
https://github.com/cantino/huginn/tree/master/doc/manual
when using Email Digest Agent got error information.

the related settings:
SMTP_DOMAIN=126.com
SMTP_USER_NAME=xxxxxx@126.com
SMTP_PASSWORD=secret
SMTP_SERVER=smtp.126.com
SMTP_PORT=587
SMTP_AUTHENTICATION=plain
SMTP_ENABLE_STARTTLS_AUTO=true
SEND_EMAIL_IN_DEVELOPMENT=true

I also enable the special email setting for SMTP service and set a special key for POP3/IMAP/SMTP/Exchange/CardDAV/CalDAV service.

got the following error information:
Exception during check. end of file reached: /usr/local/lib/ruby/2.6.0/net/protocol.rb:225:in rbuf_fill' /usr/local/lib/ruby/2.6.0/net/protocol.rb:225:in rbuf_fill'
/usr/local/lib/ruby/2.6.0/net/protocol.rb:191:in readuntil' /usr/local/lib/ruby/2.6.0/net/protocol.rb:201:in readline'
/usr/local/lib/ruby/2.6.0/net/smtp.rb:950:in recv_response' /usr/local/lib/ruby/2.6.0/net/smtp.rb:553:in block in do_start'
/usr/local/lib/ruby/2.6.0/net/smtp.rb:960:in critical' /usr/local/lib/ruby/2.6.0/net/smtp.rb:553:in do_start'
/usr/local/lib/ruby/2.6.0/net/smtp.rb:518:in start' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/mail-2.7.1/lib/mail/network/delivery_methods/smtp.rb:109:in start_smtp_session'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/mail-2.7.1/lib/mail/network/delivery_methods/smtp.rb:100:in deliver!' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/mail-2.7.1/lib/mail/message.rb:2159:in do_delivery'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/mail-2.7.1/lib/mail/message.rb:260:in block in deliver' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/actionmailer-5.2.2.1/lib/action_mailer/base.rb:560:in block in deliver_mail'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/notifications.rb:168:in block in instrument' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/notifications/instrumenter.rb:23:in instrument'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/notifications.rb:168:in instrument' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/actionmailer-5.2.2.1/lib/action_mailer/base.rb:558:in deliver_mail'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/mail-2.7.1/lib/mail/message.rb:260:in deliver' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/actionmailer-5.2.2.1/lib/action_mailer/message_delivery.rb:114:in block in deliver_now'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/actionmailer-5.2.2.1/lib/action_mailer/rescuable.rb:17:in handle_exceptions' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/actionmailer-5.2.2.1/lib/action_mailer/message_delivery.rb:113:in deliver_now'
/home/huginn/huginn/app/models/agents/email_digest_agent.rb:61:in block in check' /home/huginn/huginn/app/models/agents/email_digest_agent.rb:52:in each'
/home/huginn/huginn/app/models/agents/email_digest_agent.rb:52:in check' /home/huginn/huginn/app/jobs/agent_check_job.rb:7:in perform'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/activejob-5.2.2.1/lib/active_job/execution.rb:39:in block in perform_now' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/callbacks.rb:109:in block in run_callbacks'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/i18n-1.6.0/lib/i18n.rb:297:in with_locale' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/activejob-5.2.2.1/lib/active_job/translation.rb:9:in block (2 levels) in module:Translation'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/callbacks.rb:118:in instance_exec' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/callbacks.rb:118:in block in run_callbacks'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/activejob-5.2.2.1/lib/active_job/logging.rb:26:in block (4 levels) in <module:Logging>' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/notifications.rb:168:in block in instrument'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/notifications/instrumenter.rb:23:in instrument' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/notifications.rb:168:in instrument'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/activejob-5.2.2.1/lib/active_job/logging.rb:25:in block (3 levels) in <module:Logging>' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/activejob-5.2.2.1/lib/active_job/logging.rb:46:in block in tag_logger'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/tagged_logging.rb:71:in block in tagged' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/tagged_logging.rb:28:in tagged'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/tagged_logging.rb:71:in tagged' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/activejob-5.2.2.1/lib/active_job/logging.rb:46:in tag_logger'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/activejob-5.2.2.1/lib/active_job/logging.rb:22:in block (2 levels) in <module:Logging>' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/callbacks.rb:118:in instance_exec'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/callbacks.rb:118:in block in run_callbacks' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/callbacks.rb:136:in run_callbacks'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/activejob-5.2.2.1/lib/active_job/execution.rb:38:in perform_now' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/activejob-5.2.2.1/lib/active_job/execution.rb:24:in block in execute'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/callbacks.rb:109:in block in run_callbacks' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/activejob-5.2.2.1/lib/active_job/railtie.rb:28:in block (4 levels) in class:Railtie'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/execution_wrapper.rb:87:in wrap' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/reloader.rb:73:in block in wrap'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/execution_wrapper.rb:87:in wrap' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/reloader.rb:72:in wrap'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/activejob-5.2.2.1/lib/active_job/railtie.rb:27:in block (3 levels) in <class:Railtie>' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/callbacks.rb:118:in instance_exec'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/callbacks.rb:118:in block in run_callbacks' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/callbacks.rb:136:in run_callbacks'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/activejob-5.2.2.1/lib/active_job/execution.rb:22:in execute' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/activejob-5.2.2.1/lib/active_job/queue_adapters/delayed_job_adapter.rb:42:in perform'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/delayed_job-4.1.5/lib/delayed/backend/base.rb:81:in block in invoke_job' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/delayed_job-4.1.5/lib/delayed/lifecycle.rb:61:in block in initialize'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/delayed_job-4.1.5/lib/delayed/lifecycle.rb:66:in execute' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/delayed_job-4.1.5/lib/delayed/lifecycle.rb:40:in run_callbacks'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/delayed_job-4.1.5/lib/delayed/backend/base.rb:78:in invoke_job' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/delayed_job-4.1.5/lib/delayed/worker.rb:230:in block (2 levels) in run'
/usr/local/lib/ruby/2.6.0/timeout.rb:93:in block in timeout' /usr/local/lib/ruby/2.6.0/timeout.rb:103:in timeout'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/delayed_job-4.1.5/lib/delayed/worker.rb:230:in block in run' /usr/local/lib/ruby/2.6.0/benchmark.rb:308:in realtime'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/delayed_job-4.1.5/lib/delayed/worker.rb:229:in run' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/delayed_job-4.1.5/lib/delayed/worker.rb:312:in block in reserve_and_run_one_job'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/delayed_job-4.1.5/lib/delayed/lifecycle.rb:61:in block in initialize' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/delayed_job-4.1.5/lib/delayed/lifecycle.rb:66:in execute'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/delayed_job-4.1.5/lib/delayed/lifecycle.rb:40:in run_callbacks' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/delayed_job-4.1.5/lib/delayed/worker.rb:312:in reserve_and_run_one_job'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/delayed_job-4.1.5/lib/delayed/worker.rb:213:in block in work_off' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/delayed_job-4.1.5/lib/delayed/worker.rb:212:in times'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/delayed_job-4.1.5/lib/delayed/worker.rb:212:in work_off' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/delayed_job-4.1.5/lib/delayed/worker.rb:175:in block (4 levels) in start'
/usr/local/lib/ruby/2.6.0/benchmark.rb:308:in realtime' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/delayed_job-4.1.5/lib/delayed/worker.rb:174:in block (3 levels) in start'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/delayed_job-4.1.5/lib/delayed/lifecycle.rb:61:in block in initialize' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/delayed_job-4.1.5/lib/delayed/lifecycle.rb:66:in execute'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/delayed_job-4.1.5/lib/delayed/lifecycle.rb:40:in run_callbacks' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/delayed_job-4.1.5/lib/delayed/worker.rb:173:in block (2 levels) in start'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/delayed_job-4.1.5/lib/delayed/worker.rb:172:in loop' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/delayed_job-4.1.5/lib/delayed/worker.rb:172:in block in start'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/delayed_job-4.1.5/lib/delayed/plugins/clear_locks.rb:7:in block (2 levels) in <class:ClearLocks>' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/delayed_job-4.1.5/lib/delayed/lifecycle.rb:79:in block (2 levels) in add'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/delayed_job-4.1.5/lib/delayed/lifecycle.rb:61:in block in initialize' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/delayed_job-4.1.5/lib/delayed/lifecycle.rb:79:in block in add'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/delayed_job-4.1.5/lib/delayed/lifecycle.rb:66:in execute' /home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/delayed_job-4.1.5/lib/delayed/lifecycle.rb:40:in run_callbacks'
/home/huginn/huginn/vendor/bundle/ruby/2.6.0/gems/delayed_job-4.1.5/lib/delayed/worker.rb:171:in start' /home/huginn/huginn/lib/delayed_job_worker.rb:6:in run'
/home/huginn/huginn/app/concerns/long_runnable.rb:71:in `block in run!'

@dsander
Copy link
Collaborator

dsander commented Mar 26, 2020

This looks like the smtp server isn't responding with anything after the connection has been opened. So it's either an issue with the configuration or the server.

@huginnhuginn
Copy link
Author

This looks like the smtp server isn't responding with anything after the connection has been opened. So it's either an issue with the configuration or the server.

Thank you for your reply! So, the problem may be from the email service I choose or what other configuration may be involved?
By the way, I use SSL certification from let's encrypt.

@dsander
Copy link
Collaborator

dsander commented Mar 29, 2020

Issues in the SMTP configuration are always hard to debug without having the actual configuration 😄 . Do you know if the same configuration works in a different application and/or from a different server?

@huginnhuginn
Copy link
Author

huginnhuginn commented Apr 1, 2020

Issues in the SMTP configuration are always hard to debug without having the actual configuration 😄 . Do you know if the same configuration works in a different application and/or from a different server?

Hard to verify it for me, a beginner of cloud server and such kind of applications.
Would you please tell me which file or files contain the actual configuration you mentioned?

@dsander
Copy link
Collaborator

dsander commented Apr 1, 2020

That hugely depends on the application/service. The easiest test would be to use the SMTP credentials you have configured for Huginn in your email application.

@huginnhuginn
Copy link
Author

huginnhuginn commented Apr 5, 2020

That hugely depends on the application/service. The easiest test would be to use the SMTP credentials you have configured for Huginn in your email application.

How to do such kind of test, let me have a try.
Until now, I have not installed any services related to SMTP credentials on my cloud server.
I just do the steps given in the page of installing huginn.
It seems that Postfix could send mails by SMTP, how could I make a connection between huginn and Postfix after I install Postfix. Any configuration need to be done?

@huginnhuginn
Copy link
Author

That hugely depends on the application/service. The easiest test would be to use the SMTP credentials you have configured for Huginn in your email application.

I found several service name through the web page bellow
https://www.v2ex.com/t/222048

heirloom-mailx
sendemail
postfix

do you have some recommendations? whether I could send emails instantly after I install one of service above without make any settings in huginn?

@virtadpt
Copy link
Collaborator

virtadpt commented Apr 7, 2020

Postfix. If it's configured correctly (i.e., you can use it to send email off-system), it'll work just fine with Huginn. c.f. #1657

@dsander
Copy link
Collaborator

dsander commented Apr 7, 2020

I asked the question because I wanted you and me to be sure that the configuration you are using for Huginn works with other SMTP client applications.

@huginnhuginn
Copy link
Author

I asked the question because I wanted you and me to be sure that the configuration you are using for Huginn works with other SMTP client applications.

Thank you. I did not know that I should install SMTP client. I will try Postfix then.

@huginnhuginn
Copy link
Author

Postfix. If it's configured correctly (i.e., you can use it to send email off-system), it'll work just fine with Huginn. c.f. #1657

Great thanks.

@huginnhuginn
Copy link
Author

huginnhuginn commented Apr 9, 2020

@virtadpt what do you mean by "send email off-system". I installed postfix as the webpage of https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-postfix-as-a-send-only-smtp-server-on-ubuntu-16-04
just finish the first two steps
at the third step, could not successfully send out a test mail by
echo "This is the body of the email" | mail -s "This is the subject line" your_email_address
use several different mailboxes, but did not receive the email.

Domain Name Resolution
domain | type | priority | value
huginn | A | - | 13.xx.xxx.xx (server address)
@ | MX | 5 | mx1.qiye.aliyun.com
@ | MX | 10 | mx2.qiye.aliyun.com
POP3 | CNAME | - | pop.qiye.aliyun.com
IMAP | CNAME | - | imap.qiye.aliyun.com
SMTP | CNAME | - | smtp.qiye.aliyun.com
@ | TXT | - | v=spf1 include:spf.qiye.aliyun.com -all

@virtadpt
Copy link
Collaborator

virtadpt commented Apr 9, 2020

Just that: If you can send e-mail off of your box to another account.

Where there any errors in your system logs? What happens if you try to send e-mail manually by telnetting to localhost:25?

@huginnhuginn
Copy link
Author

nothing happens in syslog after I run
echo “This is the body of the email” | mail -s "This is the subject line" xxx@126.com

$ telnet localhost 25
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused

Just that: If you can send e-mail off of your box to another account.

Where there any errors in your system logs? What happens if you try to send e-mail manually by telnetting to localhost:25?

@virtadpt
Copy link
Collaborator

Did you remember to start Postfix after configuring it? sudo systemctl start postfix.service

@huginnhuginn
Copy link
Author

after restart the service, the port worked, however the mail could not be sent out.

root@ip-xxx:~# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 ip-xxx.xxx ESMTP Postfix (Ubuntu)
ehlo localhost
250-ip-xxx.xxx
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250-DSN
250 SMTPUTF8
mail from: root@localhost
250 2.1.0 Ok
rcpt to: xxx@126.com
250 2.1.5 Ok
data
354 End data with .

Subjet: 1st mail
Hi,
r u there?
.

250 2.0.0 Ok: queued as FxxxxxxF7
quit
221 2.0.0 Bye
Connection closed by foreign host.

the message in mail.log

Apr 11 05:00:56 ip-xxx postfix/smtp[12132]: connect to 126mx01.mxmail.netease.com[220.181.15.140]:25: Connection timed out
Apr 11 05:01:06 ip-xxx postfix/smtp[12133]: connect to 126mx03.mxmail.netease.com[220.181.15.196]:25: Connection timed out
Apr 11 05:01:06 ip-xxx postfix/smtp[12135]: connect to 126mx02.mxmail.netease.com[220.181.15.145]:25: Connection timed out
Apr 11 05:01:06 ip-xxx postfix/smtp[12134]: connect to 126mx01.mxmail.netease.com[220.181.15.131]:25: Connection timed out
Apr 11 05:01:26 ip-xxx postfix/smtp[12132]: connect to 126mx02.mxmail.netease.com[220.181.15.153]:25: Connection timed out
Apr 11 05:01:36 ip-xxx postfix/smtp[12133]: connect to 126mx01.mxmail.netease.com[220.181.15.132]:25: Connection timed out
Apr 11 05:01:36 ip-xxx postfix/smtp[12134]: connect to 126mx03.mxmail.netease.com[220.181.15.199]:25: Connection timed out
Apr 11 05:01:36 ip-xxx postfix/smtp[12135]: connect to 126mx02.mxmail.netease.com[220.181.15.144]:25: Connection timed out
Apr 11 05:01:56 ip-xxx postfix/smtp[12132]: connect to 126mx01.mxmail.netease.com[220.181.15.141]:25: Connection timed out
Apr 11 05:02:06 ip-xxx postfix/smtp[12133]: connect to 126mx03.mxmail.netease.com[220.181.15.197]:25: Connection timed out
Apr 11 05:02:06 ip-xxx postfix/smtp[12134]: connect to 126mx01.mxmail.netease.com[220.181.15.136]:25: Connection timed out
Apr 11 05:02:06 ip-xxx postfix/smtp[12135]: connect to 126mx03.mxmail.netease.com[220.181.15.196]:25: Connection timed out
Apr 11 05:02:26 ip-xxx postfix/smtp[12132]: connect to 126mx01.mxmail.netease.com[220.181.15.138]:25: Connection timed out
Apr 11 05:02:36 ip-xxx postfix/smtp[12133]: connect to 126mx02.mxmail.netease.com[220.181.15.152]:25: Connection timed out
Apr 11 05:02:36 ip-xxx postfix/smtp[12134]: connect to 126mx03.mxmail.netease.com[220.181.15.195]:25: Connection timed out
Apr 11 05:02:36 ip-xxx postfix/smtp[12135]: connect to 126mx01.mxmail.netease.com[220.181.15.132]:25: Connection timed out

@virtadpt
Copy link
Collaborator

The SMTP server on the other side (126mx03.mxmail.netease.com) isn't listening on port 25/tcp.

How do you have Postfix configured? As a regular SMTP server? Or a smart relay sending mail to another SMTP server?

@huginnhuginn
Copy link
Author

where can I check the setting, /etc/postfix/main.cf?
actually I have a hostname, xxxxxx.com, but did not change the myhostname to xxxxxx.com.

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = ip-xx-xxx-xxx-xxx.ap-northeast-2.compute.internal
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, localhost.$mydomain, $mydomain
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only
inet_protocols = all
home_mailbox = Maildir/
virtual_alias_maps = hash:/etc/postfix/virtual

The SMTP server on the other side (126mx03.mxmail.netease.com) isn't listening on port 25/tcp.

How do you have Postfix configured? As a regular SMTP server? Or a smart relay sending mail to another SMTP server?

@virtadpt
Copy link
Collaborator

Wait, you're running in AWS? That could be your problem. You can't just send SMTP out from AWS hosts. You have to send outbound SMTP through SES.

https://aws.amazon.com/ses/

@huginnhuginn

This comment has been minimized.

@huginnhuginn
Copy link
Author

@dsander @virtadpt
Thank you for your help!
Now, I can send emails using postfix through SES provided by Amazon!
My issue still exists. How does huginn send email to outside? Does huginn send email to 127.0.0.1:25 to postfix, or something else?
What should I do next?
Seems that I am close to send email using huginn, lol~

@virtadpt
Copy link
Collaborator

It does, and it should. That part of configuration takes places in huginn/.env. Here's what mine looks like:

...
SMTP_DOMAIN=my.huginn.here.example.com
SMTP_USER_NAME=
SMTP_PASSWORD=
SMTP_SERVER=localhost
SMTP_PORT=25
SMTP_AUTHENTICATION=
SMTP_ENABLE_STARTTLS_AUTO=
...

The settings I didn't need I left blank.

@huginnhuginn
Copy link
Author

huginnhuginn commented Apr 19, 2020

Success! Thank you!

seems that EMIAL_FROM_ADDRESS could be anything
EMAIL_FROM_ADDRESS=test@example.com

What will be different if I set the following configuration true?

SMTP_OPENSSL_VERIFY_MODE=false
# Set to true to send real emails via SMTP when running in the development Rails environment.

@virtadpt
Copy link
Collaborator

Yes, it can. The value of EMAIL_FROM_ADDRESS is the default e-mail address to mail from.

What SMTP_OPENSSL_VERIFY_MODE does is tell Huginn's SMTP subsystem to verify the SSL certificate of the SMTP server it uses as a relay. Because you've configured it to use the one on localhost, you can safely leave this set to false.

@huginnhuginn
Copy link
Author

Yes, it can. The value of EMAIL_FROM_ADDRESS is the default e-mail address to mail from.

What SMTP_OPENSSL_VERIFY_MODE does is tell Huginn's SMTP subsystem to verify the SSL certificate of the SMTP server it uses as a relay. Because you've configured it to use the one on localhost, you can safely leave this set to false.

Thank you!

@huginnhuginn
Copy link
Author

@virtadpt It seems that I still could not receive my afternoon digest.
Right now, I will not receive the error message from the right top corner of the huginn system.
The mail could be sent maybe, but I could not receive it.
One possible reason is I am running SES in the sandbox. But when I "run now" the accumulated error message in my Background Jobs page, I could receive the afternoon digest before through a verified special email box in SES.
Let me see whether I could receive the afternoon digest tomorrow, amazon just give me the right to run SES out of the sandbox.

@virtadpt
Copy link
Collaborator

You have to request that your SES access be taken out of the sandbox.

https://docs.aws.amazon.com/ses/latest/DeveloperGuide/request-production-access.html

@huginnhuginn
Copy link
Author

You have to request that your SES access be taken out of the sandbox.

https://docs.aws.amazon.com/ses/latest/DeveloperGuide/request-production-access.html

Yesterday, amazon accept my request to take the SES out of the sandbox. I can receive the email right now.

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

3 participants