Diffstat (limited to 'noncore/net/mail/libmailwrapper/imapwrapper.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp index 3222c7e..a01a2a9 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp | |||
@@ -693,6 +693,38 @@ void IMAPwrapper::fillBodyFields(RecPart&target_part,mailimap_body_fields*which) | |||
693 | } | 693 | } |
694 | 694 | ||
695 | QString IMAPwrapper::fetchPart(const RecMail&mail,const RecPart&part) | 695 | QString IMAPwrapper::fetchPart(const RecMail&mail,const RecPart&part) |
696 | { | 696 | { |
697 | return fetchPart(mail,part.Positionlist(),false); | 697 | return fetchPart(mail,part.Positionlist(),false); |
698 | } | 698 | } |
699 | |||
700 | void IMAPwrapper::deleteMail(const RecMail&mail) | ||
701 | { | ||
702 | mailimap_flag_list*flist; | ||
703 | mailimap_set *set; | ||
704 | mailimap_store_att_flags * store_flags; | ||
705 | int err; | ||
706 | login(); | ||
707 | if (!m_imap) { | ||
708 | return; | ||
709 | } | ||
710 | const char *mb = mail.getMbox().latin1(); | ||
711 | err = mailimap_select( m_imap, (char*)mb); | ||
712 | if ( err != MAILIMAP_NO_ERROR ) { | ||
713 | qDebug("error selecting mailbox for delete: %s",m_imap->imap_response); | ||
714 | return; | ||
715 | } | ||
716 | flist = mailimap_flag_list_new_empty(); | ||
717 | mailimap_flag_list_add(flist,mailimap_flag_new_deleted()); | ||
718 | store_flags = mailimap_store_att_flags_new_set_flags(flist); | ||
719 | set = mailimap_set_new_single(mail.getNumber()); | ||
720 | err = mailimap_store(m_imap,set,store_flags); | ||
721 | if (err != MAILIMAP_NO_ERROR) { | ||
722 | qDebug("error deleting mail: %s",m_imap->imap_response); | ||
723 | return; | ||
724 | } | ||
725 | err = mailimap_expunge(m_imap); | ||
726 | if (err != MAILIMAP_NO_ERROR) { | ||
727 | qDebug("error deleting mail: %s",m_imap->imap_response); | ||
728 | } | ||
729 | qDebug("Delete successfull"); | ||
730 | } | ||