aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-mime-utils.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix the code that creates a new ssl stream to pass the correct argumentsJeffrey Stedfast2003-09-221-1/+1
| | | | | | | | | | | | | | | | | | 2003-09-22 Jeffrey Stedfast <fejj@ximian.com> * providers/nntp/camel-nntp-store.c (connect_to_server): Fix the code that creates a new ssl stream to pass the correct arguments and the proper flags. * providers/imapp/camel-imapp-folder.c (imap_sync): Cast the CamelFolder to a CamelIMAPPFolder to hush some compiler warnings. * camel-mime-utils.h: Define a struct _CamelContentDisposition (allows the imapp code to compile) * providers/imapp/camel-imapp-driver.c: #include <string.h> svn path=/trunk/; revision=22635
* New function to replace the one from camel-mime-part.cJeffrey Stedfast2003-09-191-11/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2003-09-18 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.c (camel_transfer_encoding_to_string): New function to replace the one from camel-mime-part.c (camel_transfer_encoding_from_string): Same. (camel_content_transfer_encoding_decode): Renamed from camel_header_content_encoding_decode(). * camel-mime-part.c (camel_mime_part_encoding_to_string): Removed. (camel_mime_part_encoding_from_string): Removed. * camel-data-wrapper.[c,h]: updated for CamelTransferEncoding namespace changes * camel-folder-summary.c: updated for CamelTransferEncoding namespace changes * camel-mime-filter-bestenc.[c,h]: updated for CamelTransferEncoding namespace changes * camel-mime-message.c: updated for CamelTransferEncoding namespace changes * camel-mime-part-utils.c: updated for CamelTransferEncoding namespace changes * camel-multipart-signed.c: updated for CamelTransferEncoding namespace changes * camel-smime-context.c: updated for CamelTransferEncoding namespace changes * providers/imapp/camel-imapp-utils.c: updated for CamelTransferEncoding namespace changes * tests/lib/messages.c: updated for CamelTransferEncoding namespace changes * tests/message/test1.c: updated for CamelTransferEncoding namespace changes svn path=/trunk/; revision=22617
* namespaced the encoding/decoding routines.Jeffrey Stedfast2003-09-191-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2003-09-18 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.[c,h]: namespaced the encoding/decoding routines. * camel-mime-filter-basic.c: updated for namespace changes to the encoding/decoding routines in camel-mime-utils.c * camel-multipart.c: updated for namespace changes to the encoding/decoding routines in camel-mime-utils.c * camel-sasl-digest-md5.c: updated for namespace changes to the encoding/decoding routines in camel-mime-utils.c * camel-sasl.c: updated for namespace changes to the encoding/decoding routines in camel-mime-utils.c * camel-vee-folder.c: updated for namespace changes to the encoding/decoding routines in camel-mime-utils.c * providers/imap/camel-imap-search.c: updated for namespace changes to the encoding/decoding routines in camel-mime-utils.c * providers/pop3/camel-pop3-folder.c: updated for namespace changes to the encoding/decoding routines in camel-mime-utils.c svn path=/trunk/; revision=22615
* s/HSCAN_/CAMEL_MIME_PARSER_STATE_/g andJeffrey Stedfast2003-09-191-94/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2003-08-26 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-parser.[c,h]: s/HSCAN_/CAMEL_MIME_PARSER_STATE_/g and s/_header_state/_camel_mime_parser_state/g * camel-filter-driver.c: Same. * camel-folder-summary.c: Here too. * camel-http-stream.c: And here. * camel-mime-message.c: ... * camel-mime-part-utils.c: ... * camel-mime-part.c: ... * camel-movemail.c: ... * camel-multipart-signed.c: ... * camel-multipart.c: ... * providers/local/camel-mbox-folder.c: ... * providers/local/camel-mbox-summary.c: ... * providers/local/camel-mh-summary.c: ... * providers/nntp/camel-nntp-summary.c: ... * providers/pop3/camel-pop3-folder.c: ... 2003-08-25 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.[c,h]: Namespaced. * camel-data-wrapper.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-digest-folder.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-filter-driver.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-filter-search.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-folder-search.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-folder-summary.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-http-stream.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-http-stream.h: updated for namespace changed made to camel-mime-utils.[c,h] * camel-internet-address.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-medium.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-mime-message.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-mime-parser.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-mime-part-utils.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-mime-part.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-movemail.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-multipart-encrypted.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-multipart-signed.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-multipart.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-search-private.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-types.h: updated for namespace changed made to camel-mime-utils.[c,h] * providers/imap/camel-imap-folder.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/imap/camel-imap-store-summary.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/imap/camel-imap-utils.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/imapp/camel-imapp-utils.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * providers/local/camel-local-summary.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * providers/local/camel-maildir-summary.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/local/camel-mbox-summary.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/local/camel-spool-summary.h: updated for namespace changed made to camel-mime-utils.[c,h] * providers/nntp/camel-nntp-summary.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/nntp/camel-nntp-utils.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/pop3/camel-pop3-folder.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/sendmail/camel-sendmail-transport.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/smtp/camel-smtp-transport.c: updated for namespace changed made to camel-mime-utils.[c,h] svn path=/trunk/; revision=22613
* temporarily reverting my camel namespace patches until after we merge in ↵Jeffrey Stedfast2003-08-271-94/+94
| | | | | | some of the other branches svn path=/trunk/; revision=22373
* Namespaced.Jeffrey Stedfast2003-08-261-94/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2003-08-25 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.[c,h]: Namespaced. * camel-data-wrapper.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-digest-folder.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-filter-driver.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-filter-search.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-folder-search.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-folder-summary.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-http-stream.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-http-stream.h: updated for namespace changed made to camel-mime-utils.[c,h] * camel-internet-address.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-medium.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-mime-message.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-mime-parser.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-mime-part-utils.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-mime-part.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-movemail.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-multipart-encrypted.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-multipart-signed.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-multipart.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-search-private.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-types.h: updated for namespace changed made to camel-mime-utils.[c,h] * providers/imap/camel-imap-folder.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/imap/camel-imap-store-summary.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/imap/camel-imap-utils.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/imapp/camel-imapp-utils.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * providers/local/camel-local-summary.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * providers/local/camel-maildir-summary.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/local/camel-mbox-summary.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/local/camel-spool-summary.h: updated for namespace changed made to camel-mime-utils.[c,h] * providers/nntp/camel-nntp-summary.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/nntp/camel-nntp-utils.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/pop3/camel-pop3-folder.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/sendmail/camel-sendmail-transport.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/smtp/camel-smtp-transport.c: updated for namespace changed made to camel-mime-utils.[c,h] svn path=/trunk/; revision=22355
* New test suite for the mime parser (which is where the below 2 fixes wereJeffrey Stedfast2003-08-121-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tests/message/test4.c: New test suite for the mime parser (which is where the below 2 fixes were noticed). * camel-mime-parser.c (folder_boundary_check): Calculate 'len' by subtracting the boundary start from inend rather than 'atleast'. (folder_scan_content): Calculate 'inend' differently depending on the EOF state. 2003-08-08 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-filter-tohtml.c (html_convert): Rather than checking *inptr == '\n', check inptr >= inend - this gets rid of an Invalid Read report from valgrind. * camel-mime-part.c (write_to_stream): Don't necessarily re-encode just because the encodings differ. Need to look into making it so that message/rfc822 and multipart parts ignore the Content-Transfer-Encoding header and just keep their 'encoding' bits set to DEFAULT. 2003-08-05 Jeffrey Stedfast <fejj@ximian.com> * providers/imap/camel-imap-folder.c (get_content): Updated. * camel-mime-message.c (camel_mime_message_init): Don't override the mime_type here. (process_header): Updated to use CamelDataWrapper's mime_type field. (find_best_encoding): Same. (best_encoding): Here too. * camel-digest-folder.c (camel_digest_folder_new): Updated for CamelMimePart::content_type change. * camel-mime-part.c (camel_mime_part_init): Override our parent class's default mime_type. (camel_mime_part_finalize): Don't need to unref the content_type anymore. (process_header): Updated to use CamelDataWrapper's mime_type field. (camel_mime_part_set_filename): Same. (camel_mime_part_get_filename): Same. (camel_mime_part_get_content_type): Same. (set_content_object): Here too. (write_to_stream): Updated. (construct_from_parser): Updated. * camel-mime-part.h: Remove the content_type field. 2003-07-31 Jeffrey Stedfast <fejj@ximian.com> * tests/lib/messages.c (test_message_compare_content): If the chunks differ, perform a hexdump on the data being compared so that we may analyse it easier. * camel-multipart-signed.c (write_to_stream): Return ssize_t. * camel-mime-utils.h: Added the CamelMimePartEncodingType enum here. * camel-mime-part.h: Removed the CamelMimePartEncodingType enum from here. * camel-mime-part.c (write_to_stream): Updated to return ssize_t. Also minor changes to only re-encode the content stream if the charset or encoding changed (this way we write it out in the original raw form if nothing changed). * camel-mime-part-utils.c (simple_data_wrapper_construct_from_parser): Drastically simplify. We no longer scan html content to try and find the charset, nor do we care about converting the content to UTF-8 and handling broken windows charsets. * camel-mime-message.c (find_best_encoding): Use decode_to_stream() here. Also updated to not assume the content charset is UTF-8 since it is very likely not the case anymore since data-wrappers no longer are converted to UTF-8 at parse time. * camel-folder-summary.c (summary_build_content_info_message): Use decode_to_stream instead here too. * camel-folder-search.c (match_words_1message): Use decode_to_stream instead of write_to_stream so we can search the contents. * camel-data-wrapper.c (camel_data_wrapper_init): Set the default encoding to DEFAULT. (write_to_stream): Updated to return ssize_t (camel_data_wrapper_decode_to_stream): New virtual function to decode a data wrapper to a stream (results in nearly identical behaviour to the old write_to_stream method). (decode_to_stream): Default implementation of above virtual method. Decodes base64/qp/etc streams. * camel-data-wrapper.h: Removed the rawtext bit and added an encoding member. svn path=/trunk/; revision=22171
* Revert my previous changes to this function.Jeffrey Stedfast2003-07-241-12/+0
| | | | | | | | | | | | | | | | | | | 2003-07-23 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-message.c (find_best_encoding): Revert my previous changes to this function. * camel-mime-utils.h: Revert previous changes. * camel-mime-part.h: Revert previous changes. * camel-mime-part-utils.c: Revert previous changes. * camel-data-wrapper.c (camel_data_wrapper_init): Revert previous changes. (write_to_stream): Revert previous changes. svn path=/trunk/; revision=21920
* Add the CamelMimePartEncodingType definition here.Jeffrey Stedfast2003-07-171-0/+12
| | | | | | | | | | | | | | | | | | | | | | | 2003-07-14 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.h: Add the CamelMimePartEncodingType definition here. * camel-mime-part.h: Remove the CamelMimePartEncodingType definition. * camel-mime-part-utils.c (simple_data_wrapper_construct_from_parser): Don't do any of the auto-detection we used to do here anymore. Just read the content into a memory buffer and record the encoding type. (camel_mime_part_construct_content_from_parser): Don't mangle the Content-Type struct here anymore. * camel-data-wrapper.c (camel_data_wrapper_init): Init encoding to DEFAULT. (write_to_stream): If the stream needs to be decoded, decode it. svn path=/trunk/; revision=21842
* Handle raw 8-bit From data "correctly". (The same way we handleDan Winship2003-03-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | raw 8-bit Subject data.) * camel-mime-utils.c (header_decode_mailbox): Take a charset arg and pass it to header_decode_string. (header_decode_address): Take a charset arg and pass it to header_decode_mailbox. (header_mailbox_decode): Likewise. (header_address_decode): Take a charset arg and pass it to header_decode_address. * camel-folder-summary.c (summary_format_address): Take a charset arg and pass to header_address_decode. (message_info_new, camel_message_info_new_from_header): Pass charset to summary_format_address * camel-internet-address.c (internet_decode): Update for header_address_decode change. (Unfortunately we don't have a charset to pass here.) * camel-mime-message.c (camel_mime_message_build_mbox_from): Move this here from camel-mbox-summary since the same functionality is needed by evolution-mail too (and update for header_address_decode change) * providers/local/camel-mbox-summary.c (camel_mbox_summary_build_from): Moved to CamelMimeMessage svn path=/trunk/; revision=20430
* Use header_contentid_decode() as this new function should be safer thanJeffrey Stedfast2003-03-151-0/+1
| | | | | | | | | | | | | | | | | 2003-03-13 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-part.c (process_header): Use header_contentid_decode() as this new function should be safer than the hack that we had before. * camel-mime-utils.c (header_contentid_decode): New function to try and parse a content-id string in such a way as to work around some of the known bugs in other MIME implementations. Try to be as "safe" as we can - ie. don't allow for more than 1 @ (since the mailer uses "@@@%d" as a fake content-id value for parts without content-ids) and don't allow for invalid content-type chars. svn path=/trunk/; revision=20295
* Don't count our filler when encoding our line-length octet.Jeffrey Stedfast2002-04-091-2/+2
| | | | | | | | | 2002-04-08 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.c (uuencode_close): Don't count our filler when encoding our line-length octet. svn path=/trunk/; revision=16390
* Simplified since we can now decode in-reply-to without getting extraJeffrey Stedfast2002-04-051-1/+2
| | | | | | | | | | | | | | | | | 2002-04-04 Jeffrey Stedfast <fejj@ximian.com> * camel-folder-summary.c (message_info_new): Simplified since we can now decode in-reply-to without getting extra cruft. Get rid of the FIXME about having to check scan->id because of the possibility of it being NULL, this can no longer happen. * camel-mime-utils.c (header_references_inreplyto_decode): New function to decode in-reply-to headers. Only grabs the first thing that looks like a message-id and then returns. (header_references_decode): Loop calling header_references_decode_single (a new internal function). svn path=/trunk/; revision=16361
* Add c++ armoring.Jeffrey Stedfast2002-03-021-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2002-03-01 Jeffrey Stedfast <fejj@ximian.com> * camel-vtrash-folder.h: * camel-vee-store.h: * camel-vee-folder.h: * camel-stream-null.h: * camel-stream-filter.h: * camel-store-summary.h: * camel-news-address.h: * camel-mime-utils.h: * camel-mime-parser.h: * camel-mime-filter-save.h: * camel-mime-filter-linewrap.h: * camel-mime-filter-index.h: * camel-mime-filter-html.h: * camel-mime-filter.h: * camel-mime-filter-from.h: * camel-mime-filter-crlf.h: * camel-mime-filter-chomp.h: * camel-mime-filter-charset.h: * camel-mime-filter-bestenc.h: * camel-mime-filter-basic.h: * camel-internet-address.h: * camel-folder-thread.h: * camel-folder-summary.h: * camel-folder-search.h: * camel-filter-driver.h: * camel-charset-map.h: * camel-address.h: Add c++ armoring. * camel-object.h: s/class/klass svn path=/trunk/; revision=15885
* Use the FOLD_SIZE as a recommended folding size, but add a newNot Zed2002-02-281-1/+3
| | | | | | | | | | 2002-02-28 Not Zed <NotZed@Ximian.com> * camel-mime-utils.c (header_fold): Use the FOLD_SIZE as a recommended folding size, but add a new FOLD_MAX_SIZE (=998, the smtp max line size) as the hard limit for any output. svn path=/trunk/; revision=15866
* Use camel_mime_parser_read to read internal parser data.Jeffrey Stedfast2002-02-051-0/+2
| | | | | | | | | | | | 2002-02-04 Jeffrey Stedfast <fejj@ximian.com> * camel-http-stream.c (stream_read): Use camel_mime_parser_read to read internal parser data. (camel_http_stream_get_content_type): Implemented. * camel-mime-utils.c (header_decode_int): Made public. svn path=/trunk/; revision=15571
* As a temporary solution, just printf ("\a"); to make a beep :-)Jeffrey Stedfast2002-01-221-4/+4
| | | | | | | | | | | | | | | | | 2002-01-21 Jeffrey Stedfast <fejj@ximian.com> * camel-filter-driver.c (do_beep): As a temporary solution, just printf ("\a"); to make a beep :-) * providers/imap/camel-imap-command.c (imap_command_strdup_vprintf): Encode the mailbox to UTF-7 here. * providers/imap/camel-imap-utils.c (imap_parse_list_response): Decode the mailbox name as we parse the list response. (imap_mailbox_decode): It's only an illegal mailbox name if it didn't switch back to US-ASCII mode. svn path=/trunk/; revision=15421
* Stop uudecoding once the CAMEL_UUDECODE_STATE_END state bit gets set. SetJeffrey Stedfast2002-01-181-3/+8
| | | | | | | | | | | | | | | | | | | 2002-01-17 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-filter-basic.c (filter): Stop uudecoding once the CAMEL_UUDECODE_STATE_END state bit gets set. Set the CAMEL_UUDECODE_STATE_BEGIN state bit once we find the begin line. (reset): No longer have uu_begin or uulen state variables, these are now stuffed into a single state variable. * camel-mime-utils.c (uudecode_step): No longer needs a uulen argument and also keeps track of whether or not the end of the encoded data has been found in 'state'. (uuencode_step): Now stuffs uulen into state so that the uulen argument is no longer needed. (uuencode_close): Same. svn path=/trunk/; revision=15349
* Protect against either of the types being NULL.Jeffrey Stedfast2001-12-111-15/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-12-04 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.c (header_content_type_simple): Protect against either of the types being NULL. 2001-12-05 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-filter-basic.c (filter): If complete() allocates len+2 bytes for the out buffer, so should this. See bug #16371 for an example case. 2001-12-05 Jeffrey Stedfast <fejj@ximian.com> * camel-sasl-digest-md5.c: iconv() returns a size_t, not an int. * camel-pgp-context.c: The return value of iconv() is a size_t, not an int. * camel-mime-part-utils.c (convert_buffer): Always use size_t args for iconv(). * camel-mime-filter-charset.c (complete): Always use size_t args for iconv(). (filter): Same. * camel-mime-utils.c (header_address_fold): Make headerlen a size_t instead of an int. (header_fold): Same. (base64_encode_close): We should be returning a size_t and inlen should also be a size_t. (base64_encode_step): Same here. (base64_decode_step): Here too. (base64_encode_simple): And here... (base64_decode_simple): Same. (uuencode_close): We should also use size_t's here... (uuencode_step): And here too. (uudecode_step): And also here. (quoted_encode_close): Same idea here. (quoted_encode_step): Again here. (quoted_decode_step): Here too. (quoted_encode): Input length should be a size_t. (rfc2047_decode_word): Same. (g_string_append_len): Here too. (append_8bit): " (rfc2047_encode_word): " (quote_word): " (hex_decode): " (rfc2184_decode): Use size_t's with iconv(). (header_decode_param): Same. svn path=/trunk/; revision=14956
* More fixing of the license texts.Ettore Perazzoli2001-10-281-11/+11
| | | | svn path=/trunk/; revision=14217
* Use search_type_mlist for mailing list searches.Michael Zucci2001-10-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * camel-filter-search.c, camel-folder-search.c (check_header): Use search_type_mlist for mailing list searches. * camel.c (camel_init): call camel-mime-utils-init func. * camel-mime-utils.c: Changed mail mail_list_magic to include a domain part, also pre-compile all the patterns. They are all backward compatible except List-Id: which now uses the mail-address-like <list-name.host.name> part rather than the plain-text part (which might've been blank anyway). (camel_mime_utils_init): Initialisation function to setup any static data required by camel-mime-utils at run-time. We now setup the base64/charset class tables here, so it doesn't need to be done statically. (camel_mime_special_table, camel_mime_base64_rank): No longer statically initialise these. (main): Removed + the tests at the end of the file. (header_raw_check_mailing_list): Dont compile regex's here, already compiled in utils_init. Use the regex patterns to remove leading <'s from addresses. Also, if there is a domain part matched, add that after a '@' is added. camel-search-private.c: (camel_search_header_match): Added SEARCH_TYPE_MLIST for mlist search types. It ignores the domain part if either (but not both) of the values dont have it. svn path=/trunk/; revision=13894
* Implemented uuencoding and decoding. (complete): Implemented uuencodingJeffrey Stedfast2001-10-061-0/+4
| | | | | | | | | | | | | | 2001-10-06 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-filter-basic.c (filter): Implemented uuencoding and decoding. (complete): Implemented uuencoding and decoding. * camel-mime-utils.c (uuencode_close): New function to flush the uu encoder. (uuencode_step): New function to uuencode a block of data. svn path=/trunk/; revision=13476
* Convert to the iconv-friendly charset names.Jeffrey Stedfast2001-07-201-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-07-19 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-filter-charset.c (camel_mime_filter_charset_new_convert): Convert to the iconv-friendly charset names. * providers/imap/camel-imap-store.c (create_folder): Fixed a compiler warning about returning without a value in a non-void function. Blah. * camel-mime-part.c (process_header): Pass the locale charset as the default_charset to header_decode_string(). * camel-folder-summary.c (camel_folder_summary_format_string): Pass the locale charset as the default_charset to header_decode_string(). (content_info_new): Same. * camel-mime-message.c (process_header): Pass the locale charset as the default_charset to header_decode_string(). * camel-mime-utils.c (append_8bit): New helper function who's purpose is similar to append_latin1() but for 8bit text that we are assuming is not latin1. (header_decode_text): Now takes a default_charset parameter and calls append_8bit when appropriate. (header_decode_string): Also takes a default_charset parameter now. (header_decode_mailbox): Pass NULL as the default_charset to header_decode_string(). svn path=/trunk/; revision=11250
* Removed. (check_html_charset): Replaced with this.Not Zed2001-07-121-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-07-12 Not Zed <NotZed@Ximian.com> * camel-mime-part-utils.c (extract_metatag_charset): Removed. (check_html_charset): Replaced with this. (simple_data_wrapper_construct_from_parser): Call check_html_charset if we dont have a charset on the content-type, and we have text/html data. (check_html_charset): We also need to do qp/base64 decoding ourselves, sigh. * camel-mime-utils.c (html_meta_param_list_decode): Removed. This was very wrong, the rules for mail headers vastly different from rules for decoding html elements. (rfc2184_decode): Move the malloc inside the iconv_open worked, otherwise we have a memleak. * camel-mime-filter-html.c (camel_mime_filter_html_finalize, init, run, reset): Changed to use camelhtmlparser, and fixed a tiny memleak. * camel-html-parser.c: Made the html indexer tokeniser re-usable. ONLY TO BE USED INTERNAL TO CAMEL HOWEVER. (tokenise_step): Slight fix to non-quoted values. svn path=/trunk/; revision=11028
* New function to parse an HTML meta-tag.Jeffrey Stedfast2001-07-111-0/+3
| | | | | | | | | | | | | | | | | 2001-07-10 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.c (html_meta_param_list_decode): New function to parse an HTML meta-tag. * camel-mime-part-utils.c (simple_data_wrapper_construct_from_parser): If the Content-Type did not contain a charset parameter and it's also a text/html part, we have 1 last place to look - in the META html tags. *sigh* * camel-mime-message.c (camel_mime_message_get_source): s/gint/unsigned since that's what it should be. svn path=/trunk/; revision=10976
* Use the new header_address_fold.Jeffrey Stedfast2001-06-281-0/+1
| | | | | | | | | | | | | | | | | | 2001-06-27 Jeffrey Stedfast <fejj@ximian.com> * camel-internet-address.c (camel_internet_address_encode_address): Use the new header_address_fold. * camel-mime-utils.c: Removed some old #if 0'd code of mine. (rfc2047_encode_word): If enclen is 0, don't write an encoded word token (=?iso-8859-7?Q??= would be an invalid token). (header_address_fold): New function to wrap address headers - header_fold() was force-wrapping rfc2047 encoded words which was making the test suite fail. The *real* solution, however, is to not create rfc2047 encoded words longer than 72 chars. svn path=/trunk/; revision=10545
* Update the copyrights, replacing Helix Code with Ximian andEttore Perazzoli2001-06-231-3/+3
| | | | | | helixcode.com with ximian.com all over the place. svn path=/trunk/; revision=10440
* Decode Content-Location, either correctly or Netscape-generated-brokenly.Dan Winship2001-05-121-0/+3
| | | | | | | | | | | * camel-mime-utils.c (header_location_decode): Decode Content-Location, either correctly or Netscape-generated-brokenly. * camel-mime-part.c (camel_mime_part_set_content_location, camel_mime_part_get_content_location, etc): Deal with Content-Location header. svn path=/trunk/; revision=9772
* Big header cleanups and nntp compile fixKjartan Maraas2001-03-301-1/+1
| | | | svn path=/trunk/; revision=9024
* Added camel-sasl*.[c,h] to the build.Jeffrey Stedfast2001-03-011-0/+3
| | | | | | | | | | | | | | | | | | | | | | 2001-02-28 Jeffrey Stedfast <fejj@ximian.com> * Makefile.am: Added camel-sasl*.[c,h] to the build. * camel-sasl.[c,h]: new "abstract" SASL class * camel-sasl-kerberos4.[c,h]: new SASL class for KERBEROS_V4 * camel-sasl-cram-md5.[c,h]: new SASL class for CRAM-MD5 * camel-sasl-plain.[c,h]: new SASL class for PLAIN * providers/imap/camel-imap-auth.c: Removed the base64 functions. * camel-mime-utils.c (base64_encode_simple): Moved here from camel-imap-auth.c (base64_decode_simple): Same. svn path=/trunk/; revision=8428
* Removed unwanted header. It was never put in for a reason. Stop fixingNot Zed2001-02-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | 2001-02-06 Not Zed <NotZed@Ximian.com> * camel-search-private.c: Removed unwanted header. It was never put in for a reason. Stop fixing irrelevant warnings. (camel_ustrstrcase): Our own strstrcase impl for utf8 strings. (camel_ustrcasecmp): Ditto for strcasecmp. (camel_ustrncasecmp): And strncasecmp. (utf8_get): Simpler interface to utf8 string processing. (camel_search_header_match): Use the new things. 2001-02-05 Not Zed <NotZed@Ximian.com> * camel-folder.c (get_summary): Removed some old variables/a small memleak. (free_summary): Removed old variables. * camel-mime-utils.c (header_raw_check_mailing_list): New utility function to get the mailing list (if any) that a set of headers came from. svn path=/trunk/; revision=8008
* New function to return just foo/bar with no parameters.Dan Winship2001-01-031-0/+1
| | | | | | | | | | * camel-mime-utils.c (header_content_type_simple): New function to return just foo/bar with no parameters. * camel-data-wrapper.c (get_mime_type): Use header_content_type_simple rather than header_content_type_format. svn path=/trunk/; revision=7213
* Remove use of linewrap filter. Headers are now wrapped. encode_8bitMichael Zucci2000-12-111-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * providers/smtp/camel-smtp-transport.c (smtp_data): Remove use of linewrap filter. Headers are now wrapped. encode_8bit already enforces a 998 octet line limit. (smtp_data): Also fixed a memleak, we always have to unref our own copy of the filters. We also dont need to remove them manually, so dont bother. The type's an int too ... * camel-internet-address.c (internet_unformat): When scanning past quotes, remove them also. (camel_internet_address_format_address): If the name contains "'s, or ','s then strip and quotes and wrap the whole lot in one set of quotes. * Makefile.am (noinst_HEADERS): We dont want to install camel-charset-map-private.h, ever. There are probably other similar files ..? * camel-mime-part.c (write_to_stream): Fold header lines appropriately as we're writing them out. * camel-mime-utils.c (header_fold): Add a new argument, headerlen, tells it how long the associated header token is. (header_fold): Also,k check to see if we need to fold first, using a better algorithm, and also accept already-folded lines, and re-process accordingly. (rfc2047_decode_word): Add a little buffer space to iconv output for shifting overheads? (rfc2047_decode_word): finish the iconv with a null call, to flush shift state, etc. (rfc2047_encode_word): Attempt to break up long words into appropriately sized, independent, chunks. See rfc2047, section 2. (header_decode_mailbox): Dont add in extra spaces into the output if we are decoding adjacent encoded words. We can only guess this case, as some broken mailers put encoded words inside quoted words. (header_encode_phrase): Dont merge words if they are going to end up too long. Also change back ot only merge consecutive words of the same type. e.g. 'foo. blah fum.' -> "foo." blah "fum." or 'iam an. idiot' -> iam "an." idiot svn path=/trunk/; revision=6902
* Add a missed unref.Not Zed2000-11-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-11-29 Not Zed <NotZed@HelixCode.com> * tests/message/test2.c (main): Add a missed unref. * camel-stream-mem.c (camel_stream_mem_set_buffer): We must set ourselves as the owner of the byte-array. Weird, someone has modified this file (its been reindented), but i can't see any changelogs ... * tests/lib/messages.c (content_finalise): Fix memleak in tester, free byte array when our content object is deleted. * camel-folder-search.c (camel_folder_search_finalize): Yeah great, so the sexp is a gtk object, not a camel object. Isn't that going to be fun to fix? * camel-session.c (camel_session_finalise): Free the storage path. * providers/local/camel-local-store.c (camel_local_store_init): If store->folders is setup, free it first, then overwrite. Hmm, this seems a bit crappy to me. * camel-store.c (camel_store_init): Dont setup store->folders if its already setup. * camel-exception.c (camel_exception_setv): Removed a memleak. no need to strdup after a strdup_printf!!! * camel-address.c (camel_address_finalize): Free the address ptrarray, once finished. * providers/local/camel-local-folder.c (local_finalize): Make sure we dont leave the folder locked on close. (local_finalize): Free summary/search. * providers/local/camel-mh-summary.c (mh_summary_next_uid_string): Small memleak, always free name after using it. * camel-mime-part.c (set_content_object): Free txt after setting the header. * providers/local/camel-maildir-summary.c (maildir_summary_check): Fix a memleak, close the dir after scanning new. (message_info_free): Added so we can free the filename cached in the messageinfo. (camel_maildir_summary_finalise): Free the hostname. * tests/folder/test[12].c (main): Clear out camel-test before starting. * providers/local/camel-mbox-summary.c (mbox_summary_sync_quick): Because encode_x_evolution folds the line (sigh, because encode_param does, unlike every other function in camel-mime-utils), unfold the encoded result before comparing. (mbox_summary_sync_quick): Another small memleak, free xevnew once finished with it. * camel-mime-utils.c (header_decode_quoted_string): Removed a redundant check for c=0. (header_unfold): New function to un-fold headers. * providers/local/camel-local-summary.c (local_summary_encode_x_evolution): some problems with encoding tags, using the wrong output strings. (local_summary_encode_x_evolution): We dont need to append a ; either, param_list_format_append() will do it for us. ` svn path=/trunk/; revision=6711
* mime_guess_type_from_file_name moved back to composer as it introducedRadek Doulik2000-11-151-3/+0
| | | | | | | | | 2000-11-15 Radek Doulik <rodo@helixcode.com> * camel-mime-utils.c: mime_guess_type_from_file_name moved back to composer as it introduced unwanted VFS dependency svn path=/trunk/; revision=6578
* Removed local again, not quite ready.Not Zed2000-11-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-11-15 Not Zed <NotZed@HelixCode.com> * providers/Makefile.am: Removed local again, not quite ready. 2000-11-14 Not Zed <NotZed@HelixCode.com> * camel-folder-summary.c (message_info_new_from_message): Use message_info_new to create the summary from headers, instead of getting directly from the message. (format_recipients): No longer required. * providers/Makefile.am (SUBDIRS): Added local. 2000-11-11 Not Zed <NotZed@HelixCode.com> * camel-mime-parser.c (folder_push_part): Make sure 'atleast' is at least 1, always. This is possibly a temporary fix for a bad failure mode on bad multipart messages. (folder_scan_content): Go until inend, not inend+1. Changed the continuation and retry logic to be simpler and more robust. If we can't find a marker within the atleast we need, just set it to 1, and try again, rather than just going to the next smaller limit (boundary check checks the length anyway). (header_append): streamline the empty line case. And strip trailing \r's if there are any (\n's already stripped). (folder_scan_header): Reordered and cleaned up a lot. Check for continuation only once, and compress lwsp then. Assume the header buffer already has end of line's stripped, and simplify some things: Only check for end of headers once and easier. Dont check to remove end of line character Dont bother testing inptr-start if we get a boundary match - it is always zero. (folder_scan_header): Removed the unused part variable, and a few pointless assignments. (folder_scan_header): Change the end limit to be 1 higher, to make sure we get all content. (folder_scan_content): And here too. (folder_scan_header): Killed a warning. (folder_push_part): Removed a bad comment. Actually boundarylenfinal can be zero for a new message not in a multipart. So we fix that here. 2000-11-09 Not Zed <NotZed@HelixCode.com> * camel-mime-utils.c (header_decode_param_list): Renamed from header_param_list_decode. (header_param_list_decode): New external function to decode a parameter list. (header_param_list_format_append): Made public. (header_param_list_format): Another new public helper function for formatting just a param list. * camel-folder-summary.c (next_uid_string): Default implementation is the same as before. (camel_folder_summary_class_init): And set it up. * camel-folder-summary.h: Make next_uid_string a virtual function. * camel-folder.c (camel_folder_change_info_changed): New function to return true if the changeset contains any changes. svn path=/trunk/; revision=6577
* new function, moved from composerRadek Doulik2000-11-081-0/+3
| | | | | | | | | 2000-11-08 Radek Doulik <rodo@helixcode.com> * camel-mime-utils.c (mime_guess_type_from_file_name): new function, moved from composer svn path=/trunk/; revision=6506
* Implement a complete() function, now we need one. (filter): Upgraded toNot Zed2000-11-071-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-11-07 Not Zed <NotZed@HelixCode.com> * camel-mime-filter-bestenc.c (complete): Implement a complete() function, now we need one. (filter): Upgraded to match rfrc2045 properly. Checks also for length of line and valid CRLF sequences. (camel_mime_filter_bestenc_get_best_encoding): Do the work of working out what is the best encoding given what we found about the stream. * camel-mime-part.c (camel_mime_part_encoding_to_string): Use a lookup table to get the encoding naem, and add the binary type. (camel_mime_part_encoding_from_string): Likewise for the reverse. * camel-mime-part.h: Added the binary encoding type, see rfc2045. * camel-mime-utils.c (header_param_list_format_append): Dont put a space before ;'s in parameter lists, makes them more readable/consistent. * camel-mime-message.c (multipart_has_8bit_parts): Cleaned up the old stuff, well removed it. (camel_mime_message_set_best_encoding): Added another argument that lets you select what you want to set the best of. i.e. for smtp transport we only need 7 bit, and dont need to optimise the charset (although of course, we should always). (find_best_encoding): Implement this feature, if we are not getting the best charset, use the one we have. (best_encoding): Set the charset on the part appropriately. Sigh, the interfaces for this are nonexistant. (find_best_encoding): Tell the bestenc filter that lf should be treated as crlf for the purposes of determining encodings. 2000-11-06 Not Zed <NotZed@HelixCode.com> * camel-charset-map.c (camel_charset_init): Init function for an iterative charset determinator. (camel_charset_step): Iterate another buffer. (camel_charset_mask): Removed, since it couldn't have worked. (camel_charset_best): Use the iterative interface to do the work. (camel_charset_best_name): Get the best name for a charset so far. * camel-mime-filter-bestenc.c: New class, a stream filter that can be used to memory-efficiently determine the best encoding and/or charset to use for a given stream of bytes. * Makefile.am (libcamelinclude_HEADERS): Added stream-null*. (libcamel_la_SOURCES): Added bestenc* * camel-stream-null.c: New class, a null-stream, that always succeeds, and never has any contents. * camel-stream.c: Minor pointless changes. Was going to do something else but changed my mind. Added trivial default implementations for all callbacks. * camel-mime-message.h: Cleaned up some old cruft. * camel-folder-summary.c (camel_folder_summary_format_address): address_list_format() no longer encodes, so we dont need to decode it. * camel-address.c (camel_address_unformat): New function, attempts to reverse the formatting process on display addresses. (camel_address_length): New function to get the number of addresses, without having to peek the structure. * camel-mime-message.c (camel_mime_message_set_from): Fix a typo. (camel_mime_message_finalize): Only unref from/reply_to if we have it. (camel_mime_message_set_recipients): New function - set the recipients as a CamelInternetAddress. This function effectively deprecates the older recipient setting functions. (camel_mime_message_add_recipient): What the hell, i'll bite the bullet. Terminate this function. The old api was ambiguious and inefficient and didn't work right anyway. (camel_mime_message_remove_recipient_address): And this one. (camel_mime_message_remove_recipient_name): And this one too. (camel_mime_message_set_recipients): If we set an empty header, then remove it from the header list. Allow a null receipient object to clear a header. (camel_mime_message_set_from): Likewise, if setting an empty from address. (camel_mime_message_encode_8bit_parts): Eeek!! camel_stream_mem_new_with_byte_array owns the byte_array we give it, so make sure we dont free any of it! (camel_mime_message_encode_8bit_parts): Infact, i'll just rewrite the whole lot, its a bit of a mess. Should really rename it and make it a little more useful too, lets see ... (best_encoding): This has a string interface? Oh boy. (camel_mime_message_foreach_part): New experimental function to iterate over all message parts. Might not remain. (camel_mime_message_has_8bit_parts): New implementation using foreach_part. Fixed a couple of problems. (find_best_encoding): New function, that finds the best encoding for a given part (will probably be moved to camel-mime-part), and also the best charset to use if it is a text part. Since one affects the other it is a two pass process, but uses streams and not memory to achieve this. (camel_mime_message_set_best_encoding): Uses the function above to configure an entire message for the best encoding possible given transport constraints. (camel_mime_message_encode_8bit_parts): Reimplemented to use the function above to perform the work. * camel-internet-address.c (camel_internet_address_format_address): Dont put <> around a lone address with no real name. (camel_internet_address_encode_address): Similarly. (internet_decode): Actually return the count of decoded addresses. (internet_unformat): Implement the unformatting routine. 2000-11-05 Not Zed <NotZed@HelixCode.com> * providers/smtp/camel-smtp-transport.c (_send_to): Changed to get the internetaddress directly, rather than having to parse it itself. * camel-address.c (camel_address_format): Added a new function which will format address, suitable for display. (camel_address_cat): Concatentate 1 camel address onto another. It is upto the caller to ensure the addresses are of compatible types. (camel_address_new_clone): New function to create a new address by copying an existing one of the same type. (camel_address_copy): New helper function to copy an address. * camel-mime-message.h (struct _CamelMimeMessage): Removed cached copy of date string. (struct _CamelMimeMessage): Added date_received info. * camel-mime-message.c (camel_mime_message_get_date_string): Removed. Nothing uses it anyway, and it is redundant. (camel_mime_message_finalize): No more date_str. (camel_mime_message_init): No more date_str, initialise date_received* (write_to_stream): Change the check for a date header. (process_header): No longer track the date_str. (camel_mime_message_get_received_date): Removed. totally invalid anyway. (camel_mime_message_get_sent_date): Removed. Redundant. The only 'date' is the sent date, the received date is just made up. (camel_mime_message_get_date): Args changed to be more consistent with utility functions. (camel_mime_message_get_date): Dont set the date when we're asked for it (if its not set by the time its written, it'll be set then). (camel_mime_message_get_date_received): Actually do 'the right thing' here, if we have a received header, use that to determine the received date. And return the data in the same format as get_date. (camel_mime_message_set_from): Changed the api to better match what we should be doing. Pass a camelinternetaddress, etc. (camel_mime_message_set_reply_to): Cahnged similarly to take an internetaddress. (camel_mime_message_get_reply_to): Likewise. (camel_mime_message_finalize): Unref the from/reply_to objects. (format_address): Removed, no longer needed. (process_header): Changed to store the from/reply_to as internetaddress's. (write_to_stream): Set the from header directly to empty, if we dont have one. Maybe we should just abort, and/or create one based on the current user. * camel-mime-utils.c (header_address_list_format): Renamed to header_address_list_encode, which is what it is actually doing. (header_address_list_format_append): Similarly. (encoding_map[]): Removed, no longer used. (header_address_list_encode_append): Take another arg, do we encode the address (for internet), or not (for display - utf8 only). (header_address_list_format): Re-added this function, but now it generates a display version only. Surprise surprise, that is all anythign needs to generate anyway. Sigh. * camel-internet-address.c (camel_internet_address_get): Return false if we get an invalid index only. (camel_internet_address_encode_address): Helper function to encode a single address for mailing. (internet_encode): Use the above function to format it. (camel_internet_address_format_address): Format a single address for display. (internet_format): Implement the display version. (camel_internet_address_class_init): Init the internet_format virtual function. (internet_cat): Implement virtual function to concatenate addresses. * camel-folder-summary.c (camel_folder_summary_info_new_from_header): new function, only build the summary info, dont add it. (camel_folder_summary_info_new_from_parser): Likewise, for new info from parser. (camel_folder_summary_add_from_parser): Cahnged to call function above to build info. (camel_folder_summary_add_from_header): Changed to call function above, to build info. (camel_folder_summary_info_free): New function to free the summary message info. (camel_folder_summary_clear): Changed to clal above to free info. (camel_folder_summary_remove): Likewise. (camel_folder_summary_add): Cleaned up the clashing uid re-assignment logic a little bit. (camel_folder_summary_decode_uint32): Fixed a typo, 01 != -1. (camel_folder_summary_decode_time_t): Return -1 on error. (camel_folder_summary_encode_off_t): New function to encode an off_t type. (camel_folder_summary_decode_off_t): And likewise for the reverse. (CAMEL_FOLDER_SUMMARY_VERSION): Bumped the summary version, since we're now encoding time/off_t's right. (summary_header_save): Use time_t encoder to save the timestamp. (summary_header_load): Likewise for decoding the timestamp. (content_info_load): Decode off_t types directly, now we can. (content_info_save): And likewise for encoding. (camel_folder_summary_add_from_message): New function, create a summary item from an existing message and add it. (camel_folder_summary_info_new_from_message): New function, create a summary item from an existing message. (summary_build_content_info_message): New function to do the dirty work of building the conent info/indexing, from a message source. (format_recipients): Format an internetaddress suitable for the summary. (message_info_new_from_message): Build a new summary item from a mime message. (content_info_new_from_message): Build a new conent info from a mime part. (camel_folder_summary_class_init): Init the new class functions. (message_info_new_from_message): Fixed for message api change. Added documentation to the functions. svn path=/trunk/; revision=6474
* new function, generates simple message/content idRadek Doulik2000-11-041-0/+3
| | | | | | | | | 2000-11-03 Radek Doulik <rodo@helixcode.com> * camel-mime-utils.c (header_msgid_generate): new function, generates simple message/content id svn path=/trunk/; revision=6389
* Take an additional argument, "break_lines", saying whether or not to addDan Winship2000-10-311-2/+2
| | | | | | | | | | | | * camel-mime-utils.c (base64_encode_step, base64_encode_close): Take an additional argument, "break_lines", saying whether or not to add '\n's to the output. * camel-multipart.c (set_boundary): * camel-mime-filter-basic.c (filter, complete): Update for base64 api change. svn path=/trunk/; revision=6271
* New function to fold headers.Not Zed2000-09-281-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-09-28 Not Zed <NotZed@HelixCode.com> * camel-mime-utils.c (header_fold): New function to fold headers. 2000-09-27 Not Zed <NotZed@HelixCode.com> * camel-mime-parser.c (folder_scan_header): If we had an empty header, then it must be end of the headers too. (folder_scan_init): No we dont need to init the outbuf with a nul terminator. * camel-folder-summary.c (camel_folder_summary_set_uid): New function to reset the uid to a higher value. * providers/mbox/camel-mbox-summary.c (camel_mbox_summary_sync): "something failed (yo!)" what sort of crap is this? Fixed all the indenting again, what wanker keeps running stuff through indent? (message_info_new): Check the uid we loaded off the disk, if it existed already, assign a new one. If it didn't then make sure the nextuid is higher. * camel-charset-map.c: New file, used to build a large unicode decoding mapping table, and use it to determine what is the lowest charset a given word can be encoded with. Uses tables from libunicode's source. * camel-internet-address.c (internet_encode): Use header_phrase_encode to properly encode the fullname, as required. refixed indenting. Who keeps doing that? (camel_internet_address_find_address): Changed fatal return/warnings into assertions. * camel-mime-utils.c (header_raw_append_parse): Check : explicitly (removed from is_fieldname() macro). (camel_mime_special_table): Changed to short, so we can represent more bit types. (quoted_encode): Take a mask of the safe chars for this encoding. (header_address_decode): Removed a #warning that makes no sense anymore. (header_decode_date): Fixed the 'broken date' parser code, if it ever decoded it it just threw away the result. (header_encode_string): Use better charset matching for encoding strings as well. 2000-08-31 Not Zed <NotZed@HelixCode.com> * providers/mh/camel-mh-summary.c (camel_mh_summary_sync): Save the index if we do a sync. (camel_mh_summary_check): Save the index here too. Probably. svn path=/trunk/; revision=5615
* New function to copy a header_references structure.Dan Winship2000-07-101-0/+1
| | | | | | | | | | | | | | | | | | | | * camel-mime-utils.c (header_references_dup): New function to copy a header_references structure. * camel-folder-summary.c (camel_message_info_dup_to): New function to (deep) copy the data from one CamelMessageInfo into another. (camel_message_info_free): And free the data. * providers/vee/camel-vee-folder.c (vee_sync): Implement. (empty). (vee_search_by_expression): belatedly update for camel_folder_search change. (vee_folder_build): belatedly update for camel_folder_search change. Use camel_message_info_dup_to and camel_message_info_free (in particular, so that we get message_id and references info so vfolders can be threaded). (vee_folder_build_folder): Ditto. svn path=/trunk/; revision=4024
* added #include <glib.h> to camel-mime-utils.hJeffrey Stedfast2000-07-061-0/+1
| | | | svn path=/trunk/; revision=3900
* Added prototype for uudecode_stepJeffrey Stedfast2000-07-061-0/+3
| | | | | | | | | | | 2000-07-05 Jeffrey Stedfast <fejj@helixcode.com> * camel-mime-utils.h: Added prototype for uudecode_step * camel-mime-utils.c (uudecode_step): Cleaned up some junk that should have been cleaned up when debugging printf's were taken out. svn path=/trunk/; revision=3899
* If we get a funny result, just throw it out. Basically a fix for the oneNot Zed2000-06-031-0/+12
| | | | | | | | | | | | | | | | | | | | | | 2000-06-02 Not Zed <NotZed@HelixCode.com> * camel-mime-utils.c (header_decode_date): If we get a funny result, just throw it out. Basically a fix for the one true broken TradeClient. 2000-06-01 Not Zed <NotZed@HelixCode.com> * camel-folder-summary.c (message_info_free): Free references/messsage id. (message_info_save): Save them. (message_info_load): Load them. (message_info_new): And get them from the new message. (CAMEL_FOLDER_SUMMARY_VERSION): Bumped for new changes. * camel-folder-summary.h: Added references and messageid to summary. svn path=/trunk/; revision=3391
* Big fixes for the last commit which broke the message creation entirely.Michael Zucci2000-04-241-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Plus an address decoder/formatter, etc. * camel-mime-message.c (construct_from_parser): Allow MESSAGE_END _or_ EOF as valid termination conditions. * providers/mbox/camel-mbox-summary.c (message_struct_new): Decode and then re-encode the addresses, so they are consistently formatted. * camel-mime-utils.c (header_decode_mailbox): Store the address in a _header_address. And try to get a comment-stored name if there is one. (header_decode_address): Actually return an address. (header_to_decode): Renamed to header_address_decode() (header_mailbox_decode): New function to get a single mailbox. (header_mime_decode): Return the major/minor value, as appropriate. (header_address_new, and friends): Whole bunch of utility functions for working with the address thingies. (header_decode_domain): Free the string header, and dont expand '.' into ' . '. (camel_mime_part_construct_content_from_parser): Oops, this was totally screwed up, try creating the right cotnent on the right object. svn path=/trunk/; revision=2579
* Whole swag of changes. Still lots of cleanup remaining ...NotZed2000-04-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-04-23 NotZed <NotZed@HelixCode.com> * camel-data-wrapper.c (set_mime_type_field): Ref the content_field when we get it? * camel-mime-parser.c (camel_mime_parser_unstep): New function. Cause a subsequent call to mime_parser_step() to return the same state over again. * providers/mbox/camel-mbox-folder.c (_get_message_by_uid): Initial test code using the mime parser to construct the message. * camel-mime-part.c (construct_from_parser): part constructor. (camel_mime_part_construct_content): Basically a simpler replacement for the datawrapper repository. (camel_mime_part_init): Set the default type to text/plain. * camel-simple-data-wrapper.c (construct_from_parser): Initial implementation of a content constructor. * camel-multipart.c (construct_from_parser): Multipart construction routine. (camel_multipart_init): Set the default multipart type to multipart/mixed. Duh, no subtype is not allowed anyway. 2000-04-22 NotZed <NotZed@HelixCode.com> * camel-mime-message.h (struct _CamelMimeMessage): Removed send_date, and received_date, and replaced it with a time_t 'date' (this is what the header is called), and date_offset to store the GMT offset of the date. * camel-mime-message.c (camel_mime_message_set_from): Update raw header as we go. (_set_from): Removed. (_get_from): Removed. (camel_mime_message_get_from): Moved implementation here. (camel_mime_message_get_subject): Move implementation here. (_get_subject): Nuked. (camel_mime_message_set_subject): Handle utf-8 input, and also update raw header when changed. (_set_subject): Removed. (_set_received_date): Removed. (camel_mime_message_set_received_date): Removed. (_get_received_date): Removed. (camel_mime_message_get_received_date): Removed. (_get_sent_date): Removed. (camel_mime_message_get_sent_date): Removed. (camel_mime_message_get_date): New function to get the date as a time_t/offset. (camel_mime_message_set_date): Set the date as a time_t/offset. (camel_mime_message_get_date_string): Get the date as a string. (camel_mime_message_init): Initialise the current date as 'CMAEL_MESSAGE_DATE_CURRENT'. (_set_reply_to): Removed. (camel_mime_message_set_reply_to): Moved implementation here. This is still broken, reply-to can have multiple addresses. (_get_reply_to): Removed. (_set_field): Removed, no longer used anywhere. (_get_field): Also removed. (_init_header_name_table): Add the Date header. (process_header): Also handle snooping of Date header here. * camel-stream-filter.c (finalise): Unref the source stream on finalise, and also call the parent class (oops). * camel-mime-parser.c (camel_mime_parser_state): New function to get the current parser state. (camel_mime_parser_stream): Allow you to get the stream back from the mime_parser. (camel_mime_parser_fd): Alternative to allow you to get the fd back from the mime_parser. (folder_scan_init_with_stream): Properly ref/unref the stream. (folder_scan_close): Properly unref the stream/close the fd on exit. (folder_scan_init_with_fd): Close the old fd if there is one. * camel-data-wrapper.c (camel_data_wrapper_construct_from_parser): New method, construct a data wrapper from an initialised parser. (construct_from_parser): Empty implementation. * providers/mbox/camel-mbox-summary.c (message_struct_new): Convert subject line to unicode, before storing in the summary. (strdup_trim): Removed, no longer needed. * providers/mbox/camel-mbox-folder.c (_get_message_by_uid): Ref the folder after setting it in the new message. * camel-mime-part.c (my_set_content_object): Have the headers follow the content-type change here too. (my_write_to_stream): Dont write content-type here, automatically stored in the headers ... (my_write_to_stream): Use header_disposition_format() to format the content-disposition header. (my_write_to_stream): Removed old code, all headers are now stored in the camel-medium level, always. Need to do the same with camel-mime-message i suppose ... (my_write_to_stream): Write the content using the parent class, not some weird function. (camel_mime_part_class_init): Dont override get_output_stream. (camel_mime_part_encoding_from_string): Bleh, make it case-insensitive. * camel-mime-utils.c (header_content_type_is): Handle empty types. (header_encode_string): Start of an implementation of the rfc2047 encoder. It does iso-8859-1, and us-ascii, and utf-8 (others get tricky *sigh*) (rfc2047_encode_word): Convert a single word/string into rfc2047 encoding. (quoted_encode): Different quoted-printable encoding for rfc2047 encoding of headers. * gmime-content-field.c (gmime_content_field_write_to_stream): Use header_content_type_format() to format it. svn path=/trunk/; revision=2560
* Ref the folder after setting it in the new message.NotZed2000-04-221-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-04-22 NotZed <NotZed@HelixCode.com> * providers/mbox/camel-mbox-folder.c (_get_message_by_uid): Ref the folder after setting it in the new message. * camel-mime-part.c (my_set_content_object): Have the headers follow the content-type change here too. (my_write_to_stream): Dont write content-type here, automatically stored in the headers ... (my_write_to_stream): Use header_disposition_format() to format the content-disposition header. (my_write_to_stream): Removed old code, all headers are now stored in the camel-medium level, always. Need to do the same with camel-mime-message i suppose ... * camel-mime-utils.c (header_content_type_is): Handle empty types. * gmime-content-field.c (gmime_content_field_write_to_stream): Use header_content_type_format() to format it. 2000-04-21 NotZed <NotZed@HelixCode.com> * camel-mime-utils.h: Add prototype for header_param_list_free. * camel-recipient.c: New function to remove all the types of a recipient list. I think this whole object needs a major review. * camel-mime-message.c (camel_mime_message_class_init): Removed parse_header_pair override, override add_header instead. (_parse_header_pair): Renamed to add_header. (remove_header): Add this method, to make sure we keep upto date with removed headers too. (_set_field): If given a NULL value, clear it out. (_set_recipient_list_from_string): Constify. (set_header): Override set_header from camel_medium. (process_header): Local function to handle set/add/remove of each header we know about. * camel-mime-part.c (camel_mime_part_class_init): Removed parse_header_pair setup. (my_parse_header_pair): Moved into add_header(), removed. (my_set_disposition): Allow a NULL disposition to clear it. (my_set_content_id): Allow NULL content id to clear it. (remove_header): Track removed headers. (my_set_description): Allow NULL description to clear it. (my_set_content_MD5): Make sure we copy the md5 value, and allow a NULL value to reset it. (my_set_filename): Copy the filename. (my_set_header_lines): Removed. Nothing uses it, it doesn't actually serve any purpose. (camel_mime_part_set_header_lines): Ditto. (my_get_header_lines): Ditto. (camel_mime_part_get_header_lines): Ditto. (camel_mime_part_class_init): Remove *_header_lines setup. (camel_mime_part_init): Remove header_lines init. (my_finalize): Remove header_lines finalise. (my_write_to_stream): Write the headers here. This is just WRONG, camel_medium should be doing this. (my_get_output_stream): Kill a warning. (camel_mime_part_encoding_to_string): Ditto. (camel_mime_part_set_description): Unvirtualiase, use add_header() to do the processing. (my_set_description): Removed. (set_disposition): Renamed from my_set_disposition. (camel_mime_part_get_description): Get the descriptionf rom the get_header method. (my_get_description): Removed. (my_set_filename): Removed. (camel_mime_part_get_filename): Get the parameter from the disposition. (camel_mime_part_encoding_from_string): Handle NULL string. (camel_mime_part_init): Remove reference to filename. (my_finalize): Dont free filename. * camel-mime-part.h (CamelMimePartClass): Removed parse_header_pair() method, it doesn't add anything that add_header() can't be used for. (CamelMimePartClass): Remove *_header_lines methods. (struct _CamelMimePart): Remove header_lines list. (struct _CamelMimePart): Removed filename attribute. * camel-medium.c (camel_medium_init): Init headers to null, not a hashtable. (add_header): Append the headers as a list. (remove_header): Remove headers as a list. (get_header): Likewise for lookup. (free_header): Removed, no longer needed. (finalize): Free headers using header_raw_clear(). (camel_medium_set_header): New function, to reset and override all values of a header with a new value. * camel-medium.h (struct _CamelMedium): Changed to use a header_raw struct rather than a hash table, to store headers (many headers can occur multiple times). * camel-mime-utils.c (header_raw_find_next): New function, allows you to find multi-valued header fields. (header_disposition_format): New function to format/create content-disposition header string. (header_param_list_format_append): Function to format parameter lists into a GString. (header_content_type_format): Function to format content-type into a usable format. (header_set_param): allow NULL value to remove the parameter. (decode_token): Renamed from header_decode_token. (header_decode_token): New interface for external use. (quoted_decode): Made static to kill annoying warnings. (g_strdup_len): Killed, replaced with calls to g_strndup(). (rfc2047_decode_word): Made static to kill warnings. (decode_coded_string): Terminated. (g_string_append_len): Made static to kill warnings. (header_decode_text): Made static to kill warnings. (header_decode_text): Constify. (rfc2047_decode_word): Constify. (header_param): Constify. (header_content_type_new): Copy the type/subtype strings. (header_param_list_decode): Made static. (header_param_list_format_append): Made static. (quoted_decode): Constify. (g_string_append_len): Constify. (header_token_decode): New function to decode a single token. * providers/mbox/camel-mbox-summary.c (header_write): Append a trailing \n when writing headers. (strdup_trim): Killed a warning. (camel_mbox_summary_set_uid): Make sure the next uid is at least 1 higher than any existing one. (header_evolution_decode): Use header_token_decode to get the token. * camel-mime-parser.c (folder_scan_header): Strip the trailing \n of the end of all header lines. svn path=/trunk/; revision=2551
* MERGE NEW_PARSER branch into HEAD, fixed conflicts.NotZed2000-04-211-0/+105
| | | | | | | | | | | | | | | | | | | | | | | | | 2000-04-20 NotZed <NotZed@HelixCode.com> * MERGE NEW_PARSER branch into HEAD, fixed conflicts. * gmime-content-field.c (_print_parameter): Duh, removed again (@@#$@ cvs merge). * camel-mime-utils.c (header_content_type_is): Constify. (header_content_type_unref): Killed a couple warnings. * camel-folder.c (_init): Removed more log crap. * providers/Makefile.am (SUBDIRS): Removed nntp, pending fixes for summary changes. * providers/mbox/camel-mbox-folder.c (_get_message_by_number): Fixed for new summary interface. Added a warning for using this broken api. (_get_message_by_uid): Fixed for message new with session vanishing. svn path=/trunk/; revision=2531
* mime utils namespace changeBertrand Guiheneuf1999-05-121-46/+0
| | | | svn path=/trunk/; revision=920
* overload wrapper class method. (_write_to_file): start to write some textbertrand1999-05-121-0/+46
1999-05-11 bertrand <Bertrand.Guiheneuf@inria.fr> * camel/camel-mime-part.c (_write_to_file): overload wrapper class method. (_write_to_file): start to write some text in file. svn path=/trunk/; revision=904