Alfresco Outbound Email Configuration

To send emails from Alfresco via SMTP, specify the SMTP settings in the /alfresco/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 /alfresco/alfresco.sh restart tomcat

Alfresco 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

Allowed senders

A comma separated list of email REGEX patterns of allowed senders.
If there are any values in the list then all sender email addresses
must match.  For example:

  .*\@alfresco\.com, .*\@alfresco\.org

email.server.allowed.senders: list of patterns to allow.