Make Better Things



I like to make better things.

GitLab 5.3 email (SMTP) setup

If you want to send gitlab emails using your gmail account (or other SMTP account), follow these steps.

1) Open /home/git/gitlab/config/environments/production.rb

(mac server users can go to usual /Users/git/gitlab…)

2) Comment this below line in code -

	config.action_mailer.delivery_method = :sendmail

3) Add this just above “end” of file

	 config.action_mailer.delivery_method = :smtp
 	 config.action_mailer.smtp_settings = {
	      :address => 'gmail.com',
	      :port => 467,
	      :domain => 'gitlab.yourserver.com',
	      :authentication => :plain,
	      :user_name => 'your gmail id',
	      :password => 'yourPassword',
	      :enable_starttls_auto => true
	  }

To know more on parameters see this http://api.rubyonrails.org/classes/ActionMailer/Base.html

4) Done! You can check for setup now. Just make sure you change it every time after your gitlab updating.

Category: git, gitlab

Tagged: ,

2 Responses

  1. Ole says:

    my hair is lying in chunks around me…
    I would so much like to just use my ISP smtp and this is my setup
    No password is req.

    # Disable delivery errors, bad email addresses will be ignored
    config.action_mailer.raise_delivery_errors = true
    config.action_mailer.delivery_method = :smtp
    config.action_mailer.perform_deliveries = true
    config.action_mailer.smtp_settings = {
    :address => ‘smtp.ipvision.dk’,
    :port => 25
    }

    why does this not work? I am running on a virtual instance of gitlab from bitnami.

    Have also tried the code above and that does not work either. should it not be port 587 and smtp.gmail.com in address?

  2. Martin Dreher says:

    Just a heads up, in the newer versions you have to instead create
    a script at: ‘/home/git/gitlab/config/initializers/smpt_settings.rb’
    which you can base off of ‘/home/git/gitlab/config/initializers/smpt_settings.rb.sample’ (check the github repository at https://github.com/gitlabhq/gitlabhq/blob/master/config/initializers/smtp_settings.rb.sample if your version does not have it).

Leave a Reply