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.
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 127.0.0.1 for the server IP address.
If you are unfamiliar with using Telnet we provide instructions here: Telnet Primer
- You first connect to the IMAP service on Mailtraq using Telnet.
- Login with the username and password.
- Select the INBOX.
- Use FETCH to 'get' the message identified by the UID obtained from the log file.
- Copy the message to 'Trash'.
- Delete it from 'Trash'.
- Remove it from 'Trash' with the Expunge command.
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
telnet 127.0.0.1 143
The Command prompt will refresh and you will be in a Telnet IMAP session.
* OK mail.example.com IMAP4rev1 Mailtraq (188.8.131.5282) ready
a1 LOGIN username passworda1 OK LOGIN completed for username
a2 SELECT INBOX
* FLAGS (\Answered \Deleted \Draft \Flagged \Recent \Seen \*)
* 14 EXISTS
* 0 RECENT
* 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
* 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.