author | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
commit | 16cf79e90b5217f8d4bfce2a0fa817ae4b73db36 (patch) (unidiff) | |
tree | 0701eae15aa606a0211a2fccfde0eafdac69357c /noncore/net/mail/libmailwrapper | |
parent | 8d2d2664e5f544b8292806e617deb7a0e4170dc0 (diff) | |
download | opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.zip opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.gz opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.bz2 |
convert to Opie Debugging Framework
Diffstat (limited to 'noncore/net/mail/libmailwrapper') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/abstractmail.cpp | 8 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/generatemail.cpp | 30 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/genericwrapper.cpp | 14 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.cpp | 66 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/logindialog.cpp | 2 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mailtypes.cpp | 10 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mailwrapper.cpp | 2 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mboxwrapper.cpp | 22 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mhwrapper.cpp | 60 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/nntpwrapper.cpp | 8 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/pop3wrapper.cpp | 10 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/settings.cpp | 18 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/smtpwrapper.cpp | 30 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/statusmail.cpp | 6 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/storemail.cpp | 4 |
15 files changed, 145 insertions, 145 deletions
diff --git a/noncore/net/mail/libmailwrapper/abstractmail.cpp b/noncore/net/mail/libmailwrapper/abstractmail.cpp index 6bebb7b..1a26351 100644 --- a/noncore/net/mail/libmailwrapper/abstractmail.cpp +++ b/noncore/net/mail/libmailwrapper/abstractmail.cpp | |||
@@ -49,13 +49,13 @@ AbstractMail* AbstractMail::getWrapper(Account*a) | |||
49 | return 0; | 49 | return 0; |
50 | } | 50 | } |
51 | } | 51 | } |
52 | 52 | ||
53 | encodedString* AbstractMail::decode_String(const encodedString*text,const QString&enc) | 53 | encodedString* AbstractMail::decode_String(const encodedString*text,const QString&enc) |
54 | { | 54 | { |
55 | qDebug("Decode string start"); | 55 | odebug << "Decode string start" << oendl; |
56 | char*result_text; | 56 | char*result_text; |
57 | size_t index = 0; | 57 | size_t index = 0; |
58 | /* reset for recursive use! */ | 58 | /* reset for recursive use! */ |
59 | size_t target_length = 0; | 59 | size_t target_length = 0; |
60 | result_text = 0; | 60 | result_text = 0; |
61 | int mimetype = MAILMIME_MECHANISM_7BIT; | 61 | int mimetype = MAILMIME_MECHANISM_7BIT; |
@@ -73,13 +73,13 @@ encodedString* AbstractMail::decode_String(const encodedString*text,const QStrin | |||
73 | &result_text,&target_length); | 73 | &result_text,&target_length); |
74 | 74 | ||
75 | encodedString* result = new encodedString(); | 75 | encodedString* result = new encodedString(); |
76 | if (err == MAILIMF_NO_ERROR) { | 76 | if (err == MAILIMF_NO_ERROR) { |
77 | result->setContent(result_text,target_length); | 77 | result->setContent(result_text,target_length); |
78 | } | 78 | } |
79 | qDebug("Decode string finished"); | 79 | odebug << "Decode string finished" << oendl; |
80 | return result; | 80 | return result; |
81 | } | 81 | } |
82 | 82 | ||
83 | QString AbstractMail::convert_String(const char*text) | 83 | QString AbstractMail::convert_String(const char*text) |
84 | { | 84 | { |
85 | //size_t index = 0; | 85 | //size_t index = 0; |
@@ -88,16 +88,16 @@ QString AbstractMail::convert_String(const char*text) | |||
88 | 88 | ||
89 | QString result(text); | 89 | QString result(text); |
90 | 90 | ||
91 | /* due a bug in libetpan it isn't usable this moment */ | 91 | /* due a bug in libetpan it isn't usable this moment */ |
92 | /* int err = mailmime_encoded_phrase_parse("iso-8859-1", | 92 | /* int err = mailmime_encoded_phrase_parse("iso-8859-1", |
93 | text, strlen(text),&index, "iso-8859-1",&res);*/ | 93 | text, strlen(text),&index, "iso-8859-1",&res);*/ |
94 | //qDebug("Input: %s",text); | 94 | //odebug << "Input: " << text << "" << oendl; |
95 | if (err == MAILIMF_NO_ERROR && res && strlen(res)) { | 95 | if (err == MAILIMF_NO_ERROR && res && strlen(res)) { |
96 | // result = QString(res); | 96 | // result = QString(res); |
97 | // qDebug("Res: %s, length: %i",res,strlen(res)); | 97 | // odebug << "Res: " << res << ", length: " << strlen(res) << "" << oendl; |
98 | } | 98 | } |
99 | if (res) free(res); | 99 | if (res) free(res); |
100 | return result; | 100 | return result; |
101 | } | 101 | } |
102 | 102 | ||
103 | /* cp & paste from launcher */ | 103 | /* cp & paste from launcher */ |
diff --git a/noncore/net/mail/libmailwrapper/generatemail.cpp b/noncore/net/mail/libmailwrapper/generatemail.cpp index cb58d82..36ec232 100644 --- a/noncore/net/mail/libmailwrapper/generatemail.cpp +++ b/noncore/net/mail/libmailwrapper/generatemail.cpp | |||
@@ -94,35 +94,35 @@ mailimf_address_list *Generatemail::parseAddresses(const QString&addr ) { | |||
94 | break; | 94 | break; |
95 | case ',': | 95 | case ',': |
96 | if (!literal_open) { | 96 | if (!literal_open) { |
97 | s = addr.mid(startpos,i-startpos); | 97 | s = addr.mid(startpos,i-startpos); |
98 | if (!s.isEmpty()) { | 98 | if (!s.isEmpty()) { |
99 | list.append(s); | 99 | list.append(s); |
100 | qDebug("Appended %s",s.latin1()); | 100 | odebug << "Appended " << s.latin1() << "" << oendl; |
101 | } | 101 | } |
102 | // !!!! this is a MUST BE! | 102 | // !!!! this is a MUST BE! |
103 | startpos = ++i; | 103 | startpos = ++i; |
104 | } | 104 | } |
105 | break; | 105 | break; |
106 | default: | 106 | default: |
107 | break; | 107 | break; |
108 | } | 108 | } |
109 | } | 109 | } |
110 | s = addr.mid(startpos,i-startpos); | 110 | s = addr.mid(startpos,i-startpos); |
111 | if (!s.isEmpty()) { | 111 | if (!s.isEmpty()) { |
112 | list.append(s); | 112 | list.append(s); |
113 | qDebug("Appended %s",s.latin1()); | 113 | odebug << "Appended " << s.latin1() << "" << oendl; |
114 | } | 114 | } |
115 | QStringList::Iterator it; | 115 | QStringList::Iterator it; |
116 | for ( it = list.begin(); it != list.end(); it++ ) { | 116 | for ( it = list.begin(); it != list.end(); it++ ) { |
117 | int err = mailimf_address_list_add_parse( addresses, (char*)(*it).latin1() ); | 117 | int err = mailimf_address_list_add_parse( addresses, (char*)(*it).latin1() ); |
118 | if ( err != MAILIMF_NO_ERROR ) { | 118 | if ( err != MAILIMF_NO_ERROR ) { |
119 | qDebug( "Error parsing" ); | 119 | odebug << "Error parsing" << oendl; |
120 | qDebug( *it ); | 120 | odebug << *it << oendl; |
121 | } else { | 121 | } else { |
122 | qDebug( "Parse success! %s",(*it).latin1()); | 122 | odebug << "Parse success! " << (*it).latin1() << "" << oendl; |
123 | } | 123 | } |
124 | } | 124 | } |
125 | return addresses; | 125 | return addresses; |
126 | } | 126 | } |
127 | 127 | ||
128 | mailmime *Generatemail::buildFilePart(const QString&filename,const QString&mimetype,const QString&TextContent ) { | 128 | mailmime *Generatemail::buildFilePart(const QString&filename,const QString&mimetype,const QString&TextContent ) { |
@@ -172,13 +172,13 @@ mailmime *Generatemail::buildFilePart(const QString&filename,const QString&mimet | |||
172 | if (filename.length()>0) { | 172 | if (filename.length()>0) { |
173 | err = mailmime_set_body_file( filePart, file ); | 173 | err = mailmime_set_body_file( filePart, file ); |
174 | } else { | 174 | } else { |
175 | err = mailmime_set_body_text(filePart,strdup(TextContent.data()),TextContent.length()); | 175 | err = mailmime_set_body_text(filePart,strdup(TextContent.data()),TextContent.length()); |
176 | } | 176 | } |
177 | if (err != MAILIMF_NO_ERROR) { | 177 | if (err != MAILIMF_NO_ERROR) { |
178 | qDebug("Error setting body with file %s",file); | 178 | odebug << "Error setting body with file " << file << "" << oendl; |
179 | mailmime_free( filePart ); | 179 | mailmime_free( filePart ); |
180 | filePart = 0; | 180 | filePart = 0; |
181 | } | 181 | } |
182 | } | 182 | } |
183 | 183 | ||
184 | if (!filePart) { | 184 | if (!filePart) { |
@@ -203,29 +203,29 @@ mailmime *Generatemail::buildFilePart(const QString&filename,const QString&mimet | |||
203 | 203 | ||
204 | } | 204 | } |
205 | 205 | ||
206 | void Generatemail::addFileParts( mailmime *message,const QList<Attachment>&files ) { | 206 | void Generatemail::addFileParts( mailmime *message,const QList<Attachment>&files ) { |
207 | const Attachment *it; | 207 | const Attachment *it; |
208 | unsigned int count = files.count(); | 208 | unsigned int count = files.count(); |
209 | qDebug("List contains %i values",count); | 209 | odebug << "List contains " << count << " values" << oendl; |
210 | for ( unsigned int i = 0; i < count; ++i ) { | 210 | for ( unsigned int i = 0; i < count; ++i ) { |
211 | qDebug( "Adding file" ); | 211 | odebug << "Adding file" << oendl; |
212 | mailmime *filePart; | 212 | mailmime *filePart; |
213 | int err; | 213 | int err; |
214 | it = ((QList<Attachment>)files).at(i); | 214 | it = ((QList<Attachment>)files).at(i); |
215 | 215 | ||
216 | filePart = buildFilePart( it->getFileName(), it->getMimeType(),"" ); | 216 | filePart = buildFilePart( it->getFileName(), it->getMimeType(),"" ); |
217 | if ( filePart == NULL ) { | 217 | if ( filePart == NULL ) { |
218 | qDebug( "addFileParts: error adding file:" ); | 218 | odebug << "addFileParts: error adding file:" << oendl; |
219 | qDebug( it->getFileName() ); | 219 | odebug << it->getFileName() << oendl; |
220 | continue; | 220 | continue; |
221 | } | 221 | } |
222 | err = mailmime_smart_add_part( message, filePart ); | 222 | err = mailmime_smart_add_part( message, filePart ); |
223 | if ( err != MAILIMF_NO_ERROR ) { | 223 | if ( err != MAILIMF_NO_ERROR ) { |
224 | mailmime_free( filePart ); | 224 | mailmime_free( filePart ); |
225 | qDebug("error smart add"); | 225 | odebug << "error smart add" << oendl; |
226 | } | 226 | } |
227 | } | 227 | } |
228 | } | 228 | } |
229 | 229 | ||
230 | mailmime *Generatemail::buildTxtPart(const QString&str ) { | 230 | mailmime *Generatemail::buildTxtPart(const QString&str ) { |
231 | mailmime *txtPart; | 231 | mailmime *txtPart; |
@@ -267,13 +267,13 @@ err_free_fields: | |||
267 | mailmime_fields_free( fields ); | 267 | mailmime_fields_free( fields ); |
268 | err_free_content: | 268 | err_free_content: |
269 | mailmime_content_free( content ); | 269 | mailmime_content_free( content ); |
270 | err_free_param: | 270 | err_free_param: |
271 | mailmime_parameter_free( param ); | 271 | mailmime_parameter_free( param ); |
272 | err_free: | 272 | err_free: |
273 | qDebug( "buildTxtPart - error" ); | 273 | odebug << "buildTxtPart - error" << oendl; |
274 | 274 | ||
275 | return NULL; // Error :( | 275 | return NULL; // Error :( |
276 | } | 276 | } |
277 | 277 | ||
278 | mailimf_mailbox *Generatemail::newMailbox(const QString&name, const QString&mail ) { | 278 | mailimf_mailbox *Generatemail::newMailbox(const QString&name, const QString&mail ) { |
279 | return mailimf_mailbox_new( strdup( name.latin1() ), | 279 | return mailimf_mailbox_new( strdup( name.latin1() ), |
@@ -342,21 +342,21 @@ mailimf_fields *Generatemail::createImfFields(const Opie::Core::OSmartPointer<Ma | |||
342 | nsize = strlen(h.latin1()); | 342 | nsize = strlen(h.latin1()); |
343 | /* yes! must be malloc! */ | 343 | /* yes! must be malloc! */ |
344 | c_reply = (char*)malloc( (nsize+1)*sizeof(char)); | 344 | c_reply = (char*)malloc( (nsize+1)*sizeof(char)); |
345 | memset(c_reply,0,nsize+1); | 345 | memset(c_reply,0,nsize+1); |
346 | memcpy(c_reply,h.latin1(),nsize); | 346 | memcpy(c_reply,h.latin1(),nsize); |
347 | clist_append(in_reply_to,c_reply); | 347 | clist_append(in_reply_to,c_reply); |
348 | qDebug("In reply to: %s",c_reply); | 348 | odebug << "In reply to: " << c_reply << "" << oendl; |
349 | } | 349 | } |
350 | } | 350 | } |
351 | 351 | ||
352 | if (res) { | 352 | if (res) { |
353 | fields = mailimf_fields_new_with_data( from, sender, reply, to, cc, bcc, | 353 | fields = mailimf_fields_new_with_data( from, sender, reply, to, cc, bcc, |
354 | in_reply_to, NULL, subject ); | 354 | in_reply_to, NULL, subject ); |
355 | if ( fields == NULL ) { | 355 | if ( fields == NULL ) { |
356 | qDebug("Error creating mailimf fields"); | 356 | odebug << "Error creating mailimf fields" << oendl; |
357 | res = 0; | 357 | res = 0; |
358 | } | 358 | } |
359 | } | 359 | } |
360 | if (res) xmailer = mailimf_field_new_custom( strdup( "User-Agent" ), | 360 | if (res) xmailer = mailimf_field_new_custom( strdup( "User-Agent" ), |
361 | strdup( USER_AGENT ) ); | 361 | strdup( USER_AGENT ) ); |
362 | if ( xmailer == NULL ) { | 362 | if ( xmailer == NULL ) { |
@@ -432,13 +432,13 @@ err_free_txtPart: | |||
432 | mailmime_free( txtPart ); | 432 | mailmime_free( txtPart ); |
433 | err_free_message: | 433 | err_free_message: |
434 | mailmime_free( message ); | 434 | mailmime_free( message ); |
435 | err_free_fields: | 435 | err_free_fields: |
436 | mailimf_fields_free( fields ); | 436 | mailimf_fields_free( fields ); |
437 | err_free: | 437 | err_free: |
438 | qDebug( "createMimeMail: error" ); | 438 | odebug << "createMimeMail: error" << oendl; |
439 | 439 | ||
440 | return NULL; // Error :( | 440 | return NULL; // Error :( |
441 | } | 441 | } |
442 | 442 | ||
443 | clist *Generatemail::createRcptList( mailimf_fields *fields ) { | 443 | clist *Generatemail::createRcptList( mailimf_fields *fields ) { |
444 | clist *rcptList; | 444 | clist *rcptList; |
diff --git a/noncore/net/mail/libmailwrapper/genericwrapper.cpp b/noncore/net/mail/libmailwrapper/genericwrapper.cpp index 0c68280..fae4c99 100644 --- a/noncore/net/mail/libmailwrapper/genericwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/genericwrapper.cpp | |||
@@ -132,13 +132,13 @@ QString Genericwrapper::getencoding(mailmime_mechanism*aEnc) | |||
132 | return enc; | 132 | return enc; |
133 | } | 133 | } |
134 | 134 | ||
135 | void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*mime,QValueList<int>recList,unsigned int current_rec,int current_count) | 135 | void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*mime,QValueList<int>recList,unsigned int current_rec,int current_count) |
136 | { | 136 | { |
137 | if (current_rec >= 10) { | 137 | if (current_rec >= 10) { |
138 | qDebug("too deep recursion!"); | 138 | odebug << "too deep recursion!" << oendl; |
139 | } | 139 | } |
140 | if (!message || !mime) { | 140 | if (!message || !mime) { |
141 | return; | 141 | return; |
142 | } | 142 | } |
143 | int r; | 143 | int r; |
144 | char*data = 0; | 144 | char*data = 0; |
@@ -269,13 +269,13 @@ QString Genericwrapper::parseAddressList( mailimf_address_list *list ) | |||
269 | result.append( parseMailbox( addr->ad_data.ad_mailbox ) ); | 269 | result.append( parseMailbox( addr->ad_data.ad_mailbox ) ); |
270 | break; | 270 | break; |
271 | case MAILIMF_ADDRESS_GROUP: | 271 | case MAILIMF_ADDRESS_GROUP: |
272 | result.append( parseGroup( addr->ad_data.ad_group ) ); | 272 | result.append( parseGroup( addr->ad_data.ad_group ) ); |
273 | break; | 273 | break; |
274 | default: | 274 | default: |
275 | qDebug( "Generic: unkown mailimf address type" ); | 275 | odebug << "Generic: unkown mailimf address type" << oendl; |
276 | break; | 276 | break; |
277 | } | 277 | } |
278 | } | 278 | } |
279 | 279 | ||
280 | return result; | 280 | return result; |
281 | } | 281 | } |
@@ -362,13 +362,13 @@ void Genericwrapper::cleanMimeCache() | |||
362 | for (;it!=bodyCache.end();++it) { | 362 | for (;it!=bodyCache.end();++it) { |
363 | encodedString*t = it.data(); | 363 | encodedString*t = it.data(); |
364 | //it.setValue(0); | 364 | //it.setValue(0); |
365 | if (t) delete t; | 365 | if (t) delete t; |
366 | } | 366 | } |
367 | bodyCache.clear(); | 367 | bodyCache.clear(); |
368 | qDebug("Genericwrapper: cache cleaned"); | 368 | odebug << "Genericwrapper: cache cleaned" << oendl; |
369 | } | 369 | } |
370 | 370 | ||
371 | QStringList Genericwrapper::parseInreplies(mailimf_in_reply_to * in_replies) | 371 | QStringList Genericwrapper::parseInreplies(mailimf_in_reply_to * in_replies) |
372 | { | 372 | { |
373 | QStringList res; | 373 | QStringList res; |
374 | if (!in_replies || !in_replies->mid_list) return res; | 374 | if (!in_replies || !in_replies->mid_list) return res; |
@@ -391,18 +391,18 @@ QStringList Genericwrapper::parseInreplies(mailimf_in_reply_to * in_replies) | |||
391 | void Genericwrapper::parseList(QValueList<Opie::Core::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to) | 391 | void Genericwrapper::parseList(QValueList<Opie::Core::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to) |
392 | { | 392 | { |
393 | int r; | 393 | int r; |
394 | mailmessage_list * env_list = 0; | 394 | mailmessage_list * env_list = 0; |
395 | r = mailsession_get_messages_list(session,&env_list); | 395 | r = mailsession_get_messages_list(session,&env_list); |
396 | if (r != MAIL_NO_ERROR) { | 396 | if (r != MAIL_NO_ERROR) { |
397 | qDebug("Error message list"); | 397 | odebug << "Error message list" << oendl; |
398 | return; | 398 | return; |
399 | } | 399 | } |
400 | r = mailsession_get_envelopes_list(session, env_list); | 400 | r = mailsession_get_envelopes_list(session, env_list); |
401 | if (r != MAIL_NO_ERROR) { | 401 | if (r != MAIL_NO_ERROR) { |
402 | qDebug("Error filling message list"); | 402 | odebug << "Error filling message list" << oendl; |
403 | if (env_list) { | 403 | if (env_list) { |
404 | mailmessage_list_free(env_list); | 404 | mailmessage_list_free(env_list); |
405 | } | 405 | } |
406 | return; | 406 | return; |
407 | } | 407 | } |
408 | mailimf_references * refs = 0; | 408 | mailimf_references * refs = 0; |
@@ -410,13 +410,13 @@ void Genericwrapper::parseList(QValueList<Opie::Core::OSmartPointer<RecMail> > & | |||
410 | uint32_t i = 0; | 410 | uint32_t i = 0; |
411 | for(; i < carray_count(env_list->msg_tab) ; ++i) { | 411 | for(; i < carray_count(env_list->msg_tab) ; ++i) { |
412 | mailmessage * msg; | 412 | mailmessage * msg; |
413 | QBitArray mFlags(7); | 413 | QBitArray mFlags(7); |
414 | msg = (mailmessage*)carray_get(env_list->msg_tab, i); | 414 | msg = (mailmessage*)carray_get(env_list->msg_tab, i); |
415 | if (msg->msg_fields == NULL) { | 415 | if (msg->msg_fields == NULL) { |
416 | //qDebug("could not fetch envelope of message %i", i); | 416 | //odebug << "could not fetch envelope of message " << i << "" << oendl; |
417 | continue; | 417 | continue; |
418 | } | 418 | } |
419 | RecMailP mail = new RecMail(); | 419 | RecMailP mail = new RecMail(); |
420 | mail->setWrapper(this); | 420 | mail->setWrapper(this); |
421 | mail_flags * flag_result = 0; | 421 | mail_flags * flag_result = 0; |
422 | r = mailmessage_get_flags(msg,&flag_result); | 422 | r = mailmessage_get_flags(msg,&flag_result); |
@@ -445,13 +445,13 @@ void Genericwrapper::parseList(QValueList<Opie::Core::OSmartPointer<RecMail> > & | |||
445 | mail->setBcc( parseAddressList( single_fields.fld_bcc->bcc_addr_list ) ); | 445 | mail->setBcc( parseAddressList( single_fields.fld_bcc->bcc_addr_list ) ); |
446 | if (single_fields.fld_orig_date) | 446 | if (single_fields.fld_orig_date) |
447 | mail->setDate( parseDateTime( single_fields.fld_orig_date->dt_date_time ) ); | 447 | mail->setDate( parseDateTime( single_fields.fld_orig_date->dt_date_time ) ); |
448 | // crashes when accessing pop3 account? | 448 | // crashes when accessing pop3 account? |
449 | if (single_fields.fld_message_id->mid_value) { | 449 | if (single_fields.fld_message_id->mid_value) { |
450 | mail->setMsgid(QString(single_fields.fld_message_id->mid_value)); | 450 | mail->setMsgid(QString(single_fields.fld_message_id->mid_value)); |
451 | qDebug("Msgid == %s",mail->Msgid().latin1()); | 451 | odebug << "Msgid == " << mail->Msgid().latin1() << "" << oendl; |
452 | } | 452 | } |
453 | 453 | ||
454 | if (single_fields.fld_reply_to) { | 454 | if (single_fields.fld_reply_to) { |
455 | QStringList t = parseAddressList(single_fields.fld_reply_to->rt_addr_list); | 455 | QStringList t = parseAddressList(single_fields.fld_reply_to->rt_addr_list); |
456 | if (t.count()>0) { | 456 | if (t.count()>0) { |
457 | mail->setReplyto(t[0]); | 457 | mail->setReplyto(t[0]); |
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp index 657c2ba..35468fe 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp | |||
@@ -27,36 +27,36 @@ int IMAPwrapper::selectMbox(const QString&mbox) | |||
27 | { | 27 | { |
28 | if (mbox == m_Lastmbox) { | 28 | if (mbox == m_Lastmbox) { |
29 | return MAILIMAP_NO_ERROR; | 29 | return MAILIMAP_NO_ERROR; |
30 | } | 30 | } |
31 | int err = mailimap_select( m_imap, (char*)mbox.latin1()); | 31 | int err = mailimap_select( m_imap, (char*)mbox.latin1()); |
32 | if ( err != MAILIMAP_NO_ERROR ) { | 32 | if ( err != MAILIMAP_NO_ERROR ) { |
33 | qDebug("error selecting mailbox: %s",m_imap->imap_response); | 33 | odebug << "error selecting mailbox: " << m_imap->imap_response << "" << oendl; |
34 | m_Lastmbox = ""; | 34 | m_Lastmbox = ""; |
35 | return err; | 35 | return err; |
36 | } | 36 | } |
37 | m_Lastmbox = mbox; | 37 | m_Lastmbox = mbox; |
38 | return err; | 38 | return err; |
39 | } | 39 | } |
40 | 40 | ||
41 | void IMAPwrapper::imap_progress( size_t current, size_t maximum ) | 41 | void IMAPwrapper::imap_progress( size_t current, size_t maximum ) |
42 | { | 42 | { |
43 | qApp->processEvents(); | 43 | qApp->processEvents(); |
44 | qDebug( "IMAP: %i of %i", current, maximum ); | 44 | odebug << "IMAP: " << current << " of " << maximum << "" << oendl; |
45 | } | 45 | } |
46 | 46 | ||
47 | bool IMAPwrapper::start_tls(bool force_tls) | 47 | bool IMAPwrapper::start_tls(bool force_tls) |
48 | { | 48 | { |
49 | int err; | 49 | int err; |
50 | bool try_tls; | 50 | bool try_tls; |
51 | mailimap_capability_data * cap_data = 0; | 51 | mailimap_capability_data * cap_data = 0; |
52 | 52 | ||
53 | err = mailimap_capability(m_imap,&cap_data); | 53 | err = mailimap_capability(m_imap,&cap_data); |
54 | if (err != MAILIMAP_NO_ERROR) { | 54 | if (err != MAILIMAP_NO_ERROR) { |
55 | Global::statusMessage("error getting capabilities!"); | 55 | Global::statusMessage("error getting capabilities!"); |
56 | qDebug("error getting capabilities!"); | 56 | odebug << "error getting capabilities!" << oendl; |
57 | return false; | 57 | return false; |
58 | } | 58 | } |
59 | clistiter * cur; | 59 | clistiter * cur; |
60 | for(cur = clist_begin(cap_data->cap_list) ; cur != NULL;cur = clist_next(cur)) { | 60 | for(cur = clist_begin(cap_data->cap_list) ; cur != NULL;cur = clist_next(cur)) { |
61 | struct mailimap_capability * cap; | 61 | struct mailimap_capability * cap; |
62 | cap = (struct mailimap_capability *)clist_content(cur); | 62 | cap = (struct mailimap_capability *)clist_content(cur); |
@@ -71,13 +71,13 @@ bool IMAPwrapper::start_tls(bool force_tls) | |||
71 | mailimap_capability_data_free(cap_data); | 71 | mailimap_capability_data_free(cap_data); |
72 | } | 72 | } |
73 | if (try_tls) { | 73 | if (try_tls) { |
74 | err = mailimap_starttls(m_imap); | 74 | err = mailimap_starttls(m_imap); |
75 | if (err != MAILIMAP_NO_ERROR && force_tls) { | 75 | if (err != MAILIMAP_NO_ERROR && force_tls) { |
76 | Global::statusMessage(tr("Server has no TLS support!")); | 76 | Global::statusMessage(tr("Server has no TLS support!")); |
77 | qDebug("Server has no TLS support!"); | 77 | odebug << "Server has no TLS support!" << oendl; |
78 | try_tls = false; | 78 | try_tls = false; |
79 | } else { | 79 | } else { |
80 | mailstream_low * low; | 80 | mailstream_low * low; |
81 | mailstream_low * new_low; | 81 | mailstream_low * new_low; |
82 | low = mailstream_get_low(m_imap->imap_stream); | 82 | low = mailstream_get_low(m_imap->imap_stream); |
83 | if (!low) { | 83 | if (!low) { |
@@ -122,13 +122,13 @@ void IMAPwrapper::login() | |||
122 | if ( QDialog::Accepted == login.exec() ) { | 122 | if ( QDialog::Accepted == login.exec() ) { |
123 | // ok | 123 | // ok |
124 | user = login.getUser().latin1(); | 124 | user = login.getUser().latin1(); |
125 | pass = login.getPassword().latin1(); | 125 | pass = login.getPassword().latin1(); |
126 | } else { | 126 | } else { |
127 | // cancel | 127 | // cancel |
128 | qDebug( "IMAP: Login canceled" ); | 128 | odebug << "IMAP: Login canceled" << oendl; |
129 | return; | 129 | return; |
130 | } | 130 | } |
131 | } else { | 131 | } else { |
132 | user = account->getUser().latin1(); | 132 | user = account->getUser().latin1(); |
133 | pass = account->getPassword().latin1(); | 133 | pass = account->getPassword().latin1(); |
134 | } | 134 | } |
@@ -145,13 +145,13 @@ void IMAPwrapper::login() | |||
145 | } | 145 | } |
146 | if (account->ConnectionType()==1) { | 146 | if (account->ConnectionType()==1) { |
147 | force_tls = true; | 147 | force_tls = true; |
148 | } | 148 | } |
149 | 149 | ||
150 | if ( ssl ) { | 150 | if ( ssl ) { |
151 | qDebug( "using ssl" ); | 151 | odebug << "using ssl" << oendl; |
152 | err = mailimap_ssl_connect( m_imap, (char*)server, port ); | 152 | err = mailimap_ssl_connect( m_imap, (char*)server, port ); |
153 | } else { | 153 | } else { |
154 | err = mailimap_socket_connect( m_imap, (char*)server, port ); | 154 | err = mailimap_socket_connect( m_imap, (char*)server, port ); |
155 | } | 155 | } |
156 | 156 | ||
157 | if ( err != MAILIMAP_NO_ERROR && | 157 | if ( err != MAILIMAP_NO_ERROR && |
@@ -173,13 +173,13 @@ void IMAPwrapper::login() | |||
173 | try_tls = start_tls(force_tls); | 173 | try_tls = start_tls(force_tls); |
174 | } | 174 | } |
175 | 175 | ||
176 | bool ok = true; | 176 | bool ok = true; |
177 | if (force_tls && !try_tls) { | 177 | if (force_tls && !try_tls) { |
178 | Global::statusMessage(tr("Server has no TLS support!")); | 178 | Global::statusMessage(tr("Server has no TLS support!")); |
179 | qDebug("Server has no TLS support!"); | 179 | odebug << "Server has no TLS support!" << oendl; |
180 | ok = false; | 180 | ok = false; |
181 | } | 181 | } |
182 | 182 | ||
183 | 183 | ||
184 | /* login */ | 184 | /* login */ |
185 | 185 | ||
@@ -314,23 +314,23 @@ QValueList<Opie::Core::OSmartPointer<Folder> >* IMAPwrapper::listFolders() | |||
314 | } | 314 | } |
315 | } | 315 | } |
316 | } | 316 | } |
317 | folders->append( new IMAPFolder(temp,del,selectable,no_inferiors,account->getPrefix())); | 317 | folders->append( new IMAPFolder(temp,del,selectable,no_inferiors,account->getPrefix())); |
318 | } | 318 | } |
319 | } else { | 319 | } else { |
320 | qDebug("error fetching folders: %s",m_imap->imap_response); | 320 | odebug << "error fetching folders: " << m_imap->imap_response << "" << oendl; |
321 | } | 321 | } |
322 | mailimap_list_result_free( result ); | 322 | mailimap_list_result_free( result ); |
323 | 323 | ||
324 | /* | 324 | /* |
325 | * second stage - get the other then inbox folders | 325 | * second stage - get the other then inbox folders |
326 | */ | 326 | */ |
327 | mask = "*" ; | 327 | mask = "*" ; |
328 | path = account->getPrefix().latin1(); | 328 | path = account->getPrefix().latin1(); |
329 | if (!path) path = ""; | 329 | if (!path) path = ""; |
330 | qDebug(path); | 330 | odebug << path << oendl; |
331 | err = mailimap_list( m_imap, (char*)path, (char*)mask, &result ); | 331 | err = mailimap_list( m_imap, (char*)path, (char*)mask, &result ); |
332 | if ( err == MAILIMAP_NO_ERROR ) { | 332 | if ( err == MAILIMAP_NO_ERROR ) { |
333 | current = result->first; | 333 | current = result->first; |
334 | for ( current=clist_begin(result);current!=NULL;current=clist_next(current)) { | 334 | for ( current=clist_begin(result);current!=NULL;current=clist_next(current)) { |
335 | no_inferiors = false; | 335 | no_inferiors = false; |
336 | list = (mailimap_mailbox_list *) current->data; | 336 | list = (mailimap_mailbox_list *) current->data; |
@@ -351,13 +351,13 @@ QValueList<Opie::Core::OSmartPointer<Folder> >* IMAPwrapper::listFolders() | |||
351 | } | 351 | } |
352 | } | 352 | } |
353 | del = list->mb_delimiter; | 353 | del = list->mb_delimiter; |
354 | folders->append(new IMAPFolder(temp,del,selectable,no_inferiors,account->getPrefix())); | 354 | folders->append(new IMAPFolder(temp,del,selectable,no_inferiors,account->getPrefix())); |
355 | } | 355 | } |
356 | } else { | 356 | } else { |
357 | qDebug("error fetching folders %s",m_imap->imap_response); | 357 | odebug << "error fetching folders " << m_imap->imap_response << "" << oendl; |
358 | } | 358 | } |
359 | if (result) mailimap_list_result_free( result ); | 359 | if (result) mailimap_list_result_free( result ); |
360 | return folders; | 360 | return folders; |
361 | } | 361 | } |
362 | 362 | ||
363 | RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att) | 363 | RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att) |
@@ -463,14 +463,14 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att) | |||
463 | m->setMsgid(QString(head->env_message_id)); | 463 | m->setMsgid(QString(head->env_message_id)); |
464 | } | 464 | } |
465 | } else if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_INTERNALDATE) { | 465 | } else if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_INTERNALDATE) { |
466 | #if 0 | 466 | #if 0 |
467 | mailimap_date_time*d = item->att_data.att_static->att_data.att_internal_date; | 467 | mailimap_date_time*d = item->att_data.att_static->att_data.att_internal_date; |
468 | QDateTime da(QDate(d->dt_year,d->dt_month,d->dt_day),QTime(d->dt_hour,d->dt_min,d->dt_sec)); | 468 | QDateTime da(QDate(d->dt_year,d->dt_month,d->dt_day),QTime(d->dt_hour,d->dt_min,d->dt_sec)); |
469 | qDebug("%i %i %i - %i %i %i",d->dt_year,d->dt_month,d->dt_day,d->dt_hour,d->dt_min,d->dt_sec); | 469 | odebug << "" << d->dt_year << " " << d->dt_month << " " << d->dt_day << " - " << d->dt_hour << " " << d->dt_min << " " << d->dt_sec << "" << oendl; |
470 | qDebug(da.toString()); | 470 | odebug << da.toString() << oendl; |
471 | #endif | 471 | #endif |
472 | } else if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_RFC822_SIZE) { | 472 | } else if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_RFC822_SIZE) { |
473 | size = item->att_data.att_static->att_data.att_rfc822_size; | 473 | size = item->att_data.att_static->att_data.att_rfc822_size; |
474 | } | 474 | } |
475 | } | 475 | } |
476 | /* msg is already deleted */ | 476 | /* msg is already deleted */ |
@@ -521,13 +521,13 @@ RecBodyP IMAPwrapper::fetchBody(const RecMailP&mail) | |||
521 | msg_att = (mailimap_msg_att*)current->data; | 521 | msg_att = (mailimap_msg_att*)current->data; |
522 | mailimap_msg_att_item*item = (mailimap_msg_att_item*)msg_att->att_list->first->data; | 522 | mailimap_msg_att_item*item = (mailimap_msg_att_item*)msg_att->att_list->first->data; |
523 | QValueList<int> path; | 523 | QValueList<int> path; |
524 | body_desc = item->att_data.att_static->att_data.att_body; | 524 | body_desc = item->att_data.att_static->att_data.att_body; |
525 | traverseBody(mail,body_desc,body,0,path); | 525 | traverseBody(mail,body_desc,body,0,path); |
526 | } else { | 526 | } else { |
527 | qDebug("error fetching body: %s",m_imap->imap_response); | 527 | odebug << "error fetching body: " << m_imap->imap_response << "" << oendl; |
528 | } | 528 | } |
529 | if (result) mailimap_fetch_list_free(result); | 529 | if (result) mailimap_fetch_list_free(result); |
530 | return body; | 530 | return body; |
531 | } | 531 | } |
532 | 532 | ||
533 | QStringList IMAPwrapper::address_list_to_stringlist(clist*list) | 533 | QStringList IMAPwrapper::address_list_to_stringlist(clist*list) |
@@ -633,13 +633,13 @@ encodedString*IMAPwrapper::fetchRawPart(const RecMailP&mail,const QValueList<int | |||
633 | msg_att_item->att_data.att_static->att_data.att_body_section->sec_body_part = 0L; | 633 | msg_att_item->att_data.att_static->att_data.att_body_section->sec_body_part = 0L; |
634 | res->setContent(text,msg_att_item->att_data.att_static->att_data.att_body_section->sec_length); | 634 | res->setContent(text,msg_att_item->att_data.att_static->att_data.att_body_section->sec_length); |
635 | } | 635 | } |
636 | } | 636 | } |
637 | } | 637 | } |
638 | } else { | 638 | } else { |
639 | qDebug("error fetching text: %s",m_imap->imap_response); | 639 | odebug << "error fetching text: " << m_imap->imap_response << "" << oendl; |
640 | } | 640 | } |
641 | if (result) mailimap_fetch_list_free(result); | 641 | if (result) mailimap_fetch_list_free(result); |
642 | return res; | 642 | return res; |
643 | } | 643 | } |
644 | 644 | ||
645 | /* current_recursion is for recursive calls. | 645 | /* current_recursion is for recursive calls. |
@@ -660,13 +660,13 @@ void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&t | |||
660 | QString id(""); | 660 | QString id(""); |
661 | currentPart->setPositionlist(countlist); | 661 | currentPart->setPositionlist(countlist); |
662 | for (unsigned int j = 0; j < countlist.count();++j) { | 662 | for (unsigned int j = 0; j < countlist.count();++j) { |
663 | id+=(j>0?" ":""); | 663 | id+=(j>0?" ":""); |
664 | id+=QString("%1").arg(countlist[j]); | 664 | id+=QString("%1").arg(countlist[j]); |
665 | } | 665 | } |
666 | qDebug("ID = %s",id.latin1()); | 666 | odebug << "ID = " << id.latin1() << "" << oendl; |
667 | currentPart->setIdentifier(id); | 667 | currentPart->setIdentifier(id); |
668 | fillSinglePart(currentPart,part1); | 668 | fillSinglePart(currentPart,part1); |
669 | /* important: Check for is NULL 'cause a body can be empty! | 669 | /* important: Check for is NULL 'cause a body can be empty! |
670 | And we put it only into the mail if it is the FIRST part */ | 670 | And we put it only into the mail if it is the FIRST part */ |
671 | if (part1->bd_type==MAILIMAP_BODY_TYPE_1PART_TEXT && target_body->Bodytext().isNull() && countlist[0]==1) { | 671 | if (part1->bd_type==MAILIMAP_BODY_TYPE_1PART_TEXT && target_body->Bodytext().isNull() && countlist[0]==1) { |
672 | QString body_text = fetchTextPart(mail,countlist,true,currentPart->Encoding()); | 672 | QString body_text = fetchTextPart(mail,countlist,true,currentPart->Encoding()); |
@@ -701,13 +701,13 @@ void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&t | |||
701 | target_body->addPart(targetPart); | 701 | target_body->addPart(targetPart); |
702 | QString id(""); | 702 | QString id(""); |
703 | for (unsigned int j = 0; j < countlist.count();++j) { | 703 | for (unsigned int j = 0; j < countlist.count();++j) { |
704 | id+=(j>0?" ":""); | 704 | id+=(j>0?" ":""); |
705 | id+=QString("%1").arg(countlist[j]); | 705 | id+=QString("%1").arg(countlist[j]); |
706 | } | 706 | } |
707 | qDebug("ID(mpart) = %s",id.latin1()); | 707 | odebug << "ID(mpart) = " << id.latin1() << "" << oendl; |
708 | } | 708 | } |
709 | traverseBody(mail,current_body,target_body,current_recursion+1,countlist,ccount); | 709 | traverseBody(mail,current_body,target_body,current_recursion+1,countlist,ccount); |
710 | if (current_body->bd_type==MAILIMAP_BODY_MPART) { | 710 | if (current_body->bd_type==MAILIMAP_BODY_MPART) { |
711 | countlist = recList; | 711 | countlist = recList; |
712 | } | 712 | } |
713 | ++ccount; | 713 | ++ccount; |
@@ -745,25 +745,25 @@ void IMAPwrapper::fillSingleTextPart(RecPartP&target_part,mailimap_body_type_tex | |||
745 | { | 745 | { |
746 | if (!which) { | 746 | if (!which) { |
747 | return; | 747 | return; |
748 | } | 748 | } |
749 | QString sub; | 749 | QString sub; |
750 | sub = which->bd_media_text; | 750 | sub = which->bd_media_text; |
751 | qDebug("Type= text/%s",which->bd_media_text); | 751 | odebug << "Type= text/" << which->bd_media_text << "" << oendl; |
752 | target_part->setSubtype(sub.lower()); | 752 | target_part->setSubtype(sub.lower()); |
753 | target_part->setLines(which->bd_lines); | 753 | target_part->setLines(which->bd_lines); |
754 | fillBodyFields(target_part,which->bd_fields); | 754 | fillBodyFields(target_part,which->bd_fields); |
755 | } | 755 | } |
756 | 756 | ||
757 | void IMAPwrapper::fillSingleMsgPart(RecPartP&target_part,mailimap_body_type_msg*which) | 757 | void IMAPwrapper::fillSingleMsgPart(RecPartP&target_part,mailimap_body_type_msg*which) |
758 | { | 758 | { |
759 | if (!which) { | 759 | if (!which) { |
760 | return; | 760 | return; |
761 | } | 761 | } |
762 | target_part->setSubtype("rfc822"); | 762 | target_part->setSubtype("rfc822"); |
763 | qDebug("Message part"); | 763 | odebug << "Message part" << oendl; |
764 | /* we set this type to text/plain */ | 764 | /* we set this type to text/plain */ |
765 | target_part->setLines(which->bd_lines); | 765 | target_part->setLines(which->bd_lines); |
766 | fillBodyFields(target_part,which->bd_fields); | 766 | fillBodyFields(target_part,which->bd_fields); |
767 | } | 767 | } |
768 | 768 | ||
769 | void IMAPwrapper::fillMultiPart(RecPartP&target_part,mailimap_body_type_mpart*which) | 769 | void IMAPwrapper::fillMultiPart(RecPartP&target_part,mailimap_body_type_mpart*which) |
@@ -816,13 +816,13 @@ void IMAPwrapper::fillSingleBasicPart(RecPartP&target_part,mailimap_body_type_ba | |||
816 | } | 816 | } |
817 | if (which->bd_media_basic->med_subtype) { | 817 | if (which->bd_media_basic->med_subtype) { |
818 | sub = which->bd_media_basic->med_subtype; | 818 | sub = which->bd_media_basic->med_subtype; |
819 | } else { | 819 | } else { |
820 | sub = ""; | 820 | sub = ""; |
821 | } | 821 | } |
822 | qDebug("Type = %s/%s",type.latin1(),sub.latin1()); | 822 | odebug << "Type = " << type.latin1() << "/" << sub.latin1() << "" << oendl; |
823 | target_part->setType(type.lower()); | 823 | target_part->setType(type.lower()); |
824 | target_part->setSubtype(sub.lower()); | 824 | target_part->setSubtype(sub.lower()); |
825 | fillBodyFields(target_part,which->bd_fields); | 825 | fillBodyFields(target_part,which->bd_fields); |
826 | } | 826 | } |
827 | 827 | ||
828 | void IMAPwrapper::fillBodyFields(RecPartP&target_part,mailimap_body_fields*which) | 828 | void IMAPwrapper::fillBodyFields(RecPartP&target_part,mailimap_body_fields*which) |
@@ -892,22 +892,22 @@ void IMAPwrapper::deleteMail(const RecMailP&mail) | |||
892 | set = mailimap_set_new_single(mail->getNumber()); | 892 | set = mailimap_set_new_single(mail->getNumber()); |
893 | err = mailimap_store(m_imap,set,store_flags); | 893 | err = mailimap_store(m_imap,set,store_flags); |
894 | mailimap_set_free( set ); | 894 | mailimap_set_free( set ); |
895 | mailimap_store_att_flags_free(store_flags); | 895 | mailimap_store_att_flags_free(store_flags); |
896 | 896 | ||
897 | if (err != MAILIMAP_NO_ERROR) { | 897 | if (err != MAILIMAP_NO_ERROR) { |
898 | qDebug("error deleting mail: %s",m_imap->imap_response); | 898 | odebug << "error deleting mail: " << m_imap->imap_response << "" << oendl; |
899 | return; | 899 | return; |
900 | } | 900 | } |
901 | qDebug("deleting mail: %s",m_imap->imap_response); | 901 | odebug << "deleting mail: " << m_imap->imap_response << "" << oendl; |
902 | /* should we realy do that at this moment? */ | 902 | /* should we realy do that at this moment? */ |
903 | err = mailimap_expunge(m_imap); | 903 | err = mailimap_expunge(m_imap); |
904 | if (err != MAILIMAP_NO_ERROR) { | 904 | if (err != MAILIMAP_NO_ERROR) { |
905 | qDebug("error deleting mail: %s",m_imap->imap_response); | 905 | odebug << "error deleting mail: " << m_imap->imap_response << "" << oendl; |
906 | } | 906 | } |
907 | qDebug("Delete successfull %s",m_imap->imap_response); | 907 | odebug << "Delete successfull " << m_imap->imap_response << "" << oendl; |
908 | } | 908 | } |
909 | 909 | ||
910 | void IMAPwrapper::answeredMail(const RecMailP&mail) | 910 | void IMAPwrapper::answeredMail(const RecMailP&mail) |
911 | { | 911 | { |
912 | mailimap_flag_list*flist; | 912 | mailimap_flag_list*flist; |
913 | mailimap_set *set; | 913 | mailimap_set *set; |
@@ -927,13 +927,13 @@ void IMAPwrapper::answeredMail(const RecMailP&mail) | |||
927 | set = mailimap_set_new_single(mail->getNumber()); | 927 | set = mailimap_set_new_single(mail->getNumber()); |
928 | err = mailimap_store(m_imap,set,store_flags); | 928 | err = mailimap_store(m_imap,set,store_flags); |
929 | mailimap_set_free( set ); | 929 | mailimap_set_free( set ); |
930 | mailimap_store_att_flags_free(store_flags); | 930 | mailimap_store_att_flags_free(store_flags); |
931 | 931 | ||
932 | if (err != MAILIMAP_NO_ERROR) { | 932 | if (err != MAILIMAP_NO_ERROR) { |
933 | qDebug("error marking mail: %s",m_imap->imap_response); | 933 | odebug << "error marking mail: " << m_imap->imap_response << "" << oendl; |
934 | return; | 934 | return; |
935 | } | 935 | } |
936 | } | 936 | } |
937 | 937 | ||
938 | QString IMAPwrapper::fetchTextPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call,const QString&enc) | 938 | QString IMAPwrapper::fetchTextPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call,const QString&enc) |
939 | { | 939 | { |
@@ -995,20 +995,20 @@ int IMAPwrapper::deleteAllMail(const FolderP&folder) | |||
995 | mailimap_set_free( set ); | 995 | mailimap_set_free( set ); |
996 | mailimap_store_att_flags_free(store_flags); | 996 | mailimap_store_att_flags_free(store_flags); |
997 | if (err != MAILIMAP_NO_ERROR) { | 997 | if (err != MAILIMAP_NO_ERROR) { |
998 | Global::statusMessage(tr("error deleting mail: %s").arg(m_imap->imap_response)); | 998 | Global::statusMessage(tr("error deleting mail: %s").arg(m_imap->imap_response)); |
999 | return 0; | 999 | return 0; |
1000 | } | 1000 | } |
1001 | qDebug("deleting mail: %s",m_imap->imap_response); | 1001 | odebug << "deleting mail: " << m_imap->imap_response << "" << oendl; |
1002 | /* should we realy do that at this moment? */ | 1002 | /* should we realy do that at this moment? */ |
1003 | err = mailimap_expunge(m_imap); | 1003 | err = mailimap_expunge(m_imap); |
1004 | if (err != MAILIMAP_NO_ERROR) { | 1004 | if (err != MAILIMAP_NO_ERROR) { |
1005 | Global::statusMessage(tr("error deleting mail: %s").arg(m_imap->imap_response)); | 1005 | Global::statusMessage(tr("error deleting mail: %s").arg(m_imap->imap_response)); |
1006 | return 0; | 1006 | return 0; |
1007 | } | 1007 | } |
1008 | qDebug("Delete successfull %s",m_imap->imap_response); | 1008 | odebug << "Delete successfull " << m_imap->imap_response << "" << oendl; |
1009 | return 1; | 1009 | return 1; |
1010 | } | 1010 | } |
1011 | 1011 | ||
1012 | int IMAPwrapper::createMbox(const QString&folder,const FolderP&parentfolder,const QString& delemiter,bool getsubfolder) | 1012 | int IMAPwrapper::createMbox(const QString&folder,const FolderP&parentfolder,const QString& delemiter,bool getsubfolder) |
1013 | { | 1013 | { |
1014 | if (folder.length()==0) return 0; | 1014 | if (folder.length()==0) return 0; |
@@ -1027,13 +1027,13 @@ int IMAPwrapper::createMbox(const QString&folder,const FolderP&parentfolder,cons | |||
1027 | pre+=delemiter; | 1027 | pre+=delemiter; |
1028 | } else { | 1028 | } else { |
1029 | Global::statusMessage(tr("Cannot create folder %1 for holding subfolders").arg(pre)); | 1029 | Global::statusMessage(tr("Cannot create folder %1 for holding subfolders").arg(pre)); |
1030 | return 0; | 1030 | return 0; |
1031 | } | 1031 | } |
1032 | } | 1032 | } |
1033 | qDebug("Creating %s",pre.latin1()); | 1033 | odebug << "Creating " << pre.latin1() << "" << oendl; |
1034 | int res = mailimap_create(m_imap,pre.latin1()); | 1034 | int res = mailimap_create(m_imap,pre.latin1()); |
1035 | if (res != MAILIMAP_NO_ERROR) { | 1035 | if (res != MAILIMAP_NO_ERROR) { |
1036 | Global::statusMessage(tr("%1").arg(m_imap->imap_response)); | 1036 | Global::statusMessage(tr("%1").arg(m_imap->imap_response)); |
1037 | return 0; | 1037 | return 0; |
1038 | } | 1038 | } |
1039 | return 1; | 1039 | return 1; |
@@ -1086,13 +1086,13 @@ void IMAPwrapper::statusFolder(folderStat&target_stat,const QString & mailbox) | |||
1086 | case MAILIMAP_STATUS_ATT_UNSEEN: | 1086 | case MAILIMAP_STATUS_ATT_UNSEEN: |
1087 | target_stat.message_unseen = status_info->st_value; | 1087 | target_stat.message_unseen = status_info->st_value; |
1088 | break; | 1088 | break; |
1089 | } | 1089 | } |
1090 | } | 1090 | } |
1091 | } else { | 1091 | } else { |
1092 | qDebug("Error retrieving status"); | 1092 | odebug << "Error retrieving status" << oendl; |
1093 | } | 1093 | } |
1094 | if (status) mailimap_mailbox_data_status_free(status); | 1094 | if (status) mailimap_mailbox_data_status_free(status); |
1095 | if (att_list) mailimap_status_att_list_free(att_list); | 1095 | if (att_list) mailimap_status_att_list_free(att_list); |
1096 | } | 1096 | } |
1097 | 1097 | ||
1098 | void IMAPwrapper::storeMessage(const char*msg,size_t length, const QString&folder) | 1098 | void IMAPwrapper::storeMessage(const char*msg,size_t length, const QString&folder) |
@@ -1110,13 +1110,13 @@ MAILLIB::ATYPE IMAPwrapper::getType()const | |||
1110 | { | 1110 | { |
1111 | return account->getType(); | 1111 | return account->getType(); |
1112 | } | 1112 | } |
1113 | 1113 | ||
1114 | const QString&IMAPwrapper::getName()const | 1114 | const QString&IMAPwrapper::getName()const |
1115 | { | 1115 | { |
1116 | qDebug("Get name: %s",account->getAccountName().latin1()); | 1116 | odebug << "Get name: " << account->getAccountName().latin1() << "" << oendl; |
1117 | return account->getAccountName(); | 1117 | return account->getAccountName(); |
1118 | } | 1118 | } |
1119 | 1119 | ||
1120 | encodedString* IMAPwrapper::fetchRawBody(const RecMailP&mail) | 1120 | encodedString* IMAPwrapper::fetchRawBody(const RecMailP&mail) |
1121 | { | 1121 | { |
1122 | // dummy | 1122 | // dummy |
@@ -1126,13 +1126,13 @@ encodedString* IMAPwrapper::fetchRawBody(const RecMailP&mail) | |||
1126 | 1126 | ||
1127 | void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder, | 1127 | void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder, |
1128 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) | 1128 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) |
1129 | { | 1129 | { |
1130 | if (targetWrapper != this) { | 1130 | if (targetWrapper != this) { |
1131 | AbstractMail::mvcpAllMails(fromFolder,targetFolder,targetWrapper,moveit); | 1131 | AbstractMail::mvcpAllMails(fromFolder,targetFolder,targetWrapper,moveit); |
1132 | qDebug("Using generic"); | 1132 | odebug << "Using generic" << oendl; |
1133 | return; | 1133 | return; |
1134 | } | 1134 | } |
1135 | mailimap_set *set = 0; | 1135 | mailimap_set *set = 0; |
1136 | login(); | 1136 | login(); |
1137 | if (!m_imap) { | 1137 | if (!m_imap) { |
1138 | return; | 1138 | return; |
@@ -1145,24 +1145,24 @@ void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder, | |||
1145 | set = mailimap_set_new_interval( 1, last ); | 1145 | set = mailimap_set_new_interval( 1, last ); |
1146 | err = mailimap_copy(m_imap,set,targetFolder.latin1()); | 1146 | err = mailimap_copy(m_imap,set,targetFolder.latin1()); |
1147 | mailimap_set_free( set ); | 1147 | mailimap_set_free( set ); |
1148 | if ( err != MAILIMAP_NO_ERROR ) { | 1148 | if ( err != MAILIMAP_NO_ERROR ) { |
1149 | QString error_msg = tr("error copy mails: %1").arg(m_imap->imap_response); | 1149 | QString error_msg = tr("error copy mails: %1").arg(m_imap->imap_response); |
1150 | Global::statusMessage(error_msg); | 1150 | Global::statusMessage(error_msg); |
1151 | qDebug(error_msg); | 1151 | odebug << error_msg << oendl; |
1152 | return; | 1152 | return; |
1153 | } | 1153 | } |
1154 | if (moveit) { | 1154 | if (moveit) { |
1155 | deleteAllMail(fromFolder); | 1155 | deleteAllMail(fromFolder); |
1156 | } | 1156 | } |
1157 | } | 1157 | } |
1158 | 1158 | ||
1159 | void IMAPwrapper::mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) | 1159 | void IMAPwrapper::mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) |
1160 | { | 1160 | { |
1161 | if (targetWrapper != this) { | 1161 | if (targetWrapper != this) { |
1162 | qDebug("Using generic"); | 1162 | odebug << "Using generic" << oendl; |
1163 | AbstractMail::mvcpMail(mail,targetFolder,targetWrapper,moveit); | 1163 | AbstractMail::mvcpMail(mail,targetFolder,targetWrapper,moveit); |
1164 | return; | 1164 | return; |
1165 | } | 1165 | } |
1166 | mailimap_set *set = 0; | 1166 | mailimap_set *set = 0; |
1167 | login(); | 1167 | login(); |
1168 | if (!m_imap) { | 1168 | if (!m_imap) { |
@@ -1175,13 +1175,13 @@ void IMAPwrapper::mvcpMail(const RecMailP&mail,const QString&targetFolder,Abstra | |||
1175 | set = mailimap_set_new_single(mail->getNumber()); | 1175 | set = mailimap_set_new_single(mail->getNumber()); |
1176 | err = mailimap_copy(m_imap,set,targetFolder.latin1()); | 1176 | err = mailimap_copy(m_imap,set,targetFolder.latin1()); |
1177 | mailimap_set_free( set ); | 1177 | mailimap_set_free( set ); |
1178 | if ( err != MAILIMAP_NO_ERROR ) { | 1178 | if ( err != MAILIMAP_NO_ERROR ) { |
1179 | QString error_msg = tr("error copy mail: %1").arg(m_imap->imap_response); | 1179 | QString error_msg = tr("error copy mail: %1").arg(m_imap->imap_response); |
1180 | Global::statusMessage(error_msg); | 1180 | Global::statusMessage(error_msg); |
1181 | qDebug(error_msg); | 1181 | odebug << error_msg << oendl; |
1182 | return; | 1182 | return; |
1183 | } | 1183 | } |
1184 | if (moveit) { | 1184 | if (moveit) { |
1185 | deleteMail(mail); | 1185 | deleteMail(mail); |
1186 | } | 1186 | } |
1187 | } | 1187 | } |
diff --git a/noncore/net/mail/libmailwrapper/logindialog.cpp b/noncore/net/mail/libmailwrapper/logindialog.cpp index 01d177e..c9ae190 100644 --- a/noncore/net/mail/libmailwrapper/logindialog.cpp +++ b/noncore/net/mail/libmailwrapper/logindialog.cpp | |||
@@ -21,9 +21,9 @@ void LoginDialog::accept() | |||
21 | { | 21 | { |
22 | //_user.replace( 0, _user.length(), userLine->text() ); | 22 | //_user.replace( 0, _user.length(), userLine->text() ); |
23 | //_pass.replace( 0, _pass.length(), passLine->text() ); | 23 | //_pass.replace( 0, _pass.length(), passLine->text() ); |
24 | _user = userLine->text(); | 24 | _user = userLine->text(); |
25 | _pass = passLine->text(); | 25 | _pass = passLine->text(); |
26 | 26 | ||
27 | qDebug("User im accept: |%s|",_user.latin1()); | 27 | odebug << "User im accept: |" << _user.latin1() << "|" << oendl; |
28 | QDialog::accept(); | 28 | QDialog::accept(); |
29 | } | 29 | } |
diff --git a/noncore/net/mail/libmailwrapper/mailtypes.cpp b/noncore/net/mail/libmailwrapper/mailtypes.cpp index 90b8865..6d44db4 100644 --- a/noncore/net/mail/libmailwrapper/mailtypes.cpp +++ b/noncore/net/mail/libmailwrapper/mailtypes.cpp | |||
@@ -10,13 +10,13 @@ RecMail::RecMail() | |||
10 | 10 | ||
11 | RecMail::RecMail(const RecMail&old) | 11 | RecMail::RecMail(const RecMail&old) |
12 | :Opie::Core::ORefCount(),subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_flags(7) | 12 | :Opie::Core::ORefCount(),subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_flags(7) |
13 | { | 13 | { |
14 | init(); | 14 | init(); |
15 | copy_old(old); | 15 | copy_old(old); |
16 | qDebug("Copy constructor RecMail"); | 16 | odebug << "Copy constructor RecMail" << oendl; |
17 | } | 17 | } |
18 | 18 | ||
19 | RecMail::~RecMail() | 19 | RecMail::~RecMail() |
20 | { | 20 | { |
21 | wrapper = 0; | 21 | wrapper = 0; |
22 | } | 22 | } |
@@ -128,13 +128,13 @@ RecPart::RecPart(const RecPart&old) | |||
128 | m_encoding = old.m_encoding; | 128 | m_encoding = old.m_encoding; |
129 | m_description = old.m_description; | 129 | m_description = old.m_description; |
130 | m_lines = old.m_lines; | 130 | m_lines = old.m_lines; |
131 | m_size = old.m_size; | 131 | m_size = old.m_size; |
132 | m_Parameters = old.m_Parameters; | 132 | m_Parameters = old.m_Parameters; |
133 | m_poslist = old.m_poslist; | 133 | m_poslist = old.m_poslist; |
134 | qDebug("RecPart copy constructor"); | 134 | odebug << "RecPart copy constructor" << oendl; |
135 | } | 135 | } |
136 | 136 | ||
137 | RecPart::~RecPart() | 137 | RecPart::~RecPart() |
138 | { | 138 | { |
139 | } | 139 | } |
140 | 140 | ||
@@ -252,13 +252,13 @@ RecBody::RecBody() | |||
252 | RecBody::RecBody(const RecBody&old) | 252 | RecBody::RecBody(const RecBody&old) |
253 | :Opie::Core::ORefCount(),m_BodyText(),m_PartsList(),m_description(new RecPart()) | 253 | :Opie::Core::ORefCount(),m_BodyText(),m_PartsList(),m_description(new RecPart()) |
254 | { | 254 | { |
255 | m_BodyText = old.m_BodyText; | 255 | m_BodyText = old.m_BodyText; |
256 | m_PartsList = old.m_PartsList; | 256 | m_PartsList = old.m_PartsList; |
257 | m_description = old.m_description; | 257 | m_description = old.m_description; |
258 | qDebug("Recbody copy constructor"); | 258 | odebug << "Recbody copy constructor" << oendl; |
259 | } | 259 | } |
260 | 260 | ||
261 | RecBody::~RecBody() | 261 | RecBody::~RecBody() |
262 | { | 262 | { |
263 | } | 263 | } |
264 | 264 | ||
@@ -317,20 +317,20 @@ encodedString::encodedString(char*nContent,unsigned int nSize) | |||
317 | } | 317 | } |
318 | 318 | ||
319 | encodedString::encodedString(const encodedString&old) | 319 | encodedString::encodedString(const encodedString&old) |
320 | { | 320 | { |
321 | init(); | 321 | init(); |
322 | copy_old(old); | 322 | copy_old(old); |
323 | qDebug("encodedeString: copy constructor!"); | 323 | odebug << "encodedeString: copy constructor!" << oendl; |
324 | } | 324 | } |
325 | 325 | ||
326 | encodedString& encodedString::operator=(const encodedString&old) | 326 | encodedString& encodedString::operator=(const encodedString&old) |
327 | { | 327 | { |
328 | init(); | 328 | init(); |
329 | copy_old(old); | 329 | copy_old(old); |
330 | qDebug("encodedString: assign operator!"); | 330 | odebug << "encodedString: assign operator!" << oendl; |
331 | return *this; | 331 | return *this; |
332 | } | 332 | } |
333 | 333 | ||
334 | encodedString::~encodedString() | 334 | encodedString::~encodedString() |
335 | { | 335 | { |
336 | clean(); | 336 | clean(); |
diff --git a/noncore/net/mail/libmailwrapper/mailwrapper.cpp b/noncore/net/mail/libmailwrapper/mailwrapper.cpp index eddc0b9..2b0d112 100644 --- a/noncore/net/mail/libmailwrapper/mailwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/mailwrapper.cpp | |||
@@ -48,13 +48,13 @@ const QString& Folder::Separator()const | |||
48 | IMAPFolder::IMAPFolder(const QString&name,const QString&sep, bool select,bool no_inf, const QString&aprefix ) | 48 | IMAPFolder::IMAPFolder(const QString&name,const QString&sep, bool select,bool no_inf, const QString&aprefix ) |
49 | : Folder( name,sep ),m_MaySelect(select),m_NoInferior(no_inf) | 49 | : Folder( name,sep ),m_MaySelect(select),m_NoInferior(no_inf) |
50 | { | 50 | { |
51 | // Decode IMAP foldername | 51 | // Decode IMAP foldername |
52 | nameDisplay = IMAPFolder::decodeFolderName( name ); | 52 | nameDisplay = IMAPFolder::decodeFolderName( name ); |
53 | /* | 53 | /* |
54 | qDebug( "folder " + name + " - displayed as " + nameDisplay ); | 54 | odebug << "folder " + name + " - displayed as " + nameDisplay << oendl; |
55 | */ | 55 | */ |
56 | prefix = aprefix; | 56 | prefix = aprefix; |
57 | 57 | ||
58 | if (prefix.length()>0) { | 58 | if (prefix.length()>0) { |
59 | if (nameDisplay.startsWith(prefix) && nameDisplay.length()>prefix.length()) { | 59 | if (nameDisplay.startsWith(prefix) && nameDisplay.length()>prefix.length()) { |
60 | nameDisplay=nameDisplay.right(nameDisplay.length()-prefix.length()); | 60 | nameDisplay=nameDisplay.right(nameDisplay.length()-prefix.length()); |
diff --git a/noncore/net/mail/libmailwrapper/mboxwrapper.cpp b/noncore/net/mail/libmailwrapper/mboxwrapper.cpp index e3c75f3..df2112f 100644 --- a/noncore/net/mail/libmailwrapper/mboxwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/mboxwrapper.cpp | |||
@@ -28,13 +28,13 @@ void MBOXwrapper::listMessages(const QString & mailbox, QValueList<RecMailP> &ta | |||
28 | 28 | ||
29 | int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); | 29 | int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); |
30 | mailfolder*folder; | 30 | mailfolder*folder; |
31 | folder = mailfolder_new( storage,(char*)p.latin1(),NULL); | 31 | folder = mailfolder_new( storage,(char*)p.latin1(),NULL); |
32 | r = mailfolder_connect(folder); | 32 | r = mailfolder_connect(folder); |
33 | if (r != MAIL_NO_ERROR) { | 33 | if (r != MAIL_NO_ERROR) { |
34 | qDebug("Error initializing mbox"); | 34 | odebug << "Error initializing mbox" << oendl; |
35 | mailfolder_free(folder); | 35 | mailfolder_free(folder); |
36 | mailstorage_free(storage); | 36 | mailstorage_free(storage); |
37 | return; | 37 | return; |
38 | } | 38 | } |
39 | 39 | ||
40 | parseList(target,folder->fld_session,mailbox); | 40 | parseList(target,folder->fld_session,mailbox); |
@@ -67,20 +67,20 @@ void MBOXwrapper::deleteMail(const RecMailP & mail) | |||
67 | p+=mail->getMbox(); | 67 | p+=mail->getMbox(); |
68 | int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); | 68 | int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); |
69 | mailfolder*folder; | 69 | mailfolder*folder; |
70 | folder = mailfolder_new( storage,(char*)p.latin1(),NULL); | 70 | folder = mailfolder_new( storage,(char*)p.latin1(),NULL); |
71 | r = mailfolder_connect(folder); | 71 | r = mailfolder_connect(folder); |
72 | if (r != MAIL_NO_ERROR) { | 72 | if (r != MAIL_NO_ERROR) { |
73 | qDebug("Error initializing mbox"); | 73 | odebug << "Error initializing mbox" << oendl; |
74 | mailfolder_free(folder); | 74 | mailfolder_free(folder); |
75 | mailstorage_free(storage); | 75 | mailstorage_free(storage); |
76 | return; | 76 | return; |
77 | } | 77 | } |
78 | r = mailsession_remove_message(folder->fld_session,mail->getNumber()); | 78 | r = mailsession_remove_message(folder->fld_session,mail->getNumber()); |
79 | if (r != MAIL_NO_ERROR) { | 79 | if (r != MAIL_NO_ERROR) { |
80 | qDebug("error deleting mail"); | 80 | odebug << "error deleting mail" << oendl; |
81 | } | 81 | } |
82 | mailfolder_free(folder); | 82 | mailfolder_free(folder); |
83 | mailstorage_free(storage); | 83 | mailstorage_free(storage); |
84 | } | 84 | } |
85 | 85 | ||
86 | void MBOXwrapper::answeredMail(const RecMailP&) | 86 | void MBOXwrapper::answeredMail(const RecMailP&) |
@@ -99,27 +99,27 @@ RecBodyP MBOXwrapper::fetchBody( const RecMailP &mail ) | |||
99 | 99 | ||
100 | int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); | 100 | int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); |
101 | mailfolder*folder; | 101 | mailfolder*folder; |
102 | folder = mailfolder_new( storage,(char*)p.latin1(),NULL); | 102 | folder = mailfolder_new( storage,(char*)p.latin1(),NULL); |
103 | r = mailfolder_connect(folder); | 103 | r = mailfolder_connect(folder); |
104 | if (r != MAIL_NO_ERROR) { | 104 | if (r != MAIL_NO_ERROR) { |
105 | qDebug("Error initializing mbox"); | 105 | odebug << "Error initializing mbox" << oendl; |
106 | mailfolder_free(folder); | 106 | mailfolder_free(folder); |
107 | mailstorage_free(storage); | 107 | mailstorage_free(storage); |
108 | return body; | 108 | return body; |
109 | } | 109 | } |
110 | r = mailsession_get_message(folder->fld_session, mail->getNumber(), &msg); | 110 | r = mailsession_get_message(folder->fld_session, mail->getNumber(), &msg); |
111 | if (r != MAIL_NO_ERROR) { | 111 | if (r != MAIL_NO_ERROR) { |
112 | qDebug("Error fetching mail %i",mail->getNumber()); | 112 | odebug << "Error fetching mail " << mail->getNumber() << "" << oendl; |
113 | mailfolder_free(folder); | 113 | mailfolder_free(folder); |
114 | mailstorage_free(storage); | 114 | mailstorage_free(storage); |
115 | return body; | 115 | return body; |
116 | } | 116 | } |
117 | r = mailmessage_fetch(msg,&data,&size); | 117 | r = mailmessage_fetch(msg,&data,&size); |
118 | if (r != MAIL_NO_ERROR) { | 118 | if (r != MAIL_NO_ERROR) { |
119 | qDebug("Error fetching mail %i",mail->getNumber()); | 119 | odebug << "Error fetching mail " << mail->getNumber() << "" << oendl; |
120 | mailfolder_free(folder); | 120 | mailfolder_free(folder); |
121 | mailstorage_free(storage); | 121 | mailstorage_free(storage); |
122 | mailmessage_free(msg); | 122 | mailmessage_free(msg); |
123 | return body; | 123 | return body; |
124 | } | 124 | } |
125 | body = parseMail(msg); | 125 | body = parseMail(msg); |
@@ -129,13 +129,13 @@ RecBodyP MBOXwrapper::fetchBody( const RecMailP &mail ) | |||
129 | 129 | ||
130 | return body; | 130 | return body; |
131 | } | 131 | } |
132 | 132 | ||
133 | void MBOXwrapper::mbox_progress( size_t current, size_t maximum ) | 133 | void MBOXwrapper::mbox_progress( size_t current, size_t maximum ) |
134 | { | 134 | { |
135 | qDebug("MBOX %i von %i",current,maximum); | 135 | odebug << "MBOX " << current << " von " << maximum << "" << oendl; |
136 | } | 136 | } |
137 | 137 | ||
138 | int MBOXwrapper::createMbox(const QString&folder,const FolderP&,const QString&,bool ) | 138 | int MBOXwrapper::createMbox(const QString&folder,const FolderP&,const QString&,bool ) |
139 | { | 139 | { |
140 | QString p = MBOXPath+"/"; | 140 | QString p = MBOXPath+"/"; |
141 | p+=folder; | 141 | p+=folder; |
@@ -217,13 +217,13 @@ void MBOXwrapper::deleteMails(const QString & mailbox,const QValueList<RecMailP> | |||
217 | { | 217 | { |
218 | QString p = MBOXPath+"/"; | 218 | QString p = MBOXPath+"/"; |
219 | p+=mailbox; | 219 | p+=mailbox; |
220 | mailmbox_folder*f = 0; | 220 | mailmbox_folder*f = 0; |
221 | int r = mailmbox_init(p.latin1(),0,1,0,&f); | 221 | int r = mailmbox_init(p.latin1(),0,1,0,&f); |
222 | if (r != MAIL_NO_ERROR) { | 222 | if (r != MAIL_NO_ERROR) { |
223 | qDebug("Error init folder"); | 223 | odebug << "Error init folder" << oendl; |
224 | return; | 224 | return; |
225 | } | 225 | } |
226 | deleteMails(f,target); | 226 | deleteMails(f,target); |
227 | mailmbox_done(f); | 227 | mailmbox_done(f); |
228 | } | 228 | } |
229 | 229 | ||
@@ -232,18 +232,18 @@ void MBOXwrapper::deleteMails(mailmbox_folder*f,const QValueList<RecMailP> &targ | |||
232 | if (!f) return; | 232 | if (!f) return; |
233 | int r; | 233 | int r; |
234 | QValueList<RecMailP>::ConstIterator it; | 234 | QValueList<RecMailP>::ConstIterator it; |
235 | for (it=target.begin(); it != target.end();++it) { | 235 | for (it=target.begin(); it != target.end();++it) { |
236 | r = mailmbox_delete_msg(f,(*it)->getNumber()); | 236 | r = mailmbox_delete_msg(f,(*it)->getNumber()); |
237 | if (r!=MAILMBOX_NO_ERROR) { | 237 | if (r!=MAILMBOX_NO_ERROR) { |
238 | qDebug("error delete mail"); | 238 | odebug << "error delete mail" << oendl; |
239 | } | 239 | } |
240 | } | 240 | } |
241 | r = mailmbox_expunge(f); | 241 | r = mailmbox_expunge(f); |
242 | if (r != MAILMBOX_NO_ERROR) { | 242 | if (r != MAILMBOX_NO_ERROR) { |
243 | qDebug("error expunge mailbox"); | 243 | odebug << "error expunge mailbox" << oendl; |
244 | } | 244 | } |
245 | } | 245 | } |
246 | 246 | ||
247 | int MBOXwrapper::deleteAllMail(const FolderP&tfolder) | 247 | int MBOXwrapper::deleteAllMail(const FolderP&tfolder) |
248 | { | 248 | { |
249 | if (!tfolder) return 0; | 249 | if (!tfolder) return 0; |
@@ -266,13 +266,13 @@ int MBOXwrapper::deleteAllMail(const FolderP&tfolder) | |||
266 | res = 0; | 266 | res = 0; |
267 | } | 267 | } |
268 | } | 268 | } |
269 | if (res) { | 269 | if (res) { |
270 | r = mailsession_get_messages_list(folder->fld_session,&l); | 270 | r = mailsession_get_messages_list(folder->fld_session,&l); |
271 | if (r != MAIL_NO_ERROR) { | 271 | if (r != MAIL_NO_ERROR) { |
272 | qDebug("Error message list"); | 272 | odebug << "Error message list" << oendl; |
273 | res=0; | 273 | res=0; |
274 | } | 274 | } |
275 | } | 275 | } |
276 | for(unsigned int i = 0 ; l!= 0 && res==1 && i < carray_count(l->msg_tab) ; ++i) { | 276 | for(unsigned int i = 0 ; l!= 0 && res==1 && i < carray_count(l->msg_tab) ; ++i) { |
277 | r = mailsession_remove_message(folder->fld_session,i+1); | 277 | r = mailsession_remove_message(folder->fld_session,i+1); |
278 | if (r != MAIL_NO_ERROR) { | 278 | if (r != MAIL_NO_ERROR) { |
diff --git a/noncore/net/mail/libmailwrapper/mhwrapper.cpp b/noncore/net/mail/libmailwrapper/mhwrapper.cpp index 12472e9..cd7cecb 100644 --- a/noncore/net/mail/libmailwrapper/mhwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/mhwrapper.cpp | |||
@@ -13,13 +13,13 @@ MHwrapper::MHwrapper(const QString & mbox_dir,const QString&mbox_name) | |||
13 | : Genericwrapper(),MHPath(mbox_dir),MHName(mbox_name) | 13 | : Genericwrapper(),MHPath(mbox_dir),MHName(mbox_name) |
14 | { | 14 | { |
15 | if (MHPath.length()>0) { | 15 | if (MHPath.length()>0) { |
16 | if (MHPath[MHPath.length()-1]=='/') { | 16 | if (MHPath[MHPath.length()-1]=='/') { |
17 | MHPath=MHPath.left(MHPath.length()-1); | 17 | MHPath=MHPath.left(MHPath.length()-1); |
18 | } | 18 | } |
19 | qDebug(MHPath); | 19 | odebug << MHPath << oendl; |
20 | QDir dir(MHPath); | 20 | QDir dir(MHPath); |
21 | if (!dir.exists()) { | 21 | if (!dir.exists()) { |
22 | dir.mkdir(MHPath); | 22 | dir.mkdir(MHPath); |
23 | } | 23 | } |
24 | init_storage(); | 24 | init_storage(); |
25 | } | 25 | } |
@@ -30,21 +30,21 @@ void MHwrapper::init_storage() | |||
30 | int r; | 30 | int r; |
31 | QString pre = MHPath; | 31 | QString pre = MHPath; |
32 | if (!m_storage) { | 32 | if (!m_storage) { |
33 | m_storage = mailstorage_new(NULL); | 33 | m_storage = mailstorage_new(NULL); |
34 | r = mh_mailstorage_init(m_storage,(char*)pre.latin1(),0,0,0); | 34 | r = mh_mailstorage_init(m_storage,(char*)pre.latin1(),0,0,0); |
35 | if (r != MAIL_NO_ERROR) { | 35 | if (r != MAIL_NO_ERROR) { |
36 | qDebug("error initializing storage"); | 36 | odebug << "error initializing storage" << oendl; |
37 | mailstorage_free(m_storage); | 37 | mailstorage_free(m_storage); |
38 | m_storage = 0; | 38 | m_storage = 0; |
39 | return; | 39 | return; |
40 | } | 40 | } |
41 | } | 41 | } |
42 | r = mailstorage_connect(m_storage); | 42 | r = mailstorage_connect(m_storage); |
43 | if (r!=MAIL_NO_ERROR) { | 43 | if (r!=MAIL_NO_ERROR) { |
44 | qDebug("error connecting storage"); | 44 | odebug << "error connecting storage" << oendl; |
45 | mailstorage_free(m_storage); | 45 | mailstorage_free(m_storage); |
46 | m_storage = 0; | 46 | m_storage = 0; |
47 | } | 47 | } |
48 | } | 48 | } |
49 | 49 | ||
50 | void MHwrapper::clean_storage() | 50 | void MHwrapper::clean_storage() |
@@ -67,13 +67,13 @@ void MHwrapper::listMessages(const QString & mailbox, QValueList<Opie::Core::OSm | |||
67 | if (!m_storage) { | 67 | if (!m_storage) { |
68 | return; | 68 | return; |
69 | } | 69 | } |
70 | QString f = buildPath(mailbox); | 70 | QString f = buildPath(mailbox); |
71 | int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1()); | 71 | int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1()); |
72 | if (r!=MAIL_NO_ERROR) { | 72 | if (r!=MAIL_NO_ERROR) { |
73 | qDebug("listMessages: error selecting folder!"); | 73 | odebug << "listMessages: error selecting folder!" << oendl; |
74 | return; | 74 | return; |
75 | } | 75 | } |
76 | parseList(target,m_storage->sto_session,f); | 76 | parseList(target,m_storage->sto_session,f); |
77 | Global::statusMessage(tr("Mailbox has %1 mail(s)").arg(target.count())); | 77 | Global::statusMessage(tr("Mailbox has %1 mail(s)").arg(target.count())); |
78 | } | 78 | } |
79 | 79 | ||
@@ -87,13 +87,13 @@ QValueList<Opie::Core::OSmartPointer<Folder> >* MHwrapper::listFolders() | |||
87 | return folders; | 87 | return folders; |
88 | } | 88 | } |
89 | mail_list*flist = 0; | 89 | mail_list*flist = 0; |
90 | clistcell*current=0; | 90 | clistcell*current=0; |
91 | int r = mailsession_list_folders(m_storage->sto_session,NULL,&flist); | 91 | int r = mailsession_list_folders(m_storage->sto_session,NULL,&flist); |
92 | if (r != MAIL_NO_ERROR || !flist) { | 92 | if (r != MAIL_NO_ERROR || !flist) { |
93 | qDebug("error getting folder list"); | 93 | odebug << "error getting folder list" << oendl; |
94 | return folders; | 94 | return folders; |
95 | } | 95 | } |
96 | for (current=clist_begin(flist->mb_list);current!=0;current=clist_next(current)) { | 96 | for (current=clist_begin(flist->mb_list);current!=0;current=clist_next(current)) { |
97 | QString t = (char*)current->data; | 97 | QString t = (char*)current->data; |
98 | t.replace(0,MHPath.length(),""); | 98 | t.replace(0,MHPath.length(),""); |
99 | folders->append(new MHFolder(t,MHPath)); | 99 | folders->append(new MHFolder(t,MHPath)); |
@@ -107,18 +107,18 @@ void MHwrapper::deleteMail(const RecMailP&mail) | |||
107 | init_storage(); | 107 | init_storage(); |
108 | if (!m_storage) { | 108 | if (!m_storage) { |
109 | return; | 109 | return; |
110 | } | 110 | } |
111 | int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1()); | 111 | int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1()); |
112 | if (r!=MAIL_NO_ERROR) { | 112 | if (r!=MAIL_NO_ERROR) { |
113 | qDebug("error selecting folder!"); | 113 | odebug << "error selecting folder!" << oendl; |
114 | return; | 114 | return; |
115 | } | 115 | } |
116 | r = mailsession_remove_message(m_storage->sto_session,mail->getNumber()); | 116 | r = mailsession_remove_message(m_storage->sto_session,mail->getNumber()); |
117 | if (r != MAIL_NO_ERROR) { | 117 | if (r != MAIL_NO_ERROR) { |
118 | qDebug("error deleting mail"); | 118 | odebug << "error deleting mail" << oendl; |
119 | } | 119 | } |
120 | } | 120 | } |
121 | 121 | ||
122 | void MHwrapper::answeredMail(const RecMailP&) | 122 | void MHwrapper::answeredMail(const RecMailP&) |
123 | { | 123 | { |
124 | } | 124 | } |
@@ -137,23 +137,23 @@ RecBodyP MHwrapper::fetchBody( const RecMailP &mail ) | |||
137 | int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1()); | 137 | int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1()); |
138 | if (r != MAIL_NO_ERROR) { | 138 | if (r != MAIL_NO_ERROR) { |
139 | return body; | 139 | return body; |
140 | } | 140 | } |
141 | r = mailsession_get_message(m_storage->sto_session, mail->getNumber(), &msg); | 141 | r = mailsession_get_message(m_storage->sto_session, mail->getNumber(), &msg); |
142 | if (r != MAIL_NO_ERROR) { | 142 | if (r != MAIL_NO_ERROR) { |
143 | qDebug("Error fetching mail %i",mail->getNumber()); | 143 | odebug << "Error fetching mail " << mail->getNumber() << "" << oendl; |
144 | return body; | 144 | return body; |
145 | } | 145 | } |
146 | body = parseMail(msg); | 146 | body = parseMail(msg); |
147 | mailmessage_fetch_result_free(msg,data); | 147 | mailmessage_fetch_result_free(msg,data); |
148 | return body; | 148 | return body; |
149 | } | 149 | } |
150 | 150 | ||
151 | void MHwrapper::mbox_progress( size_t current, size_t maximum ) | 151 | void MHwrapper::mbox_progress( size_t current, size_t maximum ) |
152 | { | 152 | { |
153 | qDebug("MH %i von %i",current,maximum); | 153 | odebug << "MH " << current << " von " << maximum << "" << oendl; |
154 | } | 154 | } |
155 | 155 | ||
156 | QString MHwrapper::buildPath(const QString&p) | 156 | QString MHwrapper::buildPath(const QString&p) |
157 | { | 157 | { |
158 | QString f=""; | 158 | QString f=""; |
159 | if (p.length()==0||p=="/") | 159 | if (p.length()==0||p=="/") |
@@ -180,37 +180,37 @@ int MHwrapper::createMbox(const QString&folder,const FolderP&pfolder,const QStri | |||
180 | f = buildPath(folder); | 180 | f = buildPath(folder); |
181 | } else { | 181 | } else { |
182 | f = pfolder->getName(); | 182 | f = pfolder->getName(); |
183 | f+="/"; | 183 | f+="/"; |
184 | f+=folder; | 184 | f+=folder; |
185 | } | 185 | } |
186 | qDebug(f); | 186 | odebug << f << oendl; |
187 | int r = mailsession_create_folder(m_storage->sto_session,(char*)f.latin1()); | 187 | int r = mailsession_create_folder(m_storage->sto_session,(char*)f.latin1()); |
188 | if (r != MAIL_NO_ERROR) { | 188 | if (r != MAIL_NO_ERROR) { |
189 | qDebug("error creating folder %i",r); | 189 | odebug << "error creating folder " << r << "" << oendl; |
190 | return 0; | 190 | return 0; |
191 | } | 191 | } |
192 | qDebug("Folder created"); | 192 | odebug << "Folder created" << oendl; |
193 | return 1; | 193 | return 1; |
194 | } | 194 | } |
195 | 195 | ||
196 | void MHwrapper::storeMessage(const char*msg,size_t length, const QString&Folder) | 196 | void MHwrapper::storeMessage(const char*msg,size_t length, const QString&Folder) |
197 | { | 197 | { |
198 | init_storage(); | 198 | init_storage(); |
199 | if (!m_storage) { | 199 | if (!m_storage) { |
200 | return; | 200 | return; |
201 | } | 201 | } |
202 | QString f = buildPath(Folder); | 202 | QString f = buildPath(Folder); |
203 | int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1()); | 203 | int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1()); |
204 | if (r!=MAIL_NO_ERROR) { | 204 | if (r!=MAIL_NO_ERROR) { |
205 | qDebug("error selecting folder!"); | 205 | odebug << "error selecting folder!" << oendl; |
206 | return; | 206 | return; |
207 | } | 207 | } |
208 | r = mailsession_append_message(m_storage->sto_session,(char*)msg,length); | 208 | r = mailsession_append_message(m_storage->sto_session,(char*)msg,length); |
209 | if (r!=MAIL_NO_ERROR) { | 209 | if (r!=MAIL_NO_ERROR) { |
210 | qDebug("error storing mail"); | 210 | odebug << "error storing mail" << oendl; |
211 | } | 211 | } |
212 | return; | 212 | return; |
213 | } | 213 | } |
214 | 214 | ||
215 | encodedString* MHwrapper::fetchRawBody(const RecMailP&mail) | 215 | encodedString* MHwrapper::fetchRawBody(const RecMailP&mail) |
216 | { | 216 | { |
@@ -221,13 +221,13 @@ encodedString* MHwrapper::fetchRawBody(const RecMailP&mail) | |||
221 | } | 221 | } |
222 | mailmessage * msg = 0; | 222 | mailmessage * msg = 0; |
223 | char*data=0; | 223 | char*data=0; |
224 | size_t size; | 224 | size_t size; |
225 | int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1()); | 225 | int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1()); |
226 | if (r!=MAIL_NO_ERROR) { | 226 | if (r!=MAIL_NO_ERROR) { |
227 | qDebug("error selecting folder!"); | 227 | odebug << "error selecting folder!" << oendl; |
228 | return result; | 228 | return result; |
229 | } | 229 | } |
230 | r = mailsession_get_message(m_storage->sto_session, mail->getNumber(), &msg); | 230 | r = mailsession_get_message(m_storage->sto_session, mail->getNumber(), &msg); |
231 | if (r != MAIL_NO_ERROR) { | 231 | if (r != MAIL_NO_ERROR) { |
232 | Global::statusMessage(tr("Error fetching mail %i").arg(mail->getNumber())); | 232 | Global::statusMessage(tr("Error fetching mail %i").arg(mail->getNumber())); |
233 | return 0; | 233 | return 0; |
@@ -245,20 +245,20 @@ encodedString* MHwrapper::fetchRawBody(const RecMailP&mail) | |||
245 | 245 | ||
246 | void MHwrapper::deleteMails(const QString & mailbox,const QValueList<RecMailP> &target) | 246 | void MHwrapper::deleteMails(const QString & mailbox,const QValueList<RecMailP> &target) |
247 | { | 247 | { |
248 | QString f = buildPath(mailbox); | 248 | QString f = buildPath(mailbox); |
249 | int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1()); | 249 | int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1()); |
250 | if (r!=MAIL_NO_ERROR) { | 250 | if (r!=MAIL_NO_ERROR) { |
251 | qDebug("deleteMails: error selecting folder!"); | 251 | odebug << "deleteMails: error selecting folder!" << oendl; |
252 | return; | 252 | return; |
253 | } | 253 | } |
254 | QValueList<RecMailP>::ConstIterator it; | 254 | QValueList<RecMailP>::ConstIterator it; |
255 | for (it=target.begin(); it!=target.end();++it) { | 255 | for (it=target.begin(); it!=target.end();++it) { |
256 | r = mailsession_remove_message(m_storage->sto_session,(*it)->getNumber()); | 256 | r = mailsession_remove_message(m_storage->sto_session,(*it)->getNumber()); |
257 | if (r != MAIL_NO_ERROR) { | 257 | if (r != MAIL_NO_ERROR) { |
258 | qDebug("error deleting mail"); | 258 | odebug << "error deleting mail" << oendl; |
259 | break; | 259 | break; |
260 | } | 260 | } |
261 | } | 261 | } |
262 | } | 262 | } |
263 | 263 | ||
264 | int MHwrapper::deleteAllMail(const FolderP&tfolder) | 264 | int MHwrapper::deleteAllMail(const FolderP&tfolder) |
@@ -268,19 +268,19 @@ int MHwrapper::deleteAllMail(const FolderP&tfolder) | |||
268 | return 0; | 268 | return 0; |
269 | } | 269 | } |
270 | int res = 1; | 270 | int res = 1; |
271 | if (!tfolder) return 0; | 271 | if (!tfolder) return 0; |
272 | int r = mailsession_select_folder(m_storage->sto_session,(char*)tfolder->getName().latin1()); | 272 | int r = mailsession_select_folder(m_storage->sto_session,(char*)tfolder->getName().latin1()); |
273 | if (r!=MAIL_NO_ERROR) { | 273 | if (r!=MAIL_NO_ERROR) { |
274 | qDebug("error selecting folder!"); | 274 | odebug << "error selecting folder!" << oendl; |
275 | return 0; | 275 | return 0; |
276 | } | 276 | } |
277 | mailmessage_list*l=0; | 277 | mailmessage_list*l=0; |
278 | r = mailsession_get_messages_list(m_storage->sto_session,&l); | 278 | r = mailsession_get_messages_list(m_storage->sto_session,&l); |
279 | if (r != MAIL_NO_ERROR) { | 279 | if (r != MAIL_NO_ERROR) { |
280 | qDebug("Error message list"); | 280 | odebug << "Error message list" << oendl; |
281 | res = 0; | 281 | res = 0; |
282 | } | 282 | } |
283 | unsigned j = 0; | 283 | unsigned j = 0; |
284 | for(unsigned int i = 0 ; l!= 0 && res==1 && i < carray_count(l->msg_tab) ; ++i) { | 284 | for(unsigned int i = 0 ; l!= 0 && res==1 && i < carray_count(l->msg_tab) ; ++i) { |
285 | mailmessage * msg; | 285 | mailmessage * msg; |
286 | msg = (mailmessage*)carray_get(l->msg_tab, i); | 286 | msg = (mailmessage*)carray_get(l->msg_tab, i); |
@@ -305,13 +305,13 @@ int MHwrapper::deleteMbox(const FolderP&tfolder) | |||
305 | if (!tfolder) return 0; | 305 | if (!tfolder) return 0; |
306 | if (tfolder->getName()=="/" || tfolder->getName().isEmpty()) return 0; | 306 | if (tfolder->getName()=="/" || tfolder->getName().isEmpty()) return 0; |
307 | 307 | ||
308 | int r = mailsession_delete_folder(m_storage->sto_session,(char*)tfolder->getName().latin1()); | 308 | int r = mailsession_delete_folder(m_storage->sto_session,(char*)tfolder->getName().latin1()); |
309 | 309 | ||
310 | if (r != MAIL_NO_ERROR) { | 310 | if (r != MAIL_NO_ERROR) { |
311 | qDebug("error deleting mail box"); | 311 | odebug << "error deleting mail box" << oendl; |
312 | return 0; | 312 | return 0; |
313 | } | 313 | } |
314 | QString cmd = "rm -rf "+tfolder->getName(); | 314 | QString cmd = "rm -rf "+tfolder->getName(); |
315 | QStringList command; | 315 | QStringList command; |
316 | command << "/bin/sh"; | 316 | command << "/bin/sh"; |
317 | command << "-c"; | 317 | command << "-c"; |
@@ -323,16 +323,16 @@ int MHwrapper::deleteMbox(const FolderP&tfolder) | |||
323 | connect(process, SIGNAL( receivedStderr(Opie::Core::OProcess*,char*,int)), | 323 | connect(process, SIGNAL( receivedStderr(Opie::Core::OProcess*,char*,int)), |
324 | this, SLOT( oprocessStderr(Opie::Core::OProcess*,char*,int))); | 324 | this, SLOT( oprocessStderr(Opie::Core::OProcess*,char*,int))); |
325 | 325 | ||
326 | *process << command; | 326 | *process << command; |
327 | removeMboxfailed = false; | 327 | removeMboxfailed = false; |
328 | if(!process->start(OProcess::Block, OProcess::All) ) { | 328 | if(!process->start(OProcess::Block, OProcess::All) ) { |
329 | qDebug("could not start process"); | 329 | odebug << "could not start process" << oendl; |
330 | return 0; | 330 | return 0; |
331 | } | 331 | } |
332 | qDebug("mail box deleted"); | 332 | odebug << "mail box deleted" << oendl; |
333 | return 1; | 333 | return 1; |
334 | } | 334 | } |
335 | 335 | ||
336 | void MHwrapper::processEnded(OProcess *p) | 336 | void MHwrapper::processEnded(OProcess *p) |
337 | { | 337 | { |
338 | if (p) delete p; | 338 | if (p) delete p; |
@@ -375,68 +375,68 @@ void MHwrapper::mvcpMail(const RecMailP&mail,const QString&targetFolder,Abstract | |||
375 | { | 375 | { |
376 | init_storage(); | 376 | init_storage(); |
377 | if (!m_storage) { | 377 | if (!m_storage) { |
378 | return; | 378 | return; |
379 | } | 379 | } |
380 | if (targetWrapper != this) { | 380 | if (targetWrapper != this) { |
381 | qDebug("Using generic"); | 381 | odebug << "Using generic" << oendl; |
382 | Genericwrapper::mvcpMail(mail,targetFolder,targetWrapper,moveit); | 382 | Genericwrapper::mvcpMail(mail,targetFolder,targetWrapper,moveit); |
383 | return; | 383 | return; |
384 | } | 384 | } |
385 | qDebug("Using internal routines for move/copy"); | 385 | odebug << "Using internal routines for move/copy" << oendl; |
386 | QString tf = buildPath(targetFolder); | 386 | QString tf = buildPath(targetFolder); |
387 | int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1()); | 387 | int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1()); |
388 | if (r != MAIL_NO_ERROR) { | 388 | if (r != MAIL_NO_ERROR) { |
389 | qDebug("Error selecting source mailbox"); | 389 | odebug << "Error selecting source mailbox" << oendl; |
390 | return; | 390 | return; |
391 | } | 391 | } |
392 | if (moveit) { | 392 | if (moveit) { |
393 | r = mailsession_move_message(m_storage->sto_session,mail->getNumber(),(char*)tf.latin1()); | 393 | r = mailsession_move_message(m_storage->sto_session,mail->getNumber(),(char*)tf.latin1()); |
394 | } else { | 394 | } else { |
395 | r = mailsession_copy_message(m_storage->sto_session,mail->getNumber(),(char*)tf.latin1()); | 395 | r = mailsession_copy_message(m_storage->sto_session,mail->getNumber(),(char*)tf.latin1()); |
396 | } | 396 | } |
397 | if (r != MAIL_NO_ERROR) { | 397 | if (r != MAIL_NO_ERROR) { |
398 | qDebug("Error copy/moving mail internal (%i)",r); | 398 | odebug << "Error copy/moving mail internal (" << r << ")" << oendl; |
399 | } | 399 | } |
400 | } | 400 | } |
401 | 401 | ||
402 | void MHwrapper::mvcpAllMails(const FolderP&fromFolder, | 402 | void MHwrapper::mvcpAllMails(const FolderP&fromFolder, |
403 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) | 403 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) |
404 | { | 404 | { |
405 | init_storage(); | 405 | init_storage(); |
406 | if (!m_storage) { | 406 | if (!m_storage) { |
407 | return; | 407 | return; |
408 | } | 408 | } |
409 | if (targetWrapper != this) { | 409 | if (targetWrapper != this) { |
410 | qDebug("Using generic"); | 410 | odebug << "Using generic" << oendl; |
411 | Genericwrapper::mvcpAllMails(fromFolder,targetFolder,targetWrapper,moveit); | 411 | Genericwrapper::mvcpAllMails(fromFolder,targetFolder,targetWrapper,moveit); |
412 | return; | 412 | return; |
413 | } | 413 | } |
414 | if (!fromFolder) return; | 414 | if (!fromFolder) return; |
415 | int r = mailsession_select_folder(m_storage->sto_session,(char*)fromFolder->getName().latin1()); | 415 | int r = mailsession_select_folder(m_storage->sto_session,(char*)fromFolder->getName().latin1()); |
416 | if (r!=MAIL_NO_ERROR) { | 416 | if (r!=MAIL_NO_ERROR) { |
417 | qDebug("error selecting source folder!"); | 417 | odebug << "error selecting source folder!" << oendl; |
418 | return; | 418 | return; |
419 | } | 419 | } |
420 | QString tf = buildPath(targetFolder); | 420 | QString tf = buildPath(targetFolder); |
421 | mailmessage_list*l=0; | 421 | mailmessage_list*l=0; |
422 | r = mailsession_get_messages_list(m_storage->sto_session,&l); | 422 | r = mailsession_get_messages_list(m_storage->sto_session,&l); |
423 | if (r != MAIL_NO_ERROR) { | 423 | if (r != MAIL_NO_ERROR) { |
424 | qDebug("Error message list"); | 424 | odebug << "Error message list" << oendl; |
425 | } | 425 | } |
426 | unsigned j = 0; | 426 | unsigned j = 0; |
427 | for(unsigned int i = 0 ; l!= 0 && i < carray_count(l->msg_tab) ; ++i) { | 427 | for(unsigned int i = 0 ; l!= 0 && i < carray_count(l->msg_tab) ; ++i) { |
428 | mailmessage * msg; | 428 | mailmessage * msg; |
429 | msg = (mailmessage*)carray_get(l->msg_tab, i); | 429 | msg = (mailmessage*)carray_get(l->msg_tab, i); |
430 | j = msg->msg_index; | 430 | j = msg->msg_index; |
431 | if (moveit) { | 431 | if (moveit) { |
432 | r = mailsession_move_message(m_storage->sto_session,j,(char*)tf.latin1()); | 432 | r = mailsession_move_message(m_storage->sto_session,j,(char*)tf.latin1()); |
433 | } else { | 433 | } else { |
434 | r = mailsession_copy_message(m_storage->sto_session,j,(char*)tf.latin1()); | 434 | r = mailsession_copy_message(m_storage->sto_session,j,(char*)tf.latin1()); |
435 | } | 435 | } |
436 | if (r != MAIL_NO_ERROR) { | 436 | if (r != MAIL_NO_ERROR) { |
437 | qDebug("Error copy/moving mail internal (%i)",r); | 437 | odebug << "Error copy/moving mail internal (" << r << ")" << oendl; |
438 | break; | 438 | break; |
439 | } | 439 | } |
440 | } | 440 | } |
441 | if (l) mailmessage_list_free(l); | 441 | if (l) mailmessage_list_free(l); |
442 | } | 442 | } |
diff --git a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp index cfded43..5d5011a 100644 --- a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp | |||
@@ -26,13 +26,13 @@ NNTPwrapper::~NNTPwrapper() { | |||
26 | if (msg_cache.exists()) { | 26 | if (msg_cache.exists()) { |
27 | msg_cache.remove(); | 27 | msg_cache.remove(); |
28 | } | 28 | } |
29 | } | 29 | } |
30 | 30 | ||
31 | void NNTPwrapper::nntp_progress( size_t current, size_t maximum ) { | 31 | void NNTPwrapper::nntp_progress( size_t current, size_t maximum ) { |
32 | qDebug( "NNTP: %i of %i", current, maximum ); | 32 | odebug << "NNTP: " << current << " of " << maximum << "" << oendl; |
33 | } | 33 | } |
34 | 34 | ||
35 | 35 | ||
36 | RecBodyP NNTPwrapper::fetchBody( const RecMailP &mail ) { | 36 | RecBodyP NNTPwrapper::fetchBody( const RecMailP &mail ) { |
37 | int err = NEWSNNTP_NO_ERROR; | 37 | int err = NEWSNNTP_NO_ERROR; |
38 | char *message = 0; | 38 | char *message = 0; |
@@ -43,13 +43,13 @@ RecBodyP NNTPwrapper::fetchBody( const RecMailP &mail ) { | |||
43 | if ( !m_nntp ) { | 43 | if ( !m_nntp ) { |
44 | return body; | 44 | return body; |
45 | } | 45 | } |
46 | 46 | ||
47 | mailmessage * mailmsg; | 47 | mailmessage * mailmsg; |
48 | if (mail->Msgsize()>HARD_MSG_SIZE_LIMIT) { | 48 | if (mail->Msgsize()>HARD_MSG_SIZE_LIMIT) { |
49 | qDebug("Message to large: %i",mail->Msgsize()); | 49 | odebug << "Message to large: " << mail->Msgsize() << "" << oendl; |
50 | return body; | 50 | return body; |
51 | } | 51 | } |
52 | 52 | ||
53 | QFile msg_cache(msgTempName); | 53 | QFile msg_cache(msgTempName); |
54 | 54 | ||
55 | cleanMimeCache(); | 55 | cleanMimeCache(); |
@@ -131,13 +131,13 @@ void NNTPwrapper::login() | |||
131 | if ( QDialog::Accepted == login.exec() ) { | 131 | if ( QDialog::Accepted == login.exec() ) { |
132 | // ok | 132 | // ok |
133 | User = login.getUser().latin1(); | 133 | User = login.getUser().latin1(); |
134 | Pass = login.getPassword().latin1(); | 134 | Pass = login.getPassword().latin1(); |
135 | } else { | 135 | } else { |
136 | // cancel | 136 | // cancel |
137 | qDebug( "NNTP: Login canceled" ); | 137 | odebug << "NNTP: Login canceled" << oendl; |
138 | return; | 138 | return; |
139 | } | 139 | } |
140 | } else { | 140 | } else { |
141 | User = account->getUser().latin1(); | 141 | User = account->getUser().latin1(); |
142 | Pass = account->getPassword().latin1(); | 142 | Pass = account->getPassword().latin1(); |
143 | } | 143 | } |
@@ -168,13 +168,13 @@ void NNTPwrapper::login() | |||
168 | nntp_mailstorage_init(m_nntp,(char*)server, port, NULL, CONNECTION_TYPE_PLAIN, NNTP_AUTH_TYPE_PLAIN, | 168 | nntp_mailstorage_init(m_nntp,(char*)server, port, NULL, CONNECTION_TYPE_PLAIN, NNTP_AUTH_TYPE_PLAIN, |
169 | (char*)user,(char*)pass,0,0,0); | 169 | (char*)user,(char*)pass,0,0,0); |
170 | 170 | ||
171 | err = mailstorage_connect( m_nntp ); | 171 | err = mailstorage_connect( m_nntp ); |
172 | 172 | ||
173 | if (err != NEWSNNTP_NO_ERROR) { | 173 | if (err != NEWSNNTP_NO_ERROR) { |
174 | qDebug( QString( "FEHLERNUMMER %1" ).arg( err ) ); | 174 | odebug << QString( "FEHLERNUMMER %1" ).arg( err ) << oendl; |
175 | // Global::statusMessage(tr("Error initializing folder")); | 175 | // Global::statusMessage(tr("Error initializing folder")); |
176 | mailstorage_free(m_nntp); | 176 | mailstorage_free(m_nntp); |
177 | m_nntp = 0; | 177 | m_nntp = 0; |
178 | 178 | ||
179 | } else { | 179 | } else { |
180 | mailsession * session = m_nntp->sto_session; | 180 | mailsession * session = m_nntp->sto_session; |
diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp index 5467547..c586c29 100644 --- a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp +++ b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp | |||
@@ -25,13 +25,13 @@ POP3wrapper::~POP3wrapper() { | |||
25 | if (msg_cache.exists()) { | 25 | if (msg_cache.exists()) { |
26 | msg_cache.remove(); | 26 | msg_cache.remove(); |
27 | } | 27 | } |
28 | } | 28 | } |
29 | 29 | ||
30 | void POP3wrapper::pop3_progress( size_t current, size_t maximum ) { | 30 | void POP3wrapper::pop3_progress( size_t current, size_t maximum ) { |
31 | qDebug( "POP3: %i of %i", current, maximum ); | 31 | odebug << "POP3: " << current << " of " << maximum << "" << oendl; |
32 | } | 32 | } |
33 | 33 | ||
34 | RecBodyP POP3wrapper::fetchBody( const RecMailP &mail ) { | 34 | RecBodyP POP3wrapper::fetchBody( const RecMailP &mail ) { |
35 | int err = MAILPOP3_NO_ERROR; | 35 | int err = MAILPOP3_NO_ERROR; |
36 | char *message = 0; | 36 | char *message = 0; |
37 | size_t length = 0; | 37 | size_t length = 0; |
@@ -42,13 +42,13 @@ RecBodyP POP3wrapper::fetchBody( const RecMailP &mail ) { | |||
42 | if ( !m_pop3 ) { | 42 | if ( !m_pop3 ) { |
43 | return body; | 43 | return body; |
44 | } | 44 | } |
45 | 45 | ||
46 | mailmessage * mailmsg; | 46 | mailmessage * mailmsg; |
47 | if (mail->Msgsize()>HARD_MSG_SIZE_LIMIT) { | 47 | if (mail->Msgsize()>HARD_MSG_SIZE_LIMIT) { |
48 | qDebug("Message to large: %i",mail->Msgsize()); | 48 | odebug << "Message to large: " << mail->Msgsize() << "" << oendl; |
49 | return body; | 49 | return body; |
50 | } | 50 | } |
51 | 51 | ||
52 | QFile msg_cache(msgTempName); | 52 | QFile msg_cache(msgTempName); |
53 | 53 | ||
54 | cleanMimeCache(); | 54 | cleanMimeCache(); |
@@ -127,13 +127,13 @@ void POP3wrapper::login() | |||
127 | if ( QDialog::Accepted == login.exec() ) { | 127 | if ( QDialog::Accepted == login.exec() ) { |
128 | // ok | 128 | // ok |
129 | user = login.getUser().latin1(); | 129 | user = login.getUser().latin1(); |
130 | pass = login.getPassword().latin1(); | 130 | pass = login.getPassword().latin1(); |
131 | } else { | 131 | } else { |
132 | // cancel | 132 | // cancel |
133 | qDebug( "POP3: Login canceled" ); | 133 | odebug << "POP3: Login canceled" << oendl; |
134 | return; | 134 | return; |
135 | } | 135 | } |
136 | } else { | 136 | } else { |
137 | user = account->getUser().latin1(); | 137 | user = account->getUser().latin1(); |
138 | pass = account->getPassword().latin1(); | 138 | pass = account->getPassword().latin1(); |
139 | } | 139 | } |
@@ -159,13 +159,13 @@ void POP3wrapper::login() | |||
159 | pop3_mailstorage_init(m_pop3,(char*)server, port, NULL, conntype, POP3_AUTH_TYPE_PLAIN, | 159 | pop3_mailstorage_init(m_pop3,(char*)server, port, NULL, conntype, POP3_AUTH_TYPE_PLAIN, |
160 | (char*)user,(char*)pass,0,0,0); | 160 | (char*)user,(char*)pass,0,0,0); |
161 | 161 | ||
162 | 162 | ||
163 | err = mailstorage_connect(m_pop3); | 163 | err = mailstorage_connect(m_pop3); |
164 | if (err != MAIL_NO_ERROR) { | 164 | if (err != MAIL_NO_ERROR) { |
165 | qDebug( QString( "FEHLERNUMMER %1" ).arg( err ) ); | 165 | odebug << QString( "FEHLERNUMMER %1" ).arg( err ) << oendl; |
166 | Global::statusMessage(tr("Error initializing folder")); | 166 | Global::statusMessage(tr("Error initializing folder")); |
167 | mailstorage_free(m_pop3); | 167 | mailstorage_free(m_pop3); |
168 | m_pop3 = 0; | 168 | m_pop3 = 0; |
169 | } else { | 169 | } else { |
170 | mailsession * session = m_pop3->sto_session; | 170 | mailsession * session = m_pop3->sto_session; |
171 | mailpop3 * mail = ( ( pop3_session_state_data * )session->sess_data )->pop3_session; | 171 | mailpop3 * mail = ( ( pop3_session_state_data * )session->sess_data )->pop3_session; |
@@ -233,13 +233,13 @@ void POP3wrapper::statusFolder(folderStat&target_stat,const QString&) { | |||
233 | target_stat.message_recent = 0; | 233 | target_stat.message_recent = 0; |
234 | if (!m_pop3) | 234 | if (!m_pop3) |
235 | return; | 235 | return; |
236 | int r = mailsession_status_folder(m_pop3->sto_session,0,&target_stat.message_count, | 236 | int r = mailsession_status_folder(m_pop3->sto_session,0,&target_stat.message_count, |
237 | &target_stat.message_recent,&target_stat.message_unseen); | 237 | &target_stat.message_recent,&target_stat.message_unseen); |
238 | if (r != MAIL_NO_ERROR) { | 238 | if (r != MAIL_NO_ERROR) { |
239 | qDebug("error getting folter status."); | 239 | odebug << "error getting folter status." << oendl; |
240 | } | 240 | } |
241 | } | 241 | } |
242 | 242 | ||
243 | encodedString* POP3wrapper::fetchRawBody(const RecMailP&mail) { | 243 | encodedString* POP3wrapper::fetchRawBody(const RecMailP&mail) { |
244 | char*target=0; | 244 | char*target=0; |
245 | size_t length=0; | 245 | size_t length=0; |
diff --git a/noncore/net/mail/libmailwrapper/settings.cpp b/noncore/net/mail/libmailwrapper/settings.cpp index 2c81963..de36eeb 100644 --- a/noncore/net/mail/libmailwrapper/settings.cpp +++ b/noncore/net/mail/libmailwrapper/settings.cpp | |||
@@ -23,13 +23,13 @@ Settings::Settings() | |||
23 | } | 23 | } |
24 | 24 | ||
25 | void Settings::checkDirectory() | 25 | void Settings::checkDirectory() |
26 | { | 26 | { |
27 | if ( !QDir( (QString) getenv( "HOME" ) + "/Applications/opiemail/" ).exists() ) { | 27 | if ( !QDir( (QString) getenv( "HOME" ) + "/Applications/opiemail/" ).exists() ) { |
28 | system( "mkdir -p $HOME/Applications/opiemail" ); | 28 | system( "mkdir -p $HOME/Applications/opiemail" ); |
29 | qDebug( "$HOME/Applications/opiemail created" ); | 29 | odebug << "$HOME/Applications/opiemail created" << oendl; |
30 | } | 30 | } |
31 | } | 31 | } |
32 | 32 | ||
33 | QList<Account> Settings::getAccounts() | 33 | QList<Account> Settings::getAccounts() |
34 | { | 34 | { |
35 | return accounts; | 35 | return accounts; |
@@ -51,34 +51,34 @@ void Settings::updateAccounts() | |||
51 | accounts.clear(); | 51 | accounts.clear(); |
52 | QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" ); | 52 | QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" ); |
53 | QStringList::Iterator it; | 53 | QStringList::Iterator it; |
54 | 54 | ||
55 | QStringList imap = dir.entryList( "imap-*" ); | 55 | QStringList imap = dir.entryList( "imap-*" ); |
56 | for ( it = imap.begin(); it != imap.end(); it++ ) { | 56 | for ( it = imap.begin(); it != imap.end(); it++ ) { |
57 | qDebug( "Added IMAP account" ); | 57 | odebug << "Added IMAP account" << oendl; |
58 | IMAPaccount *account = new IMAPaccount( (*it).replace(0, 5, "") ); | 58 | IMAPaccount *account = new IMAPaccount( (*it).replace(0, 5, "") ); |
59 | accounts.append( account ); | 59 | accounts.append( account ); |
60 | } | 60 | } |
61 | 61 | ||
62 | QStringList pop3 = dir.entryList( "pop3-*" ); | 62 | QStringList pop3 = dir.entryList( "pop3-*" ); |
63 | for ( it = pop3.begin(); it != pop3.end(); it++ ) { | 63 | for ( it = pop3.begin(); it != pop3.end(); it++ ) { |
64 | qDebug( "Added POP account" ); | 64 | odebug << "Added POP account" << oendl; |
65 | POP3account *account = new POP3account( (*it).replace(0, 5, "") ); | 65 | POP3account *account = new POP3account( (*it).replace(0, 5, "") ); |
66 | accounts.append( account ); | 66 | accounts.append( account ); |
67 | } | 67 | } |
68 | 68 | ||
69 | QStringList smtp = dir.entryList( "smtp-*" ); | 69 | QStringList smtp = dir.entryList( "smtp-*" ); |
70 | for ( it = smtp.begin(); it != smtp.end(); it++ ) { | 70 | for ( it = smtp.begin(); it != smtp.end(); it++ ) { |
71 | qDebug( "Added SMTP account" ); | 71 | odebug << "Added SMTP account" << oendl; |
72 | SMTPaccount *account = new SMTPaccount( (*it).replace(0, 5, "") ); | 72 | SMTPaccount *account = new SMTPaccount( (*it).replace(0, 5, "") ); |
73 | accounts.append( account ); | 73 | accounts.append( account ); |
74 | } | 74 | } |
75 | 75 | ||
76 | QStringList nntp = dir.entryList( "nntp-*" ); | 76 | QStringList nntp = dir.entryList( "nntp-*" ); |
77 | for ( it = nntp.begin(); it != nntp.end(); it++ ) { | 77 | for ( it = nntp.begin(); it != nntp.end(); it++ ) { |
78 | qDebug( "Added NNTP account" ); | 78 | odebug << "Added NNTP account" << oendl; |
79 | NNTPaccount *account = new NNTPaccount( (*it).replace(0, 5, "") ); | 79 | NNTPaccount *account = new NNTPaccount( (*it).replace(0, 5, "") ); |
80 | accounts.append( account ); | 80 | accounts.append( account ); |
81 | } | 81 | } |
82 | 82 | ||
83 | readAccounts(); | 83 | readAccounts(); |
84 | } | 84 | } |
@@ -176,13 +176,13 @@ void IMAPaccount::read() | |||
176 | offline = conf->readBoolEntry("Offline",false); | 176 | offline = conf->readBoolEntry("Offline",false); |
177 | delete conf; | 177 | delete conf; |
178 | } | 178 | } |
179 | 179 | ||
180 | void IMAPaccount::save() | 180 | void IMAPaccount::save() |
181 | { | 181 | { |
182 | qDebug( "saving " + getFileName() ); | 182 | odebug << "saving " + getFileName() << oendl; |
183 | Settings::checkDirectory(); | 183 | Settings::checkDirectory(); |
184 | 184 | ||
185 | Config *conf = new Config( getFileName(), Config::File ); | 185 | Config *conf = new Config( getFileName(), Config::File ); |
186 | conf->setGroup( "IMAP Account" ); | 186 | conf->setGroup( "IMAP Account" ); |
187 | conf->writeEntry( "Account", accountName ); | 187 | conf->writeEntry( "Account", accountName ); |
188 | conf->writeEntry( "Server", server ); | 188 | conf->writeEntry( "Server", server ); |
@@ -254,13 +254,13 @@ void POP3account::read() | |||
254 | offline = conf->readBoolEntry("Offline",false); | 254 | offline = conf->readBoolEntry("Offline",false); |
255 | delete conf; | 255 | delete conf; |
256 | } | 256 | } |
257 | 257 | ||
258 | void POP3account::save() | 258 | void POP3account::save() |
259 | { | 259 | { |
260 | qDebug( "saving " + getFileName() ); | 260 | odebug << "saving " + getFileName() << oendl; |
261 | Settings::checkDirectory(); | 261 | Settings::checkDirectory(); |
262 | 262 | ||
263 | Config *conf = new Config( getFileName(), Config::File ); | 263 | Config *conf = new Config( getFileName(), Config::File ); |
264 | conf->setGroup( "POP3 Account" ); | 264 | conf->setGroup( "POP3 Account" ); |
265 | conf->writeEntry( "Account", accountName ); | 265 | conf->writeEntry( "Account", accountName ); |
266 | conf->writeEntry( "Server", server ); | 266 | conf->writeEntry( "Server", server ); |
@@ -336,13 +336,13 @@ void SMTPaccount::read() | |||
336 | password = conf->readEntryCrypt( "Password" ); | 336 | password = conf->readEntryCrypt( "Password" ); |
337 | delete conf; | 337 | delete conf; |
338 | } | 338 | } |
339 | 339 | ||
340 | void SMTPaccount::save() | 340 | void SMTPaccount::save() |
341 | { | 341 | { |
342 | qDebug( "saving " + getFileName() ); | 342 | odebug << "saving " + getFileName() << oendl; |
343 | Settings::checkDirectory(); | 343 | Settings::checkDirectory(); |
344 | 344 | ||
345 | Config *conf = new Config( getFileName(), Config::File ); | 345 | Config *conf = new Config( getFileName(), Config::File ); |
346 | conf->setGroup( "SMTP Account" ); | 346 | conf->setGroup( "SMTP Account" ); |
347 | conf->writeEntry( "Account", accountName ); | 347 | conf->writeEntry( "Account", accountName ); |
348 | conf->writeEntry( "Server", server ); | 348 | conf->writeEntry( "Server", server ); |
@@ -413,13 +413,13 @@ void NNTPaccount::read() | |||
413 | subscribedGroups = conf->readListEntry( "Subscribed", ',' ); | 413 | subscribedGroups = conf->readListEntry( "Subscribed", ',' ); |
414 | delete conf; | 414 | delete conf; |
415 | } | 415 | } |
416 | 416 | ||
417 | void NNTPaccount::save() | 417 | void NNTPaccount::save() |
418 | { | 418 | { |
419 | qDebug( "saving " + getFileName() ); | 419 | odebug << "saving " + getFileName() << oendl; |
420 | Settings::checkDirectory(); | 420 | Settings::checkDirectory(); |
421 | 421 | ||
422 | Config *conf = new Config( getFileName(), Config::File ); | 422 | Config *conf = new Config( getFileName(), Config::File ); |
423 | conf->setGroup( "NNTP Account" ); | 423 | conf->setGroup( "NNTP Account" ); |
424 | conf->writeEntry( "Account", accountName ); | 424 | conf->writeEntry( "Account", accountName ); |
425 | conf->writeEntry( "Server", server ); | 425 | conf->writeEntry( "Server", server ); |
diff --git a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp index e2cea7a..ba78c3b 100644 --- a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp | |||
@@ -112,13 +112,13 @@ void SMTPwrapper::smtpSend( mailmime *mail,bool later) { | |||
112 | int r = mailmessage_fetch(msg,&data,&size); | 112 | int r = mailmessage_fetch(msg,&data,&size); |
113 | mime_message_detach_mime(msg); | 113 | mime_message_detach_mime(msg); |
114 | mailmessage_free(msg); | 114 | mailmessage_free(msg); |
115 | if (r != MAIL_NO_ERROR || !data) { | 115 | if (r != MAIL_NO_ERROR || !data) { |
116 | if (data) | 116 | if (data) |
117 | free(data); | 117 | free(data); |
118 | qDebug("Error fetching mime..."); | 118 | odebug << "Error fetching mime..." << oendl; |
119 | return; | 119 | return; |
120 | } | 120 | } |
121 | msg = 0; | 121 | msg = 0; |
122 | if (later) { | 122 | if (later) { |
123 | storeMail(data,size,"Outgoing"); | 123 | storeMail(data,size,"Outgoing"); |
124 | if (data) | 124 | if (data) |
@@ -205,22 +205,22 @@ void SMTPwrapper::connect_server() | |||
205 | /* no failure message cause this happens when problems with memory - than we | 205 | /* no failure message cause this happens when problems with memory - than we |
206 | we can not display any messagebox */ | 206 | we can not display any messagebox */ |
207 | return; | 207 | return; |
208 | } | 208 | } |
209 | 209 | ||
210 | int err = MAILSMTP_NO_ERROR; | 210 | int err = MAILSMTP_NO_ERROR; |
211 | qDebug( "Servername %s at port %i", server, port ); | 211 | odebug << "Servername " << server << " at port " << port << "" << oendl; |
212 | if ( ssl ) { | 212 | if ( ssl ) { |
213 | qDebug( "SSL session" ); | 213 | odebug << "SSL session" << oendl; |
214 | err = mailsmtp_ssl_connect( m_smtp, server, port ); | 214 | err = mailsmtp_ssl_connect( m_smtp, server, port ); |
215 | } else { | 215 | } else { |
216 | qDebug( "No SSL session" ); | 216 | odebug << "No SSL session" << oendl; |
217 | err = mailsmtp_socket_connect( m_smtp, server, port ); | 217 | err = mailsmtp_socket_connect( m_smtp, server, port ); |
218 | } | 218 | } |
219 | if ( err != MAILSMTP_NO_ERROR ) { | 219 | if ( err != MAILSMTP_NO_ERROR ) { |
220 | qDebug("Error init connection"); | 220 | odebug << "Error init connection" << oendl; |
221 | failuretext = tr("Error init SMTP connection: %1").arg(mailsmtpError(err)); | 221 | failuretext = tr("Error init SMTP connection: %1").arg(mailsmtpError(err)); |
222 | result = 0; | 222 | result = 0; |
223 | } | 223 | } |
224 | 224 | ||
225 | /* switch to tls after init 'cause there it will send the ehlo */ | 225 | /* switch to tls after init 'cause there it will send the ehlo */ |
226 | if (result) { | 226 | if (result) { |
@@ -243,13 +243,13 @@ void SMTPwrapper::connect_server() | |||
243 | if (!try_tls && force_tls) { | 243 | if (!try_tls && force_tls) { |
244 | result = 0; | 244 | result = 0; |
245 | failuretext = tr("Error init SMTP tls: %1").arg(mailsmtpError(err)); | 245 | failuretext = tr("Error init SMTP tls: %1").arg(mailsmtpError(err)); |
246 | } | 246 | } |
247 | 247 | ||
248 | if (result==1 && m_SmtpAccount->getLogin() ) { | 248 | if (result==1 && m_SmtpAccount->getLogin() ) { |
249 | qDebug("smtp with auth"); | 249 | odebug << "smtp with auth" << oendl; |
250 | if ( m_SmtpAccount->getUser().isEmpty() || m_SmtpAccount->getPassword().isEmpty() ) { | 250 | if ( m_SmtpAccount->getUser().isEmpty() || m_SmtpAccount->getPassword().isEmpty() ) { |
251 | // get'em | 251 | // get'em |
252 | LoginDialog login( m_SmtpAccount->getUser(), | 252 | LoginDialog login( m_SmtpAccount->getUser(), |
253 | m_SmtpAccount->getPassword(), NULL, 0, true ); | 253 | m_SmtpAccount->getPassword(), NULL, 0, true ); |
254 | login.show(); | 254 | login.show(); |
255 | if ( QDialog::Accepted == login.exec() ) { | 255 | if ( QDialog::Accepted == login.exec() ) { |
@@ -261,17 +261,17 @@ void SMTPwrapper::connect_server() | |||
261 | failuretext=tr("Login aborted - storing mail to localfolder"); | 261 | failuretext=tr("Login aborted - storing mail to localfolder"); |
262 | } | 262 | } |
263 | } else { | 263 | } else { |
264 | user = m_SmtpAccount->getUser().latin1(); | 264 | user = m_SmtpAccount->getUser().latin1(); |
265 | pass = m_SmtpAccount->getPassword().latin1(); | 265 | pass = m_SmtpAccount->getPassword().latin1(); |
266 | } | 266 | } |
267 | qDebug( "session->auth: %i", m_smtp->auth); | 267 | odebug << "session->auth: " << m_smtp->auth << "" << oendl; |
268 | if (result) { | 268 | if (result) { |
269 | err = mailsmtp_auth( m_smtp, (char*)user, (char*)pass ); | 269 | err = mailsmtp_auth( m_smtp, (char*)user, (char*)pass ); |
270 | if ( err == MAILSMTP_NO_ERROR ) { | 270 | if ( err == MAILSMTP_NO_ERROR ) { |
271 | qDebug("auth ok"); | 271 | odebug << "auth ok" << oendl; |
272 | } else { | 272 | } else { |
273 | failuretext = tr("Authentification failed"); | 273 | failuretext = tr("Authentification failed"); |
274 | result = 0; | 274 | result = 0; |
275 | } | 275 | } |
276 | } | 276 | } |
277 | } | 277 | } |
@@ -304,31 +304,31 @@ int SMTPwrapper::smtpSend(char*from,clist*rcpts,const char*data,size_t size ) | |||
304 | result = 0; | 304 | result = 0; |
305 | } | 305 | } |
306 | 306 | ||
307 | if (!result) { | 307 | if (!result) { |
308 | storeFailedMail(data,size,failuretext); | 308 | storeFailedMail(data,size,failuretext); |
309 | } else { | 309 | } else { |
310 | qDebug( "Mail sent." ); | 310 | odebug << "Mail sent." << oendl; |
311 | storeMail(data,size,"Sent"); | 311 | storeMail(data,size,"Sent"); |
312 | } | 312 | } |
313 | return result; | 313 | return result; |
314 | } | 314 | } |
315 | 315 | ||
316 | void SMTPwrapper::sendMail(const Opie::Core::OSmartPointer<Mail>&mail,bool later ) | 316 | void SMTPwrapper::sendMail(const Opie::Core::OSmartPointer<Mail>&mail,bool later ) |
317 | { | 317 | { |
318 | mailmime * mimeMail; | 318 | mailmime * mimeMail; |
319 | 319 | ||
320 | mimeMail = createMimeMail(mail ); | 320 | mimeMail = createMimeMail(mail ); |
321 | if ( mimeMail == NULL ) { | 321 | if ( mimeMail == NULL ) { |
322 | qDebug( "sendMail: error creating mime mail" ); | 322 | odebug << "sendMail: error creating mime mail" << oendl; |
323 | } else { | 323 | } else { |
324 | sendProgress = new progressMailSend(); | 324 | sendProgress = new progressMailSend(); |
325 | sendProgress->show(); | 325 | sendProgress->show(); |
326 | sendProgress->setMaxMails(1); | 326 | sendProgress->setMaxMails(1); |
327 | smtpSend( mimeMail,later); | 327 | smtpSend( mimeMail,later); |
328 | qDebug("Clean up done"); | 328 | odebug << "Clean up done" << oendl; |
329 | sendProgress->hide(); | 329 | sendProgress->hide(); |
330 | delete sendProgress; | 330 | delete sendProgress; |
331 | sendProgress = 0; | 331 | sendProgress = 0; |
332 | mailmime_free( mimeMail ); | 332 | mailmime_free( mimeMail ); |
333 | } | 333 | } |
334 | } | 334 | } |
@@ -375,33 +375,33 @@ int SMTPwrapper::sendQueuedMail(AbstractMail*wrap,const RecMailP&which) { | |||
375 | } | 375 | } |
376 | 376 | ||
377 | /* this is a special fun */ | 377 | /* this is a special fun */ |
378 | bool SMTPwrapper::flushOutbox() { | 378 | bool SMTPwrapper::flushOutbox() { |
379 | bool returnValue = true; | 379 | bool returnValue = true; |
380 | 380 | ||
381 | qDebug("Sending the queue"); | 381 | odebug << "Sending the queue" << oendl; |
382 | if (!m_SmtpAccount) { | 382 | if (!m_SmtpAccount) { |
383 | qDebug("No smtp account given"); | 383 | odebug << "No smtp account given" << oendl; |
384 | return false; | 384 | return false; |
385 | } | 385 | } |
386 | 386 | ||
387 | bool reset_user_value = false; | 387 | bool reset_user_value = false; |
388 | QString localfolders = AbstractMail::defaultLocalfolder(); | 388 | QString localfolders = AbstractMail::defaultLocalfolder(); |
389 | AbstractMail*wrap = AbstractMail::getWrapper(localfolders); | 389 | AbstractMail*wrap = AbstractMail::getWrapper(localfolders); |
390 | if (!wrap) { | 390 | if (!wrap) { |
391 | qDebug("memory error"); | 391 | odebug << "memory error" << oendl; |
392 | return false; | 392 | return false; |
393 | } | 393 | } |
394 | QString oldPw, oldUser; | 394 | QString oldPw, oldUser; |
395 | QValueList<RecMailP> mailsToSend; | 395 | QValueList<RecMailP> mailsToSend; |
396 | QValueList<RecMailP> mailsToRemove; | 396 | QValueList<RecMailP> mailsToRemove; |
397 | QString mbox("Outgoing"); | 397 | QString mbox("Outgoing"); |
398 | wrap->listMessages(mbox,mailsToSend); | 398 | wrap->listMessages(mbox,mailsToSend); |
399 | if (mailsToSend.count()==0) { | 399 | if (mailsToSend.count()==0) { |
400 | delete wrap; | 400 | delete wrap; |
401 | qDebug("No mails to send"); | 401 | odebug << "No mails to send" << oendl; |
402 | return false; | 402 | return false; |
403 | } | 403 | } |
404 | 404 | ||
405 | oldPw = m_SmtpAccount->getPassword(); | 405 | oldPw = m_SmtpAccount->getPassword(); |
406 | oldUser = m_SmtpAccount->getUser(); | 406 | oldUser = m_SmtpAccount->getUser(); |
407 | if (m_SmtpAccount->getLogin() && (m_SmtpAccount->getUser().isEmpty() || m_SmtpAccount->getPassword().isEmpty()) ) { | 407 | if (m_SmtpAccount->getLogin() && (m_SmtpAccount->getUser().isEmpty() || m_SmtpAccount->getPassword().isEmpty()) ) { |
diff --git a/noncore/net/mail/libmailwrapper/statusmail.cpp b/noncore/net/mail/libmailwrapper/statusmail.cpp index b78244d..51383f6 100644 --- a/noncore/net/mail/libmailwrapper/statusmail.cpp +++ b/noncore/net/mail/libmailwrapper/statusmail.cpp | |||
@@ -40,13 +40,13 @@ void StatusMail::initAccounts(QList<Account>&accounts) | |||
40 | connectionList.append(current); | 40 | connectionList.append(current); |
41 | current->statusFolder(currentStat); | 41 | current->statusFolder(currentStat); |
42 | currentPop3Stat.message_count+=currentStat.message_count; | 42 | currentPop3Stat.message_count+=currentStat.message_count; |
43 | } | 43 | } |
44 | current->logout(); | 44 | current->logout(); |
45 | } | 45 | } |
46 | qDebug("Pop3 init count: %i",currentPop3Stat.message_count); | 46 | odebug << "Pop3 init count: " << currentPop3Stat.message_count << "" << oendl; |
47 | currentPop3Stat.message_recent = currentPop3Stat.message_unseen = 0; | 47 | currentPop3Stat.message_recent = currentPop3Stat.message_unseen = 0; |
48 | lastPop3Stat.message_unseen = currentPop3Stat.message_unseen; | 48 | lastPop3Stat.message_unseen = currentPop3Stat.message_unseen; |
49 | lastPop3Stat.message_recent = currentPop3Stat.message_recent; | 49 | lastPop3Stat.message_recent = currentPop3Stat.message_recent; |
50 | lastPop3Stat.message_count = currentPop3Stat.message_count; | 50 | lastPop3Stat.message_count = currentPop3Stat.message_count; |
51 | } | 51 | } |
52 | 52 | ||
@@ -69,16 +69,16 @@ void StatusMail::check_current_stat(folderStat&targetStat) | |||
69 | if (it->getType() == MAILLIB::A_IMAP) { | 69 | if (it->getType() == MAILLIB::A_IMAP) { |
70 | currentImapStat.message_unseen+=currentStat.message_unseen; | 70 | currentImapStat.message_unseen+=currentStat.message_unseen; |
71 | currentImapStat.message_recent+=currentStat.message_recent; | 71 | currentImapStat.message_recent+=currentStat.message_recent; |
72 | currentImapStat.message_count+=currentStat.message_count; | 72 | currentImapStat.message_count+=currentStat.message_count; |
73 | } else if (it->getType() == MAILLIB::A_POP3) { | 73 | } else if (it->getType() == MAILLIB::A_POP3) { |
74 | currentPop3Stat.message_count+=currentStat.message_count; | 74 | currentPop3Stat.message_count+=currentStat.message_count; |
75 | qDebug("Pop3 count: %i",currentPop3Stat.message_count); | 75 | odebug << "Pop3 count: " << currentPop3Stat.message_count << "" << oendl; |
76 | } | 76 | } |
77 | } | 77 | } |
78 | qDebug("Pop3 last: %i",lastPop3Stat.message_count); | 78 | odebug << "Pop3 last: " << lastPop3Stat.message_count << "" << oendl; |
79 | if (currentPop3Stat.message_count > lastPop3Stat.message_count) { | 79 | if (currentPop3Stat.message_count > lastPop3Stat.message_count) { |
80 | currentPop3Stat.message_recent = currentPop3Stat.message_count - lastPop3Stat.message_count; | 80 | currentPop3Stat.message_recent = currentPop3Stat.message_count - lastPop3Stat.message_count; |
81 | currentPop3Stat.message_unseen = currentPop3Stat.message_recent; | 81 | currentPop3Stat.message_unseen = currentPop3Stat.message_recent; |
82 | } else { | 82 | } else { |
83 | lastPop3Stat.message_count = currentPop3Stat.message_count; | 83 | lastPop3Stat.message_count = currentPop3Stat.message_count; |
84 | currentPop3Stat.message_recent = currentPop3Stat.message_unseen = 0; | 84 | currentPop3Stat.message_recent = currentPop3Stat.message_unseen = 0; |
diff --git a/noncore/net/mail/libmailwrapper/storemail.cpp b/noncore/net/mail/libmailwrapper/storemail.cpp index 914a11d..546d756 100644 --- a/noncore/net/mail/libmailwrapper/storemail.cpp +++ b/noncore/net/mail/libmailwrapper/storemail.cpp | |||
@@ -55,13 +55,13 @@ int Storemail::storeMail(const Opie::Core::OSmartPointer<Mail>&mail) | |||
55 | if (!wrapper) return 0; | 55 | if (!wrapper) return 0; |
56 | int ret = 1; | 56 | int ret = 1; |
57 | 57 | ||
58 | mailmime * mimeMail = 0; | 58 | mailmime * mimeMail = 0; |
59 | mimeMail = createMimeMail(mail ); | 59 | mimeMail = createMimeMail(mail ); |
60 | if ( mimeMail == NULL ) { | 60 | if ( mimeMail == NULL ) { |
61 | qDebug( "storeMail: error creating mime mail" ); | 61 | odebug << "storeMail: error creating mime mail" << oendl; |
62 | return 0; | 62 | return 0; |
63 | } | 63 | } |
64 | char *data; | 64 | char *data; |
65 | size_t size; | 65 | size_t size; |
66 | data = 0; | 66 | data = 0; |
67 | 67 | ||
@@ -70,13 +70,13 @@ int Storemail::storeMail(const Opie::Core::OSmartPointer<Mail>&mail) | |||
70 | mime_message_set_tmpdir(msg,getenv( "HOME" )); | 70 | mime_message_set_tmpdir(msg,getenv( "HOME" )); |
71 | int r = mailmessage_fetch(msg,&data,&size); | 71 | int r = mailmessage_fetch(msg,&data,&size); |
72 | mime_message_detach_mime(msg); | 72 | mime_message_detach_mime(msg); |
73 | mailmessage_free(msg); | 73 | mailmessage_free(msg); |
74 | msg = 0; | 74 | msg = 0; |
75 | if (r != MAIL_NO_ERROR || !data) { | 75 | if (r != MAIL_NO_ERROR || !data) { |
76 | qDebug("Error fetching mime..."); | 76 | odebug << "Error fetching mime..." << oendl; |
77 | ret = 0; | 77 | ret = 0; |
78 | } | 78 | } |
79 | 79 | ||
80 | if (ret) { | 80 | if (ret) { |
81 | wrapper->storeMessage(data,size,m_tfolder); | 81 | wrapper->storeMessage(data,size,m_tfolder); |
82 | } | 82 | } |