Mailtraq - the Complete Email Server

Enstar for Mailtraq email server sales & support
Making world-class Internet technology affordable  

Search for:

Advanced search

KB11111401 Log files and Exceptions




Something bad happened and now Mailtraq has issues.

Maybe it is stalled, or is constantly turning on and off.


This page explains how to fix those problems.




First - find out what went wrong...

Mailtraq writes serious problems it encounters to the Event Log.

Examining the Event Log is the first step to resolving problems that you might have.

Found 'exceptions' in the log? See how to fix them...

1 - How to safely Stop & Start Mailtraq. Read how here...

2 - Take a backup of your Configuration - now! Read how here...
Just in case, it means you can easily get back to your current situation.
And, when you have fixed today's problem, take a minute to review your Backup Regime here...

Event Log - viewer

Mailtraq presents a live, rolling view of the Event Log in the Console, and also from the Monitor at the icon in the System Tray (on the Desktop, down by the clock).

This live view is very useful for monitoring transactions, but when Mailtraq starts, the Event Log is empty and, to conserve memory, the data in the event log rolls off after approximately 700 lines. So it is less useful in diagnosing an underlying intermittent problem.


Disk Event Log

Mailtraq also writes a semi-permanent record of all Mailtraq activity to file in real time.

The default location is at:  
C:\Program Files\Mailtraq or C:\Program Files(X86)\Mailtraq

Mailtraq writes one file per day in the format LOG_31.TXT, over-written on a monthly cycle. The file name corresponding to the day of the month.

It is often the case that Logs have been set to be stored in a non-default location - you can see in the Console where that location is by opening the dialog at Options | Server | Logs


The log files are simple text files and can be opened and examined in Notepad, or any other simple text viewer. We recommend not opening them in MS Word, or other 'word processing' software as you may impose unwanted formatting on the data that will make analysis harder.


Examining the Log

Use the Edit | Find function in Notepad to search the log file for the word:  exception

Each exception to normal events is flagged with that word, and a brief description of the event.
Finding a single Exception in the log does not necessarily mean there is a problem. Mailtraq may just have hit a resource limit and then resolved the issue. Seeing several Exceptions or more indicates that you should investigate further.

Too many exceptions...

If Mailtraq encounters too many exceptions then it will stop and attempt to restart. If you find Mailtraq 'cycling' on and off this is the most likely cause.


Second, now you can fix the problem...


Resolving exceptions

Any Exception referencing a 'username.afx' indicates corruption in that mailbox file.

Most exceptions are easy to understand, here are some examples:

Mailbox corruption

