Gitlab emails for community edition

Hello all,

My company is using the GitLab Community Edition and I have the task of setting up SMTP to send emails from GitLab. I have tried several configuration methods, and ways but nothing seems to work.

Is sending emails supported for the GitLab community edition?


What version do you use? Latest is 12.3


Running an older version 8.5.10.
I’m thinking that does not matter since the reconfiguration shows the updated mail settings.

I am mostly asking if the community edition supports emailing.


Hi @aeubank!

The solution to your problem is two fold. Firstly you have to set up your SMTP server. And secondly, you will need to integrate the SMTP server with the GitLab server. I have used Postfix as SMTP server. Please find below, the steps to setup the same:

Steps to set up Postfix server: (run all the below steps as ‘root’ user, until otherwise mentioned)

  1. Install telnet, telnet-server and postfix on your server(say
  2. Make sure the firewall is disabled and selinux is permissive or disabled
  3. start and enable the services (telnet.socket and postfix)
  4. From the '/etc/hosts’ file, map the IPAddress to a domain name

  1. Edit the file ‘/etc/postfix/’ as below

queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
myhostname =
mynetworks =
relay_domains = $mydestination
home_mailbox = Maildir/
mydomain =
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost
unknown_local_recipient_reject_code = 550
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
debug_peer_level = 2
debugger_command =
ddd $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.10.1/samples
readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES

  1. Make sure that you insert the same values in the attributes ‘mydomain’ and ‘myhostname’
  2. Restart the postfix service and then run the following command:

echo “Hi! This is a test mail. Please do not reply” | mail -s “Testing Mail”

  1. Now, goto the directory you have configured for mails under the “home_mailbox” attribute in ‘/etc/postfix/’ file(in this case the value is “Maildir/”)

cd ~/Maildir/

  1. Check for a file under the “new” sub-directory(~/Maildir/new/). If you have received a mail then, the Postfix is setup correctly. You should now, move to the next section, integrating Postfix with GitLab.

Steps to Integrate Postfix with GitLab:

  1. From the GitLab server, open the GitLab configuration file ‘/etc/gitlab/gitlab.rb’ and edit the file as below:

external_url ‘
gitlab_rails[‘smtp_enable’] = true
gitlab_rails[‘smtp_address’] = ‘
gitlab_rails[‘smtp_port’] = 25
gitlab_rails[‘smtp_domain’] = ‘
gitlab_rails[‘smtp_tls’] = false
gitlab_rails[‘smtp_openssl_verify_mode’] = ‘none’
gitlab_rails[‘smtp_enable_starttls_auto’] = false
gitlab_rails[‘smtp_ssl’] = false
gitlab_rails[‘smtp_force_ssl’] = false

  1. Now, reconfigure the GitLab server

gitlab-ctl reconfigure

  1. Open the ‘/etc/hosts’ file and map the IPAddresses with the domain names:

  1. Open the gitlab-rails console by running the following command on the Gitlab server:

gitlab-rails console

  1. From the gitlab-rails console run the following command to check if the Postfix server is integrated with the GitLab successfully

Notify.test_email(‘’, ‘This is a test mail via gitlab’, ‘This is a sample test body.’).deliver_now

  1. After running the above command, exit from the gitlab-rails console and check the directory on the postfix server that you have configured for mails under the “home_mailbox” attribute in ‘/etc/postfix/’ file(in this case the value is “Maildir/”)