gitlab can't deliver email normally

偶尔善良 提交于 2020-01-06 19:34:39

问题


I have installed the gitlab-omnibus version in my centos.It seems that everything is OK.But when a newer want to sign up, he/she must recieve the comfirm enalbe which send from gitlab.I have config the /etc/gitlab/gitlab.rb according to the gitlab's office document. And I check my var/log/email,I found the message is as follow:

Apr 22 15:05:39 iZ23syflhhzZ postfix/cleanup[5899]: 9789EC3907: message-id=<201504220705.t3M75dkU005893@iZ23syflhhzZ>
Apr 22 15:05:39 iZ23syflhhzZ sendmail[5893]: t3M75dkU005893: to=postmaster, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=32576, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as 9789EC3907)
Apr 22 15:05:39 iZ23syflhhzZ postfix/qmgr[5724]: 9789EC3907: from=<>, size=4301, nrcpt=1 (queue active)
Apr 22 15:05:39 iZ23syflhhzZ postfix/smtpd[5896]: disconnect from localhost[127.0.0.1]
Apr 22 15:05:39 iZ23syflhhzZ postfix/cleanup[5899]: A6D63C38FD: message-id=<201504220705.t3M75dkU005893@iZ23syflhhzZ>
Apr 22 15:05:39 iZ23syflhhzZ postfix/qmgr[5724]: A6D63C38FD: from=<>, size=4456, nrcpt=1 (queue active)
Apr 22 15:05:39 iZ23syflhhzZ postfix/local[5900]: 9789EC3907: to=<postmaster@iZ23syflhhzZ.localdomain>, orig_to=<postmaster@iZ23syflhhzZ>, relay=local, delay=0.1, delays=0.05/0.04/0/0.01, dsn=2.0.0, status=sent (forwarded as A6D63C38FD)
Apr 22 15:05:39 iZ23syflhhzZ postfix/qmgr[5724]: 9789EC3907: removed
Apr 22 15:05:40 iZ23syflhhzZ postfix/smtp[5902]: A6D63C38FD: to=<hiufan@qq.com>, orig_to=<postmaster@iZ23syflhhzZ>, relay=mx3.qq.com[113.108.16.62]:25, delay=0.73, delays=0.01/0.03/0.12/0.57, dsn=5.0.0, status=bounced (host mx3.qq.com[113.108.16.62] said: 550 Mail content denied. http://service.mail.qq.com/cgi-bin/help?subtype=1&&id=20022&&no=1000726 (in reply to end of DATA command))
Apr 22 15:05:40 iZ23syflhhzZ postfix/qmgr[5724]: A6D63C38FD: removed

It is very confused that I am not setting the email called hiufan@qq.com,I just setting the 066337@sina.com as the default sender email. Here is my setting of /etc/gitlab/gitlab.rb:

gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.sina.com"
gitlab_rails['smtp_port'] = 25
gitlab_rails['smtp_user_name'] = "066337@sina.com"
gitlab_rails['smtp_password'] = "xxxxxx"
gitlab_rails['smtp_domain'] = "sina.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = false

gitlab_rails['gitlab_email_from'] = "066337@sina.com"
user["git_user_email"] = "066337@sina.com"

Could anyone tell me why this happened?Thank you very much.


回答1:


Look at the second last line of the log file

to=<hiufan@qq.com>, orig_to=<postmaster@iZ23syflhhzZ>, relay=mx3.qq.com[113.108.16.62]:25, delay=0.73, delays=0.01/0.03/0.12/0.57, dsn=5.0.0, status=bounced (host mx3.qq.com[113.108.16.62] said: 550 Mail content denied.   (in reply to end of DATA command))

If hiufan@qq.com is the email address of the user registering, that indicates that the message was sent by the gitlab machine but rejected by the receiving mail server (at qq.com):

status=bounced (host mx3.qq.com[113.108.16.62] said: 550 Mail content denied

Looking at the given link (using google translate) http://service.mail.qq.com/cgi-bin/help?subtype=1&&id=20022&&no=1000726 it seems that it was rejected as it is identified as spam/bulk email. (I guess that if you do read chinese the error message makes more sense)

If so, I don't think there is much you can do at the gitlab side. You can perhaps try to edit the confirmation message template, but it is and automatically generated email and there is always a risk of a spam filter identifying it as such.




回答2:


Gitlab confirmation emails can easily be identified as spam. And QQMail is really powerful in identifying and rejecting spam.

My suggestion would be changing the config of Gitlab, to stop needing confirmation email for registration.



来源:https://stackoverflow.com/questions/29792303/gitlab-cant-deliver-email-normally

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!