Configuring the SMTP service through Postfix

<< Click to Display Table of Contents >>

Navigation:  Bizagi Engine > Bizagi system administration > Other infrastructure options > Configuring the connection to your e-mail server >

Configuring the SMTP service through Postfix

applies_JEE

Overview

This section illustrates how to configure Bizagi to work with a Postfix SMTP server instance, so that Postfix can be used as an intermediate service that relays notifications to your corporate E-mail server.

 

note_pin

Postfix is a mail server (MTA) which is free and open-source produced by a third-party.

We recommend its use on JEE platforms, given that it is widely adopted on Unix-like operating systems.

 

This option is strongly recommended in order to implement several best practices such as: the use authenticated access to the SMTP server, the use of advanced SMTP settings (such as possible custom port number, using other protocols such as TLS, etc), and to achieve business continuity in your Bizagi processes (in the event of the corporate E-mail Server being temporarily off-service, Bizagi processes move on and the notifications are queued directly at Postfix).

For more information about these advantages, refer to Configuring the connection to your e-mail server.

 

 

 

Prerequisites

You need to ensure the following:

1. Having already installed Postfix in its 2.9 version, or higher.

You need to make sure Postfix is installed at the Bizagi server, with the ability to rely notifications to your corporate E-mail server.

2. Having Bizagi already configured in your server.

Further documentation and guide can be found for Bizagi configuration on a standalone or clustered setup, according to the JEE Application server of your choice (WebSphere, Weblogic or JBoss). Refer to: Configuring a JEE application server to work with Bizagi.

3. Having previously enabled the port under which your corporate SMTP server processes notification requests.

 

What you need to do

You need to carry out these steps:

1. Installing the necessary packages for the mailing features.

2. Configuring the relevant parameters in Postfix files.

3. Configuring the E-mail server parameters in Bizagi

 

Procedure

Recall that this procedure parts from already having Postfix installed at the Bizagi server.

Once Postfix is installed, carry out the following steps.

 

note_pin

In case of having Postfix installed on a different server, the same procedure described above applies. The only difference is that in Bizagi you will not be configuring settings to reference localhost but instead you will need to reference that server having Postfix.

 

1. Installing the necessary packages for the mailing features.

Install the following packages (telnet, cyrus, mailx) by running these commands (use the ROOT user or its rights):

sudo yum install telnet

sudo yum install cyrus-sasl-plain

sudo yum install mailx

 

2. Configuring the relevant parameters in Postfix files.

Locate Postfix configuration file named as main.cf, by default at /etc/postfix/main.cf.

You may use the Vi editor (by using the vi /etc/postfix/main.cf command) to include these lines at the end of the file:

relayhost = [<corporate_smtp_server>]:<port>

smtp_tls_loglevel = 1

smtp_tls_security_level = encrypt

smtp_sasl_auth_enable = yes

smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

smtp_sasl_security_options = noanonymous

smtp_sasl_mechanism_filter = CRAM-MD5, PLAIN, LOGIN

smtp_tls_CAfile = /etc/postfix/cacert.pem

 

Consider that <corporate_smtp_server> and <port> should correspond to your corporate E-mail server (and the port under which it attends mail requests), to which you will use relay. A configuration example is:

relayhost = [smtp.office365.com]:587

 

Next, create the sasl_passwd file to store credentials for outgoing mails (this file as referenced in the above configuration regarding smtp_sasl_password_maps):

You may use the Vi editor(by using the sudo vi /etc/postfix/sasl_passwd command) to include this line in that file:

[<corporate_smtp_server>]:<port> <email>:<password>

 

Consider that <email> and <password> should correspond to the authorized account that authenticates in your corporate E-mail server. A configuration example is:

[smtp.office365.com]:587 bizagi_mail_service@bizagi.com:BizagiBPM123

 

note_pin

Make sure you set the appropriate rights for this sasl_passwd file. You may do so through chmod in this command:

sudo chmod 400 /etc/postfix/sasl_passwd

 

Create the sasl_passwd.db file, by using the postmap command as shown below:

sudo postmap /etc/postfix/sasl_passwd

 

Finally, restart Postfix service to make sure changes have been taken:

cd /etc/postfix

sudo postfix reload

 

note_pin

You may verify that your configuration is correct at this point, by using:

echo "<Email_body>" | mail -s "<Email_subject>" <Recipient_email> -r <Email_for_relay>

 

Example:

echo "Sending a test mail from postfix" | mail -s "Test mail from Postfix" MyEmail@bizagi.com -r bizagi_mail_service@bizagi.com

 

Logs can be reviewed from their default location by using:

sudo tail /var/log/maillog

 

3. Configuring the E-mail server parameters in Bizagi

Once that the SMTP is setup, make sure you configure the environment parameters for your Bizagi project.

In the production or testing environments you may do this through Bizagi Management Console as provided by Bizagi Engine, and make sure you reference the local server (localhost) as the SMTP server.

Tick the Enable mail checkbox as well and specify a sender account that uses the expected domain:

 

localhostservice

 

Click Ok to save changes.