8000 How to config email for gitlab setting with alimail · Issue #16 · joephon/blog · GitHub
[go: up one dir, main page]

Skip to content

How to config email for gitlab setting with alimail #16

Open

Description

@joephon

Dependencies

  • gitlab

  • docker

Step 1 edit gitlab.rb file

sudo vim /srv/gitlab/config/gitlab.rb    #denpens on your config path
### your/config/path/gitlab.rb

### Email Settings
gitlab_rails['gitlab_email_enabled'] = true
gitlab_rails['gitlab_email_from'] = 'git@newteo.com'   # should be as well as gitlab_rails['smtp_user_name']
gitlab_rails['gitlab_email_display_name'] = 'newTeo'
gitlab_rails['gitlab_email_reply_to'] = 'noreply@newteo.com'

gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.mxhichina.com"
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_user_name'] = "git@newteo.com"
gitlab_rails['smtp_password'] = "[your ali mail password]"
gitlab_rails['smtp_domain'] = "smtp.mxhichina.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true
gitlab_rails['smtp_openssl_verify_mode'] = 'none'

Step 2 save gitlab.rb file and run reconfigure

sudo docker exec gitlab gitlab-ctl reconfigure

Step 3 get in docker image and run some command to test whether email feature is ok or not

sudo docker exec -it gitlab bash   // get in docker image

gitlab-rails console production   // get int rails console

Notify.test_email('your@mail.com', 'Message title', 'Message body').deliver_now   // send test mail

Bingo~

go to check out your mail inbox

这篇文章价值一块钱

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0