SMTP Send Failure


The article is relevant to you if any of the following are true:
 

 

Refer to SMTP Send Configuration for an understanding of how to configure SMTP sending in MailArchiva.

 

Connection does not exist

 

The resolution is as follows:
 

 

Incorrect SMTP client settings

 

In Configuration→Connections, ensure that an SMTP Client Connection has been added and configured correctly:

 

Microsoft Exchange

 

When using an SMTP client connection with Microsoft Exchange, it is important to understand how Exchange handles duplicate messages. If Exchange receives an email with a message ID that already exists in the system, it may discard the message and it may not appear in the recipient’s mailbox.

 

To avoid this issue, configure the SMTP connector in MailArchiva to use the New message ID send strategy. This causes MailArchiva to generate a new message ID so that Exchange treats the email as a new message and delivers it normally.

 

If messages are still not delivered, use the Send as attachment strategy. This sends the archived email as an attachment and does not rely on message ID matching.

 

Send As permissions

 

The Send function requires the SMTP service account to have Send As rights on the mailboxes it needs to impersonate.

 

For a single mailbox, use:

 

Add-ADPermission -Identity "MailboxName" -User supermailer -AccessRights ExtendedRight -ExtendedRights "Send As"

 

If the service account is able to send to all user mailboxes, grant Send As rights across all mailboxes using Exchange PowerShell. This must be maintained for new mailboxes as they are created.

 

Communications problem

 

There may be a networking issue or firewall blocking the communications between MailArchiva and the mail server. On the MailArchiva server, drop to the command prompt and telnet to port 25 on the Exchange server. If no reply is received, there is a networking issue.

 


Connection security mismatch

 

For MailArchiva to communicate with your mail server, it needs to share the same connection security. For example, if your mail server only accepts TLS communications and your connection mode is set to plaintext only, obviously an error will be reported. To resolve, you need to switch the SMTP connection mode settings to TLS in MailArchiva.

 


Authentication method mismatch

 

The authentication method must be set to one that is supported by your mail server. Your mail server must at the very least be configured for either basic or integrated Windows authentication. Ensure that your mail server will accept integrated Windows authentication (Exchange) or basic authentication and specify "username@company.com" or "username" in the username field.


Exchange users: In the Exchange Manager application, enable both basic and integrated authentication. In MailArchiva's SMTP client settings, in the username field, enter in the form user@company.com.

 

 

Transmit connection does not exist

 

In Configuration→Connections ensure that the default Transmit connection is set to the same name as the newly created connection. If that doesn't work, then stop the MailArchiva service, edit the server.conf using a text editor (located in /etc/opt/mailarchiva/ROOT or C:ProgramDataMailArchivaROOTconf), delete the line starting with "send.smtpconnection". Start the MailArchiva service. Thereafter, go to Configuration→Connections, and ensure the default send connector is selected and retested.

 

Note: We often get cases, where's the customer's SMTP server inside Exchange is configured such that there are no authentication methods enabled. Please ensure that either basic or integrated authentication is enabled, or both.

 

Emails go missing due To Exchange de-duplication

 

Some versions of Microsoft Exchange are particularly aggressive at de-duplicating messages sent to it. That is, if there is already an equivalent email present on the Exchange server, Exchange will recognize it as a duplicate. When it does this, it accepts the message and disregards it. The user is left thinking that the message was never sent, when in fact it was. The resolution is to switch the send strategy in the SMTP Client Connection settings either to "new message ID" or "send as attachment." 

 

Cannot send on behalf of user

 

The following error appears in the log when attempting to send an SMTP message to a user from the Search interface:

 

STOREDRV.Submission.Exception:SendAsDeniedException.MapiExceptionSendAsDenied; Failed to process message due to a permanent exception with message Cannot submit message. 16.55847:96210000

 

One way to resolve the above is to follow Option 3 to configure a connector to send mail using an SMTP relay.

 

Queue not started (Corrupted queue database)

 

When sending an email using the Search interface, the error "queue not started" appears. In this case, the queue database appears to be corrupted. The MailArchiva server must be shutdown cleanly. If it is not, there is a probability that the queue database will get corrupted.
 

Follow the steps below to resolve:
 

  1. Shutdown the MailArchiva service
  2. Delete the contents of the following directory:
    /var/opt/mailarchiva/tomcat/webapps/ROOT/queue/smtpclient/* (Linux)
    C:ProgramDataMailArchvaTomcatwebappsROOTqueuesmtpclient* (Windows)
  3. Start the MailArchiva service up
Note: If you wish to retain the information in these smtp queues rather rename the smtpclient/connection... directory to smtpclient/restore_connection... and restart MailArchiva. When MailArchiva starts up it will reprocess all the items in the queue.

 

MailArchiva ALERT (ROOT): SMTP client send message max retries exceeded

 

This alert indicates one of the following:

Further debugging

 

If the above resolutions are not applicable, please temporarily disable archiving, enable Troubleshoot logging in Configuration→Logs, perform a Test Connection in the SMTP Client Connection. Examine the log file to see the communications between MailArchiva and the mail server. Usually, the SMTP commands and error code are displayed in the log file. It should give you an indication of why MailArchiva is unable to send mail. 

Create your own Knowledge Base