zoukankan      html  css  js  c++  java
  • gitlab 配置邮箱

    摘自: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,然后我们就注册用户试验一下

    测试结果的邮件样式为:

  • 相关阅读:
    数字精确运算BigDecimal经常用法
    C3P0数据库连接池使用
    Theano学习笔记(四)——导数
    Leetcode--Merge Intervals
    1191 数轴染色
    P1021 邮票面值设计
    P1032 字串变换
    P1294 高手去散步
    P1832 A+B Problem(再升级)
    P1332 血色先锋队
  • 原文地址:https://www.cnblogs.com/smail-bao/p/5417236.html
Copyright © 2011-2022 走看看