summaryrefslogtreecommitdiff
path: root/camel/camel-mime-utils.c
Commit message (Collapse)AuthorAgeFilesLines
* bump version, libtool numbersEVOLUTION_DATA_SERVER_0_0_95evolution-data-server-0-0-95JP Rosevear2004-07-021-4276/+0
| | | | | | 2004-07-02 JP Rosevear <jpr@novell.com> * configure.in: bump version, libtool numbers
* Call camel_mime_utils_shutdown() and camel_operation_shutdown().Jeffrey Stedfast2004-06-181-1/+11
| | | | | | | | | | | | 2004-06-18 Jeffrey Stedfast <fejj@novell.com> * camel.c (camel_shutdown): Call camel_mime_utils_shutdown() and camel_operation_shutdown(). * camel-operation.c (camel_operation_shutdown): New function. * camel-mime-utils.c (camel_mime_utils_shutdown): New function to clean up the compiled regexes.
* ** A few fixes for better rfc compliance, and cleaner code.Not Zed2004-06-011-341/+203
| | | | | | | | | | | | | | | | | | | | | | | 2004-06-01 Not Zed <NotZed@Ximian.com> ** A few fixes for better rfc compliance, and cleaner code. * camel-mime-utils.c (header_encode_param): a bunch of logic cleanups with new util functions. (header_decode_init): setup a new type ATTR_CHAR, for attribute-char. * tests/misc/test2.c (main): new test for rfc2184 stuff. * camel-mime-utils.c (header_convert): helper to convert between charsets. (rfc2184_decode): fix a bunch of logic problems and use the helper above to simplify code. (decode_param_token): removed, not needed. (header_decode_rfc2184_param): removed, not needed. (header_decode_param): removed, not needed. ugh. (header_decode_param_list): completely rewritten, hence lack of need of above.
* fix/rearrange logic. It was using the wrong working pointer.Not Zed2004-05-241-9/+7
| | | | | | | 2004-05-24 Not Zed <NotZed@Ximian.com> * camel-mime-utils.c (camel_header_newsgroups_decode): fix/rearrange logic. It was using the wrong working pointer.
* Fix for #58738 ja_JP.UTF-8: Evolution crashes when certain ASCII/non-ASCIISuresh Chandrasekharan2004-05-201-3/+3
| | | | | | | | | | | | 2004-05-19 Suresh Chandrasekharan <suresh.chandrasekharan@sun.com> Fix for #58738 ja_JP.UTF-8: Evolution crashes when certain ASCII/non-ASCII combination is used in mail subject * camel-mime-utils.c: (camel_header_encode_string) Use camel_mime_is_lwsp for determining word separators, according to rfc822 (which's also same for rfc2047). g_unichar_isspace as word separator is illegal.
* Use header_decode_text() rather than rfc2047_decode_word() to decode theJeffrey Stedfast2004-03-301-2/+1
| | | | | | | | | | 2004-03-30 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.c (header_decode_param): Use header_decode_text() rather than rfc2047_decode_word() to decode the brokenly rfc2047 encoded param value string in case it is actually made up of multiple rfc2047 encoded words. Thanks to Andrei Nigmatulin for the fix.
* decode newsgroups header into a list of newsgroups.Not Zed2004-03-221-0/+43
| | | | | | | | | | | | | | | | 2004-03-22 Not Zed <NotZed@Ximian.com> * camel-mime-utils.c (camel_header_newsgroups_decode) (camel_header_newsgroups_free): decode newsgroups header into a list of newsgroups. ** See #55887. * providers/nntp/camel-nntp-summary.c (camel_nntp_summary_check): NOOP if we're offline. * providers/nntp/camel-nntp-store.c (nntp_connected): spit a warning if we try to do stuff whilst offline, rather than crash.
* drop embedded whitespace characters, and don't do unquoting, etc. SeeNot Zed2004-03-151-8/+25
| | | | | | | | 2004-03-15 Not Zed <NotZed@Ximian.com> * camel-mime-utils.c (camel_header_location_decode): drop embedded whitespace characters, and don't do unquoting, etc. See rfc2557 4.4.2 and rfc2017 3.1.
* Same.Jeffrey Stedfast2004-01-161-16/+16
| | | | | | | | | | | 2004-01-16 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-message.c (camel_mime_message_build_mbox_from): Same. * camel-internet-address.c (internet_decode): Same. * camel-mime-utils.[c,h]: Namespaced camel_header_address_t enums s/HEADER_ADDRESS_/CAMEL_HEADER_ADDRESS_/g
* if e_iconv() returns -1, check that errno != EINVAL - if errno *is*Jeffrey Stedfast2004-01-111-4/+5
| | | | | | | | | | | | | | | 2004-01-10 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.c (rfc2047_encode_word): if e_iconv() returns -1, check that errno != EINVAL - if errno *is* EINVAL, it just means that our convlen wasn't long enough to include the whole sequence. This is fine, we'll just start where we left off next loop thru. Fixes bug #52593 (the buffer was duplicated because state wasn't flushed). (camel_header_encode_string): Fixed a type-o in loop where encoding=0, don't g_string_append_len starting at 'word' inptr-start bytes long - 'word' could be NULL and/or inptr-start could be longer than inptr-word.
* Revert the s/is_/camel_mime_is_/ changes or we get really long variableJeffrey Stedfast2003-12-091-20/+20
| | | | | | | | | | 2003-12-08 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.c (header_decode_rfc2184_param): Revert the s/is_/camel_mime_is_/ changes or we get really long variable names. (header_decode_param): Same. (header_decode_param_list): Here too.
* encode the address before sending it out, rather than using the raw/utf8Not Zed2003-12-091-83/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2003-12-09 Not Zed <NotZed@Ximian.com> * providers/smtp/camel-smtp-transport.c (smtp_send_to): encode the address before sending it out, rather than using the raw/utf8 version. * camel-internet-address.c (camel_internet_address_encode_address): check for quoting the local part of the address before outputting it. (cia_encode_addrspec): quote local part if need be. (camel_internet_address_encode_address): make folding optional based on whether inlen is null or not. * camel-mime-utils.[ch]: rename is_* to camel_mime_is_* and export the type functions. 2003-12-08 Not Zed <NotZed@Ximian.com> * providers/imap/camel-imap-utils.c (imap_atom_specials): add } to the atom specials list. This isn't correct, but some busted servers expect it. Bug #50728. 2003-12-02 Not Zed <NotZed@Ximian.com> * providers/local/camel-local-folder.c (local_setv): remove some debug printfs. ** See bug #51576. * camel-url.c (camel_url_decode): robustify url decoding for bad input, addresses a crash.
* Added list-unsubscribe header match.Not Zed2003-12-011-0/+2
| | | | | | | | | | | | | | | | | 2003-11-28 Not Zed <NotZed@Ximian.com> * camel-mime-utils.c (mail_list_magic[]): Added list-unsubscribe header match. 2003-11-26 Not Zed <NotZed@Ximian.com> * camel-smime-context.c (sm_verify_cmsg): take a stream rather than a part for the content. (sm_verify): get the content directly as a stream. * camel-multipart-signed.c (camel_multipart_signed_get_content_stream): new api to get the content stream which will match the signed version.
* Single condition shorteningArtur Flinta2003-11-171-1/+1
|
* We should check List-Post before List-Id (List-Post has to contain theJeffrey Stedfast2003-10-281-10/+10
| | | | | | | | | 2003-10-28 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.c: We should check List-Post before List-Id (List-Post has to contain the mailing-list posting address, whereas List-Id does not.) WAlso moved X-Loop to after List-Id to make FreeBSD lusers happy. Fixes bug #32297.
* better detection of broken date to give to broken_date_parser.Frédéric Crozat2003-10-281-0/+15
| | | | | * camel-mime-utils.c: (camel_header_decode_date): better detection of broken date to give to broken_date_parser.
* Allow timezone offsets to be up to 14 hours ahead of UTC. Fixes bugJeffrey Stedfast2003-10-091-2/+2
| | | | | | | | | 2003-10-09 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.c (header_decode_date): Allow timezone offsets to be up to 14 hours ahead of UTC. Fixes bug #49357. * broken-date-parser.c (get_tzone): Same.
* Don't forget to flush the iconv conversion.Jeffrey Stedfast2003-09-231-1/+3
| | | | | | | 2003-09-23 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.c (append_8bit): Don't forget to flush the iconv conversion.
* New function to replace the one from camel-mime-part.cJeffrey Stedfast2003-09-181-2/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* namespaced the encoding/decoding routines.Jeffrey Stedfast2003-09-181-22/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* s/HSCAN_/CAMEL_MIME_PARSER_STATE_/g andJeffrey Stedfast2003-09-181-169/+181
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]
* temporarily reverting my camel namespace patches until after we merge in ↵Jeffrey Stedfast2003-08-261-181/+169
| | | | some of the other branches
* reverted some namespacing changes to internal functionsJeffrey Stedfast2003-08-261-17/+17
|
* Namespaced.Jeffrey Stedfast2003-08-251-182/+194
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]
* Fix for #46168 'some additional locale aliases required for chinesenew-calendar-branch-startnew-calendar-branch-merge-endnew-calendar-branch-before-create-modifySuresh Chandrasekharan2003-07-291-43/+43
| | | | | | | | | | | | | | | | | | 2003-07-11 Suresh Chandrasekharan <suresh.chandrasekharan@sun.com> * camel-iconv.c: Fix for #46168 'some additional locale aliases required for chinese support'. 2003-07-25 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.c (header_decode_word): Revert NotZed's fix for bug #42170 - this causes even more problems than it solves. See bug #46331 for info. Basically, each address header would be converted to UTF-8 twice which means no raw 8bit address header would render correctly. (header_decode_mailbox): Perform a sanity check on the resultant addr->str to make sure that it is valid UTF-8, if not convert it to UTF-8. Fixes bug #42170.
* Get rid of the #ifdef ENABLE_THREADS since we no longer plan toJeffrey Stedfast2003-07-091-20/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2003-07-09 Jeffrey Stedfast <fejj@ximian.com> * camel-block-file.c: Get rid of the #ifdef ENABLE_THREADS since we no longer plan to support/maintain this. * camel.c: Same. * camel-certdb.c: Here too. * camel-charset-map.c: And here. * camel-cipher-context.c: " * camel-data-wrapper.c: " * camel-digest-folder.c: " * camel-exception.c: " * camel-folder.c: " * camel-folder-summary.c: " * camel-lock-client.c: " * camel-mime-utils.c: " * camel-object.c: " * camel-operation.c: " * camel-partition-table.c: " * camel-sasl-popb4smtp.c: " * camel-service.c: " * camel-session.c: " * camel-store.c: " * camel-store-summary.c: " * camel-text-index.c: " * camel-transport.c: " * camel-vee-folder.c: " * camel-tcp-stream-openssl.c: Removed pthread.h, it isn't needed.
* Use gmtime_r() instead of using gmtime() and memcpy() to try and beJeffrey Stedfast2003-07-021-3/+3
| | | | | | | 2003-07-01 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.c (header_format_date): Use gmtime_r() instead of using gmtime() and memcpy() to try and be "atomic".
* Put day of week into outgoing email.David Woodhouse2003-07-011-1/+6
| | | | | | | 2003-06-24 David Woodhouse <dwmw2@infradead.org> * camel-mime-utils.c (header_format_date): Put day of week into outgoing email.
* Simplistic quick-fix for #42710. Add a charset argument. If the data is 8Not Zed2003-05-151-21/+39
| | | | | | | | | | 2003-05-15 Not Zed <NotZed@Ximian.com> * camel-mime-utils.c (header_decode_word): Simplistic quick-fix for #42710. Add a charset argument. If the data is 8 bit, try to decode into the passed in charset (i.e. the message header?), at worst, fall back to latin1, similarly to header_decode_text. Fixed all callers to pass in a charset if available, or NULL.
* Workaround for POS mailers like the one in bug #42045.Jeffrey Stedfast2003-05-021-0/+4
| | | | | | | | | | | | 2003-05-01 Jeffrey Stedfast <fejj@ximian.com> Workaround for POS mailers like the one in bug #42045. * camel-mime-utils.c (header_decode_date): Make sure the numeric timezone is between -1200 and 1200, otherwise it is invalid. * broken-date-parser.c (get_tzone): Make sure the numeric timezone is between -1200 and 1200, otherwise it is invalid.
* When we remove a node from the list, make sure to g_list_free_1().Jeffrey Stedfast2003-03-271-1/+5
| | | | | | | | | | | | 2003-03-27 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.c (header_encode_phrase_merge_words): When we remove a node from the list, make sure to g_list_free_1(). (header_encode_phrase_merge_words): Don't use CAMEL_FOLD_PREENCODED as the upper-bound for merged-word length if the merged-word will not be an rfc2047 encoded word. Instead, use CAMEL_FOLD_SIZE-8 (which is the value we use in other places for determining upper-bound lengths). Solves bug #38659.
* Handle raw 8-bit From data "correctly". (The same way we handleDan Winship2003-03-201-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Use header_contentid_decode() as this new function should be safer thanEVOLUTION_1_2_3Jeffrey Stedfast2003-03-141-0/+67
| | | | | | | | | | | | | | | 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.
* Same as the ones below.Jeffrey Stedfast2003-02-251-39/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | 2003-02-25 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-message.c: Same as the ones below. * camel-mime-part.c: Reverted back to pre-camel-iconv * camel-filter-search.c: Same as below. * camel-folder-summary.c: Reverted back to pre-camel-iconv * camel.c (camel_init): Reverted to pre-camel-iconv * camel-charset-map.c (camel_charset_locale_name): Removed (part of the revert). (camel_charset_canonical_name): Same. * camel-mime-filter-charset.c: Revert back to using e_iconv from GAL. * camel-mime-part-utils.c: Revert back to using e_iconv from GAL. * camel-mime-utils.c: Revert back to using e_iconv from GAL. * camel-sasl-digest-md5.c: Revert back to using e-iconv from GAL.
* Call camel_iconv_init(). (camel_shutdown): Call camel_iconv_shutdown().Jeffrey Stedfast2003-02-201-34/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2003-02-20 Jeffrey Stedfast <fejj@ximian.com> * camel.c (camel_init): Call camel_iconv_init(). (camel_shutdown): Call camel_iconv_shutdown(). * camel-sasl-digest-md5.c (digest_response): Updated to use camel-iconv and the new camel-charset-map functions. * camel-mime-utils.c: Updated to use camel-iconv and the new camel-charset-map functions. * camel-mime-part-utils.c (check_html_charset): Use camel_charset_canonical_name() instead of e_iconv_charset_name() which is longer available. (convert_buffer): Use camel-iconv. (simple_data_wrapper_construct_from_parser): Since camel_charset_iso_to_windows() returns the charset in it's canonical format, no need to re-canonicalise it. * camel-mime-part.c (process_header): Use camel_charset_canonical_name() instead of e_iconv_charset_name() which is longer available. * camel-mime-message.c (process_header): Use camel_charset_canonical_name() instead of e_iconv_charset_name() which is longer available. * camel-mime-filter-charset.c: Use camel-iconv. * camel-folder-summary.c (message_info_new): Use camel_charset_canonical_name() instead of e_iconv_charset_name() which is longer available. (content_info_new): Use camel_charset_locale_name(). (camel_message_info_new_from_header): Same as message_info_new(). * camel-search-private.c: Use g_alloca() instead of alloca(). * camel-filter-search.c (check_header): Use camel_charset_canonical_name() instead of e_iconv_charset_name() which is longer available. * camel-charset-map.c (camel_charset_locale_name): New function, replaces e_iconv_locale_charset(). (camel_charset_canonical_name): New function, similar to e_iconv_charset_name() but instead of returning the iconv-friendly name, it returns the canonical name. (g_iconv will do the iconv-friendly name conversions for us).
* Replace calls to g_string_sprintfa() with g_string_append_printf() sinceJeffrey Stedfast2002-12-171-46/+48
| | | | | | | | | | | | 2002-12-17 Jeffrey Stedfast <fejj@ximian.com> * camel-url.c: Replace calls to g_string_sprintfa() with g_string_append_printf() since the former seems to have been deprecated. * camel-service.c: Same. * camel-mime-utils.c: Here too.
* Use g_strerror when setting an exception string (we need it to be inJeffrey Stedfast2002-11-111-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2002-11-11 Jeffrey Stedfast <fejj@ximian.com> * providers/local/camel-spool-summary.c (spool_summary_sync_full): Use g_strerror when setting an exception string (we need it to be in UTF-8). (spool_summary_check): Here too. * providers/local/camel-spool-store.c (construct): Use g_strerror when setting an exception string (we need it to be in UTF-8). (get_folder): Same. (scan_dir): Here too. * providers/local/camel-spool-folder.c (spool_lock): Use g_strerror when setting an exception string (we need it to be in UTF-8). * providers/local/camel-mh-summary.c (mh_summary_check): Use g_strerror when setting an exception string (we need it to be in UTF-8). * providers/local/camel-mh-store.c (delete_folder): Use g_strerror when setting an exception string (we need it to be in UTF-8). * providers/local/camel-mbox-summary.c (summary_update): Use g_strerror when setting an exception string (we need it to be in UTF-8). (mbox_summary_sync_full): Here too. (mbox_summary_sync_quick): Same. (mbox_summary_sync): Also here. (camel_mbox_summary_sync_mbox): Again here. * providers/local/camel-mbox-folder.c (mbox_lock): Use g_strerror when setting an exception string (we need it to be in UTF-8). (mbox_append_message): Same. (mbox_get_message): Here too. * providers/local/camel-maildir-summary.c (maildir_summary_load): Use g_strerror when setting an exception string (we need it to be in UTF-8). (maildir_summary_check): Same. * providers/local/camel-maildir-store.c (get_folder): Use g_strerror when setting an exception string (we need it to be in UTF-8). (delete_folder): Same. (delete_folder): Here too. * providers/local/camel-local-summary.c (local_summary_sync): Use g_strerror when setting an exception string (we need it to be in UTF-8). * providers/local/camel-local-store.c (get_folder): Use g_strerror when setting an exception string (we need it to be in UTF-8). (create_folder): Same. (xrename): Here too. (rename_folder): And here. (delete_folder): Also here. * camel-provider.c (camel_provider_init): For debugging printfs, we want to use normal strerror (we want locale charset, not UTF-8). * camel-movemail.c (camel_movemail): Use g_strerror when setting an exception string (we need it to be in UTF-8). (movemail_external): Same. (camel_movemail_copy_file): Here too. (camel_movemail_solaris): Also here. * camel-mime-utils.c (rfc2047_decode_word): For debugging printfs, we want to use normal strerror (we want locale charset, not UTF-8). (header_encode_param): Same. * camel-mime-part-utils.c (convert_buffer): For debugging printfs, we want to use normal strerror (we want locale charset, not UTF-8). * camel-lock-client.c (camel_lock_helper_init): Use g_strerror when setting an exception string (we need it to be in UTF-8). * camel-data-cache.c (camel_data_cache_remove): Use g_strerror when setting an exception string (we need it to be in UTF-8). * camel-tcp-stream-raw.c (flaky_tcp_write): For debugging printfs, we want to use normal strerror (we want locale charset, not UTF-8). (flaky_tcp_read): Same. * camel-gpg-context.c (gpg_ctx_op_step): For debugging printfs, we want to use normal strerror (we want locale charset, not UTF-8). * camel-service.c (camel_gethostbyname): Use g_strerror when setting an exception string (we need it to be in UTF-8). * camel-lock.c (camel_lock_dot): Use g_strerror when setting an exception string (we need it to be in UTF-8). (camel_lock_fcntl): Same.
* Created temporary link list, we need to link with something for gettext.Not Zed2002-11-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | 2002-11-05 Not Zed <NotZed@Ximian.com> * Makefile.am (camel_lock_helper_LDADD): Created temporary link list, we need to link with something for gettext. * camel.h: Remove gstring-util.h and hash-table-utils.h. * camel-text-index.c: (text_index_normalise): Changed for g_utf8_strdown api change. * camel-search-private.c: * camel-mime-utils.c: * camel-mime-part-utils.c: * camel-html-parser.c: * camel-charset-map.c: Include glib/gunicode.h from glib instead of gal. * camel-filter-driver.c: Remove include of gtk/gtk.h, should never have been there.
* Removed. Glib2 has this function.Jeffrey Stedfast2002-11-021-12/+0
| | | | | | | 2002-11-01 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.c (g_string_append_len): Removed. Glib2 has this function.
* Fix all mailing list regex patterns to allow any number of spaces *or*Jeffrey Stedfast2002-10-071-11/+11
| | | | | | | | 2002-10-06 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.c: Fix all mailing list regex patterns to allow any number of spaces *or* tabs as pre-padding for the header values.
* Changed the Mailing-List rule to get the complete domain (* in wrongNot Zed2002-09-241-1/+1
| | | | | | | 2002-09-24 Not Zed <NotZed@Ximian.com> * camel-mime-utils.c (mail_list_magic[]): Changed the Mailing-List rule to get the complete domain (* in wrong spot). #31087.
* Revert a patch that I had not meant to commit that was aimed at fixing bugJeffrey Stedfast2002-09-111-30/+8
| | | | | | | 2002-09-11 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.c (header_encode_string): Revert a patch that I had not meant to commit that was aimed at fixing bug #29234.
* Fixes bug #4224Jeffrey Stedfast2002-09-091-8/+30
| | | | | | | | | | | | | | | | 2002-09-09 Jeffrey Stedfast <fejj@ximian.com> Fixes bug #4224 * providers/imap/camel-imap-folder.c (camel_imap_folder_fetch_data): Pass ex into camel_imap_message_cache_get(). * providers/imap/camel-imap-message-cache.c (camel_imap_message_cache_get): Now takes an exception and sets it on fail. (camel_imap_message_cache_copy): Updated to properly handle cache_get error conditions.
* Use e_mktime_utc.EVOLUTION_1_1_1evolution-1-1-1-branchDan Winship2002-09-051-8/+2
| | | | | | | | | * camel-mime-utils.c (header_decode_date): Use e_mktime_utc. * camel-mime-message.c (camel_mime_message_set_date): Use e_localtime_with_offset. * broken-date-parser.c (decode_broken_date): Use e_mktime_utc.
* Oops - outbuf pointed to alloca'd memory but we were g_free'ing it afterJeffrey Stedfast2002-08-081-5/+6
| | | | | | | | | | | 2002-08-07 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.c (header_encode_param): Oops - outbuf pointed to alloca'd memory but we were g_free'ing it after using it. Instead use g_malloc for this outbuf buffer since it may be kinda large. Also don't depend on a single byte to nul-terminate the outbuf buffer so as to be safe with charsets such as UCS2 and UCS4, instead keep a pointer to the end of the buffer.
* When writing the summary, use TRUNC flag, duh. Also, write to a temp fileNot Zed2002-07-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | 2002-07-25 Not Zed <NotZed@Ximian.com> * camel-folder-summary.c (camel_folder_summary_save): When writing the summary, use TRUNC flag, duh. Also, write to a temp file first, and rename when closed successfully, and check ferror() and fclose() against 0 rather than -1. * providers/local/camel-mbox-summary.c (summary_update): Decrement i if we remove the summary item so we dont skip every 2nd one. * camel-mime-utils.c (header_decode_mailbox): Use rfc2047_decode_word explicitly incase we just found an encoded word. Stops us re-decoding the string twice, which fixes memory corruption in #26330 when the HUGE string is used later. 2002-07-24 Not Zed <NotZed@Ximian.com> * camel-partition-table.c (camel_key_table_next): Didn't unlock if we exited on an empty key list.
* Try to get the FQDN from the results of gethostname(). If that fails, thenJeffrey Stedfast2002-07-151-9/+20
| | | | | | | | | | 2002-07-15 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.c (header_msgid_generate): Try to get the FQDN from the results of gethostname(). If that fails, then fall back to the results gotten from gethostname() or if that fails just use "localhost.localdomain". Addresses bug #17416. (header_decode_param): Protect against a NULL value.
* Parse "From: Dan Winship <danw>" (with no domain) in the way the senderEVOLUTION_1_0_8EVOLUTION_1_0_7Dan Winship2002-06-061-1/+1
| | | | | | * camel-mime-utils.c (header_decode_mailbox): Parse "From: Dan Winship <danw>" (with no domain) in the way the sender meant it, even though it's completely wrong.
* Fixed the fix for stupidly-broken-mailer bug #5 to work when multipleJeffrey Stedfast2002-05-031-3/+3
| | | | | | | | 2002-05-02 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.c (header_decode_mailbox): Fixed the fix for stupidly-broken-mailer bug #5 to work when multiple unescaped characters were in a row. Fixes bug #24140.
* If we get multiple Content-Type header values, change subsequent headersNot Zed2002-04-091-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2002-04-09 Not Zed <NotZed@Ximian.com> * camel-mime-part.c (construct_from_parser): If we get multiple Content-Type header values, change subsequent headers to X-Invalid-Content-Type so it doesn't wreck processing. This fixes the reported case in #18929, but i dont know if it fixes the original posters problems. 2002-04-08 Not Zed <NotZed@Ximian.com> * camel-vtrash-folder.c (vtrash_move_messages_to): If we find we're moving from the vtrash to another folder, we need to convert the uid from a vfolder uid to the source uid (+8). Fix for #20886. Also changed to batch multiple moves to different folders so they are done as efficiently as possible rather than one at a time. * camel-mime-utils.c (base64_decode_step): If we only get passed '=', we back track only if we actually output any data. Fix for #21716. (quoted_decode): Pass out size_t instead of int, and use 0 instead of -1 for error since its not signed. This will fix similar bug to above in different circumstances since the result is taken as unsigned. This is only an internal func. (quoted_encode): Return size_t just for consistency. * camel-block-file.c (block_file_validate_root): Comment out the debug and move it into a warning when the validation fails.