ArticlesArticles Most Popular ArticlesMost Popular Articles
RSS Feeds
DrillDown Icon Table of Contents
DrillDown Icon 2020 Official Holidays & Support Schedule
DrillDown Icon IMPORTANT: End of Life of SHA1 on Windows Server 2003
DrillDown Icon IMPORTANT: Supported Operating Systems
DrillDown Icon PLEASE READ: Our Update Server IPs Have Changed
DrillDown Icon Support
DrillDown Icon modusGate for Microsoft Azure
DrillDown Icon modusCloud
DrillDown Icon Alleviating Spam – Best Practices
DrillDown Icon directQuarantine Technical Information
DrillDown Icon modusMail & modusGate Technical Information
DrillDown Icon Documentation & Release Information
DrillDown Icon Known Issues (non-release related)
DrillDown Icon Configuration Information
DrillDown Icon modusGate & modusMail
DrillDown Icon modusGate Only
DrillDown Icon modusMail Only
DrillDown Icon How-to: Respool Mailbox Contents
DrillDown Icon How-to: Export Contacts from Outlook and Outlook Express to WebMail
DrillDown Icon Info: SSL Encryption is Disabled by Service Pack 2 or Windows Firewall
DrillDown Icon How-To: MODUSCAN Does Not Start, Service Terminated with Service-specific Error 2 (0x2)
DrillDown Icon How-To: Switch from the Standard User Database to the Extended Database
DrillDown Icon Info: Mailing Lists Moderation Feature for a Cluster or Blockade Setup
DrillDown Icon Work-around: Unusual Behavior Encountered When Using an External Email Address in the Forward Mail To field
DrillDown Icon Info for Customers Using the Extended Database Format
DrillDown Icon Info: Platypus Integration Information
DrillDown Icon Info: Rodopi Interface Information
DrillDown Icon Info: Using Telnet to Test a POP3 Connection
DrillDown Icon Info: Using Telnet to Test an IMAP4 Connection
DrillDown Icon How-To: Change the POP3 Timeout Value
DrillDown Icon How-To: Configure an IMAP Quarantine Folder for Email Clients
DrillDown Icon How-To: Configure Database Mailing Lists
DrillDown Icon How-To: Customize the Quota Warning Messages
DrillDown Icon How-To: Manage a Mailing List by Email
DrillDown Icon How-To: Send a Broadcast Email to Your Users
DrillDown Icon How-To: Switch Mailboxes from Database to Generic (Registry)
DrillDown Icon How-To: Switch Mailboxes from Registry to Database
DrillDown Icon How-To: Switch Mailboxes from WorldGroup to Registry
DrillDown Icon How-To: Use Mailbox Command Line Functions
DrillDown Icon How-To: Use the Maildomain Command Line Functions
DrillDown Icon How-To: Write a Mail Agent
DrillDown Icon Problem: Cannot Create New Mailboxes or Access Existing Accounts
DrillDown Icon SQL Server Information
DrillDown Icon MySQL Information
DrillDown Icon Security
DrillDown Icon Sieve
DrillDown Icon Spam and False-Positives
DrillDown Icon Statistics and Monitoring Section
DrillDown Icon Web Components
DrillDown Icon Troubleshooting
DrillDown Icon Hardware & OS System Requirements
DrillDown Icon Tools
DrillDown Icon Other Product Technical Information
DrillDown Icon Professional Services
DrillDown Icon Newsletters
  Email This ArticlePrint PreviewPrint Current Article/Category and All Sub-Articles/Categories
Info: Using Telnet to Test an IMAP4 Connection


Product: ModusMail

Version & Build: All


Telnet commands can be used to test IMAP4 connections to the mail server to a) see if we can successfully open an IMAP session on the server and b) if we can access a valid email address.

Below you'll find the standard syntax used for the telnet commands:

Example:  The IMAP connection for is configured on IP, port 143.
On the ModusMail server, open a DOS command window (e.g., Start > Run > cmd):

1. Use the telnet command to open a connection to the mail server, e.g. type: telnet 143 <Enter>

Note: if using Windows 2000, you may want to use the following set of commands to turn the local echo function on and display what you're typing. Local echo is enabled on Windows 2003 and XP by default.

    • From the DOS prompt, type telnet <Enter>
    • Type set local_echo <Enter>
    • Type open 143 <Enter>

2. Important notes:  Telnet does not allow backspaces, so if you make a mistake when entering the commands, start over.  Each IMAP command line normally begins with a sequential number followed by a space, but you can use ? instead of numbers.

3. When the telnet screen opens, you should see the mail server's banner, similar to: 
* OK ModusMail IMAP4S 4.2.420.0 ready
(If you do not get a banner, check the IP address and firewall configuration and start the test again)

4. Login using the command '? login <username> <password>':

  • If the mailbox is located in a domain that has its own unique IP, enter only the username, e.g. ? login betsy test
  • If the mailbox is located in a virtual domain (that does not have its own IP), enter the full email address as the username, e.g. ? login test

5. The list command can be used to list all available folders. You could specify the name of the directory where mail is stored or enter the following: ? list "" "*"

6. Use the select command to display the contents of a specific folder, e.g. enter ? select inbox

7. Use the fetch command to display specific message information. Enter the message number followed by one of the following tags:

Flags - displays all message flags such as answered, flagged, deleted, seen or draft


To fetch the flags on message #1, enter: ? fetch 1 flags

To fetch the flags on all messages in the Inbox, enter: ? fetch 1:* flags

Full - displays the full header information, enter: ? fetch 1 full

Body[text] - displays the message body (content), enter: ? fetch 1 body[text]

8. Logout using the 'logout' command, enter: ? logout

This is what it looks like on-screen:

* OK ModusMail IMAP4S 4.2.420.0 ready
? login test
? OK LOGIN completed
? list "" "*"
* LIST (\Select) "/" Drafts
* LIST (\Select \Noinferiors) "/" Inbox
* LIST (\Select) "/" "Sent Items"
? OK LIST completed
? select inbox
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft \*)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \*)]
* OK [UNSEEN 5] Message 2 is first unseen
* OK [UIDNEXT 10] Predicted next UID
* OK [UIDVALIDITY 25627141] UIDs are valid
? OK [READ-WRITE] opened inbox
? fetch 2 flags
* 2 FETCH (FLAGS ())
? OK FETCH completed
? fetch 1:* flags
* 1 FETCH (FLAGS (\Seen))
* 2 FETCH (FLAGS ())
* 3 FETCH (FLAGS ())
* 4 FETCH (FLAGS (\Seen))
* 5 FETCH (FLAGS (\Seen))
* 6 FETCH (FLAGS ())
* 7 FETCH (FLAGS (\Seen))
* 8 FETCH (FLAGS ())
* 9 FETCH (FLAGS ())
? OK FETCH completed
? fetch 1 body[text]
* 1 FETCH (BODY[text] {8244}
This is a multi-part message in MIME format.

Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit


This is a spam and virus report sent to on Sat Sep 10 04:00:00 2005

xxxx (the full html content of the form is displayed)

? OK FETCH completed
? logout
* BYE IMAP4 Server logging out
? OK LOGOUT completed


Modified 12/20/2006
Keywords: telnet IMAP4
Article ID: 1420