Diffstat (limited to 'noncore/net/mail/libmailwrapper/imapwrapper.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp index f1d42c2..0c1e05e 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp @@ -44,14 +44,14 @@ void IMAPwrapper::login() port = account->getPort().toUInt(); if ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) { LoginDialog login( account->getUser(), account->getPassword(), NULL, 0, true ); login.show(); if ( QDialog::Accepted == login.exec() ) { // ok - user = strdup( login.getUser().latin1() ); - pass = strdup( login.getPassword().latin1() ); + user = login.getUser().latin1(); + pass = login.getPassword().latin1(); } else { // cancel qDebug( "IMAP: Login canceled" ); return; } } else { @@ -971,6 +971,17 @@ void IMAPwrapper::statusFolder(folderStat&target_stat,const QString & mailbox) break; } } mailimap_mailbox_data_status_free(status); mailimap_status_att_list_free(att_list); } + +void IMAPwrapper::storeMessage(const char*msg,size_t length, const QString&folder) +{ + login(); + if (!m_imap) return; + if (!msg) return; + int r = mailimap_append(m_imap,(char*)folder.latin1(),0,0,msg,length); + if (r != MAILIMAP_NO_ERROR) { + Global::statusMessage("Error storing mail!"); + } +} |