KB-1817 Errors due to special characters in password.properties

Symptoms

A mail server is set up to be used with Appian. Appian is configured for either:

  1. SMTP server authentication, with conf.mailhandler.mail.smtp.auth=true in custom.properties.
  2. Email Polling.

When configured for SMTP server authentication, the following error message is seen in the application server log:

ERROR com.appiancorp.process.runtime.activities.SendEmailActivity - javax.mail.AuthenticationFailedException: 535 5.7.8 Error: authentication failed: authentication failure

When configured for polling an email account, the following error message is seen mail-listener.log:

ERROR com.appiancorp.process.emailpoller.MailActivation - An error occurred while attempting to open the mailbox to poll; no mail will be fetched. 
javax.mail.AuthenticationFailedException: Authentication failed.

The following are both true when configured for SMTP server authentication:

  1. The SMTP username, conf.mailhandler.mail.user, in custom.properties is correct.
  2. The associated password, conf.password.SMTP, in password.properties is correct.

The following are both true when configured for polling an email account:

  1. The email username conf.mailhandler.poller.EmailHandlerBean.userName in custom.properties is correct.
  2. The associated password conf.password.EmailHandlerBean.EMAIL_HANDLER in password.properties is correct.

Cause

Some special characters within password.properties need to be escaped when used in:

  1. The STMP password field, conf.password.SMTP
  2. The email user password field, conf.password.EmailHandlerBean.EMAIL_HANDLER

The characters which need to be escaped may vary depending on the mail server being used. For example, it is known that the character , needs to be escaped.

Action

If it is determined a special character needs to be escaped, add the characters \\ in front of the special character.

  • E.g. conf.password.SMTP=password\\,example

Some special characters do not need to be escaped. To test if a special character needs to be escaped when authentication is failing:

  1. Change the password to remove the special character in question.
  2. If authentication is successful without the special character, re-add the special character and escape it with \\.

Affected Versions

This article applies to Appian 17.2 and later.

Last Reviewed: December 2018

Related
Recommended