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 successful configuration, you will need:

  • SMTP server / SMTP port
  • SMTP username
  • Encryption type (SSL/TLS or STARTTLS)
  • SMTP password
  • The SMTP domain



GitLab Configuration File

Log in to the creoline Customer Center and navigate to the GitLab server for which you want to configure 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 incorrectly modifying the GitLab configuration file can result in the server becoming unreachable or GitLab not functioning properly.


Within the GitLab configuration, you can set up an SMTP server for sending emails. If you use your own SMTP server, you’ll need to request the required SMTP settings from your hosting or server provider. Otherwise, you can configure a send connector provided by us.



Setting Up a Send Connector

We provide dedicated Send Connectors for sending transactional emails, which you can create and use for free in your Customer Center. See also: Send Connectors

To use the Send Connector on your GitLab server, you must configure the gitlab.rb file you opened earlier.


Remove the individual # characters to uncomment the configuration and apply it.


Search the gitlab.rb file for the GitLab Email Server Settings configuration.


The following lines are important for successfully configuring the Send Connector on 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 with 587 only if you want to use STARTTLS. Port 465 uses SSL/TLS.


gitlab_rails['smtp_user_name'] = "smtp user"

Replace “smtp user” with your SMTP username 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.de


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

Change the setting from false to true depending on the method you’re using. If you’re using port 465 with SSL/TLS, set ‘smtp_tls’ to true. If you’re using STARTTLS, set ‘smtp_enable_starttls_auto’ to true.


The sender email address can be set using the following directives.

To configure the sender email, you’ll also 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 email address. For example: gitlab@meinedomain.de


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


gitlab_rails['gitlab_email_display_name'] = 'Example'

Under ‘gitlab_email_display_name’, you can customize the sender name that is displayed to you. For example, let’s use ‘GitLab’.


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

Under ‘gitlab_email_reply_to’, you can specify the email address to which any replies should be sent.


Next, enter a brief message in the “Change Note” section explaining why the GitLab URL was changed, and save the changes by clicking the Save Changes button.


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



Setting Up an External SMTP Server

If you want to use an external SMTP server, you’ll need the server details, such as the server name, username, and password. Once you have this information, you can continue with the instructions.


Remove the # to uncomment the configuration so that it takes effect.


Search the gitlab.rb file for the GitLab Email Server Settings configuration.


The following lines are important for successfully configuring the external SMTP server on your GitLab server:

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

Replace “smtp.server” with the SMTP address provided by your service provider.


gitlab_rails['smtp_port'] = 465

Replace the port 465 with 587 only if you want to use STARTTLS. Port 465 uses SSL/TLS. The ports listed here may differ depending on your provider; please check the ports.


gitlab_rails['smtp_user_name'] = "smtp user"

Replace “smtp user” with your SMTP username 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.de


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

Change the setting from false to true depending on the method you’re using. If you’re using port 465 with SSL/TLS, set ‘smtp_tls’ to true. If you’re using STARTTLS, set ‘smtp_enable_starttls_auto’ to true.


To configure the sender email, you’ll also 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 email 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 to you. For example, let’s use ‘GitLab’.


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

Under ‘gitlab_email_reply_to’, you can specify the email address to which any replies should be sent.


Next, enter a brief message in the “Change Note” section explaining why the GitLab URL was changed, and save the changes by clicking the Save Changes button.


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



Testing the SMTP Server Configuration (Root Required)

To test your GitLab server’s email sending capabilities, you can launch the GitLab Rails Console with:

gitlab-rails console


There, you can send a test email using 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 lack the permissions to use the domain