Debian Codegraph @

check_email_delivery/src/docs/How to connect to IMAP server manually.txt

raw
1 HOW TO CONNECT TO IMAP SERVER MANUALLY
2
3 This how-to borrowed from: http://www.bincimap.org/bincimap-faq.html
4
5
6 1) Connection
7 Using telnet, connect to your service on port 143. Replace "server" with your server's name. If the server is set up correctly, you will see this greeting:
8 # telnet server 143
9 * OK IMAP Server ready
10
11 If you have SSL enabled (most likely you do), connect to port 993 with the openssl tool. If the server is set up correctly, you will see this greeting:
12 # openssl s_client -connect server:993 -crlf
13 * OK IMAP Server ready
14
15 2) Logging in / authenticating
16 Firstly, check your bincimap.conf file, in the "Authentication" section, for this setting:
17 allow plain auth in non ssl = "no"
18
19 If you want users to be able to connect without using SSL, set this to "yes".
20 Using either the telnet (in case of "yes" in the above example) or openssl tool, try the LOGIN command, replacing "username" with one username on your server, and "password" with that user's password. You should get the reply on the second line.
21 1 LOGIN username password
22 1 LOGIN completed
23
24 Note that you should try logging in with at least two users to check that this feature is working properly.
25 3) Listing, creating, renaming and deleting mailboxes
26 Enter the following command to list the user's first level mailboxes. You should get at least one line of response (starting with "* LIST") before you get the "2 OK LIST" reponse.
27 2 LIST "" "%"
28 * LIST (\UnMarked) "/" "INBOX"
29 2 OK LIST completed
30
31 Check your bincimap.conf file, under the Mailbox section, and check the "depot" setting. Try creating a mailbox with the following command, replacing mailbox with a name of your choice. Note that if you are using the Maildir++ depot setting, you must use "INBOX/mailbox" instead:
32 3 CREATE mailbox
33 3 OK CREATE completed
34
35 Rename the mailbox with this command. Note the "INBOX/" prefix when using a Maildir++ depot. (After that, rerunning the LIST command from above will give you a slightly different result than before):
36 4 RENAME mailbox newmailbox
37 4 OK RENAME completed
38
39 Now delete the mailbox with this command:
40 5 DELETE newmailbox
41 5 OK DELETE completed
42
43 4) Selecting a mailbox and looking inside
44 Select your INBOX with this command. Note that the response may be slightly different from in this example:
45 6 SELECT INBOX
46 * 146 EXISTS
47 * OK [UIDVALIDITY 1047992537]
48 * OK [UIDNEXT 2683] 2683 is the next UID
49 * FLAGS (\Answered \Flagged \Deleted \Recent \Seen \Draft)
50 * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft)] Limited
51 6 OK [READ-WRITE]
52
53 Fetch the flags of all your messages with this command. Note that the "..." is for editorial clarity, many lines of output have been omitted in this example:
54 7 FETCH 1:* FLAGS
55 * 1 FETCH (FLAGS (\Seen \Answered))
56 * 2 FETCH (FLAGS (\Seen \Answered))
57 ...
58 * 146 FETCH (FLAGS (\Seen \Answered))
59 7 OK FETCH completed
60
61 Set a flag with this command:
62 8 STORE 1 +FLAGS \Flagged
63 * FETCH (FLAGS (\Seen \Flagged))
64 8 OK STORE completed
65
66 5) Logging out
67 9 LOGOUT
68 * BYE Server logging out
69 9 OK LOGOUT finished.