awsalfresco

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/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/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 the SMTP service provided by Amazon Simple Email Service (SES), refer to the guide on using Amazon SES.

NOTE: Amazon EC2 blocks SMTP port 25 by default on all Amazon EC2 instances, and you must manually request removal of this restriction to use this port.

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