golang IMAP client library
Revision | e538227818c1d060feb8646026e90a375a9b0037 (tree) |
---|---|
Time | 2011-10-28 10:50:04 |
Author | Evan Martin <martine@dang...> |
Commiter | Evan Martin |
prettier
@@ -68,7 +68,7 @@ func readExtra(im *imap.IMAP) { | ||
68 | 68 | func (ui *UI) connect(useNetmon bool) *imap.IMAP { |
69 | 69 | user, pass := loadAuth("auth") |
70 | 70 | |
71 | - ui.status("connecting") | |
71 | + ui.status("connecting...") | |
72 | 72 | conn, err := tls.Dial("tcp", "imap.gmail.com:993", nil) |
73 | 73 | check(err) |
74 | 74 |
@@ -87,19 +87,20 @@ func (ui *UI) connect(useNetmon bool) *imap.IMAP { | ||
87 | 87 | check(err) |
88 | 88 | ui.status("server hello: %s", hello) |
89 | 89 | |
90 | - ui.status("logging in") | |
90 | + ui.status("logging in...") | |
91 | 91 | resp, caps, err := im.Auth(user, pass) |
92 | 92 | check(err) |
93 | - ui.status("capabilities: %s", caps) | |
94 | 93 | ui.status("%s", resp) |
94 | + ui.status("server capabilities: %s", caps) | |
95 | 95 | |
96 | 96 | return im |
97 | 97 | } |
98 | 98 | |
99 | 99 | func (ui *UI) fetch(im *imap.IMAP, mailbox string) { |
100 | + ui.status("opening %s...", mailbox) | |
100 | 101 | examine, err := im.Examine(mailbox) |
101 | 102 | check(err) |
102 | - ui.status("%+v", examine) | |
103 | + ui.status("mailbox status: %+v", examine) | |
103 | 104 | readExtra(im) |
104 | 105 | |
105 | 106 | f, err := os.Create(mailbox + ".mbox") |
@@ -107,12 +108,12 @@ func (ui *UI) fetch(im *imap.IMAP, mailbox string) { | ||
107 | 108 | mbox := newMbox(f) |
108 | 109 | |
109 | 110 | query := fmt.Sprintf("1:%d", examine.Exists) |
110 | - ui.status("fetching %s", query) | |
111 | + ui.status("fetching messages %s", query) | |
111 | 112 | |
112 | 113 | ch, err := im.FetchAsync(query, []string{"RFC822"}) |
113 | 114 | check(err) |
114 | 115 | |
115 | - i := 0 | |
116 | + i := 1 | |
116 | 117 | L: |
117 | 118 | for { |
118 | 119 | r := <-ch |