【问题标题】:Gitlab and Exim conflicting 'from' addresses when sending emails发送电子邮件时,Gitlab 和 Exim 冲突的“发件人”地址
【发布时间】:2016-12-21 21:08:00
【问题描述】:

我在 CentOS 7 上安装了 Gitlab 8.15 和 Exim 4.84

每当 Gitlab 发送消息时,它都应该来自 'gitlab@mydomain.nl',它在 config/gitlab.yml 中正确设置。

如果我查看日志,我会看到以下内容:

2016-12-21 21:50:02 cwd=/ 6 args: /usr/sbin/sendmail -i -f gitlab@mydomain.nl -- mypersonal@gmail.com
2016-12-21 21:50:02 1cJnpq-0001ZR-NG <= git@vps.mydomain.nl U=git P=local S=3859 id=585aeafaad130_175126f0b9c43854@vps.mydomain.nl.mail T="Reset password instructions" from <git@vps.mydomain.nl> for mypersonal@gmail.com

请注意,在这两行之间,发件人地址从 gitlab@mydomain.nl 更改为基于 user@FQDNgit@vps.mydomain.nl

然后,我的外部 SMTP 服务器在 vps.mydomain.nl 而不是 mydomain.nl 上执行 DKIM 和 SPF 查找,查找失败并且邮件被拒绝。

我不确定这个变化发生在哪里以及我应该如何解决这个问题。这是 Gitlab 方面的东西还是 Exim 方面的东西?

我的 exim 配置中的相关部分:

begin routers
mysmtphost_email:
  driver = manualroute
  domains = ! +local_domains
  ignore_target_hosts = 127.0.0.0/8
  transport = mysmtphost_relay
  route_list = * vps.mysmtphost.email::587
  no_more

(...)

begin transports
mysmtphost_relay:
  driver = smtp
  port = 587
  hosts_require_auth = <; $host_address
  hosts_require_tls = <; $host_address

【问题讨论】:

    标签: gitlab exim


    【解决方案1】:

    刚刚发现用户git 不是exim.conf 文件中trusted_users 指令的一部分。我将其更改为包含用户,如下所示: trusted_users = mail:apache:passenger:git

    我得出这个结论是因为其他 Rails 应用程序以用户 passenger 发送的邮件按照发件人地址的指定正确发送。然后我注意到passenger 是该指令的一部分,而git 不是。

    来自 Exim 文档:

    始终允许受信任的用户使用 -f 选项或前导 “发件人”行指定邮件的信封发件人 通过本地接口传递给 Exim(参见 -bm 和 -f 选项 以下)。请参阅 untrusted_set_sender 选项以获取允许的方式 不受信任的用户设置信封发件人。

    http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html#SECTtrustedadmin

    以 root 或 Exim 用户身份运行的进程始终是受信任的。其他 受信任的用户由trusted_users 或trusted_groups 定义 选项。在没有 -f 的情况下,或者如果调用者不受信任,则 本地消息的发送者设置为呼叫者的登录名 默认限定域。

    【讨论】:

      猜你喜欢
      • 2016-01-21
      • 1970-01-01
      • 2015-06-27
      • 1970-01-01
      • 2011-07-21
      • 2011-05-31
      • 2012-06-24
      • 2011-07-01
      • 1970-01-01
      相关资源
      最近更新 更多