SMTP server configuration

Use an external mail server to send your GitLab emails and configure it to receive important notifications from your GitLab server via email.


For a successful configuration you need:

  • SMTP server / SMTP port
  • SMTP user name
  • Type of encryption (SSL/TLS or STARTTLS)
  • SMTP password
  • SMTP domain



GitLab configuration file

Log in to the creoline Customer Center and navigate to the GitLab server for which you want to customize the SMTP server. Select the Configuration files tab and then click Edit.


To navigate more quickly when editing large configuration files, you can also use Ctrl + F (Windows) or Command + F (MacOs) to search for a specific term or similar within the configuration file.



Please note that the incorrect adaptation of the GitLab configuration file can lead to the server no longer being accessible or GitLab not working properly.


You can configure an SMTP server for sending emails within the GitLab configuration. If you use your own SMTP server, you must request the required SMTP data from your hosting/server provider. Otherwise, you can configure a send connector from us.



Set up send connector

We provide dedicated send connectors for sending transactional emails, which you can create and use free of charge in your customer center. See also: Send connectors

To be able to use the send connector in your GitLab server, you must configure the previously opened gitlab.rb.


Remove the individual # to effectively comment in the configuration and thus be able to use the configuration.


Search in the gitlab.rb for the configuration of the GitLab E-Mail Server Settings.


The following lines are important for the successful configuration of the send connector in your GitLab server:

gitlab_rails['smtp_address'] = "smtp.server"

Replace "smtp.server" with the SMTP address from the customer center.


gitlab_rails['smtp_port'] = 465

Replace the port 465, only if you want to use STARTTLS to 587. The port 465 uses SSL/TLS.


gitlab_rails['smtp_user_name'] = "smtp user"

Replace "smtp user" with your SMTP user name from the customer center.


gitlab_rails['smtp_password'] = "smtp password"

Replace "smtp password" with your SMTP password from the customer center.


gitlab_rails['smtp_domain'] = "example.com"

Replace "example.com" with your SMTP domain. For example: smtp.mydomain.com.


gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = false

Replace the method you are using from false to true. If you use port 465 SSL/TLS change 'smtp_tls' to true. If you are using STARTTLS, change 'smtp_enable_starttls_auto' to true.


The sender e-mail address can be specified with the following directives.

To be able to configure the sender e-mail, you need to adjust the following lines:

gitlab_rails['gitlab_email_from'] = 'example@example.com'
gitlab_rails['gitlab_email_display_name'] = 'Example'
gitlab_rails['gitlab_email_reply_to'] = 'noreply@example.com'


gitlab_rails['gitlab_email_from'] = 'example@example.com'

In 'gitlab_email_from' you can set the sender's e-mail address. For example: gitlab@meinedomain.de


Please make sure that you use domains that you have previously authorized for the send connector in the Customer Center.


gitlab_rails['gitlab_email_display_name'] = 'Example'

Under 'gitlab_email_display_name' you can customize the sender name that is displayed. We will use 'GitLab' as an example here.


gitlab_rails['gitlab_email_reply_to'] = 'noreply@example.com'

In 'gitlab_email_reply_to' you can customize to which email address possible replies should be sent.


Then enter a short message in the Change message area explaining why the GitLab URL was changed and save the changes using the Save changes button.


Saving the configuration automatically triggers the deployment of the configuration and the subsequent restart of GitLab. Inform active users about the planned action in advance.



Set up external SMTP server

If you want to use an external SMTP server, you must have the data such as server, user name and password. If you have the data, you can continue with the instructions.


Remove the # to effectively comment in the configuration and thus be able to apply the configuration.


Search in the gitlab.rb for the configuration of the GitLab E-Mail Server Settings.


The following lines are important for the successful configuration of the external SMTP server in your GitLab server:

gitlab_rails['smtp_address'] = "smtp.server"

Replace "smtp.server" with the SMTP address from your provider.


gitlab_rails['smtp_port'] = 465

Replace the port 465, only if you want to use STARTTLS to 587. The port 465 uses SSL/TLS. The ports listed here may differ for your provider, please check the ports.


gitlab_rails['smtp_user_name'] = "smtp user"

Replace "smtp user" with your SMTP user name from your provider.


gitlab_rails['smtp_password'] = "smtp password"

Replace "smtp password" with your SMTP password from your provider.


gitlab_rails['smtp_domain'] = "example.com"

Replace "example.com" with your SMTP domain. For example: smtp.mydomain.com.


gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = false

Replace the method you are using from false to true. If you use port 465 SSL/TLS change 'smtp_tls' to true. If you are using STARTTLS, change 'smtp_enable_starttls_auto' to true.


To be able to configure the sender e-mail, you need to adjust the following lines:

gitlab_rails['gitlab_email_from'] = 'example@example.com'
gitlab_rails['gitlab_email_display_name'] = 'Example'
gitlab_rails['gitlab_email_reply_to'] = 'noreply@example.com'


gitlab_rails['gitlab_email_from'] = 'example@example.com'

In 'gitlab_email_from' you can set the sender's e-mail address. For example: gitlab@meinedomain.de


gitlab_rails['gitlab_email_display_name'] = 'Example'

Under 'gitlab_email_display_name' you can customize the sender name that is displayed. We will use 'GitLab' as an example here.


gitlab_rails['gitlab_email_reply_to'] = 'noreply@example.com'

In 'gitlab_email_reply_to' you can customize to which email address possible replies should be sent.


Then enter a short message in the Change message area explaining why the GitLab URL was changed and save the changes using the Save changes button.


Saving the configuration automatically triggers the deployment of the configuration and the subsequent restart of GitLab. Inform active users about the planned action in advance.



Test the SMTP server configuration (root required)

To test the e-mail delivery of your GitLab server, you can start the GitLab Rails Console with :

gitlab-rails console


There you can send a test e-mail with the following command:

Notify.test_email('destination_email@address.com', 'Message Subject', 'Message Body').deliver_now



Known error messages

Error Explanation
SSL_connect returned=1 errno=0 state=error: wrong version number (OpenSSL::SSL::SSLError) Try changing the SSL protocols to STARTTLS and port 587
Sender address rejected: not owned by user sXXXX@mail.out.creoline.de (Net::SMTPFatalError) Your outgoing email address is not authorized in the send connector or you do not have the permissions to use the domain