summaryrefslogtreecommitdiff
authoralwin <alwin>2003-12-14 19:36:09 (UTC)
committer alwin <alwin>2003-12-14 19:36:09 (UTC)
commitaa2c19611a347a3945d403e20bcef01977d68b6a (patch) (unidiff)
tree669bf39c587f9ee22e17fe2c61ed0fec78f356d3
parent353e1da81b235d7798763bce76428fb473108fb6 (diff)
downloadopie-aa2c19611a347a3945d403e20bcef01977d68b6a.zip
opie-aa2c19611a347a3945d403e20bcef01977d68b6a.tar.gz
opie-aa2c19611a347a3945d403e20bcef01977d68b6a.tar.bz2
if a mailbox-prefix is set than it will not displayed in folderview
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/imapwrapper.cpp4
-rw-r--r--noncore/net/mail/libmailwrapper/imapwrapper.cpp4
-rw-r--r--noncore/net/mail/libmailwrapper/mailwrapper.cpp12
-rw-r--r--noncore/net/mail/libmailwrapper/mailwrapper.h4
-rw-r--r--noncore/net/mail/mailwrapper.cpp12
-rw-r--r--noncore/net/mail/mailwrapper.h4
6 files changed, 32 insertions, 8 deletions
diff --git a/noncore/net/mail/imapwrapper.cpp b/noncore/net/mail/imapwrapper.cpp
index b253b49..0ce2c6c 100644
--- a/noncore/net/mail/imapwrapper.cpp
+++ b/noncore/net/mail/imapwrapper.cpp
@@ -179,53 +179,55 @@ QList<Folder>* IMAPwrapper::listFolders()
179 qDebug("error fetching folders: %s",m_imap->imap_response); 179 qDebug("error fetching folders: %s",m_imap->imap_response);
180 } 180 }
181 mailimap_list_result_free( result ); 181 mailimap_list_result_free( result );
182 182
183/* 183/*
184 * second stage - get the other then inbox folders 184 * second stage - get the other then inbox folders
185 */ 185 */
186 mask = "*" ; 186 mask = "*" ;
187 path = account->getPrefix().latin1(); 187 path = account->getPrefix().latin1();
188 if (!path) path = ""; 188 if (!path) path = "";
189 result = clist_new(); 189 result = clist_new();
190 qDebug(path); 190 qDebug(path);
191 bool selectable = true; 191 bool selectable = true;
192 mailimap_mbx_list_flags*bflags; 192 mailimap_mbx_list_flags*bflags;
193 err = mailimap_list( m_imap, (char*)path, (char*)mask, &result ); 193 err = mailimap_list( m_imap, (char*)path, (char*)mask, &result );
194 if ( err == MAILIMAP_NO_ERROR ) { 194 if ( err == MAILIMAP_NO_ERROR ) {
195 current = result->first; 195 current = result->first;
196 for ( current=clist_begin(result);current!=NULL;current=clist_next(current)) { 196 for ( current=clist_begin(result);current!=NULL;current=clist_next(current)) {
197 list = (mailimap_mailbox_list *) current->data; 197 list = (mailimap_mailbox_list *) current->data;
198 // it is better use the deep copy mechanism of qt itself 198 // it is better use the deep copy mechanism of qt itself
199 // instead of using strdup! 199 // instead of using strdup!
200 temp = list->mb_name; 200 temp = list->mb_name;
201 if (temp.lower()=="inbox") 201 if (temp.lower()=="inbox")
202 continue; 202 continue;
203 if (temp.lower()==account->getPrefix().lower())
204 continue;
203 if ( (bflags = list->mb_flag) ) { 205 if ( (bflags = list->mb_flag) ) {
204 selectable = !(bflags->mbf_type==MAILIMAP_MBX_LIST_FLAGS_SFLAG&& 206 selectable = !(bflags->mbf_type==MAILIMAP_MBX_LIST_FLAGS_SFLAG&&
205 bflags->mbf_sflag==MAILIMAP_MBX_LIST_SFLAG_NOSELECT); 207 bflags->mbf_sflag==MAILIMAP_MBX_LIST_SFLAG_NOSELECT);
206 } 208 }
207 folders->append(new IMAPFolder(temp,selectable)); 209 folders->append(new IMAPFolder(temp,selectable,account->getPrefix()));
208 } 210 }
209 } else { 211 } else {
210 qDebug("error fetching folders %s",m_imap->imap_response); 212 qDebug("error fetching folders %s",m_imap->imap_response);
211 } 213 }
212 mailimap_list_result_free( result ); 214 mailimap_list_result_free( result );
213 return folders; 215 return folders;
214} 216}
215 217
216RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att) 218RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att)
217{ 219{
218 RecMail * m = 0; 220 RecMail * m = 0;
219 mailimap_msg_att_item *item=0; 221 mailimap_msg_att_item *item=0;
220 clistcell *current,*c,*cf; 222 clistcell *current,*c,*cf;
221 mailimap_msg_att_dynamic*flist; 223 mailimap_msg_att_dynamic*flist;
222 mailimap_flag_fetch*cflag; 224 mailimap_flag_fetch*cflag;
223 int size; 225 int size;
224 QBitArray mFlags(7); 226 QBitArray mFlags(7);
225 QStringList addresslist; 227 QStringList addresslist;
226 228
227 if (!m_att) { 229 if (!m_att) {
228 return m; 230 return m;
229 } 231 }
230 m = new RecMail(); 232 m = new RecMail();
231 for (c = clist_begin(m_att->att_list); c!=NULL;c=clist_next(c) ) { 233 for (c = clist_begin(m_att->att_list); c!=NULL;c=clist_next(c) ) {
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp
index b253b49..0ce2c6c 100644
--- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp
@@ -179,53 +179,55 @@ QList<Folder>* IMAPwrapper::listFolders()
179 qDebug("error fetching folders: %s",m_imap->imap_response); 179 qDebug("error fetching folders: %s",m_imap->imap_response);
180 } 180 }
181 mailimap_list_result_free( result ); 181 mailimap_list_result_free( result );
182 182
183/* 183/*
184 * second stage - get the other then inbox folders 184 * second stage - get the other then inbox folders
185 */ 185 */
186 mask = "*" ; 186 mask = "*" ;
187 path = account->getPrefix().latin1(); 187 path = account->getPrefix().latin1();
188 if (!path) path = ""; 188 if (!path) path = "";
189 result = clist_new(); 189 result = clist_new();
190 qDebug(path); 190 qDebug(path);
191 bool selectable = true; 191 bool selectable = true;
192 mailimap_mbx_list_flags*bflags; 192 mailimap_mbx_list_flags*bflags;
193 err = mailimap_list( m_imap, (char*)path, (char*)mask, &result ); 193 err = mailimap_list( m_imap, (char*)path, (char*)mask, &result );
194 if ( err == MAILIMAP_NO_ERROR ) { 194 if ( err == MAILIMAP_NO_ERROR ) {
195 current = result->first; 195 current = result->first;
196 for ( current=clist_begin(result);current!=NULL;current=clist_next(current)) { 196 for ( current=clist_begin(result);current!=NULL;current=clist_next(current)) {
197 list = (mailimap_mailbox_list *) current->data; 197 list = (mailimap_mailbox_list *) current->data;
198 // it is better use the deep copy mechanism of qt itself 198 // it is better use the deep copy mechanism of qt itself
199 // instead of using strdup! 199 // instead of using strdup!
200 temp = list->mb_name; 200 temp = list->mb_name;
201 if (temp.lower()=="inbox") 201 if (temp.lower()=="inbox")
202 continue; 202 continue;
203 if (temp.lower()==account->getPrefix().lower())
204 continue;
203 if ( (bflags = list->mb_flag) ) { 205 if ( (bflags = list->mb_flag) ) {
204 selectable = !(bflags->mbf_type==MAILIMAP_MBX_LIST_FLAGS_SFLAG&& 206 selectable = !(bflags->mbf_type==MAILIMAP_MBX_LIST_FLAGS_SFLAG&&
205 bflags->mbf_sflag==MAILIMAP_MBX_LIST_SFLAG_NOSELECT); 207 bflags->mbf_sflag==MAILIMAP_MBX_LIST_SFLAG_NOSELECT);
206 } 208 }
207 folders->append(new IMAPFolder(temp,selectable)); 209 folders->append(new IMAPFolder(temp,selectable,account->getPrefix()));
208 } 210 }
209 } else { 211 } else {
210 qDebug("error fetching folders %s",m_imap->imap_response); 212 qDebug("error fetching folders %s",m_imap->imap_response);
211 } 213 }
212 mailimap_list_result_free( result ); 214 mailimap_list_result_free( result );
213 return folders; 215 return folders;
214} 216}
215 217
216RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att) 218RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att)
217{ 219{
218 RecMail * m = 0; 220 RecMail * m = 0;
219 mailimap_msg_att_item *item=0; 221 mailimap_msg_att_item *item=0;
220 clistcell *current,*c,*cf; 222 clistcell *current,*c,*cf;
221 mailimap_msg_att_dynamic*flist; 223 mailimap_msg_att_dynamic*flist;
222 mailimap_flag_fetch*cflag; 224 mailimap_flag_fetch*cflag;
223 int size; 225 int size;
224 QBitArray mFlags(7); 226 QBitArray mFlags(7);
225 QStringList addresslist; 227 QStringList addresslist;
226 228
227 if (!m_att) { 229 if (!m_att) {
228 return m; 230 return m;
229 } 231 }
230 m = new RecMail(); 232 m = new RecMail();
231 for (c = clist_begin(m_att->att_list); c!=NULL;c=clist_next(c) ) { 233 for (c = clist_begin(m_att->att_list); c!=NULL;c=clist_next(c) ) {
diff --git a/noncore/net/mail/libmailwrapper/mailwrapper.cpp b/noncore/net/mail/libmailwrapper/mailwrapper.cpp
index 3ffc274..96602c2 100644
--- a/noncore/net/mail/libmailwrapper/mailwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/mailwrapper.cpp
@@ -13,52 +13,62 @@
13 13
14Attachment::Attachment( DocLnk lnk ) 14Attachment::Attachment( DocLnk lnk )
15{ 15{
16 doc = lnk; 16 doc = lnk;
17 size = QFileInfo( doc.file() ).size(); 17 size = QFileInfo( doc.file() ).size();
18} 18}
19 19
20Folder::Folder(const QString&tmp_name ) 20Folder::Folder(const QString&tmp_name )
21{ 21{
22 name = tmp_name; 22 name = tmp_name;
23 nameDisplay = name; 23 nameDisplay = name;
24 24
25 for ( int pos = nameDisplay.find( '&' ); pos != -1; 25 for ( int pos = nameDisplay.find( '&' ); pos != -1;
26 pos = nameDisplay.find( '&' ) ) { 26 pos = nameDisplay.find( '&' ) ) {
27 int end = nameDisplay.find( '-' ); 27 int end = nameDisplay.find( '-' );
28 if ( end == -1 || end <= pos ) break; 28 if ( end == -1 || end <= pos ) break;
29 QString str64 = nameDisplay.mid( pos + 1, end - pos - 1 ); 29 QString str64 = nameDisplay.mid( pos + 1, end - pos - 1 );
30 // TODO: do real base64 decoding here ! 30 // TODO: do real base64 decoding here !
31 if ( str64.compare( "APw" ) == 0 ) { 31 if ( str64.compare( "APw" ) == 0 ) {
32 nameDisplay = nameDisplay.replace( pos, end - pos + 1, "ue" ); 32 nameDisplay = nameDisplay.replace( pos, end - pos + 1, "ue" );
33 } else if ( str64.compare( "APY" ) == 0 ) { 33 } else if ( str64.compare( "APY" ) == 0 ) {
34 nameDisplay = nameDisplay.replace( pos, end - pos + 1, "oe" ); 34 nameDisplay = nameDisplay.replace( pos, end - pos + 1, "oe" );
35 } 35 }
36 } 36 }
37
38 qDebug( "folder " + name + " - displayed as " + nameDisplay ); 37 qDebug( "folder " + name + " - displayed as " + nameDisplay );
39} 38}
40 39
40
41IMAPFolder::IMAPFolder(const QString&name,bool select,const QString&prefix )
42 : Folder( name ),m_MaySelect(select)
43{
44 if (prefix.length()>0) {
45 if (nameDisplay.startsWith(prefix) && nameDisplay.length()>prefix.length()) {
46 nameDisplay=nameDisplay.right(nameDisplay.length()-prefix.length());
47 }
48 }
49}
50
41MailWrapper::MailWrapper( Settings *s ) 51MailWrapper::MailWrapper( Settings *s )
42 : QObject() 52 : QObject()
43{ 53{
44 settings = s; 54 settings = s;
45} 55}
46 56
47QString MailWrapper::mailsmtpError( int errnum ) 57QString MailWrapper::mailsmtpError( int errnum )
48{ 58{
49 switch ( errnum ) { 59 switch ( errnum ) {
50 case MAILSMTP_NO_ERROR: 60 case MAILSMTP_NO_ERROR:
51 return tr( "No error" ); 61 return tr( "No error" );
52 case MAILSMTP_ERROR_UNEXPECTED_CODE: 62 case MAILSMTP_ERROR_UNEXPECTED_CODE:
53 return tr( "Unexpected error code" ); 63 return tr( "Unexpected error code" );
54 case MAILSMTP_ERROR_SERVICE_NOT_AVAILABLE: 64 case MAILSMTP_ERROR_SERVICE_NOT_AVAILABLE:
55 return tr( "Service not available" ); 65 return tr( "Service not available" );
56 case MAILSMTP_ERROR_STREAM: 66 case MAILSMTP_ERROR_STREAM:
57 return tr( "Stream error" ); 67 return tr( "Stream error" );
58 case MAILSMTP_ERROR_HOSTNAME: 68 case MAILSMTP_ERROR_HOSTNAME:
59 return tr( "gethostname() failed" ); 69 return tr( "gethostname() failed" );
60 case MAILSMTP_ERROR_NOT_IMPLEMENTED: 70 case MAILSMTP_ERROR_NOT_IMPLEMENTED:
61 return tr( "Not implemented" ); 71 return tr( "Not implemented" );
62 case MAILSMTP_ERROR_ACTION_NOT_TAKEN: 72 case MAILSMTP_ERROR_ACTION_NOT_TAKEN:
63 return tr( "Error, action not taken" ); 73 return tr( "Error, action not taken" );
64 case MAILSMTP_ERROR_EXCEED_STORAGE_ALLOCATION: 74 case MAILSMTP_ERROR_EXCEED_STORAGE_ALLOCATION:
diff --git a/noncore/net/mail/libmailwrapper/mailwrapper.h b/noncore/net/mail/libmailwrapper/mailwrapper.h
index 34fd5c5..6994dd8 100644
--- a/noncore/net/mail/libmailwrapper/mailwrapper.h
+++ b/noncore/net/mail/libmailwrapper/mailwrapper.h
@@ -55,57 +55,57 @@ public:
55 const QString&getBCC()const { return bcc; } 55 const QString&getBCC()const { return bcc; }
56 void setBCC( const QString&s ) { bcc = s; } 56 void setBCC( const QString&s ) { bcc = s; }
57 const QString&getMessage()const { return message; } 57 const QString&getMessage()const { return message; }
58 void setMessage( const QString&s ) { message = s; } 58 void setMessage( const QString&s ) { message = s; }
59 const QString&getSubject()const { return subject; } 59 const QString&getSubject()const { return subject; }
60 void setSubject( const QString&s ) { subject = s; } 60 void setSubject( const QString&s ) { subject = s; }
61 const QString&getReply()const{ return reply; } 61 const QString&getReply()const{ return reply; }
62 void setReply( const QString&a ) { reply = a; } 62 void setReply( const QString&a ) { reply = a; }
63 63
64private: 64private:
65 QList<Attachment> attList; 65 QList<Attachment> attList;
66 QString name, mail, to, cc, bcc, reply, subject, message; 66 QString name, mail, to, cc, bcc, reply, subject, message;
67}; 67};
68 68
69class Folder : public QObject 69class Folder : public QObject
70{ 70{
71 Q_OBJECT 71 Q_OBJECT
72 72
73public: 73public:
74 Folder( const QString&init_name ); 74 Folder( const QString&init_name );
75 const QString&getDisplayName()const { return nameDisplay; } 75 const QString&getDisplayName()const { return nameDisplay; }
76 const QString&getName()const { return name; } 76 const QString&getName()const { return name; }
77 virtual bool may_select()const{return true;}; 77 virtual bool may_select()const{return true;};
78 78
79private: 79protected:
80 QString nameDisplay, name; 80 QString nameDisplay, name;
81 81
82}; 82};
83 83
84class IMAPFolder : public Folder 84class IMAPFolder : public Folder
85{ 85{
86 public: 86 public:
87 IMAPFolder( QString name,bool select=true ) : Folder( name ),m_MaySelect(select) {} 87 IMAPFolder(const QString&name,bool select=true,const QString&prefix="" );
88 virtual bool may_select()const{return m_MaySelect;} 88 virtual bool may_select()const{return m_MaySelect;}
89 private: 89 private:
90 bool m_MaySelect; 90 bool m_MaySelect;
91}; 91};
92 92
93class MailWrapper : public QObject 93class MailWrapper : public QObject
94{ 94{
95 Q_OBJECT 95 Q_OBJECT
96 96
97public: 97public:
98 MailWrapper( Settings *s ); 98 MailWrapper( Settings *s );
99 void sendMail( Mail mail ); 99 void sendMail( Mail mail );
100 100
101private: 101private:
102 mailimf_mailbox *newMailbox(const QString&name,const QString&mail ); 102 mailimf_mailbox *newMailbox(const QString&name,const QString&mail );
103 mailimf_address_list *parseAddresses(const QString&addr ); 103 mailimf_address_list *parseAddresses(const QString&addr );
104 mailimf_fields *createImfFields( Mail *mail ); 104 mailimf_fields *createImfFields( Mail *mail );
105 mailmime *buildTxtPart( QString str ); 105 mailmime *buildTxtPart( QString str );
106 mailmime *buildFilePart( QString filename, QString mimetype ); 106 mailmime *buildFilePart( QString filename, QString mimetype );
107 void addFileParts( mailmime *message, QList<Attachment> files ); 107 void addFileParts( mailmime *message, QList<Attachment> files );
108 mailmime *createMimeMail( Mail *mail ); 108 mailmime *createMimeMail( Mail *mail );
109 void smtpSend( mailmime *mail ); 109 void smtpSend( mailmime *mail );
110 mailimf_field *getField( mailimf_fields *fields, int type ); 110 mailimf_field *getField( mailimf_fields *fields, int type );
111 clist *createRcptList( mailimf_fields *fields ); 111 clist *createRcptList( mailimf_fields *fields );
diff --git a/noncore/net/mail/mailwrapper.cpp b/noncore/net/mail/mailwrapper.cpp
index 3ffc274..96602c2 100644
--- a/noncore/net/mail/mailwrapper.cpp
+++ b/noncore/net/mail/mailwrapper.cpp
@@ -13,52 +13,62 @@
13 13
14Attachment::Attachment( DocLnk lnk ) 14Attachment::Attachment( DocLnk lnk )
15{ 15{
16 doc = lnk; 16 doc = lnk;
17 size = QFileInfo( doc.file() ).size(); 17 size = QFileInfo( doc.file() ).size();
18} 18}
19 19
20Folder::Folder(const QString&tmp_name ) 20Folder::Folder(const QString&tmp_name )
21{ 21{
22 name = tmp_name; 22 name = tmp_name;
23 nameDisplay = name; 23 nameDisplay = name;
24 24
25 for ( int pos = nameDisplay.find( '&' ); pos != -1; 25 for ( int pos = nameDisplay.find( '&' ); pos != -1;
26 pos = nameDisplay.find( '&' ) ) { 26 pos = nameDisplay.find( '&' ) ) {
27 int end = nameDisplay.find( '-' ); 27 int end = nameDisplay.find( '-' );
28 if ( end == -1 || end <= pos ) break; 28 if ( end == -1 || end <= pos ) break;
29 QString str64 = nameDisplay.mid( pos + 1, end - pos - 1 ); 29 QString str64 = nameDisplay.mid( pos + 1, end - pos - 1 );
30 // TODO: do real base64 decoding here ! 30 // TODO: do real base64 decoding here !
31 if ( str64.compare( "APw" ) == 0 ) { 31 if ( str64.compare( "APw" ) == 0 ) {
32 nameDisplay = nameDisplay.replace( pos, end - pos + 1, "ue" ); 32 nameDisplay = nameDisplay.replace( pos, end - pos + 1, "ue" );
33 } else if ( str64.compare( "APY" ) == 0 ) { 33 } else if ( str64.compare( "APY" ) == 0 ) {
34 nameDisplay = nameDisplay.replace( pos, end - pos + 1, "oe" ); 34 nameDisplay = nameDisplay.replace( pos, end - pos + 1, "oe" );
35 } 35 }
36 } 36 }
37
38 qDebug( "folder " + name + " - displayed as " + nameDisplay ); 37 qDebug( "folder " + name + " - displayed as " + nameDisplay );
39} 38}
40 39
40
41IMAPFolder::IMAPFolder(const QString&name,bool select,const QString&prefix )
42 : Folder( name ),m_MaySelect(select)
43{
44 if (prefix.length()>0) {
45 if (nameDisplay.startsWith(prefix) && nameDisplay.length()>prefix.length()) {
46 nameDisplay=nameDisplay.right(nameDisplay.length()-prefix.length());
47 }
48 }
49}
50
41MailWrapper::MailWrapper( Settings *s ) 51MailWrapper::MailWrapper( Settings *s )
42 : QObject() 52 : QObject()
43{ 53{
44 settings = s; 54 settings = s;
45} 55}
46 56
47QString MailWrapper::mailsmtpError( int errnum ) 57QString MailWrapper::mailsmtpError( int errnum )
48{ 58{
49 switch ( errnum ) { 59 switch ( errnum ) {
50 case MAILSMTP_NO_ERROR: 60 case MAILSMTP_NO_ERROR:
51 return tr( "No error" ); 61 return tr( "No error" );
52 case MAILSMTP_ERROR_UNEXPECTED_CODE: 62 case MAILSMTP_ERROR_UNEXPECTED_CODE:
53 return tr( "Unexpected error code" ); 63 return tr( "Unexpected error code" );
54 case MAILSMTP_ERROR_SERVICE_NOT_AVAILABLE: 64 case MAILSMTP_ERROR_SERVICE_NOT_AVAILABLE:
55 return tr( "Service not available" ); 65 return tr( "Service not available" );
56 case MAILSMTP_ERROR_STREAM: 66 case MAILSMTP_ERROR_STREAM:
57 return tr( "Stream error" ); 67 return tr( "Stream error" );
58 case MAILSMTP_ERROR_HOSTNAME: 68 case MAILSMTP_ERROR_HOSTNAME:
59 return tr( "gethostname() failed" ); 69 return tr( "gethostname() failed" );
60 case MAILSMTP_ERROR_NOT_IMPLEMENTED: 70 case MAILSMTP_ERROR_NOT_IMPLEMENTED:
61 return tr( "Not implemented" ); 71 return tr( "Not implemented" );
62 case MAILSMTP_ERROR_ACTION_NOT_TAKEN: 72 case MAILSMTP_ERROR_ACTION_NOT_TAKEN:
63 return tr( "Error, action not taken" ); 73 return tr( "Error, action not taken" );
64 case MAILSMTP_ERROR_EXCEED_STORAGE_ALLOCATION: 74 case MAILSMTP_ERROR_EXCEED_STORAGE_ALLOCATION:
diff --git a/noncore/net/mail/mailwrapper.h b/noncore/net/mail/mailwrapper.h
index 34fd5c5..6994dd8 100644
--- a/noncore/net/mail/mailwrapper.h
+++ b/noncore/net/mail/mailwrapper.h
@@ -55,57 +55,57 @@ public:
55 const QString&getBCC()const { return bcc; } 55 const QString&getBCC()const { return bcc; }
56 void setBCC( const QString&s ) { bcc = s; } 56 void setBCC( const QString&s ) { bcc = s; }
57 const QString&getMessage()const { return message; } 57 const QString&getMessage()const { return message; }
58 void setMessage( const QString&s ) { message = s; } 58 void setMessage( const QString&s ) { message = s; }
59 const QString&getSubject()const { return subject; } 59 const QString&getSubject()const { return subject; }
60 void setSubject( const QString&s ) { subject = s; } 60 void setSubject( const QString&s ) { subject = s; }
61 const QString&getReply()const{ return reply; } 61 const QString&getReply()const{ return reply; }
62 void setReply( const QString&a ) { reply = a; } 62 void setReply( const QString&a ) { reply = a; }
63 63
64private: 64private:
65 QList<Attachment> attList; 65 QList<Attachment> attList;
66 QString name, mail, to, cc, bcc, reply, subject, message; 66 QString name, mail, to, cc, bcc, reply, subject, message;
67}; 67};
68 68
69class Folder : public QObject 69class Folder : public QObject
70{ 70{
71 Q_OBJECT 71 Q_OBJECT
72 72
73public: 73public:
74 Folder( const QString&init_name ); 74 Folder( const QString&init_name );
75 const QString&getDisplayName()const { return nameDisplay; } 75 const QString&getDisplayName()const { return nameDisplay; }
76 const QString&getName()const { return name; } 76 const QString&getName()const { return name; }
77 virtual bool may_select()const{return true;}; 77 virtual bool may_select()const{return true;};
78 78
79private: 79protected:
80 QString nameDisplay, name; 80 QString nameDisplay, name;
81 81
82}; 82};
83 83
84class IMAPFolder : public Folder 84class IMAPFolder : public Folder
85{ 85{
86 public: 86 public:
87 IMAPFolder( QString name,bool select=true ) : Folder( name ),m_MaySelect(select) {} 87 IMAPFolder(const QString&name,bool select=true,const QString&prefix="" );
88 virtual bool may_select()const{return m_MaySelect;} 88 virtual bool may_select()const{return m_MaySelect;}
89 private: 89 private:
90 bool m_MaySelect; 90 bool m_MaySelect;
91}; 91};
92 92
93class MailWrapper : public QObject 93class MailWrapper : public QObject
94{ 94{
95 Q_OBJECT 95 Q_OBJECT
96 96
97public: 97public:
98 MailWrapper( Settings *s ); 98 MailWrapper( Settings *s );
99 void sendMail( Mail mail ); 99 void sendMail( Mail mail );
100 100
101private: 101private:
102 mailimf_mailbox *newMailbox(const QString&name,const QString&mail ); 102 mailimf_mailbox *newMailbox(const QString&name,const QString&mail );
103 mailimf_address_list *parseAddresses(const QString&addr ); 103 mailimf_address_list *parseAddresses(const QString&addr );
104 mailimf_fields *createImfFields( Mail *mail ); 104 mailimf_fields *createImfFields( Mail *mail );
105 mailmime *buildTxtPart( QString str ); 105 mailmime *buildTxtPart( QString str );
106 mailmime *buildFilePart( QString filename, QString mimetype ); 106 mailmime *buildFilePart( QString filename, QString mimetype );
107 void addFileParts( mailmime *message, QList<Attachment> files ); 107 void addFileParts( mailmime *message, QList<Attachment> files );
108 mailmime *createMimeMail( Mail *mail ); 108 mailmime *createMimeMail( Mail *mail );
109 void smtpSend( mailmime *mail ); 109 void smtpSend( mailmime *mail );
110 mailimf_field *getField( mailimf_fields *fields, int type ); 110 mailimf_field *getField( mailimf_fields *fields, int type );
111 clist *createRcptList( mailimf_fields *fields ); 111 clist *createRcptList( mailimf_fields *fields );