-rw-r--r-- | noncore/net/mail/abstractmail.cpp | 4 | ||||
-rw-r--r-- | noncore/net/mail/abstractmail.h | 4 | ||||
-rw-r--r-- | noncore/net/mail/imapwrapper.cpp | 40 | ||||
-rw-r--r-- | noncore/net/mail/imapwrapper.h | 1 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/abstractmail.cpp | 4 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/abstractmail.h | 4 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.cpp | 40 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.h | 1 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mailtypes.h | 7 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mboxwrapper.cpp | 21 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mboxwrapper.h | 1 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/pop3wrapper.cpp | 11 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/pop3wrapper.h | 2 | ||||
-rw-r--r-- | noncore/net/mail/mailtypes.h | 7 | ||||
-rw-r--r-- | noncore/net/mail/mboxwrapper.cpp | 21 | ||||
-rw-r--r-- | noncore/net/mail/mboxwrapper.h | 1 | ||||
-rw-r--r-- | noncore/net/mail/pop3wrapper.cpp | 11 | ||||
-rw-r--r-- | noncore/net/mail/pop3wrapper.h | 2 |
18 files changed, 180 insertions, 2 deletions
diff --git a/noncore/net/mail/abstractmail.cpp b/noncore/net/mail/abstractmail.cpp index 416795b..f303d72 100644 --- a/noncore/net/mail/abstractmail.cpp +++ b/noncore/net/mail/abstractmail.cpp | |||
@@ -59,32 +59,36 @@ encodedString* AbstractMail::decode_String(const encodedString*text,const QStrin | |||
59 | QString AbstractMail::convert_String(const char*text) | 59 | QString AbstractMail::convert_String(const char*text) |
60 | { | 60 | { |
61 | size_t index = 0; | 61 | size_t index = 0; |
62 | char*res = 0; | 62 | char*res = 0; |
63 | 63 | ||
64 | /* attention - doesn't work with arm systems! */ | 64 | /* attention - doesn't work with arm systems! */ |
65 | int err = mailmime_encoded_phrase_parse("iso-8859-1", | 65 | int err = mailmime_encoded_phrase_parse("iso-8859-1", |
66 | text, strlen(text),&index, "iso-8859-1",&res); | 66 | text, strlen(text),&index, "iso-8859-1",&res); |
67 | if (err != MAILIMF_NO_ERROR) { | 67 | if (err != MAILIMF_NO_ERROR) { |
68 | if (res) free(res); | 68 | if (res) free(res); |
69 | return QString(text); | 69 | return QString(text); |
70 | } | 70 | } |
71 | if (res) { | 71 | if (res) { |
72 | QString result(res); | 72 | QString result(res); |
73 | free(res); | 73 | free(res); |
74 | return result; | 74 | return result; |
75 | } | 75 | } |
76 | return QString(text); | 76 | return QString(text); |
77 | } | 77 | } |
78 | 78 | ||
79 | /* cp & paste from launcher */ | 79 | /* cp & paste from launcher */ |
80 | QString AbstractMail::gen_attachment_id() | 80 | QString AbstractMail::gen_attachment_id() |
81 | { | 81 | { |
82 | QFile file( "/proc/sys/kernel/random/uuid" ); | 82 | QFile file( "/proc/sys/kernel/random/uuid" ); |
83 | if (!file.open(IO_ReadOnly ) ) | 83 | if (!file.open(IO_ReadOnly ) ) |
84 | return QString::null; | 84 | return QString::null; |
85 | 85 | ||
86 | QTextStream stream(&file); | 86 | QTextStream stream(&file); |
87 | 87 | ||
88 | return "{" + stream.read().stripWhiteSpace() + "}"; | 88 | return "{" + stream.read().stripWhiteSpace() + "}"; |
89 | } | 89 | } |
90 | 90 | ||
91 | int AbstractMail::createMbox(const QString&,const Folder*,const QString& delemiter,bool) | ||
92 | { | ||
93 | return 0; | ||
94 | } | ||
diff --git a/noncore/net/mail/abstractmail.h b/noncore/net/mail/abstractmail.h index 5dc4cab..dab9e10 100644 --- a/noncore/net/mail/abstractmail.h +++ b/noncore/net/mail/abstractmail.h | |||
@@ -1,51 +1,53 @@ | |||
1 | #ifndef __abstract_mail_ | 1 | #ifndef __abstract_mail_ |
2 | #define __abstract_mail_ | 2 | #define __abstract_mail_ |
3 | 3 | ||
4 | #include <qobject.h> | 4 | #include <qobject.h> |
5 | #include "settings.h" | 5 | #include "settings.h" |
6 | 6 | ||
7 | class RecMail; | 7 | class RecMail; |
8 | class RecBody; | 8 | class RecBody; |
9 | class RecPart; | 9 | class RecPart; |
10 | class IMAPwrapper; | 10 | class IMAPwrapper; |
11 | class POP3wrapper; | 11 | class POP3wrapper; |
12 | class Folder; | 12 | class Folder; |
13 | class encodedString; | 13 | class encodedString; |
14 | struct folderStat; | ||
14 | 15 | ||
15 | class AbstractMail:public QObject | 16 | class AbstractMail:public QObject |
16 | { | 17 | { |
17 | Q_OBJECT | 18 | Q_OBJECT |
18 | public: | 19 | public: |
19 | AbstractMail(){}; | 20 | AbstractMail(){}; |
20 | virtual ~AbstractMail(){} | 21 | virtual ~AbstractMail(){} |
21 | virtual QList<Folder>* listFolders()=0; | 22 | virtual QList<Folder>* listFolders()=0; |
22 | virtual void listMessages(const QString & mailbox,QList<RecMail>&target )=0; | 23 | virtual void listMessages(const QString & mailbox,QList<RecMail>&target )=0; |
24 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX")=0; | ||
23 | virtual RecBody fetchBody(const RecMail&mail)=0; | 25 | virtual RecBody fetchBody(const RecMail&mail)=0; |
24 | virtual QString fetchTextPart(const RecMail&mail,const RecPart&part)=0; | 26 | virtual QString fetchTextPart(const RecMail&mail,const RecPart&part)=0; |
25 | virtual encodedString* fetchDecodedPart(const RecMail&mail,const RecPart&part)=0; | 27 | virtual encodedString* fetchDecodedPart(const RecMail&mail,const RecPart&part)=0; |
26 | virtual encodedString* fetchRawPart(const RecMail&mail,const RecPart&part)=0; | 28 | virtual encodedString* fetchRawPart(const RecMail&mail,const RecPart&part)=0; |
27 | 29 | ||
28 | virtual void deleteMail(const RecMail&mail)=0; | 30 | virtual void deleteMail(const RecMail&mail)=0; |
29 | virtual void answeredMail(const RecMail&mail)=0; | 31 | virtual void answeredMail(const RecMail&mail)=0; |
30 | virtual void cleanMimeCache(){}; | 32 | virtual void cleanMimeCache(){}; |
31 | virtual int deleteAllMail(const Folder*){return 1;} | 33 | virtual int deleteAllMail(const Folder*){return 1;} |
32 | virtual int deleteMbox(const Folder*){return 1;} | 34 | virtual int deleteMbox(const Folder*){return 1;} |
33 | 35 | ||
34 | /* mail box methods */ | 36 | /* mail box methods */ |
35 | /* parameter is the box to create. | 37 | /* parameter is the box to create. |
36 | * if the implementing subclass has prefixes, | 38 | * if the implementing subclass has prefixes, |
37 | * them has to be appended automatic. | 39 | * them has to be appended automatic. |
38 | */ | 40 | */ |
39 | virtual int createMbox(const QString&,const Folder*parentfolder=0,const QString& delemiter="/",bool getsubfolder=false){return 0;} | 41 | virtual int createMbox(const QString&,const Folder*parentfolder=0,const QString& delemiter="/",bool getsubfolder=false); |
40 | 42 | ||
41 | static AbstractMail* getWrapper(IMAPaccount *a); | 43 | static AbstractMail* getWrapper(IMAPaccount *a); |
42 | static AbstractMail* getWrapper(POP3account *a); | 44 | static AbstractMail* getWrapper(POP3account *a); |
43 | /* mbox only! */ | 45 | /* mbox only! */ |
44 | static AbstractMail* getWrapper(const QString&a); | 46 | static AbstractMail* getWrapper(const QString&a); |
45 | 47 | ||
46 | protected: | 48 | protected: |
47 | static encodedString*decode_String(const encodedString*text,const QString&enc); | 49 | static encodedString*decode_String(const encodedString*text,const QString&enc); |
48 | static QString convert_String(const char*text); | 50 | static QString convert_String(const char*text); |
49 | static QString gen_attachment_id(); | 51 | static QString gen_attachment_id(); |
50 | }; | 52 | }; |
51 | #endif | 53 | #endif |
diff --git a/noncore/net/mail/imapwrapper.cpp b/noncore/net/mail/imapwrapper.cpp index b437df0..f1d42c2 100644 --- a/noncore/net/mail/imapwrapper.cpp +++ b/noncore/net/mail/imapwrapper.cpp | |||
@@ -905,32 +905,72 @@ int IMAPwrapper::createMbox(const QString&folder,const Folder*parentfolder,const | |||
905 | pre += parentfolder->getDisplayName()+delemiter; | 905 | pre += parentfolder->getDisplayName()+delemiter; |
906 | } | 906 | } |
907 | pre+=folder; | 907 | pre+=folder; |
908 | if (getsubfolder) { | 908 | if (getsubfolder) { |
909 | if (delemiter.length()>0) { | 909 | if (delemiter.length()>0) { |
910 | pre+=delemiter; | 910 | pre+=delemiter; |
911 | } else { | 911 | } else { |
912 | Global::statusMessage(tr("Cannot create folder %1 for holding subfolders").arg(pre)); | 912 | Global::statusMessage(tr("Cannot create folder %1 for holding subfolders").arg(pre)); |
913 | return 0; | 913 | return 0; |
914 | } | 914 | } |
915 | } | 915 | } |
916 | qDebug("Creating %s",pre.latin1()); | 916 | qDebug("Creating %s",pre.latin1()); |
917 | int res = mailimap_create(m_imap,pre.latin1()); | 917 | int res = mailimap_create(m_imap,pre.latin1()); |
918 | if (res != MAILIMAP_NO_ERROR) { | 918 | if (res != MAILIMAP_NO_ERROR) { |
919 | Global::statusMessage(tr("%1").arg(m_imap->imap_response)); | 919 | Global::statusMessage(tr("%1").arg(m_imap->imap_response)); |
920 | return 0; | 920 | return 0; |
921 | } | 921 | } |
922 | return 1; | 922 | return 1; |
923 | } | 923 | } |
924 | 924 | ||
925 | int IMAPwrapper::deleteMbox(const Folder*folder) | 925 | int IMAPwrapper::deleteMbox(const Folder*folder) |
926 | { | 926 | { |
927 | if (!folder) return 0; | 927 | if (!folder) return 0; |
928 | login(); | 928 | login(); |
929 | if (!m_imap) {return 0;} | 929 | if (!m_imap) {return 0;} |
930 | int res = mailimap_delete(m_imap,folder->getName()); | 930 | int res = mailimap_delete(m_imap,folder->getName()); |
931 | if (res != MAILIMAP_NO_ERROR) { | 931 | if (res != MAILIMAP_NO_ERROR) { |
932 | Global::statusMessage(tr("%1").arg(m_imap->imap_response)); | 932 | Global::statusMessage(tr("%1").arg(m_imap->imap_response)); |
933 | return 0; | 933 | return 0; |
934 | } | 934 | } |
935 | return 1; | 935 | return 1; |
936 | } | 936 | } |
937 | |||
938 | void IMAPwrapper::statusFolder(folderStat&target_stat,const QString & mailbox) | ||
939 | { | ||
940 | mailimap_status_att_list * att_list =0; | ||
941 | mailimap_mailbox_data_status * status=0; | ||
942 | clistiter * cur = 0; | ||
943 | int r = 0; | ||
944 | int res = 0; | ||
945 | target_stat.message_count = 0; | ||
946 | target_stat.message_unseen = 0; | ||
947 | target_stat.message_recent = 0; | ||
948 | login(); | ||
949 | if (!m_imap) { | ||
950 | return; | ||
951 | } | ||
952 | att_list = mailimap_status_att_list_new_empty(); | ||
953 | if (!att_list) return; | ||
954 | r = mailimap_status_att_list_add(att_list, MAILIMAP_STATUS_ATT_MESSAGES); | ||
955 | r = mailimap_status_att_list_add(att_list, MAILIMAP_STATUS_ATT_RECENT); | ||
956 | r = mailimap_status_att_list_add(att_list, MAILIMAP_STATUS_ATT_UNSEEN); | ||
957 | r = mailimap_status(m_imap, mailbox.latin1(), att_list, &status); | ||
958 | for (cur = clist_begin(status->st_info_list); | ||
959 | cur != NULL ; cur = clist_next(cur)) { | ||
960 | mailimap_status_info * status_info; | ||
961 | status_info = (mailimap_status_info *)clist_content(cur); | ||
962 | switch (status_info->st_att) { | ||
963 | case MAILIMAP_STATUS_ATT_MESSAGES: | ||
964 | target_stat.message_count = status_info->st_value; | ||
965 | break; | ||
966 | case MAILIMAP_STATUS_ATT_RECENT: | ||
967 | target_stat.message_recent = status_info->st_value; | ||
968 | break; | ||
969 | case MAILIMAP_STATUS_ATT_UNSEEN: | ||
970 | target_stat.message_unseen = status_info->st_value; | ||
971 | break; | ||
972 | } | ||
973 | } | ||
974 | mailimap_mailbox_data_status_free(status); | ||
975 | mailimap_status_att_list_free(att_list); | ||
976 | } | ||
diff --git a/noncore/net/mail/imapwrapper.h b/noncore/net/mail/imapwrapper.h index 7941046..8f5a2b5 100644 --- a/noncore/net/mail/imapwrapper.h +++ b/noncore/net/mail/imapwrapper.h | |||
@@ -1,59 +1,60 @@ | |||
1 | #ifndef __IMAPWRAPPER | 1 | #ifndef __IMAPWRAPPER |
2 | #define __IMAPWRAPPER | 2 | #define __IMAPWRAPPER |
3 | 3 | ||
4 | #include <qlist.h> | 4 | #include <qlist.h> |
5 | #include "mailwrapper.h" | 5 | #include "mailwrapper.h" |
6 | #include "abstractmail.h" | 6 | #include "abstractmail.h" |
7 | #include <libetpan/clist.h> | 7 | #include <libetpan/clist.h> |
8 | 8 | ||
9 | struct mailimap; | 9 | struct mailimap; |
10 | struct mailimap_body; | 10 | struct mailimap_body; |
11 | struct mailimap_body_type_1part; | 11 | struct mailimap_body_type_1part; |
12 | struct mailimap_body_type_text; | 12 | struct mailimap_body_type_text; |
13 | struct mailimap_body_type_basic; | 13 | struct mailimap_body_type_basic; |
14 | struct mailimap_body_type_msg; | 14 | struct mailimap_body_type_msg; |
15 | struct mailimap_body_type_mpart; | 15 | struct mailimap_body_type_mpart; |
16 | struct mailimap_body_fields; | 16 | struct mailimap_body_fields; |
17 | struct mailimap_msg_att; | 17 | struct mailimap_msg_att; |
18 | class encodedString; | 18 | class encodedString; |
19 | 19 | ||
20 | class IMAPwrapper : public AbstractMail | 20 | class IMAPwrapper : public AbstractMail |
21 | { | 21 | { |
22 | Q_OBJECT | 22 | Q_OBJECT |
23 | public: | 23 | public: |
24 | IMAPwrapper( IMAPaccount *a ); | 24 | IMAPwrapper( IMAPaccount *a ); |
25 | virtual ~IMAPwrapper(); | 25 | virtual ~IMAPwrapper(); |
26 | virtual QList<Folder>* listFolders(); | 26 | virtual QList<Folder>* listFolders(); |
27 | virtual void listMessages(const QString & mailbox,QList<RecMail>&target ); | 27 | virtual void listMessages(const QString & mailbox,QList<RecMail>&target ); |
28 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); | ||
28 | 29 | ||
29 | virtual void deleteMail(const RecMail&mail); | 30 | virtual void deleteMail(const RecMail&mail); |
30 | virtual void answeredMail(const RecMail&mail); | 31 | virtual void answeredMail(const RecMail&mail); |
31 | virtual int deleteAllMail(const Folder*folder); | 32 | virtual int deleteAllMail(const Folder*folder); |
32 | 33 | ||
33 | virtual RecBody fetchBody(const RecMail&mail); | 34 | virtual RecBody fetchBody(const RecMail&mail); |
34 | virtual QString fetchTextPart(const RecMail&mail,const RecPart&part); | 35 | virtual QString fetchTextPart(const RecMail&mail,const RecPart&part); |
35 | virtual encodedString* fetchDecodedPart(const RecMail&mail,const RecPart&part); | 36 | virtual encodedString* fetchDecodedPart(const RecMail&mail,const RecPart&part); |
36 | virtual encodedString* fetchRawPart(const RecMail&mail,const RecPart&part); | 37 | virtual encodedString* fetchRawPart(const RecMail&mail,const RecPart&part); |
37 | 38 | ||
38 | virtual int createMbox(const QString&,const Folder*parentfolder=0,const QString& delemiter="/",bool getsubfolder=false); | 39 | virtual int createMbox(const QString&,const Folder*parentfolder=0,const QString& delemiter="/",bool getsubfolder=false); |
39 | virtual int deleteMbox(const Folder*folder); | 40 | virtual int deleteMbox(const Folder*folder); |
40 | 41 | ||
41 | static void imap_progress( size_t current, size_t maximum ); | 42 | static void imap_progress( size_t current, size_t maximum ); |
42 | 43 | ||
43 | protected: | 44 | protected: |
44 | RecMail*parse_list_result(mailimap_msg_att*); | 45 | RecMail*parse_list_result(mailimap_msg_att*); |
45 | void login(); | 46 | void login(); |
46 | void logout(); | 47 | void logout(); |
47 | 48 | ||
48 | virtual QString fetchTextPart(const RecMail&mail,const QValueList<int>&path,bool internal_call=false,const QString&enc=""); | 49 | virtual QString fetchTextPart(const RecMail&mail,const QValueList<int>&path,bool internal_call=false,const QString&enc=""); |
49 | virtual encodedString*fetchRawPart(const RecMail&mail,const QValueList<int>&path,bool internal_call); | 50 | virtual encodedString*fetchRawPart(const RecMail&mail,const QValueList<int>&path,bool internal_call); |
50 | 51 | ||
51 | void fillSinglePart(RecPart&target_part,mailimap_body_type_1part*Description); | 52 | void fillSinglePart(RecPart&target_part,mailimap_body_type_1part*Description); |
52 | void fillSingleTextPart(RecPart&target_part,mailimap_body_type_text*which); | 53 | void fillSingleTextPart(RecPart&target_part,mailimap_body_type_text*which); |
53 | void fillSingleBasicPart(RecPart&target_part,mailimap_body_type_basic*which); | 54 | void fillSingleBasicPart(RecPart&target_part,mailimap_body_type_basic*which); |
54 | void fillSingleMsgPart(RecPart&target_part,mailimap_body_type_msg*which); | 55 | void fillSingleMsgPart(RecPart&target_part,mailimap_body_type_msg*which); |
55 | void fillMultiPart(RecPart&target_part,mailimap_body_type_mpart*which); | 56 | void fillMultiPart(RecPart&target_part,mailimap_body_type_mpart*which); |
56 | void traverseBody(const RecMail&mail,mailimap_body*body,RecBody&target_body,int current_recursion,QValueList<int>recList,int current_count=1); | 57 | void traverseBody(const RecMail&mail,mailimap_body*body,RecBody&target_body,int current_recursion,QValueList<int>recList,int current_count=1); |
57 | 58 | ||
58 | /* just helpers */ | 59 | /* just helpers */ |
59 | static void fillBodyFields(RecPart&target_part,mailimap_body_fields*which); | 60 | static void fillBodyFields(RecPart&target_part,mailimap_body_fields*which); |
diff --git a/noncore/net/mail/libmailwrapper/abstractmail.cpp b/noncore/net/mail/libmailwrapper/abstractmail.cpp index 416795b..f303d72 100644 --- a/noncore/net/mail/libmailwrapper/abstractmail.cpp +++ b/noncore/net/mail/libmailwrapper/abstractmail.cpp | |||
@@ -59,32 +59,36 @@ encodedString* AbstractMail::decode_String(const encodedString*text,const QStrin | |||
59 | QString AbstractMail::convert_String(const char*text) | 59 | QString AbstractMail::convert_String(const char*text) |
60 | { | 60 | { |
61 | size_t index = 0; | 61 | size_t index = 0; |
62 | char*res = 0; | 62 | char*res = 0; |
63 | 63 | ||
64 | /* attention - doesn't work with arm systems! */ | 64 | /* attention - doesn't work with arm systems! */ |
65 | int err = mailmime_encoded_phrase_parse("iso-8859-1", | 65 | int err = mailmime_encoded_phrase_parse("iso-8859-1", |
66 | text, strlen(text),&index, "iso-8859-1",&res); | 66 | text, strlen(text),&index, "iso-8859-1",&res); |
67 | if (err != MAILIMF_NO_ERROR) { | 67 | if (err != MAILIMF_NO_ERROR) { |
68 | if (res) free(res); | 68 | if (res) free(res); |
69 | return QString(text); | 69 | return QString(text); |
70 | } | 70 | } |
71 | if (res) { | 71 | if (res) { |
72 | QString result(res); | 72 | QString result(res); |
73 | free(res); | 73 | free(res); |
74 | return result; | 74 | return result; |
75 | } | 75 | } |
76 | return QString(text); | 76 | return QString(text); |
77 | } | 77 | } |
78 | 78 | ||
79 | /* cp & paste from launcher */ | 79 | /* cp & paste from launcher */ |
80 | QString AbstractMail::gen_attachment_id() | 80 | QString AbstractMail::gen_attachment_id() |
81 | { | 81 | { |
82 | QFile file( "/proc/sys/kernel/random/uuid" ); | 82 | QFile file( "/proc/sys/kernel/random/uuid" ); |
83 | if (!file.open(IO_ReadOnly ) ) | 83 | if (!file.open(IO_ReadOnly ) ) |
84 | return QString::null; | 84 | return QString::null; |
85 | 85 | ||
86 | QTextStream stream(&file); | 86 | QTextStream stream(&file); |
87 | 87 | ||
88 | return "{" + stream.read().stripWhiteSpace() + "}"; | 88 | return "{" + stream.read().stripWhiteSpace() + "}"; |
89 | } | 89 | } |
90 | 90 | ||
91 | int AbstractMail::createMbox(const QString&,const Folder*,const QString& delemiter,bool) | ||
92 | { | ||
93 | return 0; | ||
94 | } | ||
diff --git a/noncore/net/mail/libmailwrapper/abstractmail.h b/noncore/net/mail/libmailwrapper/abstractmail.h index 5dc4cab..dab9e10 100644 --- a/noncore/net/mail/libmailwrapper/abstractmail.h +++ b/noncore/net/mail/libmailwrapper/abstractmail.h | |||
@@ -1,51 +1,53 @@ | |||
1 | #ifndef __abstract_mail_ | 1 | #ifndef __abstract_mail_ |
2 | #define __abstract_mail_ | 2 | #define __abstract_mail_ |
3 | 3 | ||
4 | #include <qobject.h> | 4 | #include <qobject.h> |
5 | #include "settings.h" | 5 | #include "settings.h" |
6 | 6 | ||
7 | class RecMail; | 7 | class RecMail; |
8 | class RecBody; | 8 | class RecBody; |
9 | class RecPart; | 9 | class RecPart; |
10 | class IMAPwrapper; | 10 | class IMAPwrapper; |
11 | class POP3wrapper; | 11 | class POP3wrapper; |
12 | class Folder; | 12 | class Folder; |
13 | class encodedString; | 13 | class encodedString; |
14 | struct folderStat; | ||
14 | 15 | ||
15 | class AbstractMail:public QObject | 16 | class AbstractMail:public QObject |
16 | { | 17 | { |
17 | Q_OBJECT | 18 | Q_OBJECT |
18 | public: | 19 | public: |
19 | AbstractMail(){}; | 20 | AbstractMail(){}; |
20 | virtual ~AbstractMail(){} | 21 | virtual ~AbstractMail(){} |
21 | virtual QList<Folder>* listFolders()=0; | 22 | virtual QList<Folder>* listFolders()=0; |
22 | virtual void listMessages(const QString & mailbox,QList<RecMail>&target )=0; | 23 | virtual void listMessages(const QString & mailbox,QList<RecMail>&target )=0; |
24 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX")=0; | ||
23 | virtual RecBody fetchBody(const RecMail&mail)=0; | 25 | virtual RecBody fetchBody(const RecMail&mail)=0; |
24 | virtual QString fetchTextPart(const RecMail&mail,const RecPart&part)=0; | 26 | virtual QString fetchTextPart(const RecMail&mail,const RecPart&part)=0; |
25 | virtual encodedString* fetchDecodedPart(const RecMail&mail,const RecPart&part)=0; | 27 | virtual encodedString* fetchDecodedPart(const RecMail&mail,const RecPart&part)=0; |
26 | virtual encodedString* fetchRawPart(const RecMail&mail,const RecPart&part)=0; | 28 | virtual encodedString* fetchRawPart(const RecMail&mail,const RecPart&part)=0; |
27 | 29 | ||
28 | virtual void deleteMail(const RecMail&mail)=0; | 30 | virtual void deleteMail(const RecMail&mail)=0; |
29 | virtual void answeredMail(const RecMail&mail)=0; | 31 | virtual void answeredMail(const RecMail&mail)=0; |
30 | virtual void cleanMimeCache(){}; | 32 | virtual void cleanMimeCache(){}; |
31 | virtual int deleteAllMail(const Folder*){return 1;} | 33 | virtual int deleteAllMail(const Folder*){return 1;} |
32 | virtual int deleteMbox(const Folder*){return 1;} | 34 | virtual int deleteMbox(const Folder*){return 1;} |
33 | 35 | ||
34 | /* mail box methods */ | 36 | /* mail box methods */ |
35 | /* parameter is the box to create. | 37 | /* parameter is the box to create. |
36 | * if the implementing subclass has prefixes, | 38 | * if the implementing subclass has prefixes, |
37 | * them has to be appended automatic. | 39 | * them has to be appended automatic. |
38 | */ | 40 | */ |
39 | virtual int createMbox(const QString&,const Folder*parentfolder=0,const QString& delemiter="/",bool getsubfolder=false){return 0;} | 41 | virtual int createMbox(const QString&,const Folder*parentfolder=0,const QString& delemiter="/",bool getsubfolder=false); |
40 | 42 | ||
41 | static AbstractMail* getWrapper(IMAPaccount *a); | 43 | static AbstractMail* getWrapper(IMAPaccount *a); |
42 | static AbstractMail* getWrapper(POP3account *a); | 44 | static AbstractMail* getWrapper(POP3account *a); |
43 | /* mbox only! */ | 45 | /* mbox only! */ |
44 | static AbstractMail* getWrapper(const QString&a); | 46 | static AbstractMail* getWrapper(const QString&a); |
45 | 47 | ||
46 | protected: | 48 | protected: |
47 | static encodedString*decode_String(const encodedString*text,const QString&enc); | 49 | static encodedString*decode_String(const encodedString*text,const QString&enc); |
48 | static QString convert_String(const char*text); | 50 | static QString convert_String(const char*text); |
49 | static QString gen_attachment_id(); | 51 | static QString gen_attachment_id(); |
50 | }; | 52 | }; |
51 | #endif | 53 | #endif |
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp index b437df0..f1d42c2 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp | |||
@@ -905,32 +905,72 @@ int IMAPwrapper::createMbox(const QString&folder,const Folder*parentfolder,const | |||
905 | pre += parentfolder->getDisplayName()+delemiter; | 905 | pre += parentfolder->getDisplayName()+delemiter; |
906 | } | 906 | } |
907 | pre+=folder; | 907 | pre+=folder; |
908 | if (getsubfolder) { | 908 | if (getsubfolder) { |
909 | if (delemiter.length()>0) { | 909 | if (delemiter.length()>0) { |
910 | pre+=delemiter; | 910 | pre+=delemiter; |
911 | } else { | 911 | } else { |
912 | Global::statusMessage(tr("Cannot create folder %1 for holding subfolders").arg(pre)); | 912 | Global::statusMessage(tr("Cannot create folder %1 for holding subfolders").arg(pre)); |
913 | return 0; | 913 | return 0; |
914 | } | 914 | } |
915 | } | 915 | } |
916 | qDebug("Creating %s",pre.latin1()); | 916 | qDebug("Creating %s",pre.latin1()); |
917 | int res = mailimap_create(m_imap,pre.latin1()); | 917 | int res = mailimap_create(m_imap,pre.latin1()); |
918 | if (res != MAILIMAP_NO_ERROR) { | 918 | if (res != MAILIMAP_NO_ERROR) { |
919 | Global::statusMessage(tr("%1").arg(m_imap->imap_response)); | 919 | Global::statusMessage(tr("%1").arg(m_imap->imap_response)); |
920 | return 0; | 920 | return 0; |
921 | } | 921 | } |
922 | return 1; | 922 | return 1; |
923 | } | 923 | } |
924 | 924 | ||
925 | int IMAPwrapper::deleteMbox(const Folder*folder) | 925 | int IMAPwrapper::deleteMbox(const Folder*folder) |
926 | { | 926 | { |
927 | if (!folder) return 0; | 927 | if (!folder) return 0; |
928 | login(); | 928 | login(); |
929 | if (!m_imap) {return 0;} | 929 | if (!m_imap) {return 0;} |
930 | int res = mailimap_delete(m_imap,folder->getName()); | 930 | int res = mailimap_delete(m_imap,folder->getName()); |
931 | if (res != MAILIMAP_NO_ERROR) { | 931 | if (res != MAILIMAP_NO_ERROR) { |
932 | Global::statusMessage(tr("%1").arg(m_imap->imap_response)); | 932 | Global::statusMessage(tr("%1").arg(m_imap->imap_response)); |
933 | return 0; | 933 | return 0; |
934 | } | 934 | } |
935 | return 1; | 935 | return 1; |
936 | } | 936 | } |
937 | |||
938 | void IMAPwrapper::statusFolder(folderStat&target_stat,const QString & mailbox) | ||
939 | { | ||
940 | mailimap_status_att_list * att_list =0; | ||
941 | mailimap_mailbox_data_status * status=0; | ||
942 | clistiter * cur = 0; | ||
943 | int r = 0; | ||
944 | int res = 0; | ||
945 | target_stat.message_count = 0; | ||
946 | target_stat.message_unseen = 0; | ||
947 | target_stat.message_recent = 0; | ||
948 | login(); | ||
949 | if (!m_imap) { | ||
950 | return; | ||
951 | } | ||
952 | att_list = mailimap_status_att_list_new_empty(); | ||
953 | if (!att_list) return; | ||
954 | r = mailimap_status_att_list_add(att_list, MAILIMAP_STATUS_ATT_MESSAGES); | ||
955 | r = mailimap_status_att_list_add(att_list, MAILIMAP_STATUS_ATT_RECENT); | ||
956 | r = mailimap_status_att_list_add(att_list, MAILIMAP_STATUS_ATT_UNSEEN); | ||
957 | r = mailimap_status(m_imap, mailbox.latin1(), att_list, &status); | ||
958 | for (cur = clist_begin(status->st_info_list); | ||
959 | cur != NULL ; cur = clist_next(cur)) { | ||
960 | mailimap_status_info * status_info; | ||
961 | status_info = (mailimap_status_info *)clist_content(cur); | ||
962 | switch (status_info->st_att) { | ||
963 | case MAILIMAP_STATUS_ATT_MESSAGES: | ||
964 | target_stat.message_count = status_info->st_value; | ||
965 | break; | ||
966 | case MAILIMAP_STATUS_ATT_RECENT: | ||
967 | target_stat.message_recent = status_info->st_value; | ||
968 | break; | ||
969 | case MAILIMAP_STATUS_ATT_UNSEEN: | ||
970 | target_stat.message_unseen = status_info->st_value; | ||
971 | break; | ||
972 | } | ||
973 | } | ||
974 | mailimap_mailbox_data_status_free(status); | ||
975 | mailimap_status_att_list_free(att_list); | ||
976 | } | ||
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.h b/noncore/net/mail/libmailwrapper/imapwrapper.h index 7941046..8f5a2b5 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.h +++ b/noncore/net/mail/libmailwrapper/imapwrapper.h | |||
@@ -1,59 +1,60 @@ | |||
1 | #ifndef __IMAPWRAPPER | 1 | #ifndef __IMAPWRAPPER |
2 | #define __IMAPWRAPPER | 2 | #define __IMAPWRAPPER |
3 | 3 | ||
4 | #include <qlist.h> | 4 | #include <qlist.h> |
5 | #include "mailwrapper.h" | 5 | #include "mailwrapper.h" |
6 | #include "abstractmail.h" | 6 | #include "abstractmail.h" |
7 | #include <libetpan/clist.h> | 7 | #include <libetpan/clist.h> |
8 | 8 | ||
9 | struct mailimap; | 9 | struct mailimap; |
10 | struct mailimap_body; | 10 | struct mailimap_body; |
11 | struct mailimap_body_type_1part; | 11 | struct mailimap_body_type_1part; |
12 | struct mailimap_body_type_text; | 12 | struct mailimap_body_type_text; |
13 | struct mailimap_body_type_basic; | 13 | struct mailimap_body_type_basic; |
14 | struct mailimap_body_type_msg; | 14 | struct mailimap_body_type_msg; |
15 | struct mailimap_body_type_mpart; | 15 | struct mailimap_body_type_mpart; |
16 | struct mailimap_body_fields; | 16 | struct mailimap_body_fields; |
17 | struct mailimap_msg_att; | 17 | struct mailimap_msg_att; |
18 | class encodedString; | 18 | class encodedString; |
19 | 19 | ||
20 | class IMAPwrapper : public AbstractMail | 20 | class IMAPwrapper : public AbstractMail |
21 | { | 21 | { |
22 | Q_OBJECT | 22 | Q_OBJECT |
23 | public: | 23 | public: |
24 | IMAPwrapper( IMAPaccount *a ); | 24 | IMAPwrapper( IMAPaccount *a ); |
25 | virtual ~IMAPwrapper(); | 25 | virtual ~IMAPwrapper(); |
26 | virtual QList<Folder>* listFolders(); | 26 | virtual QList<Folder>* listFolders(); |
27 | virtual void listMessages(const QString & mailbox,QList<RecMail>&target ); | 27 | virtual void listMessages(const QString & mailbox,QList<RecMail>&target ); |
28 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); | ||
28 | 29 | ||
29 | virtual void deleteMail(const RecMail&mail); | 30 | virtual void deleteMail(const RecMail&mail); |
30 | virtual void answeredMail(const RecMail&mail); | 31 | virtual void answeredMail(const RecMail&mail); |
31 | virtual int deleteAllMail(const Folder*folder); | 32 | virtual int deleteAllMail(const Folder*folder); |
32 | 33 | ||
33 | virtual RecBody fetchBody(const RecMail&mail); | 34 | virtual RecBody fetchBody(const RecMail&mail); |
34 | virtual QString fetchTextPart(const RecMail&mail,const RecPart&part); | 35 | virtual QString fetchTextPart(const RecMail&mail,const RecPart&part); |
35 | virtual encodedString* fetchDecodedPart(const RecMail&mail,const RecPart&part); | 36 | virtual encodedString* fetchDecodedPart(const RecMail&mail,const RecPart&part); |
36 | virtual encodedString* fetchRawPart(const RecMail&mail,const RecPart&part); | 37 | virtual encodedString* fetchRawPart(const RecMail&mail,const RecPart&part); |
37 | 38 | ||
38 | virtual int createMbox(const QString&,const Folder*parentfolder=0,const QString& delemiter="/",bool getsubfolder=false); | 39 | virtual int createMbox(const QString&,const Folder*parentfolder=0,const QString& delemiter="/",bool getsubfolder=false); |
39 | virtual int deleteMbox(const Folder*folder); | 40 | virtual int deleteMbox(const Folder*folder); |
40 | 41 | ||
41 | static void imap_progress( size_t current, size_t maximum ); | 42 | static void imap_progress( size_t current, size_t maximum ); |
42 | 43 | ||
43 | protected: | 44 | protected: |
44 | RecMail*parse_list_result(mailimap_msg_att*); | 45 | RecMail*parse_list_result(mailimap_msg_att*); |
45 | void login(); | 46 | void login(); |
46 | void logout(); | 47 | void logout(); |
47 | 48 | ||
48 | virtual QString fetchTextPart(const RecMail&mail,const QValueList<int>&path,bool internal_call=false,const QString&enc=""); | 49 | virtual QString fetchTextPart(const RecMail&mail,const QValueList<int>&path,bool internal_call=false,const QString&enc=""); |
49 | virtual encodedString*fetchRawPart(const RecMail&mail,const QValueList<int>&path,bool internal_call); | 50 | virtual encodedString*fetchRawPart(const RecMail&mail,const QValueList<int>&path,bool internal_call); |
50 | 51 | ||
51 | void fillSinglePart(RecPart&target_part,mailimap_body_type_1part*Description); | 52 | void fillSinglePart(RecPart&target_part,mailimap_body_type_1part*Description); |
52 | void fillSingleTextPart(RecPart&target_part,mailimap_body_type_text*which); | 53 | void fillSingleTextPart(RecPart&target_part,mailimap_body_type_text*which); |
53 | void fillSingleBasicPart(RecPart&target_part,mailimap_body_type_basic*which); | 54 | void fillSingleBasicPart(RecPart&target_part,mailimap_body_type_basic*which); |
54 | void fillSingleMsgPart(RecPart&target_part,mailimap_body_type_msg*which); | 55 | void fillSingleMsgPart(RecPart&target_part,mailimap_body_type_msg*which); |
55 | void fillMultiPart(RecPart&target_part,mailimap_body_type_mpart*which); | 56 | void fillMultiPart(RecPart&target_part,mailimap_body_type_mpart*which); |
56 | void traverseBody(const RecMail&mail,mailimap_body*body,RecBody&target_body,int current_recursion,QValueList<int>recList,int current_count=1); | 57 | void traverseBody(const RecMail&mail,mailimap_body*body,RecBody&target_body,int current_recursion,QValueList<int>recList,int current_count=1); |
57 | 58 | ||
58 | /* just helpers */ | 59 | /* just helpers */ |
59 | static void fillBodyFields(RecPart&target_part,mailimap_body_fields*which); | 60 | static void fillBodyFields(RecPart&target_part,mailimap_body_fields*which); |
diff --git a/noncore/net/mail/libmailwrapper/mailtypes.h b/noncore/net/mail/libmailwrapper/mailtypes.h index abfbe65..05c4816 100644 --- a/noncore/net/mail/libmailwrapper/mailtypes.h +++ b/noncore/net/mail/libmailwrapper/mailtypes.h | |||
@@ -153,33 +153,40 @@ public: | |||
153 | /* copy construkor - makes ALWAYS a deep copy!!!! */ | 153 | /* copy construkor - makes ALWAYS a deep copy!!!! */ |
154 | encodedString(const encodedString&old); | 154 | encodedString(const encodedString&old); |
155 | /* assign operator - makes ALWAYS a deep copy!!!! */ | 155 | /* assign operator - makes ALWAYS a deep copy!!!! */ |
156 | encodedString& operator=(const encodedString&old); | 156 | encodedString& operator=(const encodedString&old); |
157 | /* destructor - cleans the content */ | 157 | /* destructor - cleans the content */ |
158 | virtual ~encodedString(); | 158 | virtual ~encodedString(); |
159 | 159 | ||
160 | /* returns a pointer to the content - do not delete yoursel! */ | 160 | /* returns a pointer to the content - do not delete yoursel! */ |
161 | const char*Content()const; | 161 | const char*Content()const; |
162 | /* returns the lengths of the content 'cause it must not be a null-terminated string! */ | 162 | /* returns the lengths of the content 'cause it must not be a null-terminated string! */ |
163 | const int Length()const; | 163 | const int Length()const; |
164 | 164 | ||
165 | /* | 165 | /* |
166 | makes a deep copy of nContent! | 166 | makes a deep copy of nContent! |
167 | */ | 167 | */ |
168 | void setContent(const char*nContent,int nSize); | 168 | void setContent(const char*nContent,int nSize); |
169 | /* | 169 | /* |
170 | Take over the nContent. Means: it will just copy the pointer, not the content. | 170 | Take over the nContent. Means: it will just copy the pointer, not the content. |
171 | so make sure: No one else frees the string, the string has allocated with | 171 | so make sure: No one else frees the string, the string has allocated with |
172 | malloc for compatibility with c-based libs | 172 | malloc for compatibility with c-based libs |
173 | */ | 173 | */ |
174 | void setContent(char*nContent,int nSize); | 174 | void setContent(char*nContent,int nSize); |
175 | 175 | ||
176 | protected: | 176 | protected: |
177 | char * content; | 177 | char * content; |
178 | unsigned int size; | 178 | unsigned int size; |
179 | 179 | ||
180 | void init(); | 180 | void init(); |
181 | void copy_old(const encodedString&old); | 181 | void copy_old(const encodedString&old); |
182 | void clean(); | 182 | void clean(); |
183 | }; | 183 | }; |
184 | 184 | ||
185 | struct folderStat | ||
186 | { | ||
187 | unsigned int message_count; | ||
188 | unsigned int message_unseen; | ||
189 | unsigned int message_recent; | ||
190 | }; | ||
191 | |||
185 | #endif | 192 | #endif |
diff --git a/noncore/net/mail/libmailwrapper/mboxwrapper.cpp b/noncore/net/mail/libmailwrapper/mboxwrapper.cpp index 0aa33dd..540a971 100644 --- a/noncore/net/mail/libmailwrapper/mboxwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/mboxwrapper.cpp | |||
@@ -272,32 +272,53 @@ int MBOXwrapper::deleteAllMail(const Folder*tfolder) | |||
272 | } | 272 | } |
273 | } | 273 | } |
274 | for(unsigned int i = 0 ; l!= 0 && res==1 && i < carray_count(l->msg_tab) ; ++i) { | 274 | for(unsigned int i = 0 ; l!= 0 && res==1 && i < carray_count(l->msg_tab) ; ++i) { |
275 | r = mailsession_remove_message(folder->fld_session,i+1); | 275 | r = mailsession_remove_message(folder->fld_session,i+1); |
276 | if (r != MAIL_NO_ERROR) { | 276 | if (r != MAIL_NO_ERROR) { |
277 | Global::statusMessage(tr("Error deleting mail %1").arg(i+1)); | 277 | Global::statusMessage(tr("Error deleting mail %1").arg(i+1)); |
278 | res = 0; | 278 | res = 0; |
279 | break; | 279 | break; |
280 | } | 280 | } |
281 | } | 281 | } |
282 | if (l) mailmessage_list_free(l); | 282 | if (l) mailmessage_list_free(l); |
283 | if (folder) mailfolder_free(folder); | 283 | if (folder) mailfolder_free(folder); |
284 | if (storage) mailstorage_free(storage); | 284 | if (storage) mailstorage_free(storage); |
285 | return res; | 285 | return res; |
286 | } | 286 | } |
287 | 287 | ||
288 | int MBOXwrapper::deleteMbox(const Folder*tfolder) | 288 | int MBOXwrapper::deleteMbox(const Folder*tfolder) |
289 | { | 289 | { |
290 | if (!tfolder) return 0; | 290 | if (!tfolder) return 0; |
291 | QString p = MBOXPath+tfolder->getDisplayName(); | 291 | QString p = MBOXPath+tfolder->getDisplayName(); |
292 | QFile fi(p); | 292 | QFile fi(p); |
293 | if (!fi.exists()) { | 293 | if (!fi.exists()) { |
294 | Global::statusMessage(tr("Mailbox doesn't exist.")); | 294 | Global::statusMessage(tr("Mailbox doesn't exist.")); |
295 | return 0; | 295 | return 0; |
296 | } | 296 | } |
297 | if (!fi.remove()) { | 297 | if (!fi.remove()) { |
298 | Global::statusMessage(tr("Error deleting Mailbox.")); | 298 | Global::statusMessage(tr("Error deleting Mailbox.")); |
299 | return 0; | 299 | return 0; |
300 | } | 300 | } |
301 | return 1; | 301 | return 1; |
302 | } | 302 | } |
303 | 303 | ||
304 | void MBOXwrapper::statusFolder(folderStat&target_stat,const QString & mailbox) | ||
305 | { | ||
306 | mailfolder*folder = 0; | ||
307 | mailstorage*storage = mailstorage_new(NULL); | ||
308 | target_stat.message_count = 0; | ||
309 | target_stat.message_unseen = 0; | ||
310 | target_stat.message_recent = 0; | ||
311 | QString p = MBOXPath+"/"+mailbox; | ||
312 | QFile fi(p); | ||
313 | if (!fi.exists()) { | ||
314 | Global::statusMessage(tr("Mailbox doesn't exist.")); | ||
315 | return; | ||
316 | } | ||
317 | int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); | ||
318 | folder = mailfolder_new( storage,(char*)p.latin1(),NULL); | ||
319 | r = mailfolder_connect(folder); | ||
320 | r = mailsession_status_folder(folder->fld_session,(char*)mailbox.latin1(),&target_stat.message_count, | ||
321 | &target_stat.message_recent,&target_stat.message_unseen); | ||
322 | if (folder) mailfolder_free(folder); | ||
323 | if (storage) mailstorage_free(storage); | ||
324 | } | ||
diff --git a/noncore/net/mail/libmailwrapper/mboxwrapper.h b/noncore/net/mail/libmailwrapper/mboxwrapper.h index 226a544..f822997 100644 --- a/noncore/net/mail/libmailwrapper/mboxwrapper.h +++ b/noncore/net/mail/libmailwrapper/mboxwrapper.h | |||
@@ -1,41 +1,42 @@ | |||
1 | #ifndef __MBOX_WRAPPER_H | 1 | #ifndef __MBOX_WRAPPER_H |
2 | #define __MBOX_WRAPPER_H | 2 | #define __MBOX_WRAPPER_H |
3 | 3 | ||
4 | #include "genericwrapper.h" | 4 | #include "genericwrapper.h" |
5 | #include <qstring.h> | 5 | #include <qstring.h> |
6 | 6 | ||
7 | class RecMail; | 7 | class RecMail; |
8 | class RecBody; | 8 | class RecBody; |
9 | struct mailmbox_folder; | 9 | struct mailmbox_folder; |
10 | 10 | ||
11 | class MBOXwrapper : public Genericwrapper | 11 | class MBOXwrapper : public Genericwrapper |
12 | { | 12 | { |
13 | Q_OBJECT | 13 | Q_OBJECT |
14 | public: | 14 | public: |
15 | MBOXwrapper(const QString & dir); | 15 | MBOXwrapper(const QString & dir); |
16 | virtual ~MBOXwrapper(); | 16 | virtual ~MBOXwrapper(); |
17 | 17 | ||
18 | virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); | 18 | virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); |
19 | virtual QList<Folder>* listFolders(); | 19 | virtual QList<Folder>* listFolders(); |
20 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); | ||
20 | 21 | ||
21 | virtual void deleteMail(const RecMail&mail); | 22 | virtual void deleteMail(const RecMail&mail); |
22 | virtual void answeredMail(const RecMail&mail); | 23 | virtual void answeredMail(const RecMail&mail); |
23 | 24 | ||
24 | virtual int createMbox(const QString&folder,const Folder*f=0,const QString&d="",bool s=false); | 25 | virtual int createMbox(const QString&folder,const Folder*f=0,const QString&d="",bool s=false); |
25 | virtual int deleteMbox(const Folder*); | 26 | virtual int deleteMbox(const Folder*); |
26 | 27 | ||
27 | virtual void storeMessage(const char*msg,size_t length, const QString&folder); | 28 | virtual void storeMessage(const char*msg,size_t length, const QString&folder); |
28 | 29 | ||
29 | virtual RecBody fetchBody( const RecMail &mail ); | 30 | virtual RecBody fetchBody( const RecMail &mail ); |
30 | static void mbox_progress( size_t current, size_t maximum ); | 31 | static void mbox_progress( size_t current, size_t maximum ); |
31 | 32 | ||
32 | virtual void fetchRawBody(const RecMail&mail,char**target,size_t*length); | 33 | virtual void fetchRawBody(const RecMail&mail,char**target,size_t*length); |
33 | virtual void deleteMails(const QString & mailbox,QList<RecMail> &target); | 34 | virtual void deleteMails(const QString & mailbox,QList<RecMail> &target); |
34 | virtual int deleteAllMail(const Folder*); | 35 | virtual int deleteAllMail(const Folder*); |
35 | 36 | ||
36 | protected: | 37 | protected: |
37 | static void deleteMails(mailmbox_folder*f,QList<RecMail> &target); | 38 | static void deleteMails(mailmbox_folder*f,QList<RecMail> &target); |
38 | QString MBOXPath; | 39 | QString MBOXPath; |
39 | }; | 40 | }; |
40 | 41 | ||
41 | #endif | 42 | #endif |
diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp index de90dd1..d76d82a 100644 --- a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp +++ b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp | |||
@@ -187,32 +187,43 @@ void POP3wrapper::deleteMail(const RecMail&mail) | |||
187 | int err = mailsession_remove_message(m_folder->fld_session,mail.getNumber()); | 187 | int err = mailsession_remove_message(m_folder->fld_session,mail.getNumber()); |
188 | if (err != MAIL_NO_ERROR) { | 188 | if (err != MAIL_NO_ERROR) { |
189 | Global::statusMessage(tr("error deleting mail")); | 189 | Global::statusMessage(tr("error deleting mail")); |
190 | } | 190 | } |
191 | } | 191 | } |
192 | 192 | ||
193 | void POP3wrapper::answeredMail(const RecMail&) | 193 | void POP3wrapper::answeredMail(const RecMail&) |
194 | { | 194 | { |
195 | } | 195 | } |
196 | 196 | ||
197 | int POP3wrapper::deleteAllMail(const Folder*) | 197 | int POP3wrapper::deleteAllMail(const Folder*) |
198 | { | 198 | { |
199 | login(); | 199 | login(); |
200 | if (!m_pop3) return 0; | 200 | if (!m_pop3) return 0; |
201 | int res = 1; | 201 | int res = 1; |
202 | 202 | ||
203 | uint32_t result = 0; | 203 | uint32_t result = 0; |
204 | int err = mailsession_messages_number(m_folder->fld_session,NULL,&result); | 204 | int err = mailsession_messages_number(m_folder->fld_session,NULL,&result); |
205 | if (err != MAIL_NO_ERROR) { | 205 | if (err != MAIL_NO_ERROR) { |
206 | Global::statusMessage(tr("Error getting folder info")); | 206 | Global::statusMessage(tr("Error getting folder info")); |
207 | return 0; | 207 | return 0; |
208 | } | 208 | } |
209 | for (unsigned int i = 0; i < result; ++i) { | 209 | for (unsigned int i = 0; i < result; ++i) { |
210 | err = mailsession_remove_message(m_folder->fld_session,i+1); | 210 | err = mailsession_remove_message(m_folder->fld_session,i+1); |
211 | if (err != MAIL_NO_ERROR) { | 211 | if (err != MAIL_NO_ERROR) { |
212 | Global::statusMessage(tr("Error deleting mail %1").arg(i+1)); | 212 | Global::statusMessage(tr("Error deleting mail %1").arg(i+1)); |
213 | res=0; | 213 | res=0; |
214 | } | 214 | } |
215 | break; | 215 | break; |
216 | } | 216 | } |
217 | return res; | 217 | return res; |
218 | } | 218 | } |
219 | |||
220 | void POP3wrapper::statusFolder(folderStat&target_stat,const QString&) | ||
221 | { | ||
222 | login(); | ||
223 | target_stat.message_count = 0; | ||
224 | target_stat.message_unseen = 0; | ||
225 | target_stat.message_recent = 0; | ||
226 | if (!m_pop3) return; | ||
227 | int r = mailsession_status_folder(m_folder->fld_session,0,&target_stat.message_count, | ||
228 | &target_stat.message_recent,&target_stat.message_unseen); | ||
229 | } | ||
diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.h b/noncore/net/mail/libmailwrapper/pop3wrapper.h index b3a42be..536cadc 100644 --- a/noncore/net/mail/libmailwrapper/pop3wrapper.h +++ b/noncore/net/mail/libmailwrapper/pop3wrapper.h | |||
@@ -1,37 +1,39 @@ | |||
1 | #ifndef __POP3WRAPPER | 1 | #ifndef __POP3WRAPPER |
2 | #define __POP3WRAPPER | 2 | #define __POP3WRAPPER |
3 | 3 | ||
4 | #include "mailwrapper.h" | 4 | #include "mailwrapper.h" |
5 | #include "genericwrapper.h" | 5 | #include "genericwrapper.h" |
6 | #include <qstring.h> | 6 | #include <qstring.h> |
7 | 7 | ||
8 | struct mailstorage; | 8 | struct mailstorage; |
9 | struct mailfolder; | 9 | struct mailfolder; |
10 | 10 | ||
11 | class POP3wrapper : public Genericwrapper | 11 | class POP3wrapper : public Genericwrapper |
12 | { | 12 | { |
13 | Q_OBJECT | 13 | Q_OBJECT |
14 | 14 | ||
15 | public: | 15 | public: |
16 | POP3wrapper( POP3account *a ); | 16 | POP3wrapper( POP3account *a ); |
17 | virtual ~POP3wrapper(); | 17 | virtual ~POP3wrapper(); |
18 | /* mailbox will be ignored */ | 18 | /* mailbox will be ignored */ |
19 | virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); | 19 | virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); |
20 | virtual QList<Folder>* listFolders(); | 20 | virtual QList<Folder>* listFolders(); |
21 | /* mailbox will be ignored */ | ||
22 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); | ||
21 | 23 | ||
22 | virtual void deleteMail(const RecMail&mail); | 24 | virtual void deleteMail(const RecMail&mail); |
23 | virtual void answeredMail(const RecMail&mail); | 25 | virtual void answeredMail(const RecMail&mail); |
24 | virtual int deleteAllMail(const Folder*); | 26 | virtual int deleteAllMail(const Folder*); |
25 | 27 | ||
26 | virtual RecBody fetchBody( const RecMail &mail ); | 28 | virtual RecBody fetchBody( const RecMail &mail ); |
27 | static void pop3_progress( size_t current, size_t maximum ); | 29 | static void pop3_progress( size_t current, size_t maximum ); |
28 | 30 | ||
29 | protected: | 31 | protected: |
30 | void login(); | 32 | void login(); |
31 | void logout(); | 33 | void logout(); |
32 | POP3account *account; | 34 | POP3account *account; |
33 | mailstorage*m_pop3; | 35 | mailstorage*m_pop3; |
34 | mailfolder*m_folder; | 36 | mailfolder*m_folder; |
35 | }; | 37 | }; |
36 | 38 | ||
37 | #endif | 39 | #endif |
diff --git a/noncore/net/mail/mailtypes.h b/noncore/net/mail/mailtypes.h index abfbe65..05c4816 100644 --- a/noncore/net/mail/mailtypes.h +++ b/noncore/net/mail/mailtypes.h | |||
@@ -153,33 +153,40 @@ public: | |||
153 | /* copy construkor - makes ALWAYS a deep copy!!!! */ | 153 | /* copy construkor - makes ALWAYS a deep copy!!!! */ |
154 | encodedString(const encodedString&old); | 154 | encodedString(const encodedString&old); |
155 | /* assign operator - makes ALWAYS a deep copy!!!! */ | 155 | /* assign operator - makes ALWAYS a deep copy!!!! */ |
156 | encodedString& operator=(const encodedString&old); | 156 | encodedString& operator=(const encodedString&old); |
157 | /* destructor - cleans the content */ | 157 | /* destructor - cleans the content */ |
158 | virtual ~encodedString(); | 158 | virtual ~encodedString(); |
159 | 159 | ||
160 | /* returns a pointer to the content - do not delete yoursel! */ | 160 | /* returns a pointer to the content - do not delete yoursel! */ |
161 | const char*Content()const; | 161 | const char*Content()const; |
162 | /* returns the lengths of the content 'cause it must not be a null-terminated string! */ | 162 | /* returns the lengths of the content 'cause it must not be a null-terminated string! */ |
163 | const int Length()const; | 163 | const int Length()const; |
164 | 164 | ||
165 | /* | 165 | /* |
166 | makes a deep copy of nContent! | 166 | makes a deep copy of nContent! |
167 | */ | 167 | */ |
168 | void setContent(const char*nContent,int nSize); | 168 | void setContent(const char*nContent,int nSize); |
169 | /* | 169 | /* |
170 | Take over the nContent. Means: it will just copy the pointer, not the content. | 170 | Take over the nContent. Means: it will just copy the pointer, not the content. |
171 | so make sure: No one else frees the string, the string has allocated with | 171 | so make sure: No one else frees the string, the string has allocated with |
172 | malloc for compatibility with c-based libs | 172 | malloc for compatibility with c-based libs |
173 | */ | 173 | */ |
174 | void setContent(char*nContent,int nSize); | 174 | void setContent(char*nContent,int nSize); |
175 | 175 | ||
176 | protected: | 176 | protected: |
177 | char * content; | 177 | char * content; |
178 | unsigned int size; | 178 | unsigned int size; |
179 | 179 | ||
180 | void init(); | 180 | void init(); |
181 | void copy_old(const encodedString&old); | 181 | void copy_old(const encodedString&old); |
182 | void clean(); | 182 | void clean(); |
183 | }; | 183 | }; |
184 | 184 | ||
185 | struct folderStat | ||
186 | { | ||
187 | unsigned int message_count; | ||
188 | unsigned int message_unseen; | ||
189 | unsigned int message_recent; | ||
190 | }; | ||
191 | |||
185 | #endif | 192 | #endif |
diff --git a/noncore/net/mail/mboxwrapper.cpp b/noncore/net/mail/mboxwrapper.cpp index 0aa33dd..540a971 100644 --- a/noncore/net/mail/mboxwrapper.cpp +++ b/noncore/net/mail/mboxwrapper.cpp | |||
@@ -272,32 +272,53 @@ int MBOXwrapper::deleteAllMail(const Folder*tfolder) | |||
272 | } | 272 | } |
273 | } | 273 | } |
274 | for(unsigned int i = 0 ; l!= 0 && res==1 && i < carray_count(l->msg_tab) ; ++i) { | 274 | for(unsigned int i = 0 ; l!= 0 && res==1 && i < carray_count(l->msg_tab) ; ++i) { |
275 | r = mailsession_remove_message(folder->fld_session,i+1); | 275 | r = mailsession_remove_message(folder->fld_session,i+1); |
276 | if (r != MAIL_NO_ERROR) { | 276 | if (r != MAIL_NO_ERROR) { |
277 | Global::statusMessage(tr("Error deleting mail %1").arg(i+1)); | 277 | Global::statusMessage(tr("Error deleting mail %1").arg(i+1)); |
278 | res = 0; | 278 | res = 0; |
279 | break; | 279 | break; |
280 | } | 280 | } |
281 | } | 281 | } |
282 | if (l) mailmessage_list_free(l); | 282 | if (l) mailmessage_list_free(l); |
283 | if (folder) mailfolder_free(folder); | 283 | if (folder) mailfolder_free(folder); |
284 | if (storage) mailstorage_free(storage); | 284 | if (storage) mailstorage_free(storage); |
285 | return res; | 285 | return res; |
286 | } | 286 | } |
287 | 287 | ||
288 | int MBOXwrapper::deleteMbox(const Folder*tfolder) | 288 | int MBOXwrapper::deleteMbox(const Folder*tfolder) |
289 | { | 289 | { |
290 | if (!tfolder) return 0; | 290 | if (!tfolder) return 0; |
291 | QString p = MBOXPath+tfolder->getDisplayName(); | 291 | QString p = MBOXPath+tfolder->getDisplayName(); |
292 | QFile fi(p); | 292 | QFile fi(p); |
293 | if (!fi.exists()) { | 293 | if (!fi.exists()) { |
294 | Global::statusMessage(tr("Mailbox doesn't exist.")); | 294 | Global::statusMessage(tr("Mailbox doesn't exist.")); |
295 | return 0; | 295 | return 0; |
296 | } | 296 | } |
297 | if (!fi.remove()) { | 297 | if (!fi.remove()) { |
298 | Global::statusMessage(tr("Error deleting Mailbox.")); | 298 | Global::statusMessage(tr("Error deleting Mailbox.")); |
299 | return 0; | 299 | return 0; |
300 | } | 300 | } |
301 | return 1; | 301 | return 1; |
302 | } | 302 | } |
303 | 303 | ||
304 | void MBOXwrapper::statusFolder(folderStat&target_stat,const QString & mailbox) | ||
305 | { | ||
306 | mailfolder*folder = 0; | ||
307 | mailstorage*storage = mailstorage_new(NULL); | ||
308 | target_stat.message_count = 0; | ||
309 | target_stat.message_unseen = 0; | ||
310 | target_stat.message_recent = 0; | ||
311 | QString p = MBOXPath+"/"+mailbox; | ||
312 | QFile fi(p); | ||
313 | if (!fi.exists()) { | ||
314 | Global::statusMessage(tr("Mailbox doesn't exist.")); | ||
315 | return; | ||
316 | } | ||
317 | int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); | ||
318 | folder = mailfolder_new( storage,(char*)p.latin1(),NULL); | ||
319 | r = mailfolder_connect(folder); | ||
320 | r = mailsession_status_folder(folder->fld_session,(char*)mailbox.latin1(),&target_stat.message_count, | ||
321 | &target_stat.message_recent,&target_stat.message_unseen); | ||
322 | if (folder) mailfolder_free(folder); | ||
323 | if (storage) mailstorage_free(storage); | ||
324 | } | ||
diff --git a/noncore/net/mail/mboxwrapper.h b/noncore/net/mail/mboxwrapper.h index 226a544..f822997 100644 --- a/noncore/net/mail/mboxwrapper.h +++ b/noncore/net/mail/mboxwrapper.h | |||
@@ -1,41 +1,42 @@ | |||
1 | #ifndef __MBOX_WRAPPER_H | 1 | #ifndef __MBOX_WRAPPER_H |
2 | #define __MBOX_WRAPPER_H | 2 | #define __MBOX_WRAPPER_H |
3 | 3 | ||
4 | #include "genericwrapper.h" | 4 | #include "genericwrapper.h" |
5 | #include <qstring.h> | 5 | #include <qstring.h> |
6 | 6 | ||
7 | class RecMail; | 7 | class RecMail; |
8 | class RecBody; | 8 | class RecBody; |
9 | struct mailmbox_folder; | 9 | struct mailmbox_folder; |
10 | 10 | ||
11 | class MBOXwrapper : public Genericwrapper | 11 | class MBOXwrapper : public Genericwrapper |
12 | { | 12 | { |
13 | Q_OBJECT | 13 | Q_OBJECT |
14 | public: | 14 | public: |
15 | MBOXwrapper(const QString & dir); | 15 | MBOXwrapper(const QString & dir); |
16 | virtual ~MBOXwrapper(); | 16 | virtual ~MBOXwrapper(); |
17 | 17 | ||
18 | virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); | 18 | virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); |
19 | virtual QList<Folder>* listFolders(); | 19 | virtual QList<Folder>* listFolders(); |
20 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); | ||
20 | 21 | ||
21 | virtual void deleteMail(const RecMail&mail); | 22 | virtual void deleteMail(const RecMail&mail); |
22 | virtual void answeredMail(const RecMail&mail); | 23 | virtual void answeredMail(const RecMail&mail); |
23 | 24 | ||
24 | virtual int createMbox(const QString&folder,const Folder*f=0,const QString&d="",bool s=false); | 25 | virtual int createMbox(const QString&folder,const Folder*f=0,const QString&d="",bool s=false); |
25 | virtual int deleteMbox(const Folder*); | 26 | virtual int deleteMbox(const Folder*); |
26 | 27 | ||
27 | virtual void storeMessage(const char*msg,size_t length, const QString&folder); | 28 | virtual void storeMessage(const char*msg,size_t length, const QString&folder); |
28 | 29 | ||
29 | virtual RecBody fetchBody( const RecMail &mail ); | 30 | virtual RecBody fetchBody( const RecMail &mail ); |
30 | static void mbox_progress( size_t current, size_t maximum ); | 31 | static void mbox_progress( size_t current, size_t maximum ); |
31 | 32 | ||
32 | virtual void fetchRawBody(const RecMail&mail,char**target,size_t*length); | 33 | virtual void fetchRawBody(const RecMail&mail,char**target,size_t*length); |
33 | virtual void deleteMails(const QString & mailbox,QList<RecMail> &target); | 34 | virtual void deleteMails(const QString & mailbox,QList<RecMail> &target); |
34 | virtual int deleteAllMail(const Folder*); | 35 | virtual int deleteAllMail(const Folder*); |
35 | 36 | ||
36 | protected: | 37 | protected: |
37 | static void deleteMails(mailmbox_folder*f,QList<RecMail> &target); | 38 | static void deleteMails(mailmbox_folder*f,QList<RecMail> &target); |
38 | QString MBOXPath; | 39 | QString MBOXPath; |
39 | }; | 40 | }; |
40 | 41 | ||
41 | #endif | 42 | #endif |
diff --git a/noncore/net/mail/pop3wrapper.cpp b/noncore/net/mail/pop3wrapper.cpp index de90dd1..d76d82a 100644 --- a/noncore/net/mail/pop3wrapper.cpp +++ b/noncore/net/mail/pop3wrapper.cpp | |||
@@ -187,32 +187,43 @@ void POP3wrapper::deleteMail(const RecMail&mail) | |||
187 | int err = mailsession_remove_message(m_folder->fld_session,mail.getNumber()); | 187 | int err = mailsession_remove_message(m_folder->fld_session,mail.getNumber()); |
188 | if (err != MAIL_NO_ERROR) { | 188 | if (err != MAIL_NO_ERROR) { |
189 | Global::statusMessage(tr("error deleting mail")); | 189 | Global::statusMessage(tr("error deleting mail")); |
190 | } | 190 | } |
191 | } | 191 | } |
192 | 192 | ||
193 | void POP3wrapper::answeredMail(const RecMail&) | 193 | void POP3wrapper::answeredMail(const RecMail&) |
194 | { | 194 | { |
195 | } | 195 | } |
196 | 196 | ||
197 | int POP3wrapper::deleteAllMail(const Folder*) | 197 | int POP3wrapper::deleteAllMail(const Folder*) |
198 | { | 198 | { |
199 | login(); | 199 | login(); |
200 | if (!m_pop3) return 0; | 200 | if (!m_pop3) return 0; |
201 | int res = 1; | 201 | int res = 1; |
202 | 202 | ||
203 | uint32_t result = 0; | 203 | uint32_t result = 0; |
204 | int err = mailsession_messages_number(m_folder->fld_session,NULL,&result); | 204 | int err = mailsession_messages_number(m_folder->fld_session,NULL,&result); |
205 | if (err != MAIL_NO_ERROR) { | 205 | if (err != MAIL_NO_ERROR) { |
206 | Global::statusMessage(tr("Error getting folder info")); | 206 | Global::statusMessage(tr("Error getting folder info")); |
207 | return 0; | 207 | return 0; |
208 | } | 208 | } |
209 | for (unsigned int i = 0; i < result; ++i) { | 209 | for (unsigned int i = 0; i < result; ++i) { |
210 | err = mailsession_remove_message(m_folder->fld_session,i+1); | 210 | err = mailsession_remove_message(m_folder->fld_session,i+1); |
211 | if (err != MAIL_NO_ERROR) { | 211 | if (err != MAIL_NO_ERROR) { |
212 | Global::statusMessage(tr("Error deleting mail %1").arg(i+1)); | 212 | Global::statusMessage(tr("Error deleting mail %1").arg(i+1)); |
213 | res=0; | 213 | res=0; |
214 | } | 214 | } |
215 | break; | 215 | break; |
216 | } | 216 | } |
217 | return res; | 217 | return res; |
218 | } | 218 | } |
219 | |||
220 | void POP3wrapper::statusFolder(folderStat&target_stat,const QString&) | ||
221 | { | ||
222 | login(); | ||
223 | target_stat.message_count = 0; | ||
224 | target_stat.message_unseen = 0; | ||
225 | target_stat.message_recent = 0; | ||
226 | if (!m_pop3) return; | ||
227 | int r = mailsession_status_folder(m_folder->fld_session,0,&target_stat.message_count, | ||
228 | &target_stat.message_recent,&target_stat.message_unseen); | ||
229 | } | ||
diff --git a/noncore/net/mail/pop3wrapper.h b/noncore/net/mail/pop3wrapper.h index b3a42be..536cadc 100644 --- a/noncore/net/mail/pop3wrapper.h +++ b/noncore/net/mail/pop3wrapper.h | |||
@@ -1,37 +1,39 @@ | |||
1 | #ifndef __POP3WRAPPER | 1 | #ifndef __POP3WRAPPER |
2 | #define __POP3WRAPPER | 2 | #define __POP3WRAPPER |
3 | 3 | ||
4 | #include "mailwrapper.h" | 4 | #include "mailwrapper.h" |
5 | #include "genericwrapper.h" | 5 | #include "genericwrapper.h" |
6 | #include <qstring.h> | 6 | #include <qstring.h> |
7 | 7 | ||
8 | struct mailstorage; | 8 | struct mailstorage; |
9 | struct mailfolder; | 9 | struct mailfolder; |
10 | 10 | ||
11 | class POP3wrapper : public Genericwrapper | 11 | class POP3wrapper : public Genericwrapper |
12 | { | 12 | { |
13 | Q_OBJECT | 13 | Q_OBJECT |
14 | 14 | ||
15 | public: | 15 | public: |
16 | POP3wrapper( POP3account *a ); | 16 | POP3wrapper( POP3account *a ); |
17 | virtual ~POP3wrapper(); | 17 | virtual ~POP3wrapper(); |
18 | /* mailbox will be ignored */ | 18 | /* mailbox will be ignored */ |
19 | virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); | 19 | virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); |
20 | virtual QList<Folder>* listFolders(); | 20 | virtual QList<Folder>* listFolders(); |
21 | /* mailbox will be ignored */ | ||
22 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); | ||
21 | 23 | ||
22 | virtual void deleteMail(const RecMail&mail); | 24 | virtual void deleteMail(const RecMail&mail); |
23 | virtual void answeredMail(const RecMail&mail); | 25 | virtual void answeredMail(const RecMail&mail); |
24 | virtual int deleteAllMail(const Folder*); | 26 | virtual int deleteAllMail(const Folder*); |
25 | 27 | ||
26 | virtual RecBody fetchBody( const RecMail &mail ); | 28 | virtual RecBody fetchBody( const RecMail &mail ); |
27 | static void pop3_progress( size_t current, size_t maximum ); | 29 | static void pop3_progress( size_t current, size_t maximum ); |
28 | 30 | ||
29 | protected: | 31 | protected: |
30 | void login(); | 32 | void login(); |
31 | void logout(); | 33 | void logout(); |
32 | POP3account *account; | 34 | POP3account *account; |
33 | mailstorage*m_pop3; | 35 | mailstorage*m_pop3; |
34 | mailfolder*m_folder; | 36 | mailfolder*m_folder; |
35 | }; | 37 | }; |
36 | 38 | ||
37 | #endif | 39 | #endif |