-rw-r--r-- | noncore/net/mail/libmailwrapper/abstractmail.h | 8 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/genericwrapper.h | 3 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.cpp | 15 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.h | 3 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/libmailwrapper.pro | 6 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/pop3wrapper.cpp | 8 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/pop3wrapper.h | 4 |
7 files changed, 38 insertions, 9 deletions
diff --git a/noncore/net/mail/libmailwrapper/abstractmail.h b/noncore/net/mail/libmailwrapper/abstractmail.h index ca9caed..a070fb0 100644 --- a/noncore/net/mail/libmailwrapper/abstractmail.h +++ b/noncore/net/mail/libmailwrapper/abstractmail.h @@ -31,6 +31,7 @@ public: virtual void answeredMail(const RecMail&mail)=0; - virtual void cleanMimeCache(){}; - virtual int deleteAllMail(const Folder*){return 1;} - virtual int deleteMbox(const Folder*){return 1;} + virtual int deleteAllMail(const Folder*)=0; + virtual int deleteMbox(const Folder*)=0; + virtual void storeMessage(const char*msg,size_t length, const QString&folder)=0; + virtual void cleanMimeCache(){}; /* mail box methods */ @@ -41,2 +42,3 @@ public: virtual int createMbox(const QString&,const Folder*parentfolder=0,const QString& delemiter="/",bool getsubfolder=false); + virtual void logout()=0; diff --git a/noncore/net/mail/libmailwrapper/genericwrapper.h b/noncore/net/mail/libmailwrapper/genericwrapper.h index 32b75c8..1d65c0a 100644 --- a/noncore/net/mail/libmailwrapper/genericwrapper.h +++ b/noncore/net/mail/libmailwrapper/genericwrapper.h @@ -37,2 +37,5 @@ public: virtual void cleanMimeCache(); + virtual int deleteMbox(const Folder*){return 1;} + virtual void logout(){}; + virtual void storeMessage(const char*msg,size_t length, const QString&folder){}; 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 @@ -49,4 +49,4 @@ void IMAPwrapper::login() // ok - user = strdup( login.getUser().latin1() ); - pass = strdup( login.getPassword().latin1() ); + user = login.getUser().latin1(); + pass = login.getPassword().latin1(); } else { @@ -976 +976,12 @@ void IMAPwrapper::statusFolder(folderStat&target_stat,const QString & mailbox) } + +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!"); + } +} diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.h b/noncore/net/mail/libmailwrapper/imapwrapper.h index 8f5a2b5..a97f12d 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.h +++ b/noncore/net/mail/libmailwrapper/imapwrapper.h @@ -32,2 +32,3 @@ public: virtual int deleteAllMail(const Folder*folder); + virtual void storeMessage(const char*msg,size_t length, const QString&folder); @@ -43,2 +44,3 @@ public: + virtual void logout(); protected: @@ -46,3 +48,2 @@ protected: void login(); - void logout(); diff --git a/noncore/net/mail/libmailwrapper/libmailwrapper.pro b/noncore/net/mail/libmailwrapper/libmailwrapper.pro index 4b4a4f1..18583bb 100644 --- a/noncore/net/mail/libmailwrapper/libmailwrapper.pro +++ b/noncore/net/mail/libmailwrapper/libmailwrapper.pro @@ -13,3 +13,4 @@ HEADERS = mailwrapper.h \ logindialog.h \ - sendmailprogress.h + sendmailprogress.h \ + statusmail.h @@ -25,3 +26,4 @@ SOURCES = imapwrapper.cpp \ logindialog.cpp \ - sendmailprogress.cpp + sendmailprogress.cpp \ + statusmail.cpp diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp index d76d82a..b4eca6f 100644 --- a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp +++ b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp @@ -229 +229,9 @@ void POP3wrapper::statusFolder(folderStat&target_stat,const QString&) } + +void POP3wrapper::fetchRawBody(const RecMail&mail,char**target,size_t*length) +{ + mailmessage * mailmsg = 0; + int err = mailsession_get_message(m_folder->fld_session, mail.getNumber(), &mailmsg); + err = mailmessage_fetch(mailmsg,target,length); + if (mailmsg) mailmessage_free(mailmsg); +} diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.h b/noncore/net/mail/libmailwrapper/pop3wrapper.h index 536cadc..9cba101 100644 --- a/noncore/net/mail/libmailwrapper/pop3wrapper.h +++ b/noncore/net/mail/libmailwrapper/pop3wrapper.h @@ -28,2 +28,5 @@ public: virtual RecBody fetchBody( const RecMail &mail ); + virtual void fetchRawBody(const RecMail&mail,char**target,size_t*length); + virtual void logout(); + static void pop3_progress( size_t current, size_t maximum ); @@ -32,3 +35,2 @@ protected: void login(); - void logout(); POP3account *account; |