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

    测试结果的邮件样式为:

  • 相关阅读:
    react-redux简单使用
    jQuery——Js与jQuery的相互转换
    移除HTML5 input在type="number"时的上下小箭头
    echarts 5.0 地图
    Vue echarts 设置初始化默认高亮
    echarts 渐变色
    隐藏滚动条css
    echarts 柱状图--圆角
    echarts 气泡图--option
    Vue 圆柱体组件
  • 原文地址:https://www.cnblogs.com/smail-bao/p/5417236.html
Copyright © 2011-2022 走看看