summaryrefslogtreecommitdiff
authorharlekin <harlekin>2003-12-10 02:02:53 (UTC)
committer harlekin <harlekin>2003-12-10 02:02:53 (UTC)
commit1f0b92e554b76852af210ceb277b3e9ecb09a43d (patch) (unidiff)
treea813761b2f0d1a2b8a9a1a996d6e37d511d24f0f
parenta908d0ffdb5cee72b7823fc411119b8e1e3faad8 (diff)
downloadopie-1f0b92e554b76852af210ceb277b3e9ecb09a43d.zip
opie-1f0b92e554b76852af210ceb277b3e9ecb09a43d.tar.gz
opie-1f0b92e554b76852af210ceb277b3e9ecb09a43d.tar.bz2
ssl for imap now working
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/imapwrapper.cpp60
-rw-r--r--noncore/net/mail/libmailwrapper/imapwrapper.cpp60
-rw-r--r--noncore/net/mail/mainwindow.cpp2
3 files changed, 67 insertions, 55 deletions
diff --git a/noncore/net/mail/imapwrapper.cpp b/noncore/net/mail/imapwrapper.cpp
index eae85a7..dc02780 100644
--- a/noncore/net/mail/imapwrapper.cpp
+++ b/noncore/net/mail/imapwrapper.cpp
@@ -29,3 +29,3 @@ void IMAPwrapper::login()
29 int err = MAILIMAP_NO_ERROR; 29 int err = MAILIMAP_NO_ERROR;
30 30
31 server = account->getServer().latin1(); 31 server = account->getServer().latin1();
@@ -34,7 +34,13 @@ void IMAPwrapper::login()
34 pass = account->getPassword().latin1(); 34 pass = account->getPassword().latin1();
35 35
36 m_imap = mailimap_new( 20, &imap_progress ); 36 m_imap = mailimap_new( 20, &imap_progress );
37 /* connect */ 37 /* connect */
38 err = mailimap_socket_connect( m_imap, (char*)server, port ); 38 // err = mailimap_socket_connect( m_imap, (char*)server, port );
39 if ( err != MAILIMAP_NO_ERROR && 39 if (account->getSSL()) {
40 err = mailimap_ssl_connect( m_imap, (char*)server, port );
41 } else {
42 err = mailimap_socket_connect( m_imap, (char*)server, port );
43 }
44
45 if ( err != MAILIMAP_NO_ERROR &&
40 err != MAILIMAP_NO_ERROR_AUTHENTICATED && 46 err != MAILIMAP_NO_ERROR_AUTHENTICATED &&
@@ -46,3 +52,3 @@ void IMAPwrapper::login()
46 } 52 }
47 53
48 /* login */ 54 /* login */
@@ -76,3 +82,3 @@ void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target )
76 mailimap_set *set; 82 mailimap_set *set;
77 83
78 mb = mailbox.latin1(); 84 mb = mailbox.latin1();
@@ -97,4 +103,4 @@ void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target )
97 } 103 }
98 104
99 result = clist_new(); 105 result = clist_new();
100 /* the range has to start at 1!!! not with 0!!!! */ 106 /* the range has to start at 1!!! not with 0!!!! */
@@ -104,3 +110,3 @@ void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target )
104 fetchAttDate = mailimap_fetch_att_new_internaldate(); 110 fetchAttDate = mailimap_fetch_att_new_internaldate();
105 111
106 //fetchType = mailimap_fetch_type_new_fetch_att(fetchAtt); 112 //fetchType = mailimap_fetch_type_new_fetch_att(fetchAtt);
@@ -110,3 +116,3 @@ void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target )
110 mailimap_fetch_type_new_fetch_att_list_add(fetchType,fetchAttDate); 116 mailimap_fetch_type_new_fetch_att_list_add(fetchType,fetchAttDate);
111 117
112 err = mailimap_fetch( m_imap, set, fetchType, &result ); 118 err = mailimap_fetch( m_imap, set, fetchType, &result );
@@ -146,3 +152,3 @@ QList<IMAPFolder>* IMAPwrapper::listFolders()
146 clistcell *current; 152 clistcell *current;
147 153
148 QList<IMAPFolder> * folders = new QList<IMAPFolder>(); 154 QList<IMAPFolder> * folders = new QList<IMAPFolder>();
@@ -153,3 +159,3 @@ QList<IMAPFolder>* IMAPwrapper::listFolders()
153 } 159 }
154 160
155/* 161/*
@@ -178,3 +184,3 @@ QList<IMAPFolder>* IMAPwrapper::listFolders()
178 mailimap_list_result_free( result ); 184 mailimap_list_result_free( result );
179 185
180/* 186/*
@@ -182,3 +188,3 @@ QList<IMAPFolder>* IMAPwrapper::listFolders()
182 */ 188 */
183 mask = "*" ; 189 mask = "*" ;
184 path = account->getPrefix().latin1(); 190 path = account->getPrefix().latin1();
@@ -198,3 +204,3 @@ QList<IMAPFolder>* IMAPwrapper::listFolders()
198 folders->append(new IMAPFolder(temp)); 204 folders->append(new IMAPFolder(temp));
199 205
200 } 206 }
@@ -216,3 +222,3 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att)
216 QStringList addresslist; 222 QStringList addresslist;
217 223
218 if (!m_att) { 224 if (!m_att) {
@@ -331,5 +337,5 @@ RecBody IMAPwrapper::fetchBody(const RecMail&mail)
331 mailimap_body*body_desc; 337 mailimap_body*body_desc;
332 338
333 mb = mail.getMbox().latin1(); 339 mb = mail.getMbox().latin1();
334 340
335 login(); 341 login();
@@ -345,6 +351,6 @@ RecBody IMAPwrapper::fetchBody(const RecMail&mail)
345 } 351 }
346 result = clist_new(); 352 result = clist_new();
347 /* the range has to start at 1!!! not with 0!!!! */ 353 /* the range has to start at 1!!! not with 0!!!! */
348 set = mailimap_set_new_interval( mail.getNumber(),mail.getNumber() ); 354 set = mailimap_set_new_interval( mail.getNumber(),mail.getNumber() );
349 fetchAtt = mailimap_fetch_att_new_body(); 355 fetchAtt = mailimap_fetch_att_new_body();
350 fetchType = mailimap_fetch_type_new_fetch_att(fetchAtt); 356 fetchType = mailimap_fetch_type_new_fetch_att(fetchAtt);
@@ -363,3 +369,3 @@ RecBody IMAPwrapper::fetchBody(const RecMail&mail)
363 } 369 }
364 370
365 } else { 371 } else {
@@ -369,3 +375,3 @@ RecBody IMAPwrapper::fetchBody(const RecMail&mail)
369 clist_free(result); 375 clist_free(result);
370 logout(); 376 logout();
371 return body; 377 return body;
@@ -398,5 +404,5 @@ void IMAPwrapper::fillPlainBody(const RecMail&mail,RecBody&target_body, mailimap
398 mailimap_set *set; 404 mailimap_set *set;
399 405
400 mb = mail.getMbox().latin1(); 406 mb = mail.getMbox().latin1();
401 407
402 if (!m_imap) { 408 if (!m_imap) {
@@ -405,3 +411,3 @@ void IMAPwrapper::fillPlainBody(const RecMail&mail,RecBody&target_body, mailimap
405 411
406 result = clist_new(); 412 result = clist_new();
407 /* the range has to start at 1!!! not with 0!!!! */ 413 /* the range has to start at 1!!! not with 0!!!! */
@@ -413,3 +419,3 @@ void IMAPwrapper::fillPlainBody(const RecMail&mail,RecBody&target_body, mailimap
413 mailimap_fetch_type_free( fetchType ); 419 mailimap_fetch_type_free( fetchType );
414 420
415 if (err == MAILIMAP_NO_ERROR && (current=clist_begin(result)) ) { 421 if (err == MAILIMAP_NO_ERROR && (current=clist_begin(result)) ) {
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp
index eae85a7..dc02780 100644
--- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp
@@ -29,3 +29,3 @@ void IMAPwrapper::login()
29 int err = MAILIMAP_NO_ERROR; 29 int err = MAILIMAP_NO_ERROR;
30 30
31 server = account->getServer().latin1(); 31 server = account->getServer().latin1();
@@ -34,7 +34,13 @@ void IMAPwrapper::login()
34 pass = account->getPassword().latin1(); 34 pass = account->getPassword().latin1();
35 35
36 m_imap = mailimap_new( 20, &imap_progress ); 36 m_imap = mailimap_new( 20, &imap_progress );
37 /* connect */ 37 /* connect */
38 err = mailimap_socket_connect( m_imap, (char*)server, port ); 38 // err = mailimap_socket_connect( m_imap, (char*)server, port );
39 if ( err != MAILIMAP_NO_ERROR && 39 if (account->getSSL()) {
40 err = mailimap_ssl_connect( m_imap, (char*)server, port );
41 } else {
42 err = mailimap_socket_connect( m_imap, (char*)server, port );
43 }
44
45 if ( err != MAILIMAP_NO_ERROR &&
40 err != MAILIMAP_NO_ERROR_AUTHENTICATED && 46 err != MAILIMAP_NO_ERROR_AUTHENTICATED &&
@@ -46,3 +52,3 @@ void IMAPwrapper::login()
46 } 52 }
47 53
48 /* login */ 54 /* login */
@@ -76,3 +82,3 @@ void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target )
76 mailimap_set *set; 82 mailimap_set *set;
77 83
78 mb = mailbox.latin1(); 84 mb = mailbox.latin1();
@@ -97,4 +103,4 @@ void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target )
97 } 103 }
98 104
99 result = clist_new(); 105 result = clist_new();
100 /* the range has to start at 1!!! not with 0!!!! */ 106 /* the range has to start at 1!!! not with 0!!!! */
@@ -104,3 +110,3 @@ void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target )
104 fetchAttDate = mailimap_fetch_att_new_internaldate(); 110 fetchAttDate = mailimap_fetch_att_new_internaldate();
105 111
106 //fetchType = mailimap_fetch_type_new_fetch_att(fetchAtt); 112 //fetchType = mailimap_fetch_type_new_fetch_att(fetchAtt);
@@ -110,3 +116,3 @@ void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target )
110 mailimap_fetch_type_new_fetch_att_list_add(fetchType,fetchAttDate); 116 mailimap_fetch_type_new_fetch_att_list_add(fetchType,fetchAttDate);
111 117
112 err = mailimap_fetch( m_imap, set, fetchType, &result ); 118 err = mailimap_fetch( m_imap, set, fetchType, &result );
@@ -146,3 +152,3 @@ QList<IMAPFolder>* IMAPwrapper::listFolders()
146 clistcell *current; 152 clistcell *current;
147 153
148 QList<IMAPFolder> * folders = new QList<IMAPFolder>(); 154 QList<IMAPFolder> * folders = new QList<IMAPFolder>();
@@ -153,3 +159,3 @@ QList<IMAPFolder>* IMAPwrapper::listFolders()
153 } 159 }
154 160
155/* 161/*
@@ -178,3 +184,3 @@ QList<IMAPFolder>* IMAPwrapper::listFolders()
178 mailimap_list_result_free( result ); 184 mailimap_list_result_free( result );
179 185
180/* 186/*
@@ -182,3 +188,3 @@ QList<IMAPFolder>* IMAPwrapper::listFolders()
182 */ 188 */
183 mask = "*" ; 189 mask = "*" ;
184 path = account->getPrefix().latin1(); 190 path = account->getPrefix().latin1();
@@ -198,3 +204,3 @@ QList<IMAPFolder>* IMAPwrapper::listFolders()
198 folders->append(new IMAPFolder(temp)); 204 folders->append(new IMAPFolder(temp));
199 205
200 } 206 }
@@ -216,3 +222,3 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att)
216 QStringList addresslist; 222 QStringList addresslist;
217 223
218 if (!m_att) { 224 if (!m_att) {
@@ -331,5 +337,5 @@ RecBody IMAPwrapper::fetchBody(const RecMail&mail)
331 mailimap_body*body_desc; 337 mailimap_body*body_desc;
332 338
333 mb = mail.getMbox().latin1(); 339 mb = mail.getMbox().latin1();
334 340
335 login(); 341 login();
@@ -345,6 +351,6 @@ RecBody IMAPwrapper::fetchBody(const RecMail&mail)
345 } 351 }
346 result = clist_new(); 352 result = clist_new();
347 /* the range has to start at 1!!! not with 0!!!! */ 353 /* the range has to start at 1!!! not with 0!!!! */
348 set = mailimap_set_new_interval( mail.getNumber(),mail.getNumber() ); 354 set = mailimap_set_new_interval( mail.getNumber(),mail.getNumber() );
349 fetchAtt = mailimap_fetch_att_new_body(); 355 fetchAtt = mailimap_fetch_att_new_body();
350 fetchType = mailimap_fetch_type_new_fetch_att(fetchAtt); 356 fetchType = mailimap_fetch_type_new_fetch_att(fetchAtt);
@@ -363,3 +369,3 @@ RecBody IMAPwrapper::fetchBody(const RecMail&mail)
363 } 369 }
364 370
365 } else { 371 } else {
@@ -369,3 +375,3 @@ RecBody IMAPwrapper::fetchBody(const RecMail&mail)
369 clist_free(result); 375 clist_free(result);
370 logout(); 376 logout();
371 return body; 377 return body;
@@ -398,5 +404,5 @@ void IMAPwrapper::fillPlainBody(const RecMail&mail,RecBody&target_body, mailimap
398 mailimap_set *set; 404 mailimap_set *set;
399 405
400 mb = mail.getMbox().latin1(); 406 mb = mail.getMbox().latin1();
401 407
402 if (!m_imap) { 408 if (!m_imap) {
@@ -405,3 +411,3 @@ void IMAPwrapper::fillPlainBody(const RecMail&mail,RecBody&target_body, mailimap
405 411
406 result = clist_new(); 412 result = clist_new();
407 /* the range has to start at 1!!! not with 0!!!! */ 413 /* the range has to start at 1!!! not with 0!!!! */
@@ -413,3 +419,3 @@ void IMAPwrapper::fillPlainBody(const RecMail&mail,RecBody&target_body, mailimap
413 mailimap_fetch_type_free( fetchType ); 419 mailimap_fetch_type_free( fetchType );
414 420
415 if (err == MAILIMAP_NO_ERROR && (current=clist_begin(result)) ) { 421 if (err == MAILIMAP_NO_ERROR && (current=clist_begin(result)) ) {
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp
index 3edfff1..6d13a8b 100644
--- a/noncore/net/mail/mainwindow.cpp
+++ b/noncore/net/mail/mainwindow.cpp
@@ -17,3 +17,3 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
17{ 17{
18 setCaption( tr( "Opie-Mail" ) ); 18 setCaption( tr( "Mail" ) );
19 setToolBarsMovable( false ); 19 setToolBarsMovable( false );