Mailtraq - the Complete Email Server

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

Search for:

Advanced search

KB16051301 IMAP Manual delete by UID


How to manually delete a corrupted message from a mailbox.

If you believe a message in a mailbox has become corrupted you should always first try to identify it in the Mailtraq Console and delete it from the mailbox using the Console commands - Select, right-click, Delete and then Refresh.

If you are unable to identify the message in the Console, but do know the UID from the Mailtraq Event Log then you can use Telnet to manually delete the message from the mailbox.

IMAP is normally served on Port 143

These actions cannot be reversed.
You should ensure you have a valid backup of the Mailbox before starting.

Using Telnet

Telnet is a text-based program you can use to connect to another computer across your network or using the Internet. You'll be able to access programs and services that are on the remote computer. You can also use Telnet on the same machine as Mailtraq by substituting for the server IP address.

If you are unfamiliar with using Telnet we provide instructions here: Telnet Primer


  1. You first connect to the IMAP service on Mailtraq using Telnet.
  2. Login with the username and password.
  3. Select the INBOX.
  4. Use FETCH to 'get' the message identified by the UID obtained from the log file.
  5. Copy the message to 'Trash'.
  6. Delete it from 'Trash'.
  7. Remove it from 'Trash' with the Expunge command.
  8. Logout.


Procedure example

How to manually delete a message with a UID = 6

In the following worked example you type the commands in blue, and you will expect to see the server respond as in the black text. You must replace '6' in the example with the UID of the message you wish to delete.

At a CMD prompt:   telnet[space] IP ADDRESS[space]143

For example: 

telnet 143

The Command prompt will refresh and you will be in a Telnet IMAP session.

* OK IMAP4rev1 Mailtraq ( ready
a1 LOGIN username passworda1 OK LOGIN completed for username
* FLAGS (\Answered \Deleted \Draft \Flagged \Recent \Seen \*)
* OK [UNSEEN 1] first unseen
* OK [UIDNEXT 15] predicted next UID
* OK [UIDVALIDITY 10] UIDs are valid
* OK [PERMANENTFLAGS (\Answered \Deleted \Draft \Flagged \Seen \*)] flags
a2 OK [READ-WRITE] SELECT completed
a3 FETCH 6 (UID)
* 6 FETCH (UID 6)
a3 OK FETCH completed
a4 uid copy 6 trash
a4 OK [COPYUID 13 6 15] COPY completed
a5 uid store 6 +flags.silent (\Seen \Deleted)a5 OK STORE completed
a6 expungea6 OK EXPUNGE completed
a7 logout
* BYE IMAP4rev1 Server Logout
a7 OK LOGOUT completed
Connection to host lost.


After step a4, if you examined the Mailtraq mailbox in the console, you would see the message moved to the 'Folder' called Trash.

Keywords: kb clients 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.