我正在设置 Gitlab 服务器并完成安装。
虽然 Gitlab 一切运行正常,但电子邮件地址验证失败。我收到以下错误:
Date: Wed, 08 Jan 2014 15:41:50 +0100
From: Mail Delivery System <[email protected]>
To: [email protected]
Subject: Mail failure - no recipient addresses
A message that you sent using the -t command line option contained no
addresses that were not also on the command line, and were therefore
suppressed. This left no recipient addresses, and so no delivery could
be attempted.
------ This is a copy of your message, including all the headers. ------
Date: Wed, 08 Jan 2014 15:41:50 +0100
From: [email protected]
Reply-To: [email protected]
To: [email protected]
Message-ID: <[email protected]>
Subject: Confirmation instructions
Mime-Version: 1.0
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: 7bit
<p>Welcome shade!</p>
<p>You can confirm your email ([email protected]) through the link below:</p>
<p><a href="https://git.example.com/users/confirmation?confirmation_token=XXXXXXXXXXXXX">Confirm my account</a></p>
这是 Gitlab 的一个错误,还是我搞乱了 Exim 配置?
答案1
如你看到的在 exim 命令行选项的描述中,如果使用命令行选项-t
,则从 exim 命令的标准输入(从电子邮件标题中)获取收件人,然后从命令行获取的收件人将从此列表中减去。看起来您在命令行和电子邮件标题中有相同的收件人。
如果 Gitlab 的配置允许,你可以从命令行将其删除,或者你可以使用no_extract_addresses_remove_arguments
Exim 配置中的选项,因此 Exim 尝试从命令行添加收件人而不是减去它们(重复项将被正确处理,因此您应该得到您想要的)。
答案2
根据这个问题,它是上游 Ruby 或 Exim4 中的一个错误。
有一个可用的补丁:
# diff -u /opt/gitlab/embedded/service/gitlab-rails/config/application.rb.org /opt/gitlab/embedded/service/gitlab-rails/config/application.rb
--- /opt/gitlab/embedded/service/gitlab-rails/config/application.rb.org 2014-09-11 16:21:11.641493626 +0200
+++ /opt/gitlab/embedded/service/gitlab-rails/config/application.rb 2014-09-11 16:21:51.959381839 +0200
@@ -7,6 +7,9 @@
module Gitlab
class Application < Rails::Application
+ #Fix for compatibility issue with exim as explained at https://github.com/gitlabhq/gitlabhq/issues/4866
+ config.action_mailer.sendmail_settings = { :arguments => "-i" }
+
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
之后重启 Gitlab:
gitlab-ctl restart