Unable to add SMTP Server in JIRA due to error: "501 Syntax error in parameters or arguments"

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

  • Unable to add SMTP server in JIRA with following error: "501 Syntax error in parameters or arguments"

The following appears in the atlassian-jira.log:

An error has occurred with sending the test email:
com.atlassian.mail.MailException: javax.mail.MessagingException: 501 Syntax error in parameters or arguments

	at com.atlassian.mail.server.impl.SMTPMailServerImpl.send(SMTPMailServerImpl.java:179)
	at com.atlassian.jira.web.action.admin.mail.SendTestMail.doExecute(SendTestMail.java:93)
Caused by: javax.mail.MessagingException: 501 Syntax error in parameters or arguments

Diagnosis

Enabling DEBUG logging.

JIRA 5+

 

  1. Log in as a user with the 'JIRA System Administrators' global permission.
  2. Choose the cog icon  at top right of the screen, then choose JIRA Admin. Then choose System > Troubleshooting and Support > Logging & Profiling to open the 'Logging' page, which lists all defined log4j categories (as package names) and their current logging levels.
    Keyboard shortcut: 'g' + 'g' + start typing 'logging & profiling'
  3. To change logging level of a category, click linked logging level associated with the relevant package name. To turn off logging of a category, click the 'OFF' link associated with the relevant package name.


Pre JIRA 5

Logging email protocol details


The following appears in the atlassian-jira.log:

DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
DEBUG SMTP: useEhlo true, useAuth false
DEBUG SMTP: trying to connect to host <smtp_server>, port 25, isSSL false
220 SMTP Gateway: Authorized Use Only! Violators will be prosecuted service ready; Thu, 24 Jan 2013 18:57:39 -0500
DEBUG SMTP: connected to host <smtp_server>, port: 25

EHLO <hostname>
501 Syntax error in parameters or arguments
HELO <hostname>
501 Syntax error in parameters or arguments

Cause

The mail server rejects the client connection, since the HELO command expects a fully qualified domain name from the client.

Resolution

When you start JIRA, pass it the following parameter:

-Dmail.smtp.localhost=<computer_name>

Substitute the JIRA server name(FQDN) for <computer_name>. See Setting Properties and Options on Startup.

Last modified on Nov 6, 2018

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.