gitlab 配置邮箱
2016-04-21 15:42
148 查看
摘自:http://www.tuicool.com/articles/ruyERz
这里我用的是263企业邮箱
这里我们用smtp发送邮件,要是系统自带有sendmail,我们就给他卸掉,yum remove sendmail
yum -y install postfix
/etc/init.c/postfix start
然后我们测试一下服务器看能不能发送邮件
echo "Test mail from postfix" | mail -s "Test Postfix" smail_bao@163.com
然后我们这里我们登录163邮箱看一下发件人是谁,
我们修改一下,gitlab.yml 文件的的email_from 就为这个地址
email_from: root@git.localdomain
email_display_name: GitLab
email_reply_to: smail_bao@163.com
注意:
发邮件的程序取的是gitlab.yml里的值,因为我们这里gitlab 用的是8080端口访问的(ubicorn.rb里定义的),所以这里我们把port也给改成8080(修改gitlab下面的port)
最后我们修改下面的内容:
cd /home/git/gitlab/config/environments
[root@git environments]# vim production.rb
config.action_mailer.delivery_method = :smtp
# Defaults to:
# # config.action_mailer.sendmail_settings = {
# # location: '/usr/sbin/sendmail',
# # arguments: '-i -t'
# # }
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
config.action_mailer.smtp_settings = {
:address => "smtp.263.net",
:port => 25,
:domain => '263.net',
:user_name => 'baoxy@yizhenmoney.com',
:password => '12345678',
:authentication => :plain,
:enable_starttls_auto => true
}
重启一下gitlab,然后我们就注册用户试验一下
测试结果的邮件样式为:
这里我用的是263企业邮箱
这里我们用smtp发送邮件,要是系统自带有sendmail,我们就给他卸掉,yum remove sendmail
yum -y install postfix
/etc/init.c/postfix start
然后我们测试一下服务器看能不能发送邮件
echo "Test mail from postfix" | mail -s "Test Postfix" smail_bao@163.com
然后我们这里我们登录163邮箱看一下发件人是谁,
我们修改一下,gitlab.yml 文件的的email_from 就为这个地址
email_from: root@git.localdomain
email_display_name: GitLab
email_reply_to: smail_bao@163.com
注意:
发邮件的程序取的是gitlab.yml里的值,因为我们这里gitlab 用的是8080端口访问的(ubicorn.rb里定义的),所以这里我们把port也给改成8080(修改gitlab下面的port)
最后我们修改下面的内容:
cd /home/git/gitlab/config/environments
[root@git environments]# vim production.rb
config.action_mailer.delivery_method = :smtp
# Defaults to:
# # config.action_mailer.sendmail_settings = {
# # location: '/usr/sbin/sendmail',
# # arguments: '-i -t'
# # }
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
config.action_mailer.smtp_settings = {
:address => "smtp.263.net",
:port => 25,
:domain => '263.net',
:user_name => 'baoxy@yizhenmoney.com',
:password => '12345678',
:authentication => :plain,
:enable_starttls_auto => true
}
重启一下gitlab,然后我们就注册用户试验一下
测试结果的邮件样式为:
相关文章推荐
- 2016阿里算法工程师笔试题 (二)
- 怎么在ZBrush中渲染漫画风格的插画
- 在CentOS系统上从零开始搭建WordPress博客的全流程记录
- 大数据面试部分摘要
- 100条经典C语言笔试题目(上)
- Android Volly源码分析之执行线程
- Spring mvc提交form包含date类型数据错误400问题。
- Nginx 下配置SSL证书的方法
- iOS屏幕旋转
- iOS图片放大的方式(transform和frame)
- id、静态类型、自省-iOS初学
- BZOJ 2337|HNOI 2011|XOR和路径|概率期望|高斯消元
- BNUOJ 4057 魔方系列——最小装箱【细节题】
- Android开发之nuwa热修复
- java面试常见题
- maven
- mybatis
- lua调试的工具选择
- maven管理本地jar包
- Could not read symbols解决方法