author | zautrix <zautrix> | 2005-02-12 22:58:10 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-12 22:58:10 (UTC) |
commit | 00ec9899a4727a4c9100d320935dde7da4803801 (patch) (unidiff) | |
tree | 22c5100623497bc135d13e65a1da993ed5999d4b | |
parent | d45d293d045a8d0f68e09ff9414e2dd6d18dd651 (diff) | |
download | kdepimpi-00ec9899a4727a4c9100d320935dde7da4803801.zip kdepimpi-00ec9899a4727a4c9100d320935dde7da4803801.tar.gz kdepimpi-00ec9899a4727a4c9100d320935dde7da4803801.tar.bz2 |
imap login fix
-rw-r--r-- | bin/kdepim/WhatsNew.txt | 4 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/imapwrapper.cpp | 17 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/imapwrapper.h | 2 |
3 files changed, 17 insertions, 6 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 77f5829..1a3f827 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,391 +1,395 @@ | |||
1 | Info about the changes in new versions of KDE-Pim/Pi | 1 | Info about the changes in new versions of KDE-Pim/Pi |
2 | 2 | ||
3 | ********** VERSION 2.0.7 ************ | 3 | ********** VERSION 2.0.7 ************ |
4 | 4 | ||
5 | Added global application font settings | 5 | Added global application font settings |
6 | (for all KDE-Pim/Pi apps) to the general settings. | 6 | (for all KDE-Pim/Pi apps) to the general settings. |
7 | 7 | ||
8 | Fixed a problem in OM/Pi when trying to login to some IMAP servers | ||
9 | (like the IMAP server of Apple: mail.mac.com ) | ||
10 | |||
11 | |||
8 | ********** VERSION 2.0.6 ************ | 12 | ********** VERSION 2.0.6 ************ |
9 | 13 | ||
10 | Some bugfixes in the pi-sync mode. | 14 | Some bugfixes in the pi-sync mode. |
11 | Added German translation for pi-sync mode. | 15 | Added German translation for pi-sync mode. |
12 | 16 | ||
13 | KO/Pi: | 17 | KO/Pi: |
14 | Made the todolist using alternate background. | 18 | Made the todolist using alternate background. |
15 | 19 | ||
16 | Other minor fixes in KO/Pi. | 20 | Other minor fixes in KO/Pi. |
17 | 21 | ||
18 | 22 | ||
19 | ********** VERSION 2.0.5 ************ | 23 | ********** VERSION 2.0.5 ************ |
20 | 24 | ||
21 | Bugfixes in KO/Pi. | 25 | Bugfixes in KO/Pi. |
22 | 26 | ||
23 | ********** VERSION 2.0.4 ************ | 27 | ********** VERSION 2.0.4 ************ |
24 | 28 | ||
25 | KO/Pi: | 29 | KO/Pi: |
26 | Fixed problem loading translations for summary/location edit boxes in event/todo editor. | 30 | Fixed problem loading translations for summary/location edit boxes in event/todo editor. |
27 | 31 | ||
28 | Added a general "select week number" to the toolbar. | 32 | Added a general "select week number" to the toolbar. |
29 | 33 | ||
30 | Fixed some small problem of the new features introduced in version 2.0.3. | 34 | Fixed some small problem of the new features introduced in version 2.0.3. |
31 | 35 | ||
32 | Made it possible to specify one specific category as category color, | 36 | Made it possible to specify one specific category as category color, |
33 | if more than one categories are selected. | 37 | if more than one categories are selected. |
34 | 38 | ||
35 | Fixed a bug in saving colors for categories with non-ascii characters. | 39 | Fixed a bug in saving colors for categories with non-ascii characters. |
36 | (Like, e.g. German Umlauts). | 40 | (Like, e.g. German Umlauts). |
37 | Propably you have to set your colors again for those categories. | 41 | Propably you have to set your colors again for those categories. |
38 | 42 | ||
39 | 43 | ||
40 | ********** VERSION 2.0.3 ************ | 44 | ********** VERSION 2.0.3 ************ |
41 | 45 | ||
42 | KO/Pi: | 46 | KO/Pi: |
43 | Added feature for changing alarm settings for many items at once: | 47 | Added feature for changing alarm settings for many items at once: |
44 | Open list view (or search dialog), select the desired items and choose in | 48 | Open list view (or search dialog), select the desired items and choose in |
45 | the popup menu: Set alarm for selected... | 49 | the popup menu: Set alarm for selected... |
46 | 50 | ||
47 | Added to the event/todo viewer the option to send an email to | 51 | Added to the event/todo viewer the option to send an email to |
48 | all attendees or all selected (with RSVP) attendees. | 52 | all attendees or all selected (with RSVP) attendees. |
49 | 53 | ||
50 | Made the week-month mode changing in month view faster. | 54 | Made the week-month mode changing in month view faster. |
51 | 55 | ||
52 | Made month view better useable with keyboard. | 56 | Made month view better useable with keyboard. |
53 | Now TAB key jumps to next cell with an event/todo. | 57 | Now TAB key jumps to next cell with an event/todo. |
54 | Scroll in cell with coursor keys, scroll in time (next week) with | 58 | Scroll in cell with coursor keys, scroll in time (next week) with |
55 | Shift/Control + coursorkeys. | 59 | Shift/Control + coursorkeys. |
56 | 60 | ||
57 | Fixed bug that the todo view flat mode was reset after first view update. | 61 | Fixed bug that the todo view flat mode was reset after first view update. |
58 | 62 | ||
59 | If a todo is displayed closed in the todo view, | 63 | If a todo is displayed closed in the todo view, |
60 | it is now displayed in overdue/due today color depending on the subtodos overdue/due today properties. | 64 | it is now displayed in overdue/due today color depending on the subtodos overdue/due today properties. |
61 | 65 | ||
62 | Added info about the numbers of years to the caption (title) information about a birthday event. | 66 | Added info about the numbers of years to the caption (title) information about a birthday event. |
63 | 67 | ||
64 | Made completion date in todo editor editable. | 68 | Made completion date in todo editor editable. |
65 | 69 | ||
66 | Added possibility to save/load templates for journals. | 70 | Added possibility to save/load templates for journals. |
67 | (Which is just a simple "save text to file" or "insert text from file". | 71 | (Which is just a simple "save text to file" or "insert text from file". |
68 | 72 | ||
69 | ********** VERSION 2.0.2 ************ | 73 | ********** VERSION 2.0.2 ************ |
70 | 74 | ||
71 | KO/Pi: | 75 | KO/Pi: |
72 | Fixed the layout problem of the day label buttons | 76 | Fixed the layout problem of the day label buttons |
73 | of the agenda view introduced in version 2.0.1. | 77 | of the agenda view introduced in version 2.0.1. |
74 | 78 | ||
75 | Added WhatsThis support for the todo view and the list view. | 79 | Added WhatsThis support for the todo view and the list view. |
76 | 80 | ||
77 | Added a quite useful feature to the montview. | 81 | Added a quite useful feature to the montview. |
78 | Just click on the week numbers on the left. | 82 | Just click on the week numbers on the left. |
79 | And in the top right corner of month view/agenda view | 83 | And in the top right corner of month view/agenda view |
80 | there is now a "week number quick selector". | 84 | there is now a "week number quick selector". |
81 | (Click on the black triangle). | 85 | (Click on the black triangle). |
82 | 86 | ||
83 | Made the quite difficult timezone change in KO/Pi easy. | 87 | Made the quite difficult timezone change in KO/Pi easy. |
84 | 88 | ||
85 | OM/Pi: | 89 | OM/Pi: |
86 | Fixed too small icons on desktop. | 90 | Fixed too small icons on desktop. |
87 | Fixed non visible icons in mainwindow on Z with fastload enabled. | 91 | Fixed non visible icons in mainwindow on Z with fastload enabled. |
88 | Added signature file setting to smtp account config. | 92 | Added signature file setting to smtp account config. |
89 | And the signature can be edited and saved in the edit mail dialog. | 93 | And the signature can be edited and saved in the edit mail dialog. |
90 | That does mean: | 94 | That does mean: |
91 | Simply edit the signature for the selected smtp account in the | 95 | Simply edit the signature for the selected smtp account in the |
92 | edit new mail dialog and press the "save signature" button there. | 96 | edit new mail dialog and press the "save signature" button there. |
93 | Then the signature is saved to the file specified in the smtp account settings. | 97 | Then the signature is saved to the file specified in the smtp account settings. |
94 | If there is no file specified, it is saved automatically to the file | 98 | If there is no file specified, it is saved automatically to the file |
95 | kdepim/apps/kopiemail/<accountname>.sig. | 99 | kdepim/apps/kopiemail/<accountname>.sig. |
96 | 100 | ||
97 | 101 | ||
98 | 102 | ||
99 | ********** VERSION 2.0.1 ************ | 103 | ********** VERSION 2.0.1 ************ |
100 | 104 | ||
101 | Oooops ... I forgot to test on the Zaurus 5500 ... | 105 | Oooops ... I forgot to test on the Zaurus 5500 ... |
102 | 106 | ||
103 | Fixed many problems of new (english) strings (and german translations) | 107 | Fixed many problems of new (english) strings (and german translations) |
104 | introduced in the latest versions, where the text was not fitting on the | 108 | introduced in the latest versions, where the text was not fitting on the |
105 | 240x320 display of the Zaurus 5500. | 109 | 240x320 display of the Zaurus 5500. |
106 | 110 | ||
107 | KO/Pi: | 111 | KO/Pi: |
108 | Added a popup menu ( press pen and hold to get popup ) to the agenda view | 112 | Added a popup menu ( press pen and hold to get popup ) to the agenda view |
109 | with many useful items (add event/todo, show next week, two weeks, month, journal). | 113 | with many useful items (add event/todo, show next week, two weeks, month, journal). |
110 | 114 | ||
111 | Added items to the todolist popup menu for: | 115 | Added items to the todolist popup menu for: |
112 | Display all opened, all closed or all todos flat. | 116 | Display all opened, all closed or all todos flat. |
113 | The "flat" view makes is possible to sort all todos after ,e.g., prio or date. | 117 | The "flat" view makes is possible to sort all todos after ,e.g., prio or date. |
114 | Made the reparenting of todos on the desktop possible via Drag&Drop. | 118 | Made the reparenting of todos on the desktop possible via Drag&Drop. |
115 | Fixed several bugs in setting the completed datetime for todos. | 119 | Fixed several bugs in setting the completed datetime for todos. |
116 | Added info about completed datetime of todos to the todo viewer. | 120 | Added info about completed datetime of todos to the todo viewer. |
117 | Now displaying a completed todo (with completed datetime set) in the agenda view | 121 | Now displaying a completed todo (with completed datetime set) in the agenda view |
118 | at the time of the completion. Such that now it is possible to see in the agenda view | 122 | at the time of the completion. Such that now it is possible to see in the agenda view |
119 | when what todo was completed. | 123 | when what todo was completed. |
120 | Fixed behaviour of automatic setting completion of todos with sub-todos/parent todos. | 124 | Fixed behaviour of automatic setting completion of todos with sub-todos/parent todos. |
121 | Now the behaviour is: | 125 | Now the behaviour is: |
122 | Setting a parent to complete sets all (sub)childs to complete. | 126 | Setting a parent to complete sets all (sub)childs to complete. |
123 | Setting a parent to uncomplete does not change the childs. | 127 | Setting a parent to uncomplete does not change the childs. |
124 | Setting a child to uncomplete sets all parent to uncomplete. | 128 | Setting a child to uncomplete sets all parent to uncomplete. |
125 | Setting a child to complete does not change the parents. | 129 | Setting a child to complete does not change the parents. |
126 | 130 | ||
127 | Smart updating and double buffering of the daymatrix. | 131 | Smart updating and double buffering of the daymatrix. |
128 | Showing holidays in the day matrix. | 132 | Showing holidays in the day matrix. |
129 | Many other small performance updates. | 133 | Many other small performance updates. |
130 | 134 | ||
131 | Made day labels in agenda clickable. By clicking a label, the day is displayed in single day mode. | 135 | Made day labels in agenda clickable. By clicking a label, the day is displayed in single day mode. |
132 | 136 | ||
133 | Now the translation file usertranslation.txt is supposed to be in utf8 format. | 137 | Now the translation file usertranslation.txt is supposed to be in utf8 format. |
134 | If you want to translate a language from western europe, just change the germantranslation.txt file. Please read the updated Usertranslation HowTo in KO/Pi Help menu. | 138 | If you want to translate a language from western europe, just change the germantranslation.txt file. Please read the updated Usertranslation HowTo in KO/Pi Help menu. |
135 | 139 | ||
136 | 140 | ||
137 | ********** VERSION 2.0.0 ************ | 141 | ********** VERSION 2.0.0 ************ |
138 | 142 | ||
139 | Stable release 2.0.0! | 143 | Stable release 2.0.0! |
140 | 144 | ||
141 | KO/Pi: | 145 | KO/Pi: |
142 | Fixed problem in edit dialog recreation at startup. | 146 | Fixed problem in edit dialog recreation at startup. |
143 | Made "toggle view*" menu items enabled context sensitive. | 147 | Made "toggle view*" menu items enabled context sensitive. |
144 | Changed agenda size menu to items 1-10. | 148 | Changed agenda size menu to items 1-10. |
145 | Made it possible to change agenda size quickly by pressing mouse on timelabels in agenda view and move mouse up/down. | 149 | Made it possible to change agenda size quickly by pressing mouse on timelabels in agenda view and move mouse up/down. |
146 | Usebility enhancements in the KO/Pi menus. | 150 | Usebility enhancements in the KO/Pi menus. |
147 | Birthday import now adds year to summary. | 151 | Birthday import now adds year to summary. |
148 | What's Next view shows age in years for birthday. | 152 | What's Next view shows age in years for birthday. |
149 | 153 | ||
150 | OM/Pi: | 154 | OM/Pi: |
151 | Added three info lines to display subject, from and to of selected mails. | 155 | Added three info lines to display subject, from and to of selected mails. |
152 | 156 | ||
153 | KA/Pi: | 157 | KA/Pi: |
154 | Fixed jump bar behaviour on Zaurus. | 158 | Fixed jump bar behaviour on Zaurus. |
155 | Now KA/Pi search field supports searching for a range of starting characters. | 159 | Now KA/Pi search field supports searching for a range of starting characters. |
156 | E.g. to search for all contact beginning with b to n, type | 160 | E.g. to search for all contact beginning with b to n, type |
157 | b-n | 161 | b-n |
158 | in the search field. | 162 | in the search field. |
159 | 163 | ||
160 | ********** VERSION 1.9.20 ************ | 164 | ********** VERSION 1.9.20 ************ |
161 | 165 | ||
162 | KO/Pi: | 166 | KO/Pi: |
163 | Added for the "dislplay one day" agenda mode | 167 | Added for the "dislplay one day" agenda mode |
164 | info in the caption and in the day lables: | 168 | info in the caption and in the day lables: |
165 | Now it is displayed, if the selected day is from "day before yesterday" | 169 | Now it is displayed, if the selected day is from "day before yesterday" |
166 | to "day after tomorrow". | 170 | to "day after tomorrow". |
167 | Made it possible to delete a Todo, which has sub-todos. | 171 | Made it possible to delete a Todo, which has sub-todos. |
168 | Fixed two small problems in the todo view. | 172 | Fixed two small problems in the todo view. |
169 | Added missing German translation for filter edit and print dialog. | 173 | Added missing German translation for filter edit and print dialog. |
170 | Made search dialog closeable by cancel key. | 174 | Made search dialog closeable by cancel key. |
171 | 175 | ||
172 | Made it possible to select in the date picker the (ligt grey ) | 176 | Made it possible to select in the date picker the (ligt grey ) |
173 | dates of the prev./next month with the mouse. | 177 | dates of the prev./next month with the mouse. |
174 | 178 | ||
175 | OM/Pi: | 179 | OM/Pi: |
176 | "Delete mail" icon in main window now deletes all selected mails. | 180 | "Delete mail" icon in main window now deletes all selected mails. |
177 | Fixed the problem, that the state flag of imap mails was ignored. | 181 | Fixed the problem, that the state flag of imap mails was ignored. |
178 | Now mails with "FLAG_SEEN" on the imap server get no icon in the list view | 182 | Now mails with "FLAG_SEEN" on the imap server get no icon in the list view |
179 | to indecate that they are already seen. | 183 | to indecate that they are already seen. |
180 | Fixed the problem that the body of some mails was not displayed in the | 184 | Fixed the problem that the body of some mails was not displayed in the |
181 | mail viewer when fetching them from the imap server directly to read them. | 185 | mail viewer when fetching them from the imap server directly to read them. |
182 | Made it (configurable) possible to show the "To:" field in the list view. | 186 | Made it (configurable) possible to show the "To:" field in the list view. |
183 | Added to the mail viewer the option "View Source" to make it possible to see the raw mail data. | 187 | Added to the mail viewer the option "View Source" to make it possible to see the raw mail data. |
184 | Added a "Download Mail" button to the mail viewer to quickly download the viewed mail to the | 188 | Added a "Download Mail" button to the mail viewer to quickly download the viewed mail to the |
185 | local storage folder (specified in account settings) of the account of the mail. | 189 | local storage folder (specified in account settings) of the account of the mail. |
186 | Removed some memory leaks in OM/Pi. | 190 | Removed some memory leaks in OM/Pi. |
187 | 191 | ||
188 | 192 | ||
189 | ********** VERSION 1.9.19 ************ | 193 | ********** VERSION 1.9.19 ************ |
190 | 194 | ||
191 | Added a lot of missing translations to KA/Pi, | 195 | Added a lot of missing translations to KA/Pi, |
192 | Added some missing translations to KO/Pi and OM/Pi. | 196 | Added some missing translations to KO/Pi and OM/Pi. |
193 | 197 | ||
194 | Fixed some minor problems in KA/Pi + KO/Pi. | 198 | Fixed some minor problems in KA/Pi + KO/Pi. |
195 | 199 | ||
196 | Fixed a crash when closing PwM/Pi. | 200 | Fixed a crash when closing PwM/Pi. |
197 | Added German translation for PwM/Pi. | 201 | Added German translation for PwM/Pi. |
198 | 202 | ||
199 | Made view change and Month View update faster in KO/Pi. | 203 | Made view change and Month View update faster in KO/Pi. |
200 | 204 | ||
201 | 205 | ||
202 | ********** VERSION 1.9.18 ************ | 206 | ********** VERSION 1.9.18 ************ |
203 | 207 | ||
204 | FYI: The VERSION 1.9.17 was a testing release only. | 208 | FYI: The VERSION 1.9.17 was a testing release only. |
205 | Please read the changelog of VERSION 1.9.17 as well. | 209 | Please read the changelog of VERSION 1.9.17 as well. |
206 | 210 | ||
207 | Cleaned up the syncing config dialog. | 211 | Cleaned up the syncing config dialog. |
208 | Added sync config options for date range for events. | 212 | Added sync config options for date range for events. |
209 | Added sync config options for filters on incoming data. | 213 | Added sync config options for filters on incoming data. |
210 | Added sync config options for filters on outgoing data. | 214 | Added sync config options for filters on outgoing data. |
211 | Please read the updated SyncHowTo about the new filter settings. | 215 | Please read the updated SyncHowTo about the new filter settings. |
212 | These filter settings make it now possible to sync with shared | 216 | These filter settings make it now possible to sync with shared |
213 | calendars without writing back private or confidential data | 217 | calendars without writing back private or confidential data |
214 | (via the outgoing filters). | 218 | (via the outgoing filters). |
215 | To sync only with particular parts of a shared calendar, | 219 | To sync only with particular parts of a shared calendar, |
216 | the incoming filter settings can be used. | 220 | the incoming filter settings can be used. |
217 | An example can be found in the SyncHowTo. | 221 | An example can be found in the SyncHowTo. |
218 | Same for shared addressbooks. | 222 | Same for shared addressbooks. |
219 | 223 | ||
220 | Added a setting for the global kdepim data storage. | 224 | Added a setting for the global kdepim data storage. |
221 | Usually the data is stored in (yourhomedir/kdepim). | 225 | Usually the data is stored in (yourhomedir/kdepim). |
222 | Now you can set in the Global config dialog TAB, subTAB "Data storage path" | 226 | Now you can set in the Global config dialog TAB, subTAB "Data storage path" |
223 | a directory where all the kdepim data is stored. | 227 | a directory where all the kdepim data is stored. |
224 | That makes it easy to save all kdepim data on a SD card on the Z, for example. | 228 | That makes it easy to save all kdepim data on a SD card on the Z, for example. |
225 | 229 | ||
226 | KO/Pi: | 230 | KO/Pi: |
227 | The timeedit input has a pulldown list for times. | 231 | The timeedit input has a pulldown list for times. |
228 | If opened, this pulldown list should now has the right time highlighted. | 232 | If opened, this pulldown list should now has the right time highlighted. |
229 | Added the possibility to exclude events/todos/journals in a filter. | 233 | Added the possibility to exclude events/todos/journals in a filter. |
230 | You should exclude journals, if you do not want them to sync with a public calendar. | 234 | You should exclude journals, if you do not want them to sync with a public calendar. |
231 | 235 | ||
232 | KA/Pi: | 236 | KA/Pi: |
233 | Added the possibility to in/exclude public/private/confidential contacts to a filter. | 237 | Added the possibility to in/exclude public/private/confidential contacts to a filter. |
234 | If you have already defined filterrules in KA/Pi you have to adjust them all by setting the "include public/private/confidential" property manually. Sorry for that ... | 238 | If you have already defined filterrules in KA/Pi you have to adjust them all by setting the "include public/private/confidential" property manually. Sorry for that ... |
235 | Added printing of card view and details view on desktop. | 239 | Added printing of card view and details view on desktop. |
236 | Printing of list view is not working... | 240 | Printing of list view is not working... |
237 | Added button for removing pictures in contact editor. | 241 | Added button for removing pictures in contact editor. |
238 | Parsing data fix of KA/Pi version 1.9.17. | 242 | Parsing data fix of KA/Pi version 1.9.17. |
239 | Fixed the "parse name automatically" problem of KA/Pi version 1.9.17. | 243 | Fixed the "parse name automatically" problem of KA/Pi version 1.9.17. |
240 | Fixed some syncing merging problems. | 244 | Fixed some syncing merging problems. |
241 | 245 | ||
242 | 246 | ||
243 | ********** VERSION 1.9.17 ************ | 247 | ********** VERSION 1.9.17 ************ |
244 | 248 | ||
245 | KO/Pi: | 249 | KO/Pi: |
246 | Fixed that tooltips were not updated after moving an item in agenda view. | 250 | Fixed that tooltips were not updated after moving an item in agenda view. |
247 | Fixed a bug in sorting start date for recurring events in list view. | 251 | Fixed a bug in sorting start date for recurring events in list view. |
248 | Changed the left button in todo viewer from "Agenda" to "Set completed". | 252 | Changed the left button in todo viewer from "Agenda" to "Set completed". |
249 | This makes it possible to change a todo in the What's Next View quickly to the completed state without leaving the What's Next View. | 253 | This makes it possible to change a todo in the What's Next View quickly to the completed state without leaving the What's Next View. |
250 | Added more info in the todo viewer: Startdate, parent/sub todos. | 254 | Added more info in the todo viewer: Startdate, parent/sub todos. |
251 | 255 | ||
252 | 256 | ||
253 | KA/Pi: | 257 | KA/Pi: |
254 | All fields search does now actually search all the (possible) fields, | 258 | All fields search does now actually search all the (possible) fields, |
255 | not only those listed in the contact list. | 259 | not only those listed in the contact list. |
256 | Made is possible to inline a picture in a vcard on the Z. | 260 | Made is possible to inline a picture in a vcard on the Z. |
257 | This was only possible on the desktop, now is it possible on the Z as well. | 261 | This was only possible on the desktop, now is it possible on the Z as well. |
258 | Fixed of missing save settings after filter configuration. | 262 | Fixed of missing save settings after filter configuration. |
259 | Made saving of addressbook much faster. | 263 | Made saving of addressbook much faster. |
260 | Fixed extension widget layout problem. | 264 | Fixed extension widget layout problem. |
261 | Fixed saving of default formatted name settings. | 265 | Fixed saving of default formatted name settings. |
262 | Fixed formatted name handling in edit dialog. | 266 | Fixed formatted name handling in edit dialog. |
263 | Added an option for changing formatted names of many contacts | 267 | Added an option for changing formatted names of many contacts |
264 | (menu: File - Change - Set formatted name). | 268 | (menu: File - Change - Set formatted name). |
265 | 269 | ||
266 | QWhatsThis was not working on the Z ( only black rectangle was shown). | 270 | QWhatsThis was not working on the Z ( only black rectangle was shown). |
267 | This is Fixed. | 271 | This is Fixed. |
268 | 272 | ||
269 | KDE-Sync: | 273 | KDE-Sync: |
270 | Now readonly KDE resources are synced as well. | 274 | Now readonly KDE resources are synced as well. |
271 | (They are not changed in KDE itself, of course). | 275 | (They are not changed in KDE itself, of course). |
272 | 276 | ||
273 | 277 | ||
274 | 278 | ||
275 | ********** VERSION 1.9.16 ************ | 279 | ********** VERSION 1.9.16 ************ |
276 | 280 | ||
277 | KO/Pi: | 281 | KO/Pi: |
278 | Fixed search dialog size on Z 6000 (480x640 display). | 282 | Fixed search dialog size on Z 6000 (480x640 display). |
279 | Added setting to hide/show time in agenda items. | 283 | Added setting to hide/show time in agenda items. |
280 | Added setting to hide not running todos in todo view. | 284 | Added setting to hide not running todos in todo view. |
281 | Added columns for start date/time in todo view. | 285 | Added columns for start date/time in todo view. |
282 | Replaced the solid half-hour lines in agenda view by dot lines. | 286 | Replaced the solid half-hour lines in agenda view by dot lines. |
283 | Added possibility of printing the What's Next View on the desktop | 287 | Added possibility of printing the What's Next View on the desktop |
284 | (i.e. Windows and Linux). | 288 | (i.e. Windows and Linux). |
285 | Fixed a crash in KO/Pi when starting KO/Pi with What's Next view. | 289 | Fixed a crash in KO/Pi when starting KO/Pi with What's Next view. |
286 | Added tooltips in month view.(Tooltips only available on desktop) | 290 | Added tooltips in month view.(Tooltips only available on desktop) |
287 | 291 | ||
288 | Fixed a strange problem in KO/Pi alarm applet. | 292 | Fixed a strange problem in KO/Pi alarm applet. |
289 | Did not find the actual problem, | 293 | Did not find the actual problem, |
290 | such that now Qtopia reboots again if deinstalling the alarm applet. | 294 | such that now Qtopia reboots again if deinstalling the alarm applet. |
291 | But the alarm applet should work again. | 295 | But the alarm applet should work again. |
292 | 296 | ||
293 | KA/Pi: | 297 | KA/Pi: |
294 | Fixed the problem, that internal pictures were not saved. | 298 | Fixed the problem, that internal pictures were not saved. |
295 | 299 | ||
296 | Fixed a problem in the pi-sync mode by increasing the timeout for data transfer from 20 seconds to 5 minutes. | 300 | Fixed a problem in the pi-sync mode by increasing the timeout for data transfer from 20 seconds to 5 minutes. |
297 | 301 | ||
298 | Fixed some minor problems. (Like word wrap in help text windows). | 302 | Fixed some minor problems. (Like word wrap in help text windows). |
299 | 303 | ||
300 | Fixed a compiling problem in microkde/kresources. | 304 | Fixed a compiling problem in microkde/kresources. |
301 | 305 | ||
302 | KO/Pi is using zdbat (renamed to db2file) for syncing with Sharp DTM. | 306 | KO/Pi is using zdbat (renamed to db2file) for syncing with Sharp DTM. |
303 | This version now includes zdbat 1.0.0 (old version was zdbat 0.2.9) | 307 | This version now includes zdbat 1.0.0 (old version was zdbat 0.2.9) |
304 | such that now syncing KO/Pi with Sharp DTM should work on the | 308 | such that now syncing KO/Pi with Sharp DTM should work on the |
305 | Zaurus C 3000 model. | 309 | Zaurus C 3000 model. |
306 | 310 | ||
307 | ********** VERSION 1.9.15 ************ | 311 | ********** VERSION 1.9.15 ************ |
308 | 312 | ||
309 | Usebilty enhancements in KO/Pi: | 313 | Usebilty enhancements in KO/Pi: |
310 | When clicking on the date in a month view cell, the day view is shown. | 314 | When clicking on the date in a month view cell, the day view is shown. |
311 | Old behaviour was, that the "new event" dialog popped up. | 315 | Old behaviour was, that the "new event" dialog popped up. |
312 | 316 | ||
313 | Added a one step "undo delete" in KO/Pi (Accessable in the "Action" menu). | 317 | Added a one step "undo delete" in KO/Pi (Accessable in the "Action" menu). |
314 | That means, you can restore the latest | 318 | That means, you can restore the latest |
315 | event/todo/journal you have deleted. | 319 | event/todo/journal you have deleted. |
316 | A journal is deleted, if you clear all the text of the journal. | 320 | A journal is deleted, if you clear all the text of the journal. |
317 | 321 | ||
318 | Fixed the bug of the editor dialogs in KO/Pi of version 1.9.14. | 322 | Fixed the bug of the editor dialogs in KO/Pi of version 1.9.14. |
319 | 323 | ||
320 | KA/Pi starting in 480x640 resolution: | 324 | KA/Pi starting in 480x640 resolution: |
321 | Hide the filter action in toolbar | 325 | Hide the filter action in toolbar |
322 | and added icons for undo/delete/redo in toolbar. | 326 | and added icons for undo/delete/redo in toolbar. |
323 | 327 | ||
324 | Change in OM/Pi ViewMail dialog: | 328 | Change in OM/Pi ViewMail dialog: |
325 | When clicking on the "delete" icon the mail is deleted after confirmation as usual. | 329 | When clicking on the "delete" icon the mail is deleted after confirmation as usual. |
326 | But the edit dialog is not closed as before, now the next mail in the folder is shown automatically (if there is any). | 330 | But the edit dialog is not closed as before, now the next mail in the folder is shown automatically (if there is any). |
327 | 331 | ||
328 | Fixed a crash when deleting mail-accounts in OM/Pi. | 332 | Fixed a crash when deleting mail-accounts in OM/Pi. |
329 | 333 | ||
330 | 334 | ||
331 | ********** VERSION 1.9.14 ************ | 335 | ********** VERSION 1.9.14 ************ |
332 | 336 | ||
333 | Fixed some problems with the dialog sizes when switching | 337 | Fixed some problems with the dialog sizes when switching |
334 | portrait/landscape mode on 640x480 PDA display. | 338 | portrait/landscape mode on 640x480 PDA display. |
335 | 339 | ||
336 | Fixed some other small bugs in KA/Pi KO/Pi and OM/Pi and PwM/Pi. | 340 | Fixed some other small bugs in KA/Pi KO/Pi and OM/Pi and PwM/Pi. |
337 | 341 | ||
338 | Fixed an ugly bug in KOpieMail: | 342 | Fixed an ugly bug in KOpieMail: |
339 | KOpieMail was not able to write files (mails) to MSDOS file system, | 343 | KOpieMail was not able to write files (mails) to MSDOS file system, |
340 | like on an usual preformatted SD card. That should work now. | 344 | like on an usual preformatted SD card. That should work now. |
341 | To save your mail data on the Sd card do the following: | 345 | To save your mail data on the Sd card do the following: |
342 | Create a dir on the SD card: | 346 | Create a dir on the SD card: |
343 | mkdir /mnt/card/localmail | 347 | mkdir /mnt/card/localmail |
344 | Go to your home dir: | 348 | Go to your home dir: |
345 | cd | 349 | cd |
346 | Go to kopiemail data storage dir: | 350 | Go to kopiemail data storage dir: |
347 | cd kdepim/apps/kopiemail | 351 | cd kdepim/apps/kopiemail |
348 | Create a symlink to the SD card: | 352 | Create a symlink to the SD card: |
349 | ls -s /mnt/card/localmail | 353 | ls -s /mnt/card/localmail |
350 | Now KOpieMail will store all mails on the SD card. | 354 | Now KOpieMail will store all mails on the SD card. |
351 | 355 | ||
352 | KO/Pi Monthview: | 356 | KO/Pi Monthview: |
353 | Now "Go to Today" selects the current month from day 1-end, | 357 | Now "Go to Today" selects the current month from day 1-end, |
354 | not the current date + some days. | 358 | not the current date + some days. |
355 | I.e. "Go to Today" shows now always | 359 | I.e. "Go to Today" shows now always |
356 | the current month with first day of month in the first row. | 360 | the current month with first day of month in the first row. |
357 | 361 | ||
358 | Added missing German translation. | 362 | Added missing German translation. |
359 | 363 | ||
360 | Fixed icons of executeable on Wintendo. | 364 | Fixed icons of executeable on Wintendo. |
361 | 365 | ||
362 | Added a "Show next Mail" button to the OM/Pi | 366 | Added a "Show next Mail" button to the OM/Pi |
363 | mail viewer such that the mail below the current mail | 367 | mail viewer such that the mail below the current mail |
364 | in the mail list view of the current folder | 368 | in the mail list view of the current folder |
365 | can be read with a single click. | 369 | can be read with a single click. |
366 | 370 | ||
367 | 371 | ||
368 | ********** VERSION 1.9.13 ************ | 372 | ********** VERSION 1.9.13 ************ |
369 | 373 | ||
370 | Fixed nasty PwM/Pi file reading bug, when | 374 | Fixed nasty PwM/Pi file reading bug, when |
371 | the used hash algo of file is different then the global | 375 | the used hash algo of file is different then the global |
372 | hash algo. | 376 | hash algo. |
373 | 377 | ||
374 | Added KA/Pi support for opie mailit mailapplication. | 378 | Added KA/Pi support for opie mailit mailapplication. |
375 | 379 | ||
376 | Fixed some bugs in OM/Pi. | 380 | Fixed some bugs in OM/Pi. |
377 | Now character conversion tables are available for the Zaurus | 381 | Now character conversion tables are available for the Zaurus |
378 | to make OM/Pi working properly. | 382 | to make OM/Pi working properly. |
379 | To get the character conversion in OM/Pi working, please download | 383 | To get the character conversion in OM/Pi working, please download |
380 | at the sourceforge project site the package | 384 | at the sourceforge project site the package |
381 | sr-character-conversion_SharpROM_arm.ipk.zip | 385 | sr-character-conversion_SharpROM_arm.ipk.zip |
382 | (or oz-character-conversion_OZ-gcc3xx_arm.ipk.zip for OZ roms) | 386 | (or oz-character-conversion_OZ-gcc3xx_arm.ipk.zip for OZ roms) |
383 | from the section "general files for KDE/Pim" | 387 | from the section "general files for KDE/Pim" |
384 | Instructions how to install this package are in a ReadMe in this file. | 388 | Instructions how to install this package are in a ReadMe in this file. |
385 | 389 | ||
386 | 390 | ||
387 | Fixed the orientation change problem in KA/Pi when switching | 391 | Fixed the orientation change problem in KA/Pi when switching |
388 | portrait/landscape mode. | 392 | portrait/landscape mode. |
389 | 393 | ||
390 | French translation available for KA/Pi and OM/Pi. | 394 | French translation available for KA/Pi and OM/Pi. |
391 | 395 | ||
diff --git a/kmicromail/libmailwrapper/imapwrapper.cpp b/kmicromail/libmailwrapper/imapwrapper.cpp index 93fb7de..09e52b8 100644 --- a/kmicromail/libmailwrapper/imapwrapper.cpp +++ b/kmicromail/libmailwrapper/imapwrapper.cpp | |||
@@ -1,598 +1,605 @@ | |||
1 | // CHANGED 2004-09-31 Lutz Rogowski | 1 | // CHANGED 2004-09-31 Lutz Rogowski |
2 | #include <stdlib.h> | 2 | #include <stdlib.h> |
3 | #include <libetpan/libetpan.h> | 3 | #include <libetpan/libetpan.h> |
4 | #include <qpe/global.h> | 4 | #include <qpe/global.h> |
5 | #include <qapplication.h> | 5 | #include <qapplication.h> |
6 | #include "imapwrapper.h" | 6 | #include "imapwrapper.h" |
7 | #include "mailtypes.h" | 7 | #include "mailtypes.h" |
8 | #include "logindialog.h" | 8 | #include "logindialog.h" |
9 | #include <qprogressbar.h> | 9 | #include <qprogressbar.h> |
10 | #include "genericwrapper.h" | 10 | #include "genericwrapper.h" |
11 | #include <kglobal.h> | 11 | #include <kglobal.h> |
12 | 12 | ||
13 | using namespace Opie::Core; | 13 | using namespace Opie::Core; |
14 | int IMAPwrapper::mMax = 0; | 14 | int IMAPwrapper::mMax = 0; |
15 | int IMAPwrapper::mCurrent = 0; | 15 | int IMAPwrapper::mCurrent = 0; |
16 | 16 | ||
17 | IMAPwrapper::IMAPwrapper( IMAPaccount *a ) | 17 | IMAPwrapper::IMAPwrapper( IMAPaccount *a ) |
18 | : AbstractMail() | 18 | : AbstractMail() |
19 | { | 19 | { |
20 | account = a; | 20 | account = a; |
21 | m_imap = 0; | 21 | m_imap = 0; |
22 | m_Lastmbox = ""; | 22 | m_Lastmbox = ""; |
23 | mCurrent = 0; | 23 | mCurrent = 0; |
24 | mMax = 0; | 24 | mMax = 0; |
25 | } | 25 | } |
26 | 26 | ||
27 | IMAPwrapper::~IMAPwrapper() | 27 | IMAPwrapper::~IMAPwrapper() |
28 | { | 28 | { |
29 | logout(); | 29 | logout(); |
30 | } | 30 | } |
31 | 31 | ||
32 | /* to avoid to often select statements in loops etc. | 32 | /* to avoid to often select statements in loops etc. |
33 | we trust that we are logged in and connection is established!*/ | 33 | we trust that we are logged in and connection is established!*/ |
34 | int IMAPwrapper::selectMbox(const QString&mbox) | 34 | int IMAPwrapper::selectMbox(const QString&mbox) |
35 | { | 35 | { |
36 | if (mbox == m_Lastmbox) { | 36 | if (mbox == m_Lastmbox) { |
37 | return MAILIMAP_NO_ERROR; | 37 | return MAILIMAP_NO_ERROR; |
38 | } | 38 | } |
39 | int err = mailimap_select( m_imap, (char*)mbox.latin1()); | 39 | int err = mailimap_select( m_imap, (char*)mbox.latin1()); |
40 | if ( err != MAILIMAP_NO_ERROR ) { | 40 | if ( err != MAILIMAP_NO_ERROR ) { |
41 | m_Lastmbox = ""; | 41 | m_Lastmbox = ""; |
42 | return err; | 42 | return err; |
43 | } | 43 | } |
44 | m_Lastmbox = mbox; | 44 | m_Lastmbox = mbox; |
45 | return err; | 45 | return err; |
46 | } | 46 | } |
47 | 47 | ||
48 | void IMAPwrapper::imap_progress( size_t current, size_t maximum ) | 48 | void IMAPwrapper::imap_progress( size_t current, size_t maximum ) |
49 | { | 49 | { |
50 | qApp->processEvents(); | 50 | qApp->processEvents(); |
51 | return; | 51 | return; |
52 | //qDebug("imap progress %d of %d ",current,maximum ); | 52 | //qDebug("imap progress %d of %d ",current,maximum ); |
53 | //Global::statusMessage(i18n("Downloading message %1 of %2").arg( current).arg(maximum)); | 53 | //Global::statusMessage(i18n("Downloading message %1 of %2").arg( current).arg(maximum)); |
54 | //qApp->processEvents() | 54 | //qApp->processEvents() |
55 | static unsigned int last = 0; | 55 | static unsigned int last = 0; |
56 | if ( last != current ) | 56 | if ( last != current ) |
57 | IMAPwrapper::progress(); | 57 | IMAPwrapper::progress(); |
58 | last = current; | 58 | last = current; |
59 | } | 59 | } |
60 | void IMAPwrapper::progress( QString m ) | 60 | void IMAPwrapper::progress( QString m ) |
61 | { | 61 | { |
62 | static QString mProgrMess; | 62 | static QString mProgrMess; |
63 | if ( m != QString::null ) { | 63 | if ( m != QString::null ) { |
64 | mProgrMess = m; | 64 | mProgrMess = m; |
65 | mCurrent = 1; | 65 | mCurrent = 1; |
66 | return; | 66 | return; |
67 | } | 67 | } |
68 | QString mess; | 68 | QString mess; |
69 | //qDebug("progress "); | 69 | //qDebug("progress "); |
70 | if ( mMax ) mess = mProgrMess +i18n(" message %1 of %2").arg( mCurrent++).arg(mMax); | 70 | if ( mMax ) mess = mProgrMess +i18n(" message %1 of %2").arg( mCurrent++).arg(mMax); |
71 | else mess = mProgrMess +i18n(" message %1").arg( mCurrent++); | 71 | else mess = mProgrMess +i18n(" message %1").arg( mCurrent++); |
72 | Global::statusMessage(mess); | 72 | Global::statusMessage(mess); |
73 | //qDebug("Progress %s %s", mess.latin1(), m.latin1()); | 73 | //qDebug("Progress %s %s", mess.latin1(), m.latin1()); |
74 | qApp->processEvents(); | 74 | qApp->processEvents(); |
75 | } | 75 | } |
76 | bool IMAPwrapper::start_tls(bool force_tls) | 76 | bool IMAPwrapper::start_tls(bool force_tls) |
77 | { | 77 | { |
78 | int err; | 78 | int err; |
79 | bool try_tls = force_tls; | 79 | bool try_tls = force_tls; |
80 | mailimap_capability_data * cap_data = 0; | 80 | mailimap_capability_data * cap_data = 0; |
81 | 81 | ||
82 | err = mailimap_capability(m_imap,&cap_data); | 82 | err = mailimap_capability(m_imap,&cap_data); |
83 | if (err != MAILIMAP_NO_ERROR) { | 83 | if (err != MAILIMAP_NO_ERROR) { |
84 | Global::statusMessage("error getting capabilities!"); | 84 | Global::statusMessage("error getting capabilities!"); |
85 | return false; | 85 | return false; |
86 | } | 86 | } |
87 | clistiter * cur; | 87 | clistiter * cur; |
88 | for(cur = clist_begin(cap_data->cap_list) ; cur != NULL;cur = clist_next(cur)) { | 88 | for(cur = clist_begin(cap_data->cap_list) ; cur != NULL;cur = clist_next(cur)) { |
89 | struct mailimap_capability * cap; | 89 | struct mailimap_capability * cap; |
90 | cap = (struct mailimap_capability *)clist_content(cur); | 90 | cap = (struct mailimap_capability *)clist_content(cur); |
91 | if (cap->cap_type == MAILIMAP_CAPABILITY_NAME) { | 91 | if (cap->cap_type == MAILIMAP_CAPABILITY_NAME) { |
92 | if (strcasecmp(cap->cap_data.cap_name, "STARTTLS") == 0) { | 92 | if (strcasecmp(cap->cap_data.cap_name, "STARTTLS") == 0) { |
93 | try_tls = true; | 93 | try_tls = true; |
94 | break; | 94 | break; |
95 | } | 95 | } |
96 | } | 96 | } |
97 | } | 97 | } |
98 | if (cap_data) { | 98 | if (cap_data) { |
99 | mailimap_capability_data_free(cap_data); | 99 | mailimap_capability_data_free(cap_data); |
100 | } | 100 | } |
101 | if (try_tls) { | 101 | if (try_tls) { |
102 | err = mailimap_starttls(m_imap); | 102 | err = mailimap_starttls(m_imap); |
103 | if (err != MAILIMAP_NO_ERROR && force_tls) { | 103 | if (err != MAILIMAP_NO_ERROR && force_tls) { |
104 | Global::statusMessage(i18n("Server has no TLS support!")); | 104 | Global::statusMessage(i18n("Server has no TLS support!")); |
105 | try_tls = false; | 105 | try_tls = false; |
106 | } else { | 106 | } else { |
107 | mailstream_low * low; | 107 | mailstream_low * low; |
108 | mailstream_low * new_low; | 108 | mailstream_low * new_low; |
109 | low = mailstream_get_low(m_imap->imap_stream); | 109 | low = mailstream_get_low(m_imap->imap_stream); |
110 | if (!low) { | 110 | if (!low) { |
111 | try_tls = false; | 111 | try_tls = false; |
112 | } else { | 112 | } else { |
113 | int fd = mailstream_low_get_fd(low); | 113 | int fd = mailstream_low_get_fd(low); |
114 | if (fd > -1 && (new_low = mailstream_low_ssl_open(fd))!=0) { | 114 | if (fd > -1 && (new_low = mailstream_low_ssl_open(fd))!=0) { |
115 | mailstream_low_free(low); | 115 | mailstream_low_free(low); |
116 | mailstream_set_low(m_imap->imap_stream, new_low); | 116 | mailstream_set_low(m_imap->imap_stream, new_low); |
117 | } else { | 117 | } else { |
118 | try_tls = false; | 118 | try_tls = false; |
119 | } | 119 | } |
120 | } | 120 | } |
121 | } | 121 | } |
122 | } | 122 | } |
123 | return try_tls; | 123 | return try_tls; |
124 | } | 124 | } |
125 | 125 | ||
126 | void IMAPwrapper::login() | 126 | void IMAPwrapper::login(bool tryTLS) // = true) |
127 | { | 127 | { |
128 | QString server, user, pass; | 128 | QString server, user, pass; |
129 | uint16_t port; | 129 | uint16_t port; |
130 | int err = MAILIMAP_NO_ERROR; | 130 | int err = MAILIMAP_NO_ERROR; |
131 | 131 | ||
132 | if (account->getOffline()) return; | 132 | if (account->getOffline()) return; |
133 | /* we are connected this moment */ | 133 | /* we are connected this moment */ |
134 | /* TODO: setup a timer holding the line or if connection closed - delete the value */ | 134 | /* TODO: setup a timer holding the line or if connection closed - delete the value */ |
135 | if (m_imap) { | 135 | if (m_imap) { |
136 | err = mailimap_noop(m_imap); | 136 | err = mailimap_noop(m_imap); |
137 | if (err!=MAILIMAP_NO_ERROR) { | 137 | if (err!=MAILIMAP_NO_ERROR) { |
138 | logout(); | 138 | logout(); |
139 | } else { | 139 | } else { |
140 | mailstream_flush(m_imap->imap_stream); | 140 | mailstream_flush(m_imap->imap_stream); |
141 | return; | 141 | return; |
142 | } | 142 | } |
143 | } | 143 | } |
144 | server = account->getServer(); | 144 | server = account->getServer(); |
145 | port = account->getPort().toUInt(); | 145 | port = account->getPort().toUInt(); |
146 | if ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) { | 146 | if ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) { |
147 | LoginDialog login( account->getUser(), account->getPassword(), NULL, 0, true ); | 147 | LoginDialog login( account->getUser(), account->getPassword(), NULL, 0, true ); |
148 | login.show(); | 148 | login.show(); |
149 | if ( QDialog::Accepted == login.exec() ) { | 149 | if ( QDialog::Accepted == login.exec() ) { |
150 | // ok | 150 | // ok |
151 | user = login.getUser(); | 151 | user = login.getUser(); |
152 | pass = login.getPassword(); | 152 | pass = login.getPassword(); |
153 | } else { | 153 | } else { |
154 | // cancel | 154 | // cancel |
155 | return; | 155 | return; |
156 | } | 156 | } |
157 | } else { | 157 | } else { |
158 | user = account->getUser(); | 158 | user = account->getUser(); |
159 | pass = account->getPassword(); | 159 | pass = account->getPassword(); |
160 | } | 160 | } |
161 | 161 | ||
162 | m_imap = mailimap_new( 20, &imap_progress ); | 162 | m_imap = mailimap_new( 20, &imap_progress ); |
163 | 163 | ||
164 | /* connect */ | 164 | /* connect */ |
165 | bool ssl = false; | 165 | bool ssl = false; |
166 | bool try_tls = false; | 166 | bool try_tls = false; |
167 | bool force_tls = false; | 167 | bool force_tls = false; |
168 | 168 | ||
169 | if ( account->ConnectionType() == 2 ) { | 169 | if ( account->ConnectionType() == 2 ) { |
170 | ssl = true; | 170 | ssl = true; |
171 | } | 171 | } |
172 | if (account->ConnectionType()==1) { | 172 | if (account->ConnectionType()==1) { |
173 | force_tls = true; | 173 | force_tls = true; |
174 | } | 174 | } |
175 | 175 | ||
176 | if ( ssl ) { | 176 | if ( ssl ) { |
177 | qDebug("using ssl "); | 177 | qDebug("using ssl "); |
178 | err = mailimap_ssl_connect( m_imap, (char*)server.latin1(), port ); | 178 | err = mailimap_ssl_connect( m_imap, (char*)server.latin1(), port ); |
179 | qDebug("back "); | 179 | qDebug("back "); |
180 | } else { | 180 | } else { |
181 | err = mailimap_socket_connect( m_imap, (char*)server.latin1(), port ); | 181 | err = mailimap_socket_connect( m_imap, (char*)server.latin1(), port ); |
182 | } | 182 | } |
183 | 183 | ||
184 | if ( err != MAILIMAP_NO_ERROR && | 184 | if ( err != MAILIMAP_NO_ERROR && |
185 | err != MAILIMAP_NO_ERROR_AUTHENTICATED && | 185 | err != MAILIMAP_NO_ERROR_AUTHENTICATED && |
186 | err != MAILIMAP_NO_ERROR_NON_AUTHENTICATED ) { | 186 | err != MAILIMAP_NO_ERROR_NON_AUTHENTICATED ) { |
187 | QString failure = ""; | 187 | QString failure = ""; |
188 | if (err == MAILIMAP_ERROR_CONNECTION_REFUSED) { | 188 | if (err == MAILIMAP_ERROR_CONNECTION_REFUSED) { |
189 | failure="Connection refused"; | 189 | failure="Connection refused"; |
190 | } else { | 190 | } else { |
191 | failure="Unknown failure"; | 191 | failure="Unknown failure"; |
192 | } | 192 | } |
193 | Global::statusMessage(i18n("error connecting imap server: %1").arg(failure)); | 193 | Global::statusMessage(i18n("error connecting imap server: %1").arg(failure)); |
194 | mailimap_free( m_imap ); | 194 | mailimap_free( m_imap ); |
195 | m_imap = 0; | 195 | m_imap = 0; |
196 | return; | 196 | return; |
197 | } | 197 | } |
198 | 198 | if ( tryTLS ) { | |
199 | if (!ssl) { | 199 | if (!ssl) { |
200 | try_tls = start_tls(force_tls); | 200 | try_tls = start_tls(force_tls); |
201 | } | ||
201 | } | 202 | } |
202 | |||
203 | bool ok = true; | 203 | bool ok = true; |
204 | if (force_tls && !try_tls) { | 204 | if (force_tls && !try_tls) { |
205 | Global::statusMessage(i18n("Server has no TLS support!")); | 205 | Global::statusMessage(i18n("Server has no TLS support!")); |
206 | ok = false; | 206 | ok = false; |
207 | } | 207 | } |
208 | 208 | ||
209 | 209 | ||
210 | /* login */ | 210 | /* login */ |
211 | 211 | ||
212 | if (ok) { | 212 | if (ok) { |
213 | err = mailimap_login_simple( m_imap, (char*)user.latin1(), (char*)pass.latin1() ); | 213 | err = mailimap_login_simple( m_imap, (char*)user.latin1(), (char*)pass.latin1() ); |
214 | if ( err != MAILIMAP_NO_ERROR ) { | 214 | if ( err != MAILIMAP_NO_ERROR ) { |
215 | if ( tryTLS && !force_tls && !try_tls ) { | ||
216 | err = mailimap_close( m_imap ); | ||
217 | mailimap_free( m_imap ); | ||
218 | m_imap = 0; | ||
219 | login( false ); | ||
220 | return; | ||
221 | } | ||
215 | Global::statusMessage(i18n("error logging in imap server: %1").arg(m_imap->imap_response)); | 222 | Global::statusMessage(i18n("error logging in imap server: %1").arg(m_imap->imap_response)); |
216 | ok = false; | 223 | ok = false; |
217 | } | 224 | } |
218 | } | 225 | } |
219 | if (!ok) { | 226 | if (!ok) { |
220 | err = mailimap_close( m_imap ); | 227 | err = mailimap_close( m_imap ); |
221 | mailimap_free( m_imap ); | 228 | mailimap_free( m_imap ); |
222 | m_imap = 0; | 229 | m_imap = 0; |
223 | } | 230 | } |
224 | } | 231 | } |
225 | 232 | ||
226 | void IMAPwrapper::logout() | 233 | void IMAPwrapper::logout() |
227 | { | 234 | { |
228 | int err = MAILIMAP_NO_ERROR; | 235 | int err = MAILIMAP_NO_ERROR; |
229 | if (!m_imap) return; | 236 | if (!m_imap) return; |
230 | err = mailimap_logout( m_imap ); | 237 | err = mailimap_logout( m_imap ); |
231 | err = mailimap_close( m_imap ); | 238 | err = mailimap_close( m_imap ); |
232 | mailimap_free( m_imap ); | 239 | mailimap_free( m_imap ); |
233 | m_imap = 0; | 240 | m_imap = 0; |
234 | m_Lastmbox = ""; | 241 | m_Lastmbox = ""; |
235 | } | 242 | } |
236 | 243 | ||
237 | void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::Core::OSmartPointer<RecMail> > &target , int maxSizeInKb) | 244 | void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::Core::OSmartPointer<RecMail> > &target , int maxSizeInKb) |
238 | { | 245 | { |
239 | 246 | ||
240 | int tryAgain = 1; | 247 | int tryAgain = 1; |
241 | while ( tryAgain >= 0 ) { | 248 | while ( tryAgain >= 0 ) { |
242 | int err = MAILIMAP_NO_ERROR; | 249 | int err = MAILIMAP_NO_ERROR; |
243 | clist *result = 0; | 250 | clist *result = 0; |
244 | clistcell *current; | 251 | clistcell *current; |
245 | mailimap_fetch_type *fetchType = 0; | 252 | mailimap_fetch_type *fetchType = 0; |
246 | mailimap_set *set = 0; | 253 | mailimap_set *set = 0; |
247 | 254 | ||
248 | login(); | 255 | login(); |
249 | if (!m_imap) { | 256 | if (!m_imap) { |
250 | return; | 257 | return; |
251 | } | 258 | } |
252 | /* select mailbox READONLY for operations */ | 259 | /* select mailbox READONLY for operations */ |
253 | err = selectMbox(mailbox); | 260 | err = selectMbox(mailbox); |
254 | if ( err != MAILIMAP_NO_ERROR ) { | 261 | if ( err != MAILIMAP_NO_ERROR ) { |
255 | return; | 262 | return; |
256 | } | 263 | } |
257 | 264 | ||
258 | int last = m_imap->imap_selection_info->sel_exists; | 265 | int last = m_imap->imap_selection_info->sel_exists; |
259 | 266 | ||
260 | if (last == 0) { | 267 | if (last == 0) { |
261 | Global::statusMessage(i18n("Mailbox has no mails")); | 268 | Global::statusMessage(i18n("Mailbox has no mails")); |
262 | return; | 269 | return; |
263 | } else { | 270 | } else { |
264 | } | 271 | } |
265 | progress( i18n("Fetch ")); | 272 | progress( i18n("Fetch ")); |
266 | mMax = last; | 273 | mMax = last; |
267 | //qDebug("last %d ", last); | 274 | //qDebug("last %d ", last); |
268 | Global::statusMessage(i18n("Fetching header list")); | 275 | Global::statusMessage(i18n("Fetching header list")); |
269 | qApp->processEvents(); | 276 | qApp->processEvents(); |
270 | /* the range has to start at 1!!! not with 0!!!! */ | 277 | /* the range has to start at 1!!! not with 0!!!! */ |
271 | //LR the access to web.de imap server is no working with value 1 | 278 | //LR the access to web.de imap server is no working with value 1 |
272 | //qDebug("interval %d - %d ", tryAgain, last-1+tryAgain ); | 279 | //qDebug("interval %d - %d ", tryAgain, last-1+tryAgain ); |
273 | set = mailimap_set_new_interval( tryAgain, last ); | 280 | set = mailimap_set_new_interval( tryAgain, last ); |
274 | fetchType = mailimap_fetch_type_new_fetch_att_list_empty(); | 281 | fetchType = mailimap_fetch_type_new_fetch_att_list_empty(); |
275 | mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_envelope()); | 282 | mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_envelope()); |
276 | mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_flags()); | 283 | mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_flags()); |
277 | mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_internaldate()); | 284 | mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_internaldate()); |
278 | mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_rfc822_size()); | 285 | mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_rfc822_size()); |
279 | 286 | ||
280 | err = mailimap_fetch( m_imap, set, fetchType, &result ); | 287 | err = mailimap_fetch( m_imap, set, fetchType, &result ); |
281 | mailimap_set_free( set ); | 288 | mailimap_set_free( set ); |
282 | mailimap_fetch_type_free( fetchType ); | 289 | mailimap_fetch_type_free( fetchType ); |
283 | 290 | ||
284 | QString date,subject,from; | 291 | QString date,subject,from; |
285 | 292 | ||
286 | if ( err == MAILIMAP_NO_ERROR ) { | 293 | if ( err == MAILIMAP_NO_ERROR ) { |
287 | tryAgain = -1; | 294 | tryAgain = -1; |
288 | mailimap_msg_att * msg_att; | 295 | mailimap_msg_att * msg_att; |
289 | int i = 0; | 296 | int i = 0; |
290 | for (current = clist_begin(result); current != 0; current=clist_next(current)) { | 297 | for (current = clist_begin(result); current != 0; current=clist_next(current)) { |
291 | ++i; | 298 | ++i; |
292 | //qDebug("iii %d ",i); | 299 | //qDebug("iii %d ",i); |
293 | msg_att = (mailimap_msg_att*)current->data; | 300 | msg_att = (mailimap_msg_att*)current->data; |
294 | RecMail*m = parse_list_result(msg_att); | 301 | RecMail*m = parse_list_result(msg_att); |
295 | if (m) { | 302 | if (m) { |
296 | if ( maxSizeInKb == 0 || m->Msgsize()<=(unsigned int ) maxSizeInKb*1024 ) { | 303 | if ( maxSizeInKb == 0 || m->Msgsize()<=(unsigned int ) maxSizeInKb*1024 ) { |
297 | m->setNumber(i); | 304 | m->setNumber(i); |
298 | m->setMbox(mailbox); | 305 | m->setMbox(mailbox); |
299 | m->setWrapper(this); | 306 | m->setWrapper(this); |
300 | target.append(m); | 307 | target.append(m); |
301 | } | 308 | } |
302 | } | 309 | } |
303 | } | 310 | } |
304 | Global::statusMessage(i18n("Mailbox has %1 mails").arg(target.count())); | 311 | Global::statusMessage(i18n("Mailbox has %1 mails").arg(target.count())); |
305 | } else { | 312 | } else { |
306 | --tryAgain; | 313 | --tryAgain; |
307 | --tryAgain;//disabled tryagain by adding this line | 314 | --tryAgain;//disabled tryagain by adding this line |
308 | if ( tryAgain < 0 ) | 315 | if ( tryAgain < 0 ) |
309 | Global::statusMessage(i18n("Error fetching headers: %1").arg(m_imap->imap_response)); | 316 | Global::statusMessage(i18n("Error fetching headers: %1").arg(m_imap->imap_response)); |
310 | else | 317 | else |
311 | qDebug("try again... "); | 318 | qDebug("try again... "); |
312 | } | 319 | } |
313 | 320 | ||
314 | if (result) mailimap_fetch_list_free(result); | 321 | if (result) mailimap_fetch_list_free(result); |
315 | } | 322 | } |
316 | } | 323 | } |
317 | 324 | ||
318 | QValueList<Opie::Core::OSmartPointer<Folder> >* IMAPwrapper::listFolders() | 325 | QValueList<Opie::Core::OSmartPointer<Folder> >* IMAPwrapper::listFolders() |
319 | { | 326 | { |
320 | const char *path, *mask; | 327 | const char *path, *mask; |
321 | int err = MAILIMAP_NO_ERROR; | 328 | int err = MAILIMAP_NO_ERROR; |
322 | clist *result = 0; | 329 | clist *result = 0; |
323 | clistcell *current = 0; | 330 | clistcell *current = 0; |
324 | clistcell*cur_flag = 0; | 331 | clistcell*cur_flag = 0; |
325 | mailimap_mbx_list_flags*bflags = 0; | 332 | mailimap_mbx_list_flags*bflags = 0; |
326 | 333 | ||
327 | QValueList<FolderP>* folders = new QValueList<FolderP>(); | 334 | QValueList<FolderP>* folders = new QValueList<FolderP>(); |
328 | login(); | 335 | login(); |
329 | if (!m_imap) { | 336 | if (!m_imap) { |
330 | return folders; | 337 | return folders; |
331 | } | 338 | } |
332 | 339 | ||
333 | /* | 340 | /* |
334 | * First we have to check for INBOX 'cause it sometimes it's not inside the path. | 341 | * First we have to check for INBOX 'cause it sometimes it's not inside the path. |
335 | * We must not forget to filter them out in next loop! | 342 | * We must not forget to filter them out in next loop! |
336 | * it seems like ugly code. and yes - it is ugly code. but the best way. | 343 | * it seems like ugly code. and yes - it is ugly code. but the best way. |
337 | */ | 344 | */ |
338 | Global::statusMessage(i18n("Fetching folder list")); | 345 | Global::statusMessage(i18n("Fetching folder list")); |
339 | qApp->processEvents(); | 346 | qApp->processEvents(); |
340 | QString temp; | 347 | QString temp; |
341 | mask = "INBOX" ; | 348 | mask = "INBOX" ; |
342 | mailimap_mailbox_list *list; | 349 | mailimap_mailbox_list *list; |
343 | err = mailimap_list( m_imap, (char*)"", (char*)mask, &result ); | 350 | err = mailimap_list( m_imap, (char*)"", (char*)mask, &result ); |
344 | QString del; | 351 | QString del; |
345 | bool selectable = true; | 352 | bool selectable = true; |
346 | bool no_inferiors = false; | 353 | bool no_inferiors = false; |
347 | if ( err == MAILIMAP_NO_ERROR ) { | 354 | if ( err == MAILIMAP_NO_ERROR ) { |
348 | current = result->first; | 355 | current = result->first; |
349 | for ( int i = result->count; i > 0; i-- ) { | 356 | for ( int i = result->count; i > 0; i-- ) { |
350 | list = (mailimap_mailbox_list *) current->data; | 357 | list = (mailimap_mailbox_list *) current->data; |
351 | // it is better use the deep copy mechanism of qt itself | 358 | // it is better use the deep copy mechanism of qt itself |
352 | // instead of using strdup! | 359 | // instead of using strdup! |
353 | temp = list->mb_name; | 360 | temp = list->mb_name; |
354 | del = list->mb_delimiter; | 361 | del = list->mb_delimiter; |
355 | current = current->next; | 362 | current = current->next; |
356 | if ( (bflags = list->mb_flag) ) { | 363 | if ( (bflags = list->mb_flag) ) { |
357 | selectable = !(bflags->mbf_type==MAILIMAP_MBX_LIST_FLAGS_SFLAG&& | 364 | selectable = !(bflags->mbf_type==MAILIMAP_MBX_LIST_FLAGS_SFLAG&& |
358 | bflags->mbf_sflag==MAILIMAP_MBX_LIST_SFLAG_NOSELECT); | 365 | bflags->mbf_sflag==MAILIMAP_MBX_LIST_SFLAG_NOSELECT); |
359 | for(cur_flag=clist_begin(bflags->mbf_oflags);cur_flag;cur_flag=clist_next(cur_flag)) { | 366 | for(cur_flag=clist_begin(bflags->mbf_oflags);cur_flag;cur_flag=clist_next(cur_flag)) { |
360 | if ( ((mailimap_mbx_list_oflag*)cur_flag->data)->of_type==MAILIMAP_MBX_LIST_OFLAG_NOINFERIORS) { | 367 | if ( ((mailimap_mbx_list_oflag*)cur_flag->data)->of_type==MAILIMAP_MBX_LIST_OFLAG_NOINFERIORS) { |
361 | no_inferiors = true; | 368 | no_inferiors = true; |
362 | } | 369 | } |
363 | } | 370 | } |
364 | } | 371 | } |
365 | folders->append( new IMAPFolder(temp,del,selectable,no_inferiors,account->getPrefix())); | 372 | folders->append( new IMAPFolder(temp,del,selectable,no_inferiors,account->getPrefix())); |
366 | } | 373 | } |
367 | } else { | 374 | } else { |
368 | qDebug("error fetching folders: "); | 375 | qDebug("error fetching folders: "); |
369 | 376 | ||
370 | } | 377 | } |
371 | mailimap_list_result_free( result ); | 378 | mailimap_list_result_free( result ); |
372 | 379 | ||
373 | /* | 380 | /* |
374 | * second stage - get the other then inbox folders | 381 | * second stage - get the other then inbox folders |
375 | */ | 382 | */ |
376 | mask = "*" ; | 383 | mask = "*" ; |
377 | path = account->getPrefix().latin1(); | 384 | path = account->getPrefix().latin1(); |
378 | if (!path) path = ""; | 385 | if (!path) path = ""; |
379 | err = mailimap_list( m_imap, (char*)path, (char*)mask, &result ); | 386 | err = mailimap_list( m_imap, (char*)path, (char*)mask, &result ); |
380 | if ( err == MAILIMAP_NO_ERROR ) { | 387 | if ( err == MAILIMAP_NO_ERROR ) { |
381 | current = result->first; | 388 | current = result->first; |
382 | for ( current=clist_begin(result);current!=NULL;current=clist_next(current)) { | 389 | for ( current=clist_begin(result);current!=NULL;current=clist_next(current)) { |
383 | no_inferiors = false; | 390 | no_inferiors = false; |
384 | list = (mailimap_mailbox_list *) current->data; | 391 | list = (mailimap_mailbox_list *) current->data; |
385 | // it is better use the deep copy mechanism of qt itself | 392 | // it is better use the deep copy mechanism of qt itself |
386 | // instead of using strdup! | 393 | // instead of using strdup! |
387 | temp = list->mb_name; | 394 | temp = list->mb_name; |
388 | if (temp.lower()=="inbox") | 395 | if (temp.lower()=="inbox") |
389 | continue; | 396 | continue; |
390 | if (temp.lower()==account->getPrefix().lower()) | 397 | if (temp.lower()==account->getPrefix().lower()) |
391 | continue; | 398 | continue; |
392 | if ( (bflags = list->mb_flag) ) { | 399 | if ( (bflags = list->mb_flag) ) { |
393 | selectable = !(bflags->mbf_type==MAILIMAP_MBX_LIST_FLAGS_SFLAG&& | 400 | selectable = !(bflags->mbf_type==MAILIMAP_MBX_LIST_FLAGS_SFLAG&& |
394 | bflags->mbf_sflag==MAILIMAP_MBX_LIST_SFLAG_NOSELECT); | 401 | bflags->mbf_sflag==MAILIMAP_MBX_LIST_SFLAG_NOSELECT); |
395 | for(cur_flag=clist_begin(bflags->mbf_oflags);cur_flag;cur_flag=clist_next(cur_flag)) { | 402 | for(cur_flag=clist_begin(bflags->mbf_oflags);cur_flag;cur_flag=clist_next(cur_flag)) { |
396 | if ( ((mailimap_mbx_list_oflag*)cur_flag->data)->of_type==MAILIMAP_MBX_LIST_OFLAG_NOINFERIORS) { | 403 | if ( ((mailimap_mbx_list_oflag*)cur_flag->data)->of_type==MAILIMAP_MBX_LIST_OFLAG_NOINFERIORS) { |
397 | no_inferiors = true; | 404 | no_inferiors = true; |
398 | } | 405 | } |
399 | } | 406 | } |
400 | } | 407 | } |
401 | del = list->mb_delimiter; | 408 | del = list->mb_delimiter; |
402 | folders->append(new IMAPFolder(temp,del,selectable,no_inferiors,account->getPrefix())); | 409 | folders->append(new IMAPFolder(temp,del,selectable,no_inferiors,account->getPrefix())); |
403 | } | 410 | } |
404 | } else { | 411 | } else { |
405 | qDebug("error fetching folders "); | 412 | qDebug("error fetching folders "); |
406 | 413 | ||
407 | } | 414 | } |
408 | if (result) mailimap_list_result_free( result ); | 415 | if (result) mailimap_list_result_free( result ); |
409 | return folders; | 416 | return folders; |
410 | } | 417 | } |
411 | 418 | ||
412 | RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att) | 419 | RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att) |
413 | { | 420 | { |
414 | RecMail * m = 0; | 421 | RecMail * m = 0; |
415 | mailimap_msg_att_item *item=0; | 422 | mailimap_msg_att_item *item=0; |
416 | clistcell *current,*c,*cf; | 423 | clistcell *current,*c,*cf; |
417 | mailimap_msg_att_dynamic*flist; | 424 | mailimap_msg_att_dynamic*flist; |
418 | mailimap_flag_fetch*cflag; | 425 | mailimap_flag_fetch*cflag; |
419 | int size = 0; | 426 | int size = 0; |
420 | QBitArray mFlags(7); | 427 | QBitArray mFlags(7); |
421 | QStringList addresslist; | 428 | QStringList addresslist; |
422 | 429 | ||
423 | if (!m_att) { | 430 | if (!m_att) { |
424 | return m; | 431 | return m; |
425 | } | 432 | } |
426 | m = new RecMail(); | 433 | m = new RecMail(); |
427 | for (c = clist_begin(m_att->att_list); c!=NULL;c=clist_next(c) ) { | 434 | for (c = clist_begin(m_att->att_list); c!=NULL;c=clist_next(c) ) { |
428 | current = c; | 435 | current = c; |
429 | size = 0; | 436 | size = 0; |
430 | item = (mailimap_msg_att_item*)current->data; | 437 | item = (mailimap_msg_att_item*)current->data; |
431 | if ( !item ) | 438 | if ( !item ) |
432 | continue; | 439 | continue; |
433 | if (item->att_type!=MAILIMAP_MSG_ATT_ITEM_STATIC) { | 440 | if (item->att_type!=MAILIMAP_MSG_ATT_ITEM_STATIC) { |
434 | flist = (mailimap_msg_att_dynamic*)item->att_data.att_dyn; | 441 | flist = (mailimap_msg_att_dynamic*)item->att_data.att_dyn; |
435 | if (!flist || !flist->att_list) { | 442 | if (!flist || !flist->att_list) { |
436 | continue; | 443 | continue; |
437 | } | 444 | } |
438 | cf = flist->att_list->first; | 445 | cf = flist->att_list->first; |
439 | if( cf ) { | 446 | if( cf ) { |
440 | for (cf = clist_begin(flist->att_list); cf!=NULL; cf = clist_next(cf)) { | 447 | for (cf = clist_begin(flist->att_list); cf!=NULL; cf = clist_next(cf)) { |
441 | cflag = (mailimap_flag_fetch*)cf->data; | 448 | cflag = (mailimap_flag_fetch*)cf->data; |
442 | if( ! cflag ) | 449 | if( ! cflag ) |
443 | qDebug("imap:NO cflag "); | 450 | qDebug("imap:NO cflag "); |
444 | else { | 451 | else { |
445 | if (cflag->fl_type==MAILIMAP_FLAG_FETCH_OTHER && cflag->fl_flag!=0) { | 452 | if (cflag->fl_type==MAILIMAP_FLAG_FETCH_OTHER && cflag->fl_flag!=0) { |
446 | switch (cflag->fl_flag->fl_type) { | 453 | switch (cflag->fl_flag->fl_type) { |
447 | case MAILIMAP_FLAG_ANSWERED: /* \Answered flag */ | 454 | case MAILIMAP_FLAG_ANSWERED: /* \Answered flag */ |
448 | mFlags.setBit(FLAG_ANSWERED); | 455 | mFlags.setBit(FLAG_ANSWERED); |
449 | break; | 456 | break; |
450 | case MAILIMAP_FLAG_FLAGGED: /* \Flagged flag */ | 457 | case MAILIMAP_FLAG_FLAGGED: /* \Flagged flag */ |
451 | mFlags.setBit(FLAG_FLAGGED); | 458 | mFlags.setBit(FLAG_FLAGGED); |
452 | break; | 459 | break; |
453 | case MAILIMAP_FLAG_DELETED: /* \Deleted flag */ | 460 | case MAILIMAP_FLAG_DELETED: /* \Deleted flag */ |
454 | mFlags.setBit(FLAG_DELETED); | 461 | mFlags.setBit(FLAG_DELETED); |
455 | break; | 462 | break; |
456 | case MAILIMAP_FLAG_SEEN: /* \Seen flag */ | 463 | case MAILIMAP_FLAG_SEEN: /* \Seen flag */ |
457 | mFlags.setBit(FLAG_SEEN); | 464 | mFlags.setBit(FLAG_SEEN); |
458 | break; | 465 | break; |
459 | case MAILIMAP_FLAG_DRAFT: /* \Draft flag */ | 466 | case MAILIMAP_FLAG_DRAFT: /* \Draft flag */ |
460 | mFlags.setBit(FLAG_DRAFT); | 467 | mFlags.setBit(FLAG_DRAFT); |
461 | break; | 468 | break; |
462 | case MAILIMAP_FLAG_KEYWORD: /* keyword flag */ | 469 | case MAILIMAP_FLAG_KEYWORD: /* keyword flag */ |
463 | break; | 470 | break; |
464 | case MAILIMAP_FLAG_EXTENSION: /* \extension flag */ | 471 | case MAILIMAP_FLAG_EXTENSION: /* \extension flag */ |
465 | break; | 472 | break; |
466 | default: | 473 | default: |
467 | break; | 474 | break; |
468 | } | 475 | } |
469 | } else if (cflag->fl_type==MAILIMAP_FLAG_FETCH_RECENT) { | 476 | } else if (cflag->fl_type==MAILIMAP_FLAG_FETCH_RECENT) { |
470 | mFlags.setBit(FLAG_RECENT); | 477 | mFlags.setBit(FLAG_RECENT); |
471 | } | 478 | } |
472 | } | 479 | } |
473 | } | 480 | } |
474 | } | 481 | } |
475 | //qDebug(" continue"); | 482 | //qDebug(" continue"); |
476 | continue; | 483 | continue; |
477 | } | 484 | } |
478 | if ( item->att_data.att_static == NULL ) | 485 | if ( item->att_data.att_static == NULL ) |
479 | continue; | 486 | continue; |
480 | if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_ENVELOPE) { | 487 | if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_ENVELOPE) { |
481 | mailimap_envelope * head = item->att_data.att_static->att_data.att_env; | 488 | mailimap_envelope * head = item->att_data.att_static->att_data.att_env; |
482 | if ( head == NULL ) | 489 | if ( head == NULL ) |
483 | continue; | 490 | continue; |
484 | if ( head->env_date != NULL ) { | 491 | if ( head->env_date != NULL ) { |
485 | m->setDate(head->env_date); | 492 | m->setDate(head->env_date); |
486 | //struct mailimf_date_time result; | 493 | //struct mailimf_date_time result; |
487 | struct mailimf_date_time* date;// = &result; | 494 | struct mailimf_date_time* date;// = &result; |
488 | struct mailimf_date_time **re = &date; | 495 | struct mailimf_date_time **re = &date; |
489 | size_t length = m->getDate().length(); | 496 | size_t length = m->getDate().length(); |
490 | size_t index = 0; | 497 | size_t index = 0; |
491 | if ( mailimf_date_time_parse(head->env_date, length,&index, re ) == MAILIMF_NO_ERROR ) { | 498 | if ( mailimf_date_time_parse(head->env_date, length,&index, re ) == MAILIMF_NO_ERROR ) { |
492 | //qDebug("parseDateTime "); | 499 | //qDebug("parseDateTime "); |
493 | QDateTime dt = Genericwrapper::parseDateTime( date ); | 500 | QDateTime dt = Genericwrapper::parseDateTime( date ); |
494 | QString ret; | 501 | QString ret; |
495 | if ( dt.date() == QDate::currentDate () ) | 502 | if ( dt.date() == QDate::currentDate () ) |
496 | ret = KGlobal::locale()->formatTime( dt.time(),true); | 503 | ret = KGlobal::locale()->formatTime( dt.time(),true); |
497 | else { | 504 | else { |
498 | ret = KGlobal::locale()->formatDateTime( dt,true,true); | 505 | ret = KGlobal::locale()->formatDateTime( dt,true,true); |
499 | } | 506 | } |
500 | m->setDate( ret ); | 507 | m->setDate( ret ); |
501 | char tmp[20]; | 508 | char tmp[20]; |
502 | snprintf( tmp, 20, "%04i-%02i-%02i %02i:%02i:%02i", | 509 | snprintf( tmp, 20, "%04i-%02i-%02i %02i:%02i:%02i", |
503 | dt.date().year(),dt.date().month(), dt.date().day(), dt.time().hour(), dt.time().minute(), dt.time().second() ); | 510 | dt.date().year(),dt.date().month(), dt.date().day(), dt.time().hour(), dt.time().minute(), dt.time().second() ); |
504 | //qDebug("%d iso %s %s ", date->dt_zone, tmp, head->env_date); | 511 | //qDebug("%d iso %s %s ", date->dt_zone, tmp, head->env_date); |
505 | m->setIsoDate( QString( tmp ) ); | 512 | m->setIsoDate( QString( tmp ) ); |
506 | mailimf_date_time_free ( date ); | 513 | mailimf_date_time_free ( date ); |
507 | } else { | 514 | } else { |
508 | m->setIsoDate(head->env_date); | 515 | m->setIsoDate(head->env_date); |
509 | } | 516 | } |
510 | } | 517 | } |
511 | if ( head->env_subject != NULL ) | 518 | if ( head->env_subject != NULL ) |
512 | m->setSubject(convert_String((const char*)head->env_subject)); | 519 | m->setSubject(convert_String((const char*)head->env_subject)); |
513 | //m->setSubject(head->env_subject); | 520 | //m->setSubject(head->env_subject); |
514 | if (head->env_from!=NULL) { | 521 | if (head->env_from!=NULL) { |
515 | addresslist = address_list_to_stringlist(head->env_from->frm_list); | 522 | addresslist = address_list_to_stringlist(head->env_from->frm_list); |
516 | if (addresslist.count()) { | 523 | if (addresslist.count()) { |
517 | m->setFrom(addresslist.first()); | 524 | m->setFrom(addresslist.first()); |
518 | } | 525 | } |
519 | } | 526 | } |
520 | if (head->env_to!=NULL) { | 527 | if (head->env_to!=NULL) { |
521 | addresslist = address_list_to_stringlist(head->env_to->to_list); | 528 | addresslist = address_list_to_stringlist(head->env_to->to_list); |
522 | m->setTo(addresslist); | 529 | m->setTo(addresslist); |
523 | } | 530 | } |
524 | if (head->env_cc!=NULL) { | 531 | if (head->env_cc!=NULL) { |
525 | addresslist = address_list_to_stringlist(head->env_cc->cc_list); | 532 | addresslist = address_list_to_stringlist(head->env_cc->cc_list); |
526 | m->setCC(addresslist); | 533 | m->setCC(addresslist); |
527 | } | 534 | } |
528 | if (head->env_bcc!=NULL) { | 535 | if (head->env_bcc!=NULL) { |
529 | addresslist = address_list_to_stringlist(head->env_bcc->bcc_list); | 536 | addresslist = address_list_to_stringlist(head->env_bcc->bcc_list); |
530 | m->setBcc(addresslist); | 537 | m->setBcc(addresslist); |
531 | } | 538 | } |
532 | /* reply to address, eg. email. */ | 539 | /* reply to address, eg. email. */ |
533 | if (head->env_reply_to!=NULL) { | 540 | if (head->env_reply_to!=NULL) { |
534 | addresslist = address_list_to_stringlist(head->env_reply_to->rt_list); | 541 | addresslist = address_list_to_stringlist(head->env_reply_to->rt_list); |
535 | if (addresslist.count()) { | 542 | if (addresslist.count()) { |
536 | m->setReplyto(addresslist.first()); | 543 | m->setReplyto(addresslist.first()); |
537 | } | 544 | } |
538 | } | 545 | } |
539 | if (head->env_in_reply_to!=NULL) { | 546 | if (head->env_in_reply_to!=NULL) { |
540 | QString h(head->env_in_reply_to); | 547 | QString h(head->env_in_reply_to); |
541 | while (h.length()>0 && h[0]=='<') { | 548 | while (h.length()>0 && h[0]=='<') { |
542 | h.remove(0,1); | 549 | h.remove(0,1); |
543 | } | 550 | } |
544 | while (h.length()>0 && h[h.length()-1]=='>') { | 551 | while (h.length()>0 && h[h.length()-1]=='>') { |
545 | h.remove(h.length()-1,1); | 552 | h.remove(h.length()-1,1); |
546 | } | 553 | } |
547 | if (h.length()>0) { | 554 | if (h.length()>0) { |
548 | m->setInreply(QStringList(h)); | 555 | m->setInreply(QStringList(h)); |
549 | } | 556 | } |
550 | } | 557 | } |
551 | if (head->env_message_id != NULL) { | 558 | if (head->env_message_id != NULL) { |
552 | m->setMsgid(QString(head->env_message_id)); | 559 | m->setMsgid(QString(head->env_message_id)); |
553 | } | 560 | } |
554 | } else if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_INTERNALDATE) { | 561 | } else if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_INTERNALDATE) { |
555 | #if 0 | 562 | #if 0 |
556 | mailimap_date_time*d = item->att_data.att_static->att_data.att_internal_date; | 563 | mailimap_date_time*d = item->att_data.att_static->att_data.att_internal_date; |
557 | QDateTime da(QDate(d->dt_year,d->dt_month,d->dt_day),QTime(d->dt_hour,d->dt_min,d->dt_sec)); | 564 | QDateTime da(QDate(d->dt_year,d->dt_month,d->dt_day),QTime(d->dt_hour,d->dt_min,d->dt_sec)); |
558 | qDebug("time %s ",da.toString().latin1() ); | 565 | qDebug("time %s ",da.toString().latin1() ); |
559 | #endif | 566 | #endif |
560 | } else if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_RFC822_SIZE) { | 567 | } else if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_RFC822_SIZE) { |
561 | size = item->att_data.att_static->att_data.att_rfc822_size; | 568 | size = item->att_data.att_static->att_data.att_rfc822_size; |
562 | } | 569 | } |
563 | } | 570 | } |
564 | /* msg is already deleted */ | 571 | /* msg is already deleted */ |
565 | if (mFlags.testBit(FLAG_DELETED) && m) { | 572 | if (mFlags.testBit(FLAG_DELETED) && m) { |
566 | delete m; | 573 | delete m; |
567 | m = 0; | 574 | m = 0; |
568 | } | 575 | } |
569 | if (m) { | 576 | if (m) { |
570 | m->setFlags(mFlags); | 577 | m->setFlags(mFlags); |
571 | m->setMsgsize(size); | 578 | m->setMsgsize(size); |
572 | } | 579 | } |
573 | return m; | 580 | return m; |
574 | } | 581 | } |
575 | 582 | ||
576 | RecBodyP IMAPwrapper::fetchBody(const RecMailP&mail) | 583 | RecBodyP IMAPwrapper::fetchBody(const RecMailP&mail) |
577 | { | 584 | { |
578 | RecBodyP body = new RecBody(); | 585 | RecBodyP body = new RecBody(); |
579 | const char *mb; | 586 | const char *mb; |
580 | int err = MAILIMAP_NO_ERROR; | 587 | int err = MAILIMAP_NO_ERROR; |
581 | clist *result = 0; | 588 | clist *result = 0; |
582 | clistcell *current; | 589 | clistcell *current; |
583 | mailimap_fetch_att *fetchAtt = 0; | 590 | mailimap_fetch_att *fetchAtt = 0; |
584 | mailimap_fetch_type *fetchType = 0; | 591 | mailimap_fetch_type *fetchType = 0; |
585 | mailimap_set *set = 0; | 592 | mailimap_set *set = 0; |
586 | mailimap_body*body_desc = 0; | 593 | mailimap_body*body_desc = 0; |
587 | 594 | ||
588 | mb = mail->getMbox().latin1(); | 595 | mb = mail->getMbox().latin1(); |
589 | 596 | ||
590 | login(); | 597 | login(); |
591 | if (!m_imap) { | 598 | if (!m_imap) { |
592 | return body; | 599 | return body; |
593 | } | 600 | } |
594 | err = selectMbox(mail->getMbox()); | 601 | err = selectMbox(mail->getMbox()); |
595 | if ( err != MAILIMAP_NO_ERROR ) { | 602 | if ( err != MAILIMAP_NO_ERROR ) { |
596 | return body; | 603 | return body; |
597 | } | 604 | } |
598 | 605 | ||
diff --git a/kmicromail/libmailwrapper/imapwrapper.h b/kmicromail/libmailwrapper/imapwrapper.h index 5535d8d..31c60a8 100644 --- a/kmicromail/libmailwrapper/imapwrapper.h +++ b/kmicromail/libmailwrapper/imapwrapper.h | |||
@@ -1,85 +1,85 @@ | |||
1 | // CHANGED 2004-09-31 Lutz Rogowski | 1 | // CHANGED 2004-09-31 Lutz Rogowski |
2 | #ifndef __IMAPWRAPPER | 2 | #ifndef __IMAPWRAPPER |
3 | #define __IMAPWRAPPER | 3 | #define __IMAPWRAPPER |
4 | 4 | ||
5 | #include <qlist.h> | 5 | #include <qlist.h> |
6 | #include "mailwrapper.h" | 6 | #include "mailwrapper.h" |
7 | #include "abstractmail.h" | 7 | #include "abstractmail.h" |
8 | #include <libetpan/clist.h> | 8 | #include <libetpan/clist.h> |
9 | 9 | ||
10 | struct mailimap; | 10 | struct mailimap; |
11 | struct mailimap_body; | 11 | struct mailimap_body; |
12 | struct mailimap_body_type_1part; | 12 | struct mailimap_body_type_1part; |
13 | struct mailimap_body_type_text; | 13 | struct mailimap_body_type_text; |
14 | struct mailimap_body_type_basic; | 14 | struct mailimap_body_type_basic; |
15 | struct mailimap_body_type_msg; | 15 | struct mailimap_body_type_msg; |
16 | struct mailimap_body_type_mpart; | 16 | struct mailimap_body_type_mpart; |
17 | struct mailimap_body_fields; | 17 | struct mailimap_body_fields; |
18 | struct mailimap_msg_att; | 18 | struct mailimap_msg_att; |
19 | class encodedString; | 19 | class encodedString; |
20 | 20 | ||
21 | class IMAPwrapper : public AbstractMail | 21 | class IMAPwrapper : public AbstractMail |
22 | { | 22 | { |
23 | Q_OBJECT | 23 | Q_OBJECT |
24 | public: | 24 | public: |
25 | IMAPwrapper( IMAPaccount *a ); | 25 | IMAPwrapper( IMAPaccount *a ); |
26 | virtual ~IMAPwrapper(); | 26 | virtual ~IMAPwrapper(); |
27 | virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); | 27 | virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); |
28 | virtual void listMessages(const QString & mailbox,QValueList<Opie::Core::OSmartPointer<RecMail> >&target , int sizeInKb = 0); | 28 | virtual void listMessages(const QString & mailbox,QValueList<Opie::Core::OSmartPointer<RecMail> >&target , int sizeInKb = 0); |
29 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); | 29 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); |
30 | 30 | ||
31 | virtual void deleteMail(const RecMailP&mail); | 31 | virtual void deleteMail(const RecMailP&mail); |
32 | void deleteMailList(const QValueList<RecMailP>&target); | 32 | void deleteMailList(const QValueList<RecMailP>&target); |
33 | virtual void answeredMail(const RecMailP&mail); | 33 | virtual void answeredMail(const RecMailP&mail); |
34 | virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&folder); | 34 | virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&folder); |
35 | virtual void storeMessage(const char*msg,size_t length, const QString&folder); | 35 | virtual void storeMessage(const char*msg,size_t length, const QString&folder); |
36 | virtual void mvcpAllMails(const Opie::Core::OSmartPointer<Folder>&fromFolder, | 36 | virtual void mvcpAllMails(const Opie::Core::OSmartPointer<Folder>&fromFolder, |
37 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit,int sizeInKb = 0); | 37 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit,int sizeInKb = 0); |
38 | virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | 38 | virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); |
39 | 39 | ||
40 | virtual RecBodyP fetchBody(const RecMailP&mail); | 40 | virtual RecBodyP fetchBody(const RecMailP&mail); |
41 | virtual QString fetchTextPart(const RecMailP&mail,const RecPartP&part); | 41 | virtual QString fetchTextPart(const RecMailP&mail,const RecPartP&part); |
42 | virtual encodedString* fetchDecodedPart(const RecMailP&mail,const RecPartP&part); | 42 | virtual encodedString* fetchDecodedPart(const RecMailP&mail,const RecPartP&part); |
43 | virtual encodedString* fetchRawPart(const RecMailP&mail,const RecPartP&part); | 43 | virtual encodedString* fetchRawPart(const RecMailP&mail,const RecPartP&part); |
44 | virtual encodedString* fetchRawBody(const RecMailP&mail); | 44 | virtual encodedString* fetchRawBody(const RecMailP&mail); |
45 | 45 | ||
46 | virtual int createMbox(const QString&,const Opie::Core::OSmartPointer<Folder>&parentfolder=0, | 46 | virtual int createMbox(const QString&,const Opie::Core::OSmartPointer<Folder>&parentfolder=0, |
47 | const QString& delemiter="/",bool getsubfolder=false); | 47 | const QString& delemiter="/",bool getsubfolder=false); |
48 | virtual int deleteMbox(const Opie::Core::OSmartPointer<Folder>&folder); | 48 | virtual int deleteMbox(const Opie::Core::OSmartPointer<Folder>&folder); |
49 | 49 | ||
50 | static void imap_progress( size_t current, size_t maximum ); | 50 | static void imap_progress( size_t current, size_t maximum ); |
51 | 51 | ||
52 | virtual void logout(); | 52 | virtual void logout(); |
53 | virtual MAILLIB::ATYPE getType()const; | 53 | virtual MAILLIB::ATYPE getType()const; |
54 | virtual const QString&getName()const; | 54 | virtual const QString&getName()const; |
55 | virtual Account* getAccount() { return account; }; | 55 | virtual Account* getAccount() { return account; }; |
56 | 56 | ||
57 | protected: | 57 | protected: |
58 | RecMail*parse_list_result(mailimap_msg_att*); | 58 | RecMail*parse_list_result(mailimap_msg_att*); |
59 | void login(); | 59 | void login(bool tryTLS = true); |
60 | bool start_tls(bool force=true); | 60 | bool start_tls(bool force=true); |
61 | 61 | ||
62 | virtual QString fetchTextPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call=false,const QString&enc=""); | 62 | virtual QString fetchTextPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call=false,const QString&enc=""); |
63 | virtual encodedString*fetchRawPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call); | 63 | virtual encodedString*fetchRawPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call); |
64 | int selectMbox(const QString&mbox); | 64 | int selectMbox(const QString&mbox); |
65 | 65 | ||
66 | void fillSinglePart(RecPartP&target_part,mailimap_body_type_1part*Description); | 66 | void fillSinglePart(RecPartP&target_part,mailimap_body_type_1part*Description); |
67 | void fillSingleTextPart(RecPartP&target_part,mailimap_body_type_text*which); | 67 | void fillSingleTextPart(RecPartP&target_part,mailimap_body_type_text*which); |
68 | void fillSingleBasicPart(RecPartP&target_part,mailimap_body_type_basic*which); | 68 | void fillSingleBasicPart(RecPartP&target_part,mailimap_body_type_basic*which); |
69 | void fillSingleMsgPart(RecPartP&target_part,mailimap_body_type_msg*which); | 69 | void fillSingleMsgPart(RecPartP&target_part,mailimap_body_type_msg*which); |
70 | void fillMultiPart(RecPartP&target_part,mailimap_body_type_mpart*which); | 70 | void fillMultiPart(RecPartP&target_part,mailimap_body_type_mpart*which); |
71 | void traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&target_body,int current_recursion,QValueList<int>recList,int current_count=1); | 71 | void traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&target_body,int current_recursion,QValueList<int>recList,int current_count=1); |
72 | 72 | ||
73 | /* just helpers */ | 73 | /* just helpers */ |
74 | static void fillBodyFields(RecPartP&target_part,mailimap_body_fields*which); | 74 | static void fillBodyFields(RecPartP&target_part,mailimap_body_fields*which); |
75 | static QStringList address_list_to_stringlist(clist*list); | 75 | static QStringList address_list_to_stringlist(clist*list); |
76 | 76 | ||
77 | static void progress(QString mess = QString::null); | 77 | static void progress(QString mess = QString::null); |
78 | static int mCurrent; | 78 | static int mCurrent; |
79 | static int mMax; | 79 | static int mMax; |
80 | IMAPaccount *account; | 80 | IMAPaccount *account; |
81 | mailimap *m_imap; | 81 | mailimap *m_imap; |
82 | QString m_Lastmbox; | 82 | QString m_Lastmbox; |
83 | }; | 83 | }; |
84 | 84 | ||
85 | #endif | 85 | #endif |