summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/libmailwrapper/imapwrapper.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp
index 576804d..9e58303 100644
--- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp
@@ -19,65 +19,65 @@ IMAPwrapper::IMAPwrapper( IMAPaccount *a )
19 19
20IMAPwrapper::~IMAPwrapper() 20IMAPwrapper::~IMAPwrapper()
21{ 21{
22 logout(); 22 logout();
23} 23}
24 24
25/* to avoid to often select statements in loops etc. 25/* to avoid to often select statements in loops etc.
26 we trust that we are logged in and connection is established!*/ 26 we trust that we are logged in and connection is established!*/
27int IMAPwrapper::selectMbox(const QString&mbox) 27int IMAPwrapper::selectMbox(const QString&mbox)
28{ 28{
29 if (mbox == m_Lastmbox) { 29 if (mbox == m_Lastmbox) {
30 return MAILIMAP_NO_ERROR; 30 return MAILIMAP_NO_ERROR;
31 } 31 }
32 int err = mailimap_select( m_imap, (char*)mbox.latin1()); 32 int err = mailimap_select( m_imap, (char*)mbox.latin1());
33 if ( err != MAILIMAP_NO_ERROR ) { 33 if ( err != MAILIMAP_NO_ERROR ) {
34 odebug << "error selecting mailbox: " << m_imap->imap_response << "" << oendl; 34 odebug << "error selecting mailbox: " << m_imap->imap_response << "" << oendl;
35 m_Lastmbox = ""; 35 m_Lastmbox = "";
36 return err; 36 return err;
37 } 37 }
38 m_Lastmbox = mbox; 38 m_Lastmbox = mbox;
39 return err; 39 return err;
40} 40}
41 41
42void IMAPwrapper::imap_progress( size_t current, size_t maximum ) 42void IMAPwrapper::imap_progress( size_t current, size_t maximum )
43{ 43{
44 qApp->processEvents(); 44 qApp->processEvents();
45 odebug << "IMAP: " << current << " of " << maximum << "" << oendl; 45 odebug << "IMAP: " << current << " of " << maximum << "" << oendl;
46} 46}
47 47
48bool IMAPwrapper::start_tls(bool force_tls) 48bool IMAPwrapper::start_tls(bool force_tls)
49{ 49{
50 int err; 50 int err;
51 bool try_tls; 51 bool try_tls=false;
52 mailimap_capability_data * cap_data = 0; 52 mailimap_capability_data * cap_data = 0;
53 53
54 err = mailimap_capability(m_imap,&cap_data); 54 err = mailimap_capability(m_imap,&cap_data);
55 if (err != MAILIMAP_NO_ERROR) { 55 if (err != MAILIMAP_NO_ERROR) {
56 Global::statusMessage("error getting capabilities!"); 56 Global::statusMessage("error getting capabilities!");
57 odebug << "error getting capabilities!" << oendl; 57 odebug << "error getting capabilities!" << oendl;
58 return false; 58 return false;
59 } 59 }
60 clistiter * cur; 60 clistiter * cur;
61 for(cur = clist_begin(cap_data->cap_list) ; cur != NULL;cur = clist_next(cur)) { 61 for(cur = clist_begin(cap_data->cap_list) ; cur != NULL;cur = clist_next(cur)) {
62 struct mailimap_capability * cap; 62 struct mailimap_capability * cap;
63 cap = (struct mailimap_capability *)clist_content(cur); 63 cap = (struct mailimap_capability *)clist_content(cur);
64 if (cap->cap_type == MAILIMAP_CAPABILITY_NAME) { 64 if (cap->cap_type == MAILIMAP_CAPABILITY_NAME) {
65 if (strcasecmp(cap->cap_data.cap_name, "STARTTLS") == 0) { 65 if (strcasecmp(cap->cap_data.cap_name, "STARTTLS") == 0) {
66 try_tls = true; 66 try_tls = true;
67 break; 67 break;
68 } 68 }
69 } 69 }
70 } 70 }
71 if (cap_data) { 71 if (cap_data) {
72 mailimap_capability_data_free(cap_data); 72 mailimap_capability_data_free(cap_data);
73 } 73 }
74 if (try_tls) { 74 if (try_tls) {
75 err = mailimap_starttls(m_imap); 75 err = mailimap_starttls(m_imap);
76 if (err != MAILIMAP_NO_ERROR) { 76 if (err != MAILIMAP_NO_ERROR) {
77 if (force_tls) { 77 if (force_tls) {
78 Global::statusMessage(tr("Server has no TLS support!")); 78 Global::statusMessage(tr("Server has no TLS support!"));
79 odebug << "Server has no TLS support!" << oendl; 79 odebug << "Server has no TLS support!" << oendl;
80 } 80 }
81 try_tls = false; 81 try_tls = false;
82 } else { 82 } else {
83 mailstream_low * low; 83 mailstream_low * low;