Sa Nov 27 2010 08:08:51 EST von "dothebart" <dotheb...@uncensored.citadel.org> Betreff: [SCM] citadel.org branch, master, updated. a1cdf216c9d092490b69eb54566896b9463dc379


Add test mime containers that (used to..) cause troubles in the recent past.

Add mime-parser-testing tool

to be able to test the mimeparser in an insulated binary, here we have a test, that reads a given file into memory, and parses it using the mime parser.

More hickups found due to the mimetester; pre push.

- the_mime_parser (): we need to know where parse_MimeHeaders() finds the end of the headers.
- the_mime_parser (): don't move the pointer around just to count up to the end-pointer. this can be done by pointer substraction.
- parse_MimeHeaders (): move the parameter so our caller gets to know what we read
- parse_MimeHeaders (): if (ptr >= content_end) after reading is probably a bug (also there in stable..), that makes us fail to read the last line, if. move it to the end of the pointer.
- don't call strchr twice; remember & evaluate the first result
- stripping the disposition-header can be done right where we found it.

fix crash: we want to do is_digit() on *char* not on char*

some bug the mimetest found before push.

First Step: chop mimeparser into pieces.

- move the cluster of buffers into a struct compatible to the CKEY macro
- add the interesting other evaluated flags & numbers to that struct
- move finding & parsing of the 'interesting headers' into its own function.

by all this we hope to get informations about the mimepart before we have to search for its end

create mode 100644 libcitadel/tests/mimeparser_test.c
rename libcitadel/tests/{ => testdata/emailaddresses}/email_recipientstrings.txt (100%)
create mode 100644 libcitadel/tests/testdata/mime/badmsg.eml
create mode 100644 libcitadel/tests/testdata/mime/browser.mime
create mode 100644 libcitadel/tests/testdata/mime/endlessloop.eml
create mode 100644 libcitadel/tests/testdata/mime/post_mimecontainer.mime
create mode 100644 libcitadel/tests/testdata/mime/vcard_hides_message_content.eml


ok, big chunk. not yet all there. this moves the search for content-type & friends into their own sub-function and does some more optimizations.

for easy testing there now is a tests/mimeparser_test to be called like this

./tests/mimeparser_test -p -f ./tests/testdata/mime/endlessloop.eml

(for example...)

where endlessloop.eml would be something one saved via imap/tbird ctrl+u

post_mimecontainter.mime is sniffed from webcit with a multipart mime post.

 

still want to create more flexibility when to call the 'interesting header - parser' so we can decide better where & how to search for the next boundary.

Reply via email to