Configure SMTP for outbound emails

Outbound email configuration

To send emails from Alfresco via SMTP, specify the SMTP settings in the /opt/bitnami/tomcat/shared/classes/ file. The following example shows how to configure Alfresco using a Gmail account. Replace USERNAME and PASSWORD with your Gmail account username and password respectively.

Restart the Tomcat server for your changes to take effect

$ sudo /opt/bitnami/ restart tomcat

Inbound email configuration

To send emails to Alfresco using SMTP, specify the following parameters in the /opt/bitnami/tomcat/shared/classes/ file.


The Tomcat server is configured to run as the tomcat user and not the root user for security reasons. The problem with this configuration is that Tomcat then does not have privileges to bind port 25 (the SMTP port), so it becomes necessary to specify another port (2025 in the example above), and then create a port forwarding rule in the system to redirect all requests from port 25 to port 2025. Run the following command:

$ sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 25 -j REDIRECT --to-port 2025

Check the iptables rules with this command:

$ sudo iptables -t nat -L -n -v

Check that port 25 is open in your firewall and restart the Tomcat server for your changes to take effect

$ sudo /opt/bitnami/ restart tomcat

From another machine, verify connectivity using telnet:

$ telnet your_host_name 25

You should see something similar to this:

Trying ...
Connected to ....
Escape character is '^]'.
220 your_server_domain ESMTP SubEthaSMTP 3.1.6

More information.

To configure the application to use other third-party SMTP services for outgoing email, such as SendGrid, refer to the FAQ.

NOTE: If you are using Gmail as the outbound email server, your application’s attempts to send outgoing emails may be blocked by Gmail if it considers the authentication attempts to be suspicious. When this happens, you will receive a Gmail security alert at the corresponding Gmail address. To proceed, you will need to manually confirm the validity of the authentication attempt before Gmail will permit the application to send outbound emails. For more information on this and other Gmail issues related to outbound email from your application, refer to our Gmail SMTP troubleshooting page.

Last modification February 9, 2023