GITLAB email不发送腾讯企业邮箱解决方案

废话不说,直接给思路

gitlab重部署后新加用户不发送激活邮件,配置如下:

gitlab_rails['smtp_enable']=true
gitlab_rails['smtp_address']="smtp.exmail.qq.com"
gitlab_rails['smtp_port']=465
gitlab_rails['smtp_user_name']="[email protected]"
gitlab_rails['smtp_password']="pass"
gitlab_rails['smtp_domain']="doamin.com"
gitlab_rails['smtp_authentication']="login"
gitlab_rails['smtp_enable_starttls_auto']=true
gitlab_rails['smtp_tls']=true
gitlab_rails['gitlab_email_from']="[email protected]"
  1. 首先确认配置没问题
  2. 查看日志production.log, 也没有给出错误信息
  3. 开大招 sudo gitlab-rails console production
irb(main):001:0> ActionMailer::Base.delivery_method
=> :smtp
确保method为smtp,错了就是配置写错了或者没被正确加载

irb(main):002:0> ActionMailer::Base.smtp_settings
=> {:address=>"localhost", :port=>25, :domain=>"localhost.localdomain", :user_name=>nil, :password=>nil, :authentication=>nil, :enable_starttls_auto=>true}`
确保配置是我们要的

irb(main):003:0> Notify.test_email('[email protected]', 'Hello World', 'This is a test message').deliver_now
发送测试邮件,此时会打印详细错误
TX返回一个553的错误和一个链接地址 http://service.mail.qq.com/cgi-bin/help?subtype=1&&id=28&&no=1001256

此时真相大白,用第三方客户端登录QQ邮箱需要用授权码代替密码

你可能感兴趣的:(git)