无法从GitLab发送邮件

时间:2015-11-03 08:45:34

标签: exchange-server gitlab gitlab-omnibus

我正在尝试将GitLab配置为使用Microsoft Exchange发送邮件,但它不起作用,没有从gitlab向用户发送电子邮件

这是我的配置:

gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "mail.company.com"
gitlab_rails['smtp_port'] = 25
gitlab_rails['smtp_user_name'] = "gitlab@company.com"
gitlab_rails['smtp_password'] = "PASSWORD"

我还用Java邮件实现了一段代码,并成功发送邮件,这里是Java Mail配置:

final String username = "gitlab@company.com";
final String password = "PASSWORD";
properties.put("mail.smtp.host", "mail.company.com");
properties.put("mail.smtp.port", "25");
properties.put("mail.transport.protocol", "smtp");

有人能指出如何解决这个问题吗?

3 个答案:

答案 0 :(得分:0)

完整的交换配置还应包含以下行:

gitlab_rails['smtp_domain'] = "smtp.company.com" # SMTP domain to use
gitlab_rails['smtp_authentication'] = "login" # Use login credentials

Source

答案 1 :(得分:0)

  

我正在尝试将GitLab配置为使用Microsoft Exchange发送邮件

在OP后3年以上的{em> GitLab 11.7 (January 22nd, 2019)前,这不可能/容易。

请参见“ GitLab now supports Microsoft Exchange and Google Groups for incoming email features like Service Desk

  

从GitLab 11.7开始,您现在可以将Microsoft Exchange或Google网上论坛与配置为电子邮件服务器的自我管理的GitLab实例一起使用,在设置传入电子邮件功能时为您提供更多选择。

     

以前,只有您的电子邮件服务器支持 sub-addressing 时,这些功能才可用于自助GitLab用户。 (illustrated here
  Microsoft Exchange和Google网上论坛不支持子地址。

     

GitLab 11.7现在支持子地址和全部电子邮件邮箱,从而与确实提供全部电子邮件邮箱的这两个流行选项兼容。

看到configuration example(用于Omnibus安装)

 gitlab_rails['incoming_email_enabled'] = true

 # The email address including the `%{key}` placeholder that will be replaced to reference the item being replied to.
 # The placeholder can be omitted but if present, it must appear in the "user" part of the address (before the `@`).
 # Exchange does not support sub-addressing, so a catch-all mailbox must be used.
 gitlab_rails['incoming_email_address'] = "incoming-%{key}@exchange.example.com"

 # Email account username
 # Typically this is the userPrincipalName (UPN)
 gitlab_rails['incoming_email_email'] = "incoming@ad-domain.example.com"
 # Email account password
 gitlab_rails['incoming_email_password'] = "[REDACTED]"

 # IMAP server host
 gitlab_rails['incoming_email_host'] = "exchange.example.com"
 # IMAP server port
 gitlab_rails['incoming_email_port'] = 993
 # Whether the IMAP server uses SSL
 gitlab_rails['incoming_email_ssl'] = true

是的,GitLab的所有所有版本均可用,包括Core“ CE”一个(“社区版”,免费)。
参见release notes

  

GitLab具有一些使用传入电子邮件的出色功能,例如,通过电子邮件进行回复,通过电子邮件进行新发行,通过电子邮件进行新合并请求以及服务台。以前,只有使用配置为使用子地址的电子邮件服务器,您才能利用这些功能。

     

在此版本中,GitLab现在使用新的电子邮件格式同时支持子地址和所有电子邮件邮箱,从而允许更多的电子邮件服务器与GitLab一起使用,包括Microsoft Exchange和Google网上论坛(不支持寻址)。

答案 2 :(得分:0)

我遇到了同样的问题,并设法使用此配置修复了它:

gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.company.com"
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_user_name'] = "gitlab@company.com"
gitlab_rails['smtp_password'] = 'PASS'
gitlab_rails['smtp_domain'] = "smtp.company.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
#gitlab_rails['smtp_tls'] = false
gitlab_rails['gitlab_email_from'] = 'gitlab@conpany.com'
相关问题