author | alwin <alwin> | 2003-12-24 14:18:28 (UTC) |
---|---|---|
committer | alwin <alwin> | 2003-12-24 14:18:28 (UTC) |
commit | 9d2a848b254d6c859d7054d486eedac6535d26ec (patch) (unidiff) | |
tree | d3cb3479465b1cc6ef4b67898fc9649f8416c3da | |
parent | c609fd3341bccf6150e313f4fa08ff3ca9086503 (diff) | |
download | opie-9d2a848b254d6c859d7054d486eedac6535d26ec.zip opie-9d2a848b254d6c859d7054d486eedac6535d26ec.tar.gz opie-9d2a848b254d6c859d7054d486eedac6535d26ec.tar.bz2 |
hopefully fixed some memleaks and some not initialized vars
-rw-r--r-- | noncore/net/mail/genericwrapper.cpp | 6 | ||||
-rw-r--r-- | noncore/net/mail/imapwrapper.cpp | 12 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/genericwrapper.cpp | 6 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.cpp | 12 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mailwrapper.cpp | 2 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mboxwrapper.cpp | 12 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/smtpwrapper.cpp | 33 | ||||
-rw-r--r-- | noncore/net/mail/mailwrapper.cpp | 2 | ||||
-rw-r--r-- | noncore/net/mail/mboxwrapper.cpp | 12 | ||||
-rw-r--r-- | noncore/net/mail/smtpwrapper.cpp | 33 |
10 files changed, 84 insertions, 46 deletions
diff --git a/noncore/net/mail/genericwrapper.cpp b/noncore/net/mail/genericwrapper.cpp index 447cad0..c1b6e48 100644 --- a/noncore/net/mail/genericwrapper.cpp +++ b/noncore/net/mail/genericwrapper.cpp | |||
@@ -188,15 +188,15 @@ RecBody Genericwrapper::parseMail( mailmessage * msg ) | |||
188 | 188 | ||
189 | RecMail *Genericwrapper::parseHeader( const char *header ) | 189 | RecMail *Genericwrapper::parseHeader( const char *header ) |
190 | { | 190 | { |
191 | int err = MAILIMF_NO_ERROR; | 191 | int err = MAILIMF_NO_ERROR; |
192 | size_t curTok = 0; | 192 | size_t curTok = 0; |
193 | RecMail *mail = new RecMail(); | 193 | RecMail *mail = new RecMail(); |
194 | mailimf_fields *fields; | 194 | mailimf_fields *fields = 0; |
195 | mailimf_references * refs; | 195 | mailimf_references * refs = 0; |
196 | mailimf_keywords*keys; | 196 | mailimf_keywords*keys = 0; |
197 | QString status; | 197 | QString status; |
198 | QString value; | 198 | QString value; |
199 | QBitArray mFlags(7); | 199 | QBitArray mFlags(7); |
200 | 200 | ||
201 | err = mailimf_fields_parse( (char *) header, strlen( header ), &curTok, &fields ); | 201 | err = mailimf_fields_parse( (char *) header, strlen( header ), &curTok, &fields ); |
202 | for ( clistiter *current = clist_begin( fields->fld_list ); current != NULL; current = current->next ) { | 202 | for ( clistiter *current = clist_begin( fields->fld_list ); current != NULL; current = current->next ) { |
diff --git a/noncore/net/mail/imapwrapper.cpp b/noncore/net/mail/imapwrapper.cpp index 853e4a2..0178e33 100644 --- a/noncore/net/mail/imapwrapper.cpp +++ b/noncore/net/mail/imapwrapper.cpp | |||
@@ -91,19 +91,19 @@ void IMAPwrapper::logout() | |||
91 | mailimap_free( m_imap ); | 91 | mailimap_free( m_imap ); |
92 | m_imap = 0; | 92 | m_imap = 0; |
93 | } | 93 | } |
94 | 94 | ||
95 | void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target ) | 95 | void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target ) |
96 | { | 96 | { |
97 | const char *mb; | 97 | const char *mb = 0; |
98 | int err = MAILIMAP_NO_ERROR; | 98 | int err = MAILIMAP_NO_ERROR; |
99 | clist *result; | 99 | clist *result = 0; |
100 | clistcell *current; | 100 | clistcell *current; |
101 | // mailimap_fetch_att *fetchAtt,*fetchAttFlags,*fetchAttDate,*fetchAttSize; | 101 | // mailimap_fetch_att *fetchAtt,*fetchAttFlags,*fetchAttDate,*fetchAttSize; |
102 | mailimap_fetch_type *fetchType; | 102 | mailimap_fetch_type *fetchType = 0; |
103 | mailimap_set *set; | 103 | mailimap_set *set = 0; |
104 | 104 | ||
105 | mb = mailbox.latin1(); | 105 | mb = mailbox.latin1(); |
106 | login(); | 106 | login(); |
107 | if (!m_imap) { | 107 | if (!m_imap) { |
108 | return; | 108 | return; |
109 | } | 109 | } |
@@ -118,13 +118,12 @@ void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target ) | |||
118 | 118 | ||
119 | if (last == 0) { | 119 | if (last == 0) { |
120 | qDebug("mailbox has no mails"); | 120 | qDebug("mailbox has no mails"); |
121 | return; | 121 | return; |
122 | } | 122 | } |
123 | 123 | ||
124 | result = clist_new(); | ||
125 | /* the range has to start at 1!!! not with 0!!!! */ | 124 | /* the range has to start at 1!!! not with 0!!!! */ |
126 | set = mailimap_set_new_interval( 1, last ); | 125 | set = mailimap_set_new_interval( 1, last ); |
127 | fetchType = mailimap_fetch_type_new_fetch_att_list_empty(); | 126 | fetchType = mailimap_fetch_type_new_fetch_att_list_empty(); |
128 | mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_envelope()); | 127 | mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_envelope()); |
129 | mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_flags()); | 128 | mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_flags()); |
130 | mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_internaldate()); | 129 | mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_internaldate()); |
@@ -134,13 +133,12 @@ void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target ) | |||
134 | mailimap_set_free( set ); | 133 | mailimap_set_free( set ); |
135 | mailimap_fetch_type_free( fetchType ); | 134 | mailimap_fetch_type_free( fetchType ); |
136 | 135 | ||
137 | QString date,subject,from; | 136 | QString date,subject,from; |
138 | 137 | ||
139 | if ( err == MAILIMAP_NO_ERROR ) { | 138 | if ( err == MAILIMAP_NO_ERROR ) { |
140 | |||
141 | mailimap_msg_att * msg_att; | 139 | mailimap_msg_att * msg_att; |
142 | int i = 0; | 140 | int i = 0; |
143 | for (current = clist_begin(result); current != 0; current=clist_next(current)) { | 141 | for (current = clist_begin(result); current != 0; current=clist_next(current)) { |
144 | ++i; | 142 | ++i; |
145 | msg_att = (mailimap_msg_att*)current->data; | 143 | msg_att = (mailimap_msg_att*)current->data; |
146 | RecMail*m = parse_list_result(msg_att); | 144 | RecMail*m = parse_list_result(msg_att); |
@@ -151,13 +149,13 @@ void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target ) | |||
151 | target.append(m); | 149 | target.append(m); |
152 | } | 150 | } |
153 | } | 151 | } |
154 | } else { | 152 | } else { |
155 | qDebug("Error fetching headers: %s",m_imap->imap_response); | 153 | qDebug("Error fetching headers: %s",m_imap->imap_response); |
156 | } | 154 | } |
157 | mailimap_fetch_list_free(result); | 155 | if (result) mailimap_fetch_list_free(result); |
158 | } | 156 | } |
159 | 157 | ||
160 | QList<Folder>* IMAPwrapper::listFolders() | 158 | QList<Folder>* IMAPwrapper::listFolders() |
161 | { | 159 | { |
162 | const char *path, *mask; | 160 | const char *path, *mask; |
163 | int err = MAILIMAP_NO_ERROR; | 161 | int err = MAILIMAP_NO_ERROR; |
diff --git a/noncore/net/mail/libmailwrapper/genericwrapper.cpp b/noncore/net/mail/libmailwrapper/genericwrapper.cpp index 447cad0..c1b6e48 100644 --- a/noncore/net/mail/libmailwrapper/genericwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/genericwrapper.cpp | |||
@@ -188,15 +188,15 @@ RecBody Genericwrapper::parseMail( mailmessage * msg ) | |||
188 | 188 | ||
189 | RecMail *Genericwrapper::parseHeader( const char *header ) | 189 | RecMail *Genericwrapper::parseHeader( const char *header ) |
190 | { | 190 | { |
191 | int err = MAILIMF_NO_ERROR; | 191 | int err = MAILIMF_NO_ERROR; |
192 | size_t curTok = 0; | 192 | size_t curTok = 0; |
193 | RecMail *mail = new RecMail(); | 193 | RecMail *mail = new RecMail(); |
194 | mailimf_fields *fields; | 194 | mailimf_fields *fields = 0; |
195 | mailimf_references * refs; | 195 | mailimf_references * refs = 0; |
196 | mailimf_keywords*keys; | 196 | mailimf_keywords*keys = 0; |
197 | QString status; | 197 | QString status; |
198 | QString value; | 198 | QString value; |
199 | QBitArray mFlags(7); | 199 | QBitArray mFlags(7); |
200 | 200 | ||
201 | err = mailimf_fields_parse( (char *) header, strlen( header ), &curTok, &fields ); | 201 | err = mailimf_fields_parse( (char *) header, strlen( header ), &curTok, &fields ); |
202 | for ( clistiter *current = clist_begin( fields->fld_list ); current != NULL; current = current->next ) { | 202 | for ( clistiter *current = clist_begin( fields->fld_list ); current != NULL; current = current->next ) { |
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp index 853e4a2..0178e33 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp | |||
@@ -91,19 +91,19 @@ void IMAPwrapper::logout() | |||
91 | mailimap_free( m_imap ); | 91 | mailimap_free( m_imap ); |
92 | m_imap = 0; | 92 | m_imap = 0; |
93 | } | 93 | } |
94 | 94 | ||
95 | void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target ) | 95 | void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target ) |
96 | { | 96 | { |
97 | const char *mb; | 97 | const char *mb = 0; |
98 | int err = MAILIMAP_NO_ERROR; | 98 | int err = MAILIMAP_NO_ERROR; |
99 | clist *result; | 99 | clist *result = 0; |
100 | clistcell *current; | 100 | clistcell *current; |
101 | // mailimap_fetch_att *fetchAtt,*fetchAttFlags,*fetchAttDate,*fetchAttSize; | 101 | // mailimap_fetch_att *fetchAtt,*fetchAttFlags,*fetchAttDate,*fetchAttSize; |
102 | mailimap_fetch_type *fetchType; | 102 | mailimap_fetch_type *fetchType = 0; |
103 | mailimap_set *set; | 103 | mailimap_set *set = 0; |
104 | 104 | ||
105 | mb = mailbox.latin1(); | 105 | mb = mailbox.latin1(); |
106 | login(); | 106 | login(); |
107 | if (!m_imap) { | 107 | if (!m_imap) { |
108 | return; | 108 | return; |
109 | } | 109 | } |
@@ -118,13 +118,12 @@ void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target ) | |||
118 | 118 | ||
119 | if (last == 0) { | 119 | if (last == 0) { |
120 | qDebug("mailbox has no mails"); | 120 | qDebug("mailbox has no mails"); |
121 | return; | 121 | return; |
122 | } | 122 | } |
123 | 123 | ||
124 | result = clist_new(); | ||
125 | /* the range has to start at 1!!! not with 0!!!! */ | 124 | /* the range has to start at 1!!! not with 0!!!! */ |
126 | set = mailimap_set_new_interval( 1, last ); | 125 | set = mailimap_set_new_interval( 1, last ); |
127 | fetchType = mailimap_fetch_type_new_fetch_att_list_empty(); | 126 | fetchType = mailimap_fetch_type_new_fetch_att_list_empty(); |
128 | mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_envelope()); | 127 | mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_envelope()); |
129 | mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_flags()); | 128 | mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_flags()); |
130 | mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_internaldate()); | 129 | mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_internaldate()); |
@@ -134,13 +133,12 @@ void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target ) | |||
134 | mailimap_set_free( set ); | 133 | mailimap_set_free( set ); |
135 | mailimap_fetch_type_free( fetchType ); | 134 | mailimap_fetch_type_free( fetchType ); |
136 | 135 | ||
137 | QString date,subject,from; | 136 | QString date,subject,from; |
138 | 137 | ||
139 | if ( err == MAILIMAP_NO_ERROR ) { | 138 | if ( err == MAILIMAP_NO_ERROR ) { |
140 | |||
141 | mailimap_msg_att * msg_att; | 139 | mailimap_msg_att * msg_att; |
142 | int i = 0; | 140 | int i = 0; |
143 | for (current = clist_begin(result); current != 0; current=clist_next(current)) { | 141 | for (current = clist_begin(result); current != 0; current=clist_next(current)) { |
144 | ++i; | 142 | ++i; |
145 | msg_att = (mailimap_msg_att*)current->data; | 143 | msg_att = (mailimap_msg_att*)current->data; |
146 | RecMail*m = parse_list_result(msg_att); | 144 | RecMail*m = parse_list_result(msg_att); |
@@ -151,13 +149,13 @@ void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target ) | |||
151 | target.append(m); | 149 | target.append(m); |
152 | } | 150 | } |
153 | } | 151 | } |
154 | } else { | 152 | } else { |
155 | qDebug("Error fetching headers: %s",m_imap->imap_response); | 153 | qDebug("Error fetching headers: %s",m_imap->imap_response); |
156 | } | 154 | } |
157 | mailimap_fetch_list_free(result); | 155 | if (result) mailimap_fetch_list_free(result); |
158 | } | 156 | } |
159 | 157 | ||
160 | QList<Folder>* IMAPwrapper::listFolders() | 158 | QList<Folder>* IMAPwrapper::listFolders() |
161 | { | 159 | { |
162 | const char *path, *mask; | 160 | const char *path, *mask; |
163 | int err = MAILIMAP_NO_ERROR; | 161 | int err = MAILIMAP_NO_ERROR; |
diff --git a/noncore/net/mail/libmailwrapper/mailwrapper.cpp b/noncore/net/mail/libmailwrapper/mailwrapper.cpp index f8efd09..6479783 100644 --- a/noncore/net/mail/libmailwrapper/mailwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/mailwrapper.cpp | |||
@@ -52,13 +52,13 @@ static unsigned char base64chars[] = | |||
52 | QString IMAPFolder::decodeFolderName( const QString &name ) | 52 | QString IMAPFolder::decodeFolderName( const QString &name ) |
53 | { | 53 | { |
54 | unsigned char c, i, bitcount; | 54 | unsigned char c, i, bitcount; |
55 | unsigned long ucs4, utf16, bitbuf; | 55 | unsigned long ucs4, utf16, bitbuf; |
56 | unsigned char base64[256], utf8[6]; | 56 | unsigned char base64[256], utf8[6]; |
57 | unsigned long srcPtr = 0; | 57 | unsigned long srcPtr = 0; |
58 | QCString dst; | 58 | QCString dst = ""; |
59 | QCString src = name.ascii(); | 59 | QCString src = name.ascii(); |
60 | 60 | ||
61 | /* initialize modified base64 decoding table */ | 61 | /* initialize modified base64 decoding table */ |
62 | memset(base64, UNDEFINED, sizeof(base64)); | 62 | memset(base64, UNDEFINED, sizeof(base64)); |
63 | for (i = 0; i < sizeof(base64chars); ++i) { | 63 | for (i = 0; i < sizeof(base64chars); ++i) { |
64 | base64[(int)base64chars[i]] = i; | 64 | base64[(int)base64chars[i]] = i; |
diff --git a/noncore/net/mail/libmailwrapper/mboxwrapper.cpp b/noncore/net/mail/libmailwrapper/mboxwrapper.cpp index 293ae1b..6d69263 100644 --- a/noncore/net/mail/libmailwrapper/mboxwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/mboxwrapper.cpp | |||
@@ -1,12 +1,13 @@ | |||
1 | #include "mboxwrapper.h" | 1 | #include "mboxwrapper.h" |
2 | #include "mailtypes.h" | 2 | #include "mailtypes.h" |
3 | #include "mailwrapper.h" | 3 | #include "mailwrapper.h" |
4 | #include <libetpan/libetpan.h> | 4 | #include <libetpan/libetpan.h> |
5 | #include <libetpan/mailstorage.h> | 5 | #include <libetpan/mailstorage.h> |
6 | #include <qdir.h> | 6 | #include <qdir.h> |
7 | #include <stdlib.h> | ||
7 | 8 | ||
8 | MBOXwrapper::MBOXwrapper(const QString & mbox_dir) | 9 | MBOXwrapper::MBOXwrapper(const QString & mbox_dir) |
9 | : Genericwrapper(),MBOXPath(mbox_dir) | 10 | : Genericwrapper(),MBOXPath(mbox_dir) |
10 | { | 11 | { |
11 | QDir dir(MBOXPath); | 12 | QDir dir(MBOXPath); |
12 | if (!dir.exists()) { | 13 | if (!dir.exists()) { |
@@ -20,39 +21,45 @@ MBOXwrapper::~MBOXwrapper() | |||
20 | 21 | ||
21 | void MBOXwrapper::listMessages(const QString & mailbox, QList<RecMail> &target ) | 22 | void MBOXwrapper::listMessages(const QString & mailbox, QList<RecMail> &target ) |
22 | { | 23 | { |
23 | mailstorage*storage = mailstorage_new(NULL); | 24 | mailstorage*storage = mailstorage_new(NULL); |
24 | QString p = MBOXPath+"/"; | 25 | QString p = MBOXPath+"/"; |
25 | p+=mailbox; | 26 | p+=mailbox; |
27 | char*fname = 0; | ||
26 | 28 | ||
27 | int r = mbox_mailstorage_init(storage,strdup(p.latin1()),0,0,0); | 29 | fname = strdup(p.latin1()); |
30 | |||
31 | int r = mbox_mailstorage_init(storage,fname,0,0,0); | ||
28 | mailfolder*folder; | 32 | mailfolder*folder; |
29 | folder = mailfolder_new( storage,strdup(p.latin1()),NULL); | 33 | folder = mailfolder_new( storage,fname,NULL); |
30 | r = mailfolder_connect(folder); | 34 | r = mailfolder_connect(folder); |
31 | if (r != MAIL_NO_ERROR) { | 35 | if (r != MAIL_NO_ERROR) { |
32 | qDebug("Error initializing mbox"); | 36 | qDebug("Error initializing mbox"); |
33 | mailfolder_free(folder); | 37 | mailfolder_free(folder); |
34 | mailstorage_free(storage); | 38 | mailstorage_free(storage); |
39 | free(fname); | ||
35 | return; | 40 | return; |
36 | } | 41 | } |
37 | mailmessage_list * env_list = 0; | 42 | mailmessage_list * env_list = 0; |
38 | r = mailsession_get_messages_list(folder->fld_session,&env_list); | 43 | r = mailsession_get_messages_list(folder->fld_session,&env_list); |
39 | if (r != MAIL_NO_ERROR) { | 44 | if (r != MAIL_NO_ERROR) { |
40 | qDebug("Error message list"); | 45 | qDebug("Error message list"); |
41 | mailfolder_free(folder); | 46 | mailfolder_free(folder); |
42 | mailstorage_free(storage); | 47 | mailstorage_free(storage); |
48 | free(fname); | ||
43 | return; | 49 | return; |
44 | } | 50 | } |
45 | r = mailsession_get_envelopes_list(folder->fld_session, env_list); | 51 | r = mailsession_get_envelopes_list(folder->fld_session, env_list); |
46 | if (r != MAIL_NO_ERROR) { | 52 | if (r != MAIL_NO_ERROR) { |
47 | qDebug("Error filling message list"); | 53 | qDebug("Error filling message list"); |
48 | if (env_list) { | 54 | if (env_list) { |
49 | mailmessage_list_free(env_list); | 55 | mailmessage_list_free(env_list); |
50 | } | 56 | } |
51 | mailfolder_free(folder); | 57 | mailfolder_free(folder); |
52 | mailstorage_free(storage); | 58 | mailstorage_free(storage); |
59 | free(fname); | ||
53 | return; | 60 | return; |
54 | } | 61 | } |
55 | mailimf_references * refs; | 62 | mailimf_references * refs; |
56 | 63 | ||
57 | for(int i = 0 ; i < carray_count(env_list->msg_tab) ; ++i) { | 64 | for(int i = 0 ; i < carray_count(env_list->msg_tab) ; ++i) { |
58 | mailmessage * msg; | 65 | mailmessage * msg; |
@@ -100,12 +107,13 @@ void MBOXwrapper::listMessages(const QString & mailbox, QList<RecMail> &target ) | |||
100 | if (env_list) { | 107 | if (env_list) { |
101 | mailmessage_list_free(env_list); | 108 | mailmessage_list_free(env_list); |
102 | } | 109 | } |
103 | mailfolder_disconnect(folder); | 110 | mailfolder_disconnect(folder); |
104 | mailfolder_free(folder); | 111 | mailfolder_free(folder); |
105 | mailstorage_free(storage); | 112 | mailstorage_free(storage); |
113 | free(fname); | ||
106 | } | 114 | } |
107 | 115 | ||
108 | QList<Folder>* MBOXwrapper::listFolders() | 116 | QList<Folder>* MBOXwrapper::listFolders() |
109 | { | 117 | { |
110 | QList<Folder> * folders = new QList<Folder>(); | 118 | QList<Folder> * folders = new QList<Folder>(); |
111 | folders->setAutoDelete( false ); | 119 | folders->setAutoDelete( false ); |
diff --git a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp index a7e4837..21992b4 100644 --- a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp | |||
@@ -438,13 +438,15 @@ char *SMTPwrapper::getFrom( mailimf_field *ffrom) | |||
438 | 438 | ||
439 | return from; | 439 | return from; |
440 | } | 440 | } |
441 | 441 | ||
442 | char *SMTPwrapper::getFrom( mailmime *mail ) | 442 | char *SMTPwrapper::getFrom( mailmime *mail ) |
443 | { | 443 | { |
444 | /* no need to delete - its just a pointer to structure content */ | ||
444 | mailimf_field *ffrom = 0; | 445 | mailimf_field *ffrom = 0; |
446 | char*f = 0; | ||
445 | ffrom = getField( mail->mm_data.mm_message.mm_fields, MAILIMF_FIELD_FROM ); | 447 | ffrom = getField( mail->mm_data.mm_message.mm_fields, MAILIMF_FIELD_FROM ); |
446 | return getFrom(ffrom); | 448 | return getFrom(ffrom); |
447 | } | 449 | } |
448 | 450 | ||
449 | SMTPaccount *SMTPwrapper::getAccount(const QString&name ) | 451 | SMTPaccount *SMTPwrapper::getAccount(const QString&name ) |
450 | { | 452 | { |
@@ -560,12 +562,15 @@ void SMTPwrapper::smtpSend( mailmime *mail,bool later, SMTPaccount *smtp ) | |||
560 | if (data) free( data ); | 562 | if (data) free( data ); |
561 | return; | 563 | return; |
562 | } | 564 | } |
563 | from = getFrom( mail ); | 565 | from = getFrom( mail ); |
564 | rcpts = createRcptList( mail->mm_data.mm_message.mm_fields ); | 566 | rcpts = createRcptList( mail->mm_data.mm_message.mm_fields ); |
565 | smtpSend(from,rcpts,data,size,smtp); | 567 | smtpSend(from,rcpts,data,size,smtp); |
568 | if (data) {free(data);} | ||
569 | if (from) {free(from);} | ||
570 | if (rcpts) smtp_address_list_free( rcpts ); | ||
566 | } | 571 | } |
567 | 572 | ||
568 | int SMTPwrapper::smtpSend(char*from,clist*rcpts,char*data,size_t size, SMTPaccount *smtp ) | 573 | int SMTPwrapper::smtpSend(char*from,clist*rcpts,char*data,size_t size, SMTPaccount *smtp ) |
569 | { | 574 | { |
570 | char *server, *user, *pass; | 575 | char *server, *user, *pass; |
571 | bool ssl; | 576 | bool ssl; |
@@ -627,16 +632,13 @@ int SMTPwrapper::smtpSend(char*from,clist*rcpts,char*data,size_t size, SMTPaccou | |||
627 | 632 | ||
628 | free_con_session: | 633 | free_con_session: |
629 | mailsmtp_quit( session ); | 634 | mailsmtp_quit( session ); |
630 | free_mem_session: | 635 | free_mem_session: |
631 | mailsmtp_free( session ); | 636 | mailsmtp_free( session ); |
632 | free_mem: | 637 | free_mem: |
633 | if (rcpts) smtp_address_list_free( rcpts ); | ||
634 | if (data) free( data ); | ||
635 | if (server) free( server ); | 638 | if (server) free( server ); |
636 | if (from) free( from ); | ||
637 | if ( smtp->getLogin() ) { | 639 | if ( smtp->getLogin() ) { |
638 | free( user ); | 640 | free( user ); |
639 | free( pass ); | 641 | free( pass ); |
640 | } | 642 | } |
641 | return result; | 643 | return result; |
642 | } | 644 | } |
@@ -649,13 +651,12 @@ void SMTPwrapper::sendMail(const Mail&mail,bool later ) | |||
649 | 651 | ||
650 | mimeMail = createMimeMail(mail ); | 652 | mimeMail = createMimeMail(mail ); |
651 | if ( mimeMail == NULL ) { | 653 | if ( mimeMail == NULL ) { |
652 | qDebug( "sendMail: error creating mime mail" ); | 654 | qDebug( "sendMail: error creating mime mail" ); |
653 | } else { | 655 | } else { |
654 | sendProgress = new progressMailSend(); | 656 | sendProgress = new progressMailSend(); |
655 | // sendProgress->showMaximized(); | ||
656 | sendProgress->show(); | 657 | sendProgress->show(); |
657 | sendProgress->setMaxMails(1); | 658 | sendProgress->setMaxMails(1); |
658 | smtpSend( mimeMail,later,smtp); | 659 | smtpSend( mimeMail,later,smtp); |
659 | mailmime_free( mimeMail ); | 660 | mailmime_free( mimeMail ); |
660 | qDebug("Clean up done"); | 661 | qDebug("Clean up done"); |
661 | sendProgress->hide(); | 662 | sendProgress->hide(); |
@@ -670,12 +671,13 @@ int SMTPwrapper::sendQueuedMail(MBOXwrapper*wrap,SMTPaccount*smtp,RecMail*which) | |||
670 | size_t length = 0; | 671 | size_t length = 0; |
671 | size_t curTok = 0; | 672 | size_t curTok = 0; |
672 | mailimf_fields *fields = 0; | 673 | mailimf_fields *fields = 0; |
673 | mailimf_field*ffrom = 0; | 674 | mailimf_field*ffrom = 0; |
674 | clist *rcpts = 0; | 675 | clist *rcpts = 0; |
675 | char*from = 0; | 676 | char*from = 0; |
677 | int res = 0; | ||
676 | 678 | ||
677 | wrap->fetchRawBody(*which,&data,&length); | 679 | wrap->fetchRawBody(*which,&data,&length); |
678 | if (!data) return 0; | 680 | if (!data) return 0; |
679 | int err = mailimf_fields_parse( data, length, &curTok, &fields ); | 681 | int err = mailimf_fields_parse( data, length, &curTok, &fields ); |
680 | if (err != MAILIMF_NO_ERROR) { | 682 | if (err != MAILIMF_NO_ERROR) { |
681 | free(data); | 683 | free(data); |
@@ -686,15 +688,28 @@ int SMTPwrapper::sendQueuedMail(MBOXwrapper*wrap,SMTPaccount*smtp,RecMail*which) | |||
686 | rcpts = createRcptList( fields ); | 688 | rcpts = createRcptList( fields ); |
687 | ffrom = getField(fields, MAILIMF_FIELD_FROM ); | 689 | ffrom = getField(fields, MAILIMF_FIELD_FROM ); |
688 | from = getFrom(ffrom); | 690 | from = getFrom(ffrom); |
689 | 691 | ||
690 | qDebug("Size: %i vs. %i",length,strlen(data)); | 692 | qDebug("Size: %i vs. %i",length,strlen(data)); |
691 | if (rcpts && from) { | 693 | if (rcpts && from) { |
692 | return smtpSend(from,rcpts,data,strlen(data),smtp ); | 694 | res = smtpSend(from,rcpts,data,length,smtp ); |
693 | } | 695 | } |
694 | return 0; | 696 | if (fields) { |
697 | mailimf_fields_free(fields); | ||
698 | fields = 0; | ||
699 | } | ||
700 | if (data) { | ||
701 | free(data); | ||
702 | } | ||
703 | if (from) { | ||
704 | free(from); | ||
705 | } | ||
706 | if (rcpts) { | ||
707 | smtp_address_list_free( rcpts ); | ||
708 | } | ||
709 | return res; | ||
695 | } | 710 | } |
696 | 711 | ||
697 | /* this is a special fun */ | 712 | /* this is a special fun */ |
698 | bool SMTPwrapper::flushOutbox(SMTPaccount*smtp) | 713 | bool SMTPwrapper::flushOutbox(SMTPaccount*smtp) |
699 | { | 714 | { |
700 | bool returnValue = true; | 715 | bool returnValue = true; |
@@ -714,15 +729,14 @@ bool SMTPwrapper::flushOutbox(SMTPaccount*smtp) | |||
714 | if (mailsToSend.count()==0) { | 729 | if (mailsToSend.count()==0) { |
715 | delete wrap; | 730 | delete wrap; |
716 | return false; | 731 | return false; |
717 | } | 732 | } |
718 | mailsToSend.setAutoDelete(false); | 733 | mailsToSend.setAutoDelete(false); |
719 | sendProgress = new progressMailSend(); | 734 | sendProgress = new progressMailSend(); |
720 | // sendProgress->showMaximized(); | 735 | sendProgress->show(); |
721 | sendProgress->show(); | 736 | sendProgress->setMaxMails(mailsToSend.count()); |
722 | sendProgress->setMaxMails(mailsToSend.count()); | ||
723 | 737 | ||
724 | while (mailsToSend.count()>0) { | 738 | while (mailsToSend.count()>0) { |
725 | if (sendQueuedMail(wrap,smtp,mailsToSend.at(0))==0) { | 739 | if (sendQueuedMail(wrap,smtp,mailsToSend.at(0))==0) { |
726 | QMessageBox::critical(0,tr("Error sending mail"), | 740 | QMessageBox::critical(0,tr("Error sending mail"), |
727 | tr("Error sending queued mail - breaking")); | 741 | tr("Error sending queued mail - breaking")); |
728 | 742 | ||
@@ -737,8 +751,7 @@ bool SMTPwrapper::flushOutbox(SMTPaccount*smtp) | |||
737 | delete sendProgress; | 751 | delete sendProgress; |
738 | sendProgress = 0; | 752 | sendProgress = 0; |
739 | wrap->deleteMails(mbox,mailsToRemove); | 753 | wrap->deleteMails(mbox,mailsToRemove); |
740 | mailsToSend.setAutoDelete(true); | 754 | mailsToSend.setAutoDelete(true); |
741 | delete wrap; | 755 | delete wrap; |
742 | return returnValue; | 756 | return returnValue; |
743 | |||
744 | } | 757 | } |
diff --git a/noncore/net/mail/mailwrapper.cpp b/noncore/net/mail/mailwrapper.cpp index f8efd09..6479783 100644 --- a/noncore/net/mail/mailwrapper.cpp +++ b/noncore/net/mail/mailwrapper.cpp | |||
@@ -52,13 +52,13 @@ static unsigned char base64chars[] = | |||
52 | QString IMAPFolder::decodeFolderName( const QString &name ) | 52 | QString IMAPFolder::decodeFolderName( const QString &name ) |
53 | { | 53 | { |
54 | unsigned char c, i, bitcount; | 54 | unsigned char c, i, bitcount; |
55 | unsigned long ucs4, utf16, bitbuf; | 55 | unsigned long ucs4, utf16, bitbuf; |
56 | unsigned char base64[256], utf8[6]; | 56 | unsigned char base64[256], utf8[6]; |
57 | unsigned long srcPtr = 0; | 57 | unsigned long srcPtr = 0; |
58 | QCString dst; | 58 | QCString dst = ""; |
59 | QCString src = name.ascii(); | 59 | QCString src = name.ascii(); |
60 | 60 | ||
61 | /* initialize modified base64 decoding table */ | 61 | /* initialize modified base64 decoding table */ |
62 | memset(base64, UNDEFINED, sizeof(base64)); | 62 | memset(base64, UNDEFINED, sizeof(base64)); |
63 | for (i = 0; i < sizeof(base64chars); ++i) { | 63 | for (i = 0; i < sizeof(base64chars); ++i) { |
64 | base64[(int)base64chars[i]] = i; | 64 | base64[(int)base64chars[i]] = i; |
diff --git a/noncore/net/mail/mboxwrapper.cpp b/noncore/net/mail/mboxwrapper.cpp index 293ae1b..6d69263 100644 --- a/noncore/net/mail/mboxwrapper.cpp +++ b/noncore/net/mail/mboxwrapper.cpp | |||
@@ -1,12 +1,13 @@ | |||
1 | #include "mboxwrapper.h" | 1 | #include "mboxwrapper.h" |
2 | #include "mailtypes.h" | 2 | #include "mailtypes.h" |
3 | #include "mailwrapper.h" | 3 | #include "mailwrapper.h" |
4 | #include <libetpan/libetpan.h> | 4 | #include <libetpan/libetpan.h> |
5 | #include <libetpan/mailstorage.h> | 5 | #include <libetpan/mailstorage.h> |
6 | #include <qdir.h> | 6 | #include <qdir.h> |
7 | #include <stdlib.h> | ||
7 | 8 | ||
8 | MBOXwrapper::MBOXwrapper(const QString & mbox_dir) | 9 | MBOXwrapper::MBOXwrapper(const QString & mbox_dir) |
9 | : Genericwrapper(),MBOXPath(mbox_dir) | 10 | : Genericwrapper(),MBOXPath(mbox_dir) |
10 | { | 11 | { |
11 | QDir dir(MBOXPath); | 12 | QDir dir(MBOXPath); |
12 | if (!dir.exists()) { | 13 | if (!dir.exists()) { |
@@ -20,39 +21,45 @@ MBOXwrapper::~MBOXwrapper() | |||
20 | 21 | ||
21 | void MBOXwrapper::listMessages(const QString & mailbox, QList<RecMail> &target ) | 22 | void MBOXwrapper::listMessages(const QString & mailbox, QList<RecMail> &target ) |
22 | { | 23 | { |
23 | mailstorage*storage = mailstorage_new(NULL); | 24 | mailstorage*storage = mailstorage_new(NULL); |
24 | QString p = MBOXPath+"/"; | 25 | QString p = MBOXPath+"/"; |
25 | p+=mailbox; | 26 | p+=mailbox; |
27 | char*fname = 0; | ||
26 | 28 | ||
27 | int r = mbox_mailstorage_init(storage,strdup(p.latin1()),0,0,0); | 29 | fname = strdup(p.latin1()); |
30 | |||
31 | int r = mbox_mailstorage_init(storage,fname,0,0,0); | ||
28 | mailfolder*folder; | 32 | mailfolder*folder; |
29 | folder = mailfolder_new( storage,strdup(p.latin1()),NULL); | 33 | folder = mailfolder_new( storage,fname,NULL); |
30 | r = mailfolder_connect(folder); | 34 | r = mailfolder_connect(folder); |
31 | if (r != MAIL_NO_ERROR) { | 35 | if (r != MAIL_NO_ERROR) { |
32 | qDebug("Error initializing mbox"); | 36 | qDebug("Error initializing mbox"); |
33 | mailfolder_free(folder); | 37 | mailfolder_free(folder); |
34 | mailstorage_free(storage); | 38 | mailstorage_free(storage); |
39 | free(fname); | ||
35 | return; | 40 | return; |
36 | } | 41 | } |
37 | mailmessage_list * env_list = 0; | 42 | mailmessage_list * env_list = 0; |
38 | r = mailsession_get_messages_list(folder->fld_session,&env_list); | 43 | r = mailsession_get_messages_list(folder->fld_session,&env_list); |
39 | if (r != MAIL_NO_ERROR) { | 44 | if (r != MAIL_NO_ERROR) { |
40 | qDebug("Error message list"); | 45 | qDebug("Error message list"); |
41 | mailfolder_free(folder); | 46 | mailfolder_free(folder); |
42 | mailstorage_free(storage); | 47 | mailstorage_free(storage); |
48 | free(fname); | ||
43 | return; | 49 | return; |
44 | } | 50 | } |
45 | r = mailsession_get_envelopes_list(folder->fld_session, env_list); | 51 | r = mailsession_get_envelopes_list(folder->fld_session, env_list); |
46 | if (r != MAIL_NO_ERROR) { | 52 | if (r != MAIL_NO_ERROR) { |
47 | qDebug("Error filling message list"); | 53 | qDebug("Error filling message list"); |
48 | if (env_list) { | 54 | if (env_list) { |
49 | mailmessage_list_free(env_list); | 55 | mailmessage_list_free(env_list); |
50 | } | 56 | } |
51 | mailfolder_free(folder); | 57 | mailfolder_free(folder); |
52 | mailstorage_free(storage); | 58 | mailstorage_free(storage); |
59 | free(fname); | ||
53 | return; | 60 | return; |
54 | } | 61 | } |
55 | mailimf_references * refs; | 62 | mailimf_references * refs; |
56 | 63 | ||
57 | for(int i = 0 ; i < carray_count(env_list->msg_tab) ; ++i) { | 64 | for(int i = 0 ; i < carray_count(env_list->msg_tab) ; ++i) { |
58 | mailmessage * msg; | 65 | mailmessage * msg; |
@@ -100,12 +107,13 @@ void MBOXwrapper::listMessages(const QString & mailbox, QList<RecMail> &target ) | |||
100 | if (env_list) { | 107 | if (env_list) { |
101 | mailmessage_list_free(env_list); | 108 | mailmessage_list_free(env_list); |
102 | } | 109 | } |
103 | mailfolder_disconnect(folder); | 110 | mailfolder_disconnect(folder); |
104 | mailfolder_free(folder); | 111 | mailfolder_free(folder); |
105 | mailstorage_free(storage); | 112 | mailstorage_free(storage); |
113 | free(fname); | ||
106 | } | 114 | } |
107 | 115 | ||
108 | QList<Folder>* MBOXwrapper::listFolders() | 116 | QList<Folder>* MBOXwrapper::listFolders() |
109 | { | 117 | { |
110 | QList<Folder> * folders = new QList<Folder>(); | 118 | QList<Folder> * folders = new QList<Folder>(); |
111 | folders->setAutoDelete( false ); | 119 | folders->setAutoDelete( false ); |
diff --git a/noncore/net/mail/smtpwrapper.cpp b/noncore/net/mail/smtpwrapper.cpp index a7e4837..21992b4 100644 --- a/noncore/net/mail/smtpwrapper.cpp +++ b/noncore/net/mail/smtpwrapper.cpp | |||
@@ -438,13 +438,15 @@ char *SMTPwrapper::getFrom( mailimf_field *ffrom) | |||
438 | 438 | ||
439 | return from; | 439 | return from; |
440 | } | 440 | } |
441 | 441 | ||
442 | char *SMTPwrapper::getFrom( mailmime *mail ) | 442 | char *SMTPwrapper::getFrom( mailmime *mail ) |
443 | { | 443 | { |
444 | /* no need to delete - its just a pointer to structure content */ | ||
444 | mailimf_field *ffrom = 0; | 445 | mailimf_field *ffrom = 0; |
446 | char*f = 0; | ||
445 | ffrom = getField( mail->mm_data.mm_message.mm_fields, MAILIMF_FIELD_FROM ); | 447 | ffrom = getField( mail->mm_data.mm_message.mm_fields, MAILIMF_FIELD_FROM ); |
446 | return getFrom(ffrom); | 448 | return getFrom(ffrom); |
447 | } | 449 | } |
448 | 450 | ||
449 | SMTPaccount *SMTPwrapper::getAccount(const QString&name ) | 451 | SMTPaccount *SMTPwrapper::getAccount(const QString&name ) |
450 | { | 452 | { |
@@ -560,12 +562,15 @@ void SMTPwrapper::smtpSend( mailmime *mail,bool later, SMTPaccount *smtp ) | |||
560 | if (data) free( data ); | 562 | if (data) free( data ); |
561 | return; | 563 | return; |
562 | } | 564 | } |
563 | from = getFrom( mail ); | 565 | from = getFrom( mail ); |
564 | rcpts = createRcptList( mail->mm_data.mm_message.mm_fields ); | 566 | rcpts = createRcptList( mail->mm_data.mm_message.mm_fields ); |
565 | smtpSend(from,rcpts,data,size,smtp); | 567 | smtpSend(from,rcpts,data,size,smtp); |
568 | if (data) {free(data);} | ||
569 | if (from) {free(from);} | ||
570 | if (rcpts) smtp_address_list_free( rcpts ); | ||
566 | } | 571 | } |
567 | 572 | ||
568 | int SMTPwrapper::smtpSend(char*from,clist*rcpts,char*data,size_t size, SMTPaccount *smtp ) | 573 | int SMTPwrapper::smtpSend(char*from,clist*rcpts,char*data,size_t size, SMTPaccount *smtp ) |
569 | { | 574 | { |
570 | char *server, *user, *pass; | 575 | char *server, *user, *pass; |
571 | bool ssl; | 576 | bool ssl; |
@@ -627,16 +632,13 @@ int SMTPwrapper::smtpSend(char*from,clist*rcpts,char*data,size_t size, SMTPaccou | |||
627 | 632 | ||
628 | free_con_session: | 633 | free_con_session: |
629 | mailsmtp_quit( session ); | 634 | mailsmtp_quit( session ); |
630 | free_mem_session: | 635 | free_mem_session: |
631 | mailsmtp_free( session ); | 636 | mailsmtp_free( session ); |
632 | free_mem: | 637 | free_mem: |
633 | if (rcpts) smtp_address_list_free( rcpts ); | ||
634 | if (data) free( data ); | ||
635 | if (server) free( server ); | 638 | if (server) free( server ); |
636 | if (from) free( from ); | ||
637 | if ( smtp->getLogin() ) { | 639 | if ( smtp->getLogin() ) { |
638 | free( user ); | 640 | free( user ); |
639 | free( pass ); | 641 | free( pass ); |
640 | } | 642 | } |
641 | return result; | 643 | return result; |
642 | } | 644 | } |
@@ -649,13 +651,12 @@ void SMTPwrapper::sendMail(const Mail&mail,bool later ) | |||
649 | 651 | ||
650 | mimeMail = createMimeMail(mail ); | 652 | mimeMail = createMimeMail(mail ); |
651 | if ( mimeMail == NULL ) { | 653 | if ( mimeMail == NULL ) { |
652 | qDebug( "sendMail: error creating mime mail" ); | 654 | qDebug( "sendMail: error creating mime mail" ); |
653 | } else { | 655 | } else { |
654 | sendProgress = new progressMailSend(); | 656 | sendProgress = new progressMailSend(); |
655 | // sendProgress->showMaximized(); | ||
656 | sendProgress->show(); | 657 | sendProgress->show(); |
657 | sendProgress->setMaxMails(1); | 658 | sendProgress->setMaxMails(1); |
658 | smtpSend( mimeMail,later,smtp); | 659 | smtpSend( mimeMail,later,smtp); |
659 | mailmime_free( mimeMail ); | 660 | mailmime_free( mimeMail ); |
660 | qDebug("Clean up done"); | 661 | qDebug("Clean up done"); |
661 | sendProgress->hide(); | 662 | sendProgress->hide(); |
@@ -670,12 +671,13 @@ int SMTPwrapper::sendQueuedMail(MBOXwrapper*wrap,SMTPaccount*smtp,RecMail*which) | |||
670 | size_t length = 0; | 671 | size_t length = 0; |
671 | size_t curTok = 0; | 672 | size_t curTok = 0; |
672 | mailimf_fields *fields = 0; | 673 | mailimf_fields *fields = 0; |
673 | mailimf_field*ffrom = 0; | 674 | mailimf_field*ffrom = 0; |
674 | clist *rcpts = 0; | 675 | clist *rcpts = 0; |
675 | char*from = 0; | 676 | char*from = 0; |
677 | int res = 0; | ||
676 | 678 | ||
677 | wrap->fetchRawBody(*which,&data,&length); | 679 | wrap->fetchRawBody(*which,&data,&length); |
678 | if (!data) return 0; | 680 | if (!data) return 0; |
679 | int err = mailimf_fields_parse( data, length, &curTok, &fields ); | 681 | int err = mailimf_fields_parse( data, length, &curTok, &fields ); |
680 | if (err != MAILIMF_NO_ERROR) { | 682 | if (err != MAILIMF_NO_ERROR) { |
681 | free(data); | 683 | free(data); |
@@ -686,15 +688,28 @@ int SMTPwrapper::sendQueuedMail(MBOXwrapper*wrap,SMTPaccount*smtp,RecMail*which) | |||
686 | rcpts = createRcptList( fields ); | 688 | rcpts = createRcptList( fields ); |
687 | ffrom = getField(fields, MAILIMF_FIELD_FROM ); | 689 | ffrom = getField(fields, MAILIMF_FIELD_FROM ); |
688 | from = getFrom(ffrom); | 690 | from = getFrom(ffrom); |
689 | 691 | ||
690 | qDebug("Size: %i vs. %i",length,strlen(data)); | 692 | qDebug("Size: %i vs. %i",length,strlen(data)); |
691 | if (rcpts && from) { | 693 | if (rcpts && from) { |
692 | return smtpSend(from,rcpts,data,strlen(data),smtp ); | 694 | res = smtpSend(from,rcpts,data,length,smtp ); |
693 | } | 695 | } |
694 | return 0; | 696 | if (fields) { |
697 | mailimf_fields_free(fields); | ||
698 | fields = 0; | ||
699 | } | ||
700 | if (data) { | ||
701 | free(data); | ||
702 | } | ||
703 | if (from) { | ||
704 | free(from); | ||
705 | } | ||
706 | if (rcpts) { | ||
707 | smtp_address_list_free( rcpts ); | ||
708 | } | ||
709 | return res; | ||
695 | } | 710 | } |
696 | 711 | ||
697 | /* this is a special fun */ | 712 | /* this is a special fun */ |
698 | bool SMTPwrapper::flushOutbox(SMTPaccount*smtp) | 713 | bool SMTPwrapper::flushOutbox(SMTPaccount*smtp) |
699 | { | 714 | { |
700 | bool returnValue = true; | 715 | bool returnValue = true; |
@@ -714,15 +729,14 @@ bool SMTPwrapper::flushOutbox(SMTPaccount*smtp) | |||
714 | if (mailsToSend.count()==0) { | 729 | if (mailsToSend.count()==0) { |
715 | delete wrap; | 730 | delete wrap; |
716 | return false; | 731 | return false; |
717 | } | 732 | } |
718 | mailsToSend.setAutoDelete(false); | 733 | mailsToSend.setAutoDelete(false); |
719 | sendProgress = new progressMailSend(); | 734 | sendProgress = new progressMailSend(); |
720 | // sendProgress->showMaximized(); | 735 | sendProgress->show(); |
721 | sendProgress->show(); | 736 | sendProgress->setMaxMails(mailsToSend.count()); |
722 | sendProgress->setMaxMails(mailsToSend.count()); | ||
723 | 737 | ||
724 | while (mailsToSend.count()>0) { | 738 | while (mailsToSend.count()>0) { |
725 | if (sendQueuedMail(wrap,smtp,mailsToSend.at(0))==0) { | 739 | if (sendQueuedMail(wrap,smtp,mailsToSend.at(0))==0) { |
726 | QMessageBox::critical(0,tr("Error sending mail"), | 740 | QMessageBox::critical(0,tr("Error sending mail"), |
727 | tr("Error sending queued mail - breaking")); | 741 | tr("Error sending queued mail - breaking")); |
728 | 742 | ||
@@ -737,8 +751,7 @@ bool SMTPwrapper::flushOutbox(SMTPaccount*smtp) | |||
737 | delete sendProgress; | 751 | delete sendProgress; |
738 | sendProgress = 0; | 752 | sendProgress = 0; |
739 | wrap->deleteMails(mbox,mailsToRemove); | 753 | wrap->deleteMails(mbox,mailsToRemove); |
740 | mailsToSend.setAutoDelete(true); | 754 | mailsToSend.setAutoDelete(true); |
741 | delete wrap; | 755 | delete wrap; |
742 | return returnValue; | 756 | return returnValue; |
743 | |||
744 | } | 757 | } |