summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/imapwrapper.cpp9
-rw-r--r--noncore/net/mail/libmailwrapper/imapwrapper.cpp9
2 files changed, 14 insertions, 4 deletions
diff --git a/noncore/net/mail/imapwrapper.cpp b/noncore/net/mail/imapwrapper.cpp
index 89ec7ab..ab20249 100644
--- a/noncore/net/mail/imapwrapper.cpp
+++ b/noncore/net/mail/imapwrapper.cpp
@@ -30,14 +30,19 @@ void IMAPwrapper::login()
uint16_t port;
int err = MAILIMAP_NO_ERROR;
/* we are connected this moment */
/* TODO: setup a timer holding the line or if connection closed - delete the value */
if (m_imap) {
- mailstream_flush(m_imap->imap_stream);
- return;
+ err = mailimap_noop(m_imap);
+ if (err!=MAILIMAP_NO_ERROR) {
+ logout();
+ } else {
+ mailstream_flush(m_imap->imap_stream);
+ return;
+ }
}
server = account->getServer().latin1();
port = account->getPort().toUInt();
if ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) {
LoginDialog login( account->getUser(), account->getPassword(), NULL, 0, true );
login.show();
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp
index 89ec7ab..ab20249 100644
--- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp
@@ -30,14 +30,19 @@ void IMAPwrapper::login()
uint16_t port;
int err = MAILIMAP_NO_ERROR;
/* we are connected this moment */
/* TODO: setup a timer holding the line or if connection closed - delete the value */
if (m_imap) {
- mailstream_flush(m_imap->imap_stream);
- return;
+ err = mailimap_noop(m_imap);
+ if (err!=MAILIMAP_NO_ERROR) {
+ logout();
+ } else {
+ mailstream_flush(m_imap->imap_stream);
+ return;
+ }
}
server = account->getServer().latin1();
port = account->getPort().toUInt();
if ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) {
LoginDialog login( account->getUser(), account->getPassword(), NULL, 0, true );
login.show();