author | alwin <alwin> | 2003-12-19 19:30:47 (UTC) |
---|---|---|
committer | alwin <alwin> | 2003-12-19 19:30:47 (UTC) |
commit | 00a0c8cf03fe746c1e3ba608bf298c8e66d065f9 (patch) (unidiff) | |
tree | 15cd3d961b3f974945f63e86dd314a12eb183575 /noncore | |
parent | b66e2d718769a3ac1ae6bc1fc135c04f532bdbf3 (diff) | |
download | opie-00a0c8cf03fe746c1e3ba608bf298c8e66d065f9.zip opie-00a0c8cf03fe746c1e3ba608bf298c8e66d065f9.tar.gz opie-00a0c8cf03fe746c1e3ba608bf298c8e66d065f9.tar.bz2 |
receiving and splitting a mail finished
next step: setup unique ids for attachmenst if not given an cache them.
Note: this could can used later for MH access, too. Means, pop3 and
MH wrapper should get a baseclass for the parsing funs.
-rw-r--r-- | noncore/net/mail/libmailwrapper/pop3wrapper.cpp | 33 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/pop3wrapper.h | 1 | ||||
-rw-r--r-- | noncore/net/mail/pop3wrapper.cpp | 33 | ||||
-rw-r--r-- | noncore/net/mail/pop3wrapper.h | 1 |
4 files changed, 52 insertions, 16 deletions
diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp index 2c2a42a..65cd4ba 100644 --- a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp +++ b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp | |||
@@ -448,12 +448,6 @@ void POP3wrapper::traverseBody(RecBody&target,mailmessage*message,mailmime*mime, | |||
448 | clistiter * cur = 0; | 448 | clistiter * cur = 0; |
449 | mailmime_single_fields fields; | ||
450 | int res; | 449 | int res; |
451 | QString b; | 450 | QString b; |
452 | memset(&fields, 0, sizeof(struct mailmime_single_fields)); | ||
453 | RecPart part; | 451 | RecPart part; |
454 | 452 | ||
455 | if (mime->mm_mime_fields != NULL) { | ||
456 | mailmime_single_fields_init(&fields, mime->mm_mime_fields, | ||
457 | mime->mm_content_type); | ||
458 | } | ||
459 | switch (mime->mm_type) { | 453 | switch (mime->mm_type) { |
@@ -461,2 +455,3 @@ void POP3wrapper::traverseBody(RecBody&target,mailmessage*message,mailmime*mime, | |||
461 | r = mailmessage_fetch_section(message,mime,&data,&len); | 455 | r = mailmessage_fetch_section(message,mime,&data,&len); |
456 | part.setSize(len); | ||
462 | fillSingleBody(part,message,mime); | 457 | fillSingleBody(part,message,mime); |
@@ -525,4 +520,11 @@ void POP3wrapper::fillSingleBody(RecPart&target,mailmessage*,mailmime*mime) | |||
525 | } | 520 | } |
526 | mailmime_content*type = mime->mm_content_type; | ||
527 | mailmime_field*field = 0; | 521 | mailmime_field*field = 0; |
522 | mailmime_single_fields fields; | ||
523 | memset(&fields, 0, sizeof(struct mailmime_single_fields)); | ||
524 | if (mime->mm_mime_fields != NULL) { | ||
525 | mailmime_single_fields_init(&fields, mime->mm_mime_fields, | ||
526 | mime->mm_content_type); | ||
527 | } | ||
528 | |||
529 | mailmime_content*type = fields.fld_content; | ||
528 | clistcell*current; | 530 | clistcell*current; |
@@ -556,2 +558,5 @@ void POP3wrapper::fillSingleBody(RecPart&target,mailmessage*,mailmime*mime) | |||
556 | } | 558 | } |
559 | if (type->ct_parameters) { | ||
560 | fillParameters(target,type->ct_parameters); | ||
561 | } | ||
557 | } | 562 | } |
@@ -575,3 +580,15 @@ void POP3wrapper::fillSingleBody(RecPart&target,mailmessage*,mailmime*mime) | |||
575 | } | 580 | } |
576 | // TODO search the parameter list for unique id and so on | 581 | } |
582 | |||
583 | void POP3wrapper::fillParameters(RecPart&target,clist*parameters) | ||
584 | { | ||
585 | if (!parameters) {return;} | ||
586 | clistcell*current=0; | ||
587 | mailmime_parameter*param; | ||
588 | for (current=clist_begin(parameters);current!=0;current=clist_next(current)) { | ||
589 | param = (mailmime_parameter*)current->data; | ||
590 | if (param) { | ||
591 | target.addParameter(QString(param->pa_name).lower(),QString(param->pa_value)); | ||
592 | } | ||
593 | } | ||
577 | } | 594 | } |
diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.h b/noncore/net/mail/libmailwrapper/pop3wrapper.h index 4171a76..b17928e 100644 --- a/noncore/net/mail/libmailwrapper/pop3wrapper.h +++ b/noncore/net/mail/libmailwrapper/pop3wrapper.h | |||
@@ -48,2 +48,3 @@ protected: | |||
48 | static void fillSingleBody(RecPart&target,mailmessage*message,mailmime*mime); | 48 | static void fillSingleBody(RecPart&target,mailmessage*message,mailmime*mime); |
49 | static void fillParameters(RecPart&target,clist*parameters); | ||
49 | static QString POP3wrapper::getencoding(mailmime_mechanism*aEnc); | 50 | static QString POP3wrapper::getencoding(mailmime_mechanism*aEnc); |
diff --git a/noncore/net/mail/pop3wrapper.cpp b/noncore/net/mail/pop3wrapper.cpp index 2c2a42a..65cd4ba 100644 --- a/noncore/net/mail/pop3wrapper.cpp +++ b/noncore/net/mail/pop3wrapper.cpp | |||
@@ -448,12 +448,6 @@ void POP3wrapper::traverseBody(RecBody&target,mailmessage*message,mailmime*mime, | |||
448 | clistiter * cur = 0; | 448 | clistiter * cur = 0; |
449 | mailmime_single_fields fields; | ||
450 | int res; | 449 | int res; |
451 | QString b; | 450 | QString b; |
452 | memset(&fields, 0, sizeof(struct mailmime_single_fields)); | ||
453 | RecPart part; | 451 | RecPart part; |
454 | 452 | ||
455 | if (mime->mm_mime_fields != NULL) { | ||
456 | mailmime_single_fields_init(&fields, mime->mm_mime_fields, | ||
457 | mime->mm_content_type); | ||
458 | } | ||
459 | switch (mime->mm_type) { | 453 | switch (mime->mm_type) { |
@@ -461,2 +455,3 @@ void POP3wrapper::traverseBody(RecBody&target,mailmessage*message,mailmime*mime, | |||
461 | r = mailmessage_fetch_section(message,mime,&data,&len); | 455 | r = mailmessage_fetch_section(message,mime,&data,&len); |
456 | part.setSize(len); | ||
462 | fillSingleBody(part,message,mime); | 457 | fillSingleBody(part,message,mime); |
@@ -525,4 +520,11 @@ void POP3wrapper::fillSingleBody(RecPart&target,mailmessage*,mailmime*mime) | |||
525 | } | 520 | } |
526 | mailmime_content*type = mime->mm_content_type; | ||
527 | mailmime_field*field = 0; | 521 | mailmime_field*field = 0; |
522 | mailmime_single_fields fields; | ||
523 | memset(&fields, 0, sizeof(struct mailmime_single_fields)); | ||
524 | if (mime->mm_mime_fields != NULL) { | ||
525 | mailmime_single_fields_init(&fields, mime->mm_mime_fields, | ||
526 | mime->mm_content_type); | ||
527 | } | ||
528 | |||
529 | mailmime_content*type = fields.fld_content; | ||
528 | clistcell*current; | 530 | clistcell*current; |
@@ -556,2 +558,5 @@ void POP3wrapper::fillSingleBody(RecPart&target,mailmessage*,mailmime*mime) | |||
556 | } | 558 | } |
559 | if (type->ct_parameters) { | ||
560 | fillParameters(target,type->ct_parameters); | ||
561 | } | ||
557 | } | 562 | } |
@@ -575,3 +580,15 @@ void POP3wrapper::fillSingleBody(RecPart&target,mailmessage*,mailmime*mime) | |||
575 | } | 580 | } |
576 | // TODO search the parameter list for unique id and so on | 581 | } |
582 | |||
583 | void POP3wrapper::fillParameters(RecPart&target,clist*parameters) | ||
584 | { | ||
585 | if (!parameters) {return;} | ||
586 | clistcell*current=0; | ||
587 | mailmime_parameter*param; | ||
588 | for (current=clist_begin(parameters);current!=0;current=clist_next(current)) { | ||
589 | param = (mailmime_parameter*)current->data; | ||
590 | if (param) { | ||
591 | target.addParameter(QString(param->pa_name).lower(),QString(param->pa_value)); | ||
592 | } | ||
593 | } | ||
577 | } | 594 | } |
diff --git a/noncore/net/mail/pop3wrapper.h b/noncore/net/mail/pop3wrapper.h index 4171a76..b17928e 100644 --- a/noncore/net/mail/pop3wrapper.h +++ b/noncore/net/mail/pop3wrapper.h | |||
@@ -48,2 +48,3 @@ protected: | |||
48 | static void fillSingleBody(RecPart&target,mailmessage*message,mailmime*mime); | 48 | static void fillSingleBody(RecPart&target,mailmessage*message,mailmime*mime); |
49 | static void fillParameters(RecPart&target,clist*parameters); | ||
49 | static QString POP3wrapper::getencoding(mailmime_mechanism*aEnc); | 50 | static QString POP3wrapper::getencoding(mailmime_mechanism*aEnc); |