Gitlab无法发送电子邮件

时间:2014-09-03 14:07:57

标签: email smtp gitlab mail-server

我在/etc/gitlab/gitlab.rb中设置了以下配置

gitlab_rails['gitlab_email_from'] = 'testing@mydom.com'
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = 'secure.emailsrvr.com'
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_user_name'] = 'testing@mydom.com'
gitlab_rails['smtp_password'] = 'password'
gitlab_rails['smtp_domain'] = 'mydom.info'
gitlab_rails['smtp_authentication'] = 'login'
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true

注意:我已尝试将smtp_domain设置为mydom.com以防万一,但仍然没有变化。

在管理面板中的sidekiq下,我收到以下错误:

Worker: Sidekiq::Extensions::DelayedMailer
Arguments:"---\n- !ruby/class 'Notify'\n- :project_access_granted_email\n- - 68\n"
Error: ActiveRecord::ConnectionTimeoutError: could not obtain a database connection within 5.000 seconds (waited 5.000 seconds)

Worker: Sidekiq::Extensions::DelayedMailer
Arguments: "---\n- !ruby/class 'Notify'\n- :group_access_granted_email\n- - 32\n"
Error: ActiveRecord::RecordNotFound: Couldn't find UsersGroup with 'id'=32

这是/opt/gitlab/embedded/service/gitlab-rails/config/environments/production.rb中的等效内容

  config.action_mailer.delivery_method = :smtp
  config.action_mailer.smtp_settings = {
   :address => 'secure.emailsrvr.com',
   :port => 465,
   :domain => 'mydom.info',
   :authentication => :login,
   :user_name => 'testing@mydom.com',
   :password => 'password',
   :enable_starttls_auto => true,
   :tls => true
  }

编辑 至少我可以用它来测试这些配置是否正确?

1 个答案:

答案 0 :(得分:1)

这是配置细节不正确的问题。