1

I wanted to fully explore IMAP connections from the command line, if I can connect via Thunderbird, then I should be able to via telnet?!

Microsoft detail IMAP login as :-

LOGIN NTDOMAIN/NTACCOUNT/ALIAS PASSWORD

The settings in my Thunderbird are :-

<domain>\<username>\<alias>

Various sources state slightly different IMAP commands :-

LOGIN user@domain.com <password>                                   (1)
LOGIN <Domain_Name>/<Log_On_Name> <Password>                       (2)
LOGIN <LogOnName>@<DomainName>.<Top-Level_Domain_Name> <Password>  (3)
LOGIN DOMAIN/USERNAME/MAILBOX                                      (4)
LOGIN NTDOMAIN/NTACCOUNT/ALIAS PASSWORD                            (5)

POP attempts :-

telnet <servername> pop3
+OK Microsoft Exchange POP3 server version 5.5.2658.25 ready
user <username>
+OK
pass <password>
-ERR Logon failure: unknown user name or bad password.

user <domain>\<username>
+OK
pass <password>
-ERR There is no such mailbox on this server

The later shows that it my account access was authorised.

IMAP attempts :-

telnet <servername> imap
* OK Microsoft Exchange IMAP4rev1 server version 5.5.2658.25 (<servername>) ready
login <domain>/<username> <password>
login BAD Protocol Error: "Unidentifiable command specified"
login <username>@<domain>.<servername> <password>
login BAD Protocol Error: "Unidentifiable command specified"
login <domain>/<username>/IanVaughan
login BAD Protocol Error: "Unidentifiable command specified"
LOGIN
* BAD Protocol Error: "Tag not found in command"
login
login BAD Protocol Error: "No space following tag in IMAP command"
LOGIN <domain>/<username> <password>
LOGIN BAD Protocol Error: "Unidentifiable command specified"
LOGIN <username>@<domain> <password>
LOGIN BAD Protocol Error: "Unidentifiable command specified"
IanVaughan
  • 133
  • 2
  • 10

2 Answers2

3

You've misunderstood IMAP. Every IMAP command has to be preceded with an identification token, so instead of LOGIN domain/user/mailbox password the KB article you quoted advises you to use ? LOGIN domain/user/mailbox password (note the ? prepended to the LOGIN command - which is the mentioned token).

BTW: you do not necessarily have to use domain/user/mailbox - simply using "user" (the Windows NT logon user name) will connect you to that user's mailbox automatically.

Another thing is the authentication mechanism - plain authentication (simply supplying the password in clear) is discouraged due to its insecurity and thus most servers refuse plain authentication and force users to use a digest auth instead if SSL is not used. I do not know if Exchange 5.5 does so by default, though.

the-wabbit
  • 40,737
  • 13
  • 111
  • 174
0

Usually, I use telnet to verify the email server connection. However, you need to make sure you are issuing valid commands Unidentifiable command specified. Also, you need to make sure you specifying the username and password correctly.

When connecting to POP3 service, I am not sure if username\domain format will work. I usually use one of the forms:

user username
user username@domain

If you can login using an email client such as Thunderbird or Outlook, you can simply use a network sniffer like wireshark to check for the correct POP3/IMAP commands.

Khaled
  • 36,533
  • 8
  • 72
  • 99