Setting up your mail server

Setting up Bitbucket Server to use your SMTP mail server:

  • allows Bitbucket Server to send notifications about events to do with pull requests. See Using pull requests in Bitbucket Server. Note that if the mail server fails, notifications will be dropped.
  • allows Bitbucket Server to email a link to a newly created user, which the user can use to generate their own password.
  • allows a user to reset his or her password if they forget it.

To configure a mail server for Bitbucket Server, go to the administration area and click Mail server (under 'Settings'). See Supported platforms for the mail clients supported by Bitbucket Server.

Complete the form and click Save.

HostnameThe hostname of the mail server (for example "localhost" or "192.168.1.15").
PortThe port of the mail server (if unspecified, the port 25 will be used).
UsernameThe username to use to connect to the mail server.
PasswordThe password to use to connect to the mail server.
Protocol

Use either SMTP or SMTPS when connecting to the mail server.

When using SMTP, you can specify that:

  • SSL/TLS is used if supported by the mail server, otherwise mail is sent in plaintext.
  • mail should only be sent if the mail server supports SSL/TLS.

See Securing email notifications below.

Use SSL/TLS if available If the SMTP server supports the STARTTLS extension this will be used to encrypt mail with SSL/TLS otherwise plaintext will be used. SMTPS servers always support SSL/TLS
Always use SSL/TLS If the SMTP server does not support the STARTTLS extension mail will not be sent. SMTPS servers always support SSL/TLS
Email fromSpecifies the 'From' header in notification emails (for example: noreply@yourcompany.com).
Send a test emailEnter an email address to send a test email to check that the mail server is configured correctly.

Anonymous user

If you wish to set up the outgoing mail server as an anonymous user, simply leave the username and password fields empty. However, in Chrome, these fields may be auto-populated, leading to an error – as a workaround, try using a different browser.

 

 

 

 

 

 

 

 

 

Securing email notifications

Bitbucket Server 3.6 and later versions support the following protocols:

  • SMTP, where mail is not encrypted.
  • SMTP encrypted by SSL/TLS using the STARTTLS extension, where the protocol conversation is upgraded only if SSL/TLS is supported by the mail server, but otherwise remains as plaintext.
  • SMTP, where STARTTLS support is required on the mail server, otherwise mail is not sent. 
  • SMTPS (where the whole protocol conversation uses SSL/TLS).

Note that if you use either SMTP with STARTTLS, or SMTPS, and connect to a self-signed mail server, you may need to import the server's cert ificate and set up a custom cacerts file for Bitbucket Server (just as you do for any outbound SSL/TLS connection to a self-signed server). See this Bitbucket Server knowledge base article for information about how to do that.

Configuring the mail server to use Gmail

If you wish to connect to a Gmail account for email notifications in Bitbucket Server, refer to the Configuring the Mail Server to Use Gmail guide.

In particular, note that Gmail won't show images in the email because of the way that Google loads images on their servers. For Google Apps, a Bitbucket Server administrator can solve the problem by adding the Bitbucket Server domain name to a whitelist – see https://support.google.com/a/answer/3299041?hl=en for more information.

Last modified on Sep 20, 2015

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.