generalalfresco

Configure SMTP for outbound emails

Outbound email configuration

To send emails from Alfresco via SMTP, specify the SMTP settings in the /opt/bitnami/apache-tomcat/shared/classes/alfresco-global.properties 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.

mail.host=smtp.gmail.com
mail.port=465
mail.protocol=smtps
mail.username=USERNAME@gmail.com
mail.password=PASSWORD
mail.encoding=UTF-8
mail.smtps.starttls.enable=true
mail.smtps.auth=true

Restart the Tomcat server for your changes to take effect

$ sudo /opt/bitnami/ctlscript.sh restart tomcat

Inbound email configuration

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

email.inbound.unknownUser=anonymous
email.inbound.enabled=true
email.server.enabled=true
email.server.port=2025
email.server.domain=your_server_domain
email.server.allowed.senders=.*

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/ctlscript.sh 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 and have experienced issues trying to send emails correctly, check the Gmail SMTP troubleshooting page to learn the causes of these issues and how to solve them.

Last modification January 18, 2019