KB-1749 Email polling error "Logon failure: unknown user name or bad password" when using Microsoft Exchange Server
Symptoms
When using Appian email polling with Microsoft Exchange Server, mail-listener.log shows the following error:
[ServerService Thread Pool -- 63] INFO com.appiancorp.process.emailpoller.EmailPoller - MA 1 endpointActivation success MailActivationSpec(storeProtocol=pop3, mailServer=servername, port=110, starttls=false, mailFolder=INBOX, userName=domainusername, password non-null, pollingInterval=30000, messageSelector=null, maxMessages=1, debug=true, partialFetch=true, forceImapLogin=false)[Appian MailActivation - 1] 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: Logon failure: unknown user name or bad password.
In addition to the above error message, it is confirmed that:
- The email username specified with
conf.mailhandler.poller.EmailHandlerBean.userNamein custom.properties is the intended user. - The associated password specified with
conf.password.EmailHandlerBean.EMAIL_HANDLERin password.properties is correct.
Cause
Microsoft Exchange Server email usernames are specified with the format domain\username. However, the \ symbol is a special character in the Simple Mail Transfer Protocol, and it is filtered out when interpreted by Appian in custom.properties.
This causes the email userName field with format conf.mailhandler.poller.EmailHandlerBean.userName=domain\username to be interpreted as domainusername by Appian. This can be seen in the above error message.
Action
- When specifying the email
userNamefield with formatdomain\username, the\character needs to be escaped. - The email
userNamefield should be changed to follow the below format:
conf.mailhandler.poller.EmailHandlerBean.userName=domain\\username
Affected Versions
This article applies to Appian 18.2 and later using Microsoft Exchange Server.
Last Reviewed: October 2018
