Homeland Docker 部署阿里云,邮件发送出错

phantomk9 · 2019年07月10日 · 最后由 phantomk9 回复于 2019年07月10日 · 297 次阅读

Docker 部署阿里云,无法发送邮件,报错信息如下

--------------------------------------------------

#<EOFError: 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: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/app/homeland/vendor/bundle/ruby/2.6.0/gems/mail-2.7.1/lib/mail/network/delivery_methods/smtp.rb:109:in `start_smtp_session'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/mail-2.7.1/lib/mail/network/delivery_methods/smtp.rb:100:in `deliver!'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/mail-2.7.1/lib/mail/message.rb:2159:in `do_delivery'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/mail-2.7.1/lib/mail/message.rb:260:in `block in deliver'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/actionmailer-5.2.3/lib/action_mailer/base.rb:560:in `block in deliver_mail'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/notifications.rb:168:in `block in instrument'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/notifications.rb:168:in `instrument'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/actionmailer-5.2.3/lib/action_mailer/base.rb:558:in `deliver_mail'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/mail-2.7.1/lib/mail/message.rb:260:in `deliver'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/actionmailer-5.2.3/lib/action_mailer/message_delivery.rb:114:in `block in deliver_now'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/actionmailer-5.2.3/lib/action_mailer/rescuable.rb:17:in `handle_exceptions'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/actionmailer-5.2.3/lib/action_mailer/message_delivery.rb:113:in `deliver_now'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/actionmailer-5.2.3/lib/action_mailer/delivery_job.rb:16:in `perform'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activejob-5.2.3/lib/active_job/execution.rb:39:in `block in perform_now'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:109:in `block in run_callbacks'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/i18n-1.6.0/lib/i18n.rb:297:in `with_locale'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activejob-5.2.3/lib/active_job/translation.rb:9:in `block (2 levels) in <module:Translation>'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:118:in `instance_exec'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:118:in `block in run_callbacks'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activejob-5.2.3/lib/active_job/logging.rb:26:in `block (4 levels) in <module:Logging>'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/notifications.rb:168:in `block in instrument'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/notifications.rb:168:in `instrument'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activejob-5.2.3/lib/active_job/logging.rb:25:in `block (3 levels) in <module:Logging>'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activejob-5.2.3/lib/active_job/logging.rb:46:in `block in tag_logger'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/tagged_logging.rb:71:in `block in tagged'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/tagged_logging.rb:28:in `tagged'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/tagged_logging.rb:71:in `tagged'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activejob-5.2.3/lib/active_job/logging.rb:46:in `tag_logger'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activejob-5.2.3/lib/active_job/logging.rb:22:in `block (2 levels) in <module:Logging>'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:118:in `instance_exec'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:118:in `block in run_callbacks'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:136:in `run_callbacks'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activejob-5.2.3/lib/active_job/execution.rb:38:in `perform_now'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activejob-5.2.3/lib/active_job/execution.rb:24:in `block in execute'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:109:in `block in run_callbacks'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activejob-5.2.3/lib/active_job/railtie.rb:28:in `block (4 levels) in <class:Railtie>'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/execution_wrapper.rb:87:in `wrap'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/reloader.rb:73:in `block in wrap'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/execution_wrapper.rb:83:in `wrap'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/reloader.rb:72:in `wrap'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activejob-5.2.3/lib/active_job/railtie.rb:27:in `block (3 levels) in <class:Railtie>'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:118:in `instance_exec'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:118:in `block in run_callbacks'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:136:in `run_callbacks'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activejob-5.2.3/lib/active_job/execution.rb:22:in `execute'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activejob-5.2.3/lib/active_job/queue_adapters/sidekiq_adapter.rb:42:in `perform'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/sidekiq-5.2.3/lib/sidekiq/processor.rb:185:in `execute_job'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/sidekiq-5.2.3/lib/sidekiq/processor.rb:167:in `block (2 levels) in process'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/sidekiq-5.2.3/lib/sidekiq/middleware/chain.rb:128:in `block in invoke'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/sidekiq-5.2.3/lib/sidekiq/middleware/chain.rb:133:in `invoke'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/sidekiq-5.2.3/lib/sidekiq/processor.rb:166:in `block in process'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/sidekiq-5.2.3/lib/sidekiq/processor.rb:137:in `block (6 levels) in dispatch'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/sidekiq-5.2.3/lib/sidekiq/job_retry.rb:108:in `local'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/sidekiq-5.2.3/lib/sidekiq/processor.rb:136:in `block (5 levels) in dispatch'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/sidekiq-5.2.3/lib/sidekiq/rails.rb:42:in `block in call'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/execution_wrapper.rb:87:in `wrap'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/reloader.rb:73:in `block in wrap'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/execution_wrapper.rb:87:in `wrap'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/reloader.rb:72:in `wrap'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/sidekiq-5.2.3/lib/sidekiq/rails.rb:41:in `call'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/sidekiq-5.2.3/lib/sidekiq/processor.rb:132:in `block (4 levels) in dispatch'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/sidekiq-5.2.3/lib/sidekiq/processor.rb:243:in `stats'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/sidekiq-5.2.3/lib/sidekiq/processor.rb:127:in `block (3 levels) in dispatch'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/sidekiq-5.2.3/lib/sidekiq/job_logger.rb:8:in `call'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/sidekiq-5.2.3/lib/sidekiq/processor.rb:126:in `block (2 levels) in dispatch'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/sidekiq-5.2.3/lib/sidekiq/job_retry.rb:73:in `global'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/sidekiq-5.2.3/lib/sidekiq/processor.rb:125:in `block in dispatch'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/sidekiq-5.2.3/lib/sidekiq/logging.rb:48:in `with_context'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/sidekiq-5.2.3/lib/sidekiq/logging.rb:42:in `with_job_hash_context'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/sidekiq-5.2.3/lib/sidekiq/processor.rb:124:in `dispatch'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/sidekiq-5.2.3/lib/sidekiq/processor.rb:165:in `process'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/sidekiq-5.2.3/lib/sidekiq/processor.rb:83:in `process_one'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/sidekiq-5.2.3/lib/sidekiq/processor.rb:71:in `run'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/sidekiq-5.2.3/lib/sidekiq/util.rb:16:in `watchdog'
/home/app/homeland/vendor/bundle/ruby/2.6.0/gems/sidekiq-5.2.3/lib/sidekiq/util.rb:25:in `block in safe_thread'

邮箱配置如下

mailer_provider=smtp
mailer_sender=mymail@163.com
mailer_options_address=smtp.163.com
mailer_options_port=465
mailer_options_domain=163.com
mailer_options_user_name=mymail@163.com
mailer_options_password=mypwd
mailer_options_authentication=plain
mailer_options_enable_starttls_auto=true
共收到 2 条回复

如果在自己机器可以发送,大概率不是程序问题;而是阿里云端口封禁的问题

robertyu 回复

不是端口问题,阿里云默认封 25 端口。换成 gmail 可以了,估计是 163 的问题

huacnlee 关闭了讨论 07月19日 10:38
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册