gpt4 book ai didi

email - 使用gitlab 7.1.1外部smtp电子邮件设置还需要什么?

转载 作者:行者123 更新时间:2023-12-04 06:55:07 25 4
gpt4 key购买 nike

我知道,要在 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: <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1677757579637862566f7963643b7b777f7a3b6573646073643875797b" rel="noreferrer noopener nofollow">[email protected]</a>

并重命名该文件

/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 的电子邮件,您还需要注意其他几点吗?

最佳答案

请注意:

Gitlab uses the system configured sendmail to issue emails to users.
The recommended method is to configure your host sendmail so that it properly works and then Gitlab will successfully email as a result.

If configuring sendmail is not desirable, then Gitlab provides smtp_settings.rb which can be used to override default Gitlab email settings.
This uses ruby net::smtp to configure email.
In order to properly configure it one must know the available SMTP AUTH methods allowed by their mail provider. ruby net::smtp supports only three auth schemes: PLAIN, LOGIN, and CRAM MD5.

If you're using SMTP, make sure you change:

config.action_mailer.delivery_method = :sendmail

to

config.action_mailer.delivery_method = :smtp

in the config/environments/production.rb file.

关于email - 使用gitlab 7.1.1外部smtp电子邮件设置还需要什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25622509/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com