How do messages end up in the BadMail Directory?


SUMMARY

There are many reasons why messages may be placed in the Bad Mail folder and this article explains possible causes and provides diagnostic guidance.

DETAIL

Messages will be placed in the Bad Mail directory for the following reasons:

  1. An infinite message loop was detected and the message was placed in the folder to prevent further looping. These may be messages recieved by SMTP that are received and are then routed and sent via SMTP, resulting in the messages looping.
  2. The message was sent to a remote mail server that could not be contacted. The message will be returned to the sender and potentially also being placed in the Bad Mail directory
  3. A message delay notification or delivery failure could not be delivered to the target recipient. When this occurs the message is placed in the Bad Mail directory to prevent further looping.
  4. An inbound SMTP message was partially received from another the mail server and the transmission was interrupted. For example: a remote mail server could not complete sending a message because a failure occurred during the transmission.
  5. A Mail Transfer Agent Filter was triggered with an action to place the message in the Bad Mail folder.
  6. Messages that are pulled (via POP retrieval) from a remote server that cannot be delivered to the end user mailbox will be placed in the BadMail folder.
  7. In order prevent information loss, MailEnable may also place partially transmitted messages the MailEnable Bad Mail folder.

DIAGNOSING BADMAIL MESSAGES

Firstly, open the Management Console and access  the Bad Mail node. Next open the message by double clicking on it and take note of the Created date and the Recipients field.

Next view the message source of the message and search the message for the following: X-ME-BADMAIL.

This will give an indication as to why the message was placed in the bad mail folder. Typical values are:

  • BADMAIL_CORRUPTENVELOPE, Corrupt Envelope Detected
  • MISSINGPOSTMASTER, Postmaster not in address map
  • UNKNOWNCONNECTOR, Unknown Connector
  • CONNECTORTRANSFERERROR, Connector Transfer Error
  • FILTERACTION, Filter Action
  • MISSINGCONTENT, Missing Content File
  • INFINITEROUTELOOP, Infinite Route Loop
  • BADMAIL_CONNECTIONRESET, Connection Reset
  • LISTCONNECTOR, List Connector Action
  • LISTCONNECTORJUNK, List Connector Detected As Junk
  • POSTMASTERLOOP, Postmaster Null Sender Loop Detected
  • NOTDELIVERABLE, Sender of message exceeding mailbox quota is the mailbox address
  • NOTDELIVERABLE, Sender of message exceeding mailbox quota is the notification address
  • TRANSFERCOPYFAILED, Message Transfer Copy Failed
  • CORRUPTRECIPIENT, Message has corrupt recipients
  • POSTMASTERNDR, Postmaster NDR
  • TOOBIG, Message size is too large to be delivered
  • SYSTEMDELIVERYERROR, Non Recoverable System Delivery Error
  • TRANSMISSIONERROR, Transmission Error occurred when delivering
  • NDREXPIRED, Gave up delivering NDR
  • NDRFAILURE, Unable to deliver NDR

If the message contains the header X-MailEnablePOPC then the message has originated from MailEnable's POP Retrieval connector (and has been pulled from a remote mail server).  Note: In this case the message will not necisarily contain a relevant topmost MailEnable Recieved header (since doing so would affect the message Received date when viewed in the target mailbox).

For messages containing the X-MailEnablePOPC header, the Recipients field mentioned earlier will indicate the target mailbox. You can review the Postoffice Connector Debug log file (for the day denoted by the Created date), searching for the message id for detailed non-delivery information.

Otherwise, the topmost Received header will advise of the messages origin and how MailEnable received it.

In this case, the message tracking utility can be used to trace the message and provide detailed information as to why the message was sent to the system Bad Mail folder. This utility can be accessed from the MailEnable Tray applet on the server with MailEnable installed.

Alternatively, MailEnable's log files can be reviewed at the time the message was placed into the Bad Mail folder. 

MANAGING BADMAIL MESSAGES

It is important to regularly flush the contents of the bad mail directory and any directories that accumulate mail. Such folders and mailboxes have the ability to receive thousands of messages daily and can quickly become
unmanageable.

MailEnable Enterprise and Enterprise Premium versions can automatically purge this directory via the Management Service.

MailEnable also provides a utility that purges files from postmaster mailboxes and the bad mail directory. It is available at:
http://www.mailenable.com/Tools/mepurge.zip

For help using the utility simply enter mepurge /? from the Windows Command Prompt. This utility can also be scheduled using the Windows Scheduler (or AT command).

MORE INFORMATION

Reasons for messages going into bad mail folder:http://www.mailenable.com/kb/content/article.asp?ID=ME020119

How to diagnose outgoing mail problems and delivery delay notifications:http://www.mailenable.com/kb/content/article.asp?ID=ME020148

How to troubleshoot mail looping issues:http://www.mailenable.com/kb/content/article.asp?ID=ME020269

(MTA-1010): Mail Transfer Agent - Infinite Message Loop Detection: http://www.mailenable.com/kb/content/article.asp?ID=ME020076

How to automatically purge mail messages from the message store: http://www.mailenable.com/kb/content/article.asp?ID=ME020223



Product:MailEnable (All Versions)
Category:Other
Article:ME020169
Module:General
Keywords:badmail,looping,delay,notification
Class:TRB: Troubleshooting (Configuration or Environment)
Created:12/07/2003 2:06:00 PM
Revised:Wednesday, January 17, 2018
Author:
Publisher:MailEnable