>[date] [time] EXCEPTION (NexusDB: ...variable text ... Recursive call (3 times):

with the 'variable text' containing a description of an event with a reference to a 'jdoe.afx'
then that indicates the mailbox DB database file for jdoe (John Doe) has a corruption issue. 


>[date] [time]  EXCEPTION (NexusDB: TABLE_jsmith (FieldName: MSGDATA): Expected BlockOwnerID 75 but found 0 in file "C:\Program Files\Mailtraq\database\mail\inbox\jsmith.afx" for block 502623 [$2302/8962]) Unable to store message...
then that indicates the mailbox DB database file for jsmith (John Smith) has a corruption issue.

How to fix

This KB Article explains how to fix that problem - KB08040101 Repairing a corrupt AFX 'mailbox'

Message tracker corruption.

If you discover other Exceptions which will have variable text but may contain an internal reference 

 >[date] [time]  EXCEPTION .... e:\work\libs.....  or other location

that indicates that the Message Tracker may have become corrupted. It is easily rectified.

How to fix

Stop Mailtraq - locate the msgtrack.db file from the Mailtraq Database, and delete it. 
Restart Mailtraq. Mailtraq will automatically recreate the db file.

Resource limit

Symptom: Mailtraq is running but the services are not responding - no mail is being received or can be sent.

If Mailtraq is trying to do more work than the server hardware can cope with then it will hit a 'resource limit'. You will see the following entry in the logs:

'Resource limit detected -- restarting service to free O/S caches'

The limit referred to is usually RAM, but it could be CPU or Disk Access Speed - examining the Windows resource monitors will indicate which limit was reached.

Mailtraq will attempt to automatically restart, however Windows security interlocks may prevent Mailtraq from restarting the services, or the service may be so busy that it cannot disconnect. Mailtraq will be running but services will be stopped, and not responsive. Rebooting the server will correct the issue.

How to fix Resource Limits

In a stable running system you should not expect to hit a Resource Limit.

If you hit a Resource Limit on a newly commissioned system it most likely indicates that the hardware is undersized for the volume of mail, users, mailboxes or IMAP folders. 

The most likely cause is some type of 'mail event' where Mailtraq is flooded with tens of thousands of inbound messages in a very short period of time, in effect exhausting the RAM resources of the server. The most likely reason for such an event is Mailtraq having become an Open Relay or is under a DDoS attack. You can resolve an Open Relay like this... You can mitigate a Denial of Service attack by examining the logs on disk and identifying the inbound IP address connections and blocking them at your network firewall/router.

Mailtraq has an internal Mailing List engine of its own that manages very large mailings however, if you have an external mailing list system or other similar email process (e.g. a billing system) that periodically uses Mailtraq as an SMTP relay you may need to throttle or limit the number of messages per hour that the external application sends to balance the available machine resources. Mailtraq does not have an inbound message throttle.

What else causes Corruption Exceptions?

If you see exceptions like the one above or of the type:

17.10.2004 20:02 EXCEPTION (I/O error 103)@ Error Closing File: C:\Program Files\Mailtraq\database\mail\pending\LPT048C7250 [0079AB58] Recursive call (3 times)


17.10.2004 20:02 EXCEPTION (Cannot open file  "C:\Program Files\Mailtraq\database\mail\pending\LPT048C7250

then that normally indicates a problem with an anti-virus, or back-up program that is locking a file that Mailtraq is trying to use. This KB article explains how to fix that -  KB04102101 EXCEPTION & Error 103


Why did this happen?

The most common cause of corrupted mailboxes and exceptions is abrupt power failure without shutdown, followed by wrongly set-up Anti-Virus and/or backup software.

Mailtraq is an asynchronous service, mostly running in the background, and it can be busy doing something - like receiving an email - at any time. If you abruptly cut the power or shut down a Virtual Machine, Mailtraq may be in the middle of some task that does not get completed  and so database corruption can happen.

Always stop the Mailtraq service - which may take time - before rebooting or powering down. Mailtraq should automatically start when the system restarts.


Read about how to safely stop the Mailtraq service here...

Read about correctly installing Anti-Virus here...

Read about correctly managing backups here...


Getting more information - The Exceptions Log

Each exception that Mailtraq encounters and logs is also entered into a special exceptions log.

The default location is at:  
C:\Program Files\Mailtraq or C:\Program Files(X86)\Mailtraq

This file is called:

mailtraq.exc or MailtraqService.exc    -  note that extension is exC

This is also a simple text file. Entries are appended to this file, so the most recent event is at the bottom. Examining the exc entry for an 'exception' will give more details.


Getting more help

If you are encountering 'exceptions' that you do not understand and cannot resolve yourself, you can get help from Support. They will ask you to send them an extract of the Event Log showing examples of the exception, together with the matching entries from the exc file.

If you have to send Event Logs and EXC files to Support, be sure to zip them before sending. If the zip files are bigger than 1MB be sure to email Support before sending otherwise they may be rejected. It is usually easiest to send large log files by one of the free online large file transfer services. Such as TransferBigFiles...

You must have valid Upgrade Protection to receive individual support of this nature. You can check on your support status in the About dialog and if necessary you can Renew your Upgrade Protection.


Keywords: kb troubleshooting
Mailtraq Highlights...
 SMTP Server     Mailtraq SMTP email server video IMAP Server     Mailtraq IMAP email Server video
 POP3 Server     Mailtraq POP3 email server video Proxy Server     Mailtraq proxy email server video
 Webmail Server     Mailtraq webmail email server video Mailing-list Server     Mailing list email server video
 Groupware Services     Mailtraq groupware email services video Spam and Virus control     Spam and virus control email server video


   Copyright © 2003 - 2011 Enstar Ltd, Enstar LLC & Fastraq Ltd. All rights reserved. Privacy policy.
   Mailtraq® is a registered trademark of Fastraq Limited.