ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/proj/trunk/IMAPHandler/Tester.cpp
Revision: 114
Committed: 2003-03-31T23:08:58-08:00 (22 years, 2 months ago) by douglas
File size: 1333 byte(s)
Log Message:
More, more!

File Contents

# Content
1 // IMAP Handler
2 //
3 // Douglas Thrift
4 //
5 // Tester.cpp
6
7 #include "IMAPHandler.h"
8
9 string program;
10 bool debug = true;
11
12 int main(int argc, char* argv[])
13 {
14 program = argv[0];
15
16 IMAPHandler tester("imap.myrealbox.com", false);
17
18 tester.capability();
19 tester.starttls();
20 tester.capability();
21 // tester.noop();
22
23 char* login = new char[32 + 1];
24 char* password = new char[32 + 1];
25
26 cout << "login: " << flush;
27 cin.getline(login, 32);
28 cout << "password: " << flush;
29 cin.getline(password, 32);
30
31 tester.login(string(login) + ' ' + password);
32
33 memset(login, 0, strlen(login));
34 memset(password, 0, strlen(password));
35
36 delete [] login;
37 delete [] password;
38
39 cout << tester.list("\"\" *");
40 tester.status_("INBOX (MESSAGES UNSEEN)");
41 tester.examine("INBOX");
42
43 string message = string("Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)\r\n")
44 + "From: Fred Foobar <foobar@Blurdybloop.COM>\r\n"
45 + "Subject: afternoon meeting\r\n"
46 + "To: mooch@owatagu.siam.edu\r\n"
47 + "Message-Id: <B27397-0100000@Blurdybloop.COM>\r\n"
48 + "MIME-Version: 1.0\r\n"
49 + "Content-Type: TEXT/PLAIN; CHARSET=US-ASCII\r\n\r\n"
50 + "Hello Joe, do you think we can meet at 3:30 tomorrow?\r\n";
51
52 char length[4];
53 sprintf(length, "%u", message.length());
54
55 tester.append("INBOX {" + string(length) + "}", message);
56 tester.noop();
57 tester.logout();
58
59 return 0;
60 }