2014-09-02 50 views
2

我知道,要在gitlab 7.1.1中使用smtp,你需要下面的配置;在:还有什么需要使用gitlab 7.1.1外部smtp电子邮件设置?

/home/git/gitlab/config/gitlab.yml 

编辑下面一行

## Email settings 
# Email address used in the "From" field in mails sent by GitLab 
email_from: [email protected] 

并将其重命名

/home/git/gitlab/config/initializers/smtp_settings.rb.sample 

/home/git/gitlab/config/initializers/smtp_settings.rb 

和编辑以下设置:

ActionMailer::Base.smtp_settings = { 
address: "email.server.com", 
port: 456, 
user_name: "smtp", 
password: "123456", 
domain: "gitlab.company.com", 
authentication: :login, 
enable_starttls_auto: true 
} 

并重新启动GitLab实例。

为了在GitLab 7.x中使用基于smtp的电子邮件,是否还有其他要点需要注意?

回答

5

需要注意的是:

Gitlab使用系统配置sendmail发送电子邮件给用户。
推荐的方法是配置您的主机sendmail,以便它正常工作,然后Gitlab将成功发送电子邮件

如果在配置sendmail是不期望的,那么Gitlab提供smtp_settings.rb可用于覆盖默认Gitlab电子邮件设置。
这使用ruby net::smtp来配置电子邮件。
为了正确配置它,必须知道邮件提供商允许的可用SMTP AUTH方法。 ruby net::smtp仅支持三种认证方案:PLAINLOGINCRAM MD5

如果您使用SMTP,请确保您更改:

config.action_mailer.delivery_method = :sendmail 

config.action_mailer.delivery_method = :smtp 

config/environments/production.rb文件中。