Commit Graph

182 Commits

Author SHA1 Message Date
c56bdc1cef Workaround for POS mailers like the one in bug #42045.
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.

svn path=/trunk/; revision=21048
2003-05-02 17:37:11 +00:00
6ba4c3938c When we remove a node from the list, make sure to g_list_free_1().
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.

svn path=/trunk/; revision=20549
2003-03-27 20:16:57 +00:00
becf944b42 Handle raw 8-bit From data "correctly". (The same way we handle
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
2003-03-20 16:43:29 +00:00
1df1d4aead Use header_contentid_decode() as this new function should be safer than
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
2003-03-14 17:44:20 +00:00
74205e83d1 Same as the ones below.
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.

svn path=/trunk/; revision=20056
2003-02-25 19:43:22 +00:00
abada7e2cd Call camel_iconv_init(). (camel_shutdown): Call camel_iconv_shutdown().
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).

svn path=/trunk/; revision=19977
2003-02-20 21:04:19 +00:00
5c90cbb6e1 Replace calls to g_string_sprintfa() with g_string_append_printf() since
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.

svn path=/trunk/; revision=19153
2002-12-17 21:01:00 +00:00
3eabd14ace Use g_strerror when setting an exception string (we need it to be in
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.

svn path=/trunk/; revision=18689
2002-11-11 06:24:56 +00:00
c8b587d9c5 Created temporary link list, we need to link with something for gettext.
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.

svn path=/trunk/; revision=18542
2002-11-05 09:05:24 +00:00
9536369bca Removed. Glib2 has this function.
2002-11-01  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-mime-utils.c (g_string_append_len): Removed. Glib2 has
	this function.

svn path=/trunk/; revision=18499
2002-11-02 00:59:16 +00:00
bf304afc8a Fix all mailing list regex patterns to allow any number of spaces *or*
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.

svn path=/trunk/; revision=18333
2002-10-07 18:10:24 +00:00
adfb8ab4d8 Changed the Mailing-List rule to get the complete domain (* in wrong
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.

svn path=/trunk/; revision=18192
2002-09-24 05:48:14 +00:00
9f492d6f81 Revert a patch that I had not meant to commit that was aimed at fixing bug
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.

svn path=/trunk/; revision=18040
2002-09-11 05:40:01 +00:00
4a52b7b9a9 Fixes bug #4224
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.

svn path=/trunk/; revision=18027
2002-09-09 20:28:35 +00:00
15af11c988 Use e_mktime_utc.
* 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.

svn path=/trunk/; revision=17986
2002-09-05 14:26:30 +00:00
511e3153b9 Oops - outbuf pointed to alloca'd memory but we were g_free'ing it after
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.

svn path=/trunk/; revision=17737
2002-08-08 00:11:29 +00:00
9fcbc8f335 When writing the summary, use TRUNC flag, duh. Also, write to a temp file
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.

svn path=/trunk/; revision=17570
2002-07-24 15:13:43 +00:00
c3e9ea3409 Try to get the FQDN from the results of gethostname(). If that fails, then
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.

svn path=/trunk/; revision=17470
2002-07-15 22:44:13 +00:00
2dd7e35afd Parse "From: Dan Winship <danw>" (with no domain) in the way the sender
* 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.

svn path=/trunk/; revision=17137
2002-06-06 20:41:14 +00:00
b3a906a2ec Fixed the fix for stupidly-broken-mailer bug #5 to work when multiple
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.

svn path=/trunk/; revision=16672
2002-05-03 00:38:45 +00:00
d89f072f8d If we get multiple Content-Type header values, change subsequent headers
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.

svn path=/trunk/; revision=16394
2002-04-09 13:45:44 +00:00
600e799994 Don't count our filler when encoding our line-length octet.
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
2002-04-08 17:34:12 +00:00
49e82f8b9f Simplified since we can now decode in-reply-to without getting extra
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
2002-04-05 00:08:23 +00:00
c18057139c Fix this to work right. We need to convert the input buffer to the charset
2002-03-19  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-mime-utils.c (header_encode_param): Fix this to work
	right. We need to convert the input buffer to the charset we claim
	in the encoded param (duh).

svn path=/trunk/; revision=16214
2002-03-19 23:29:41 +00:00
bb93ebbbee Change the order of the mailing list magic patterns so that the more
* camel-mime-utils.c: Change the order of the mailing list magic
patterns so that the more mailing-list specific ones are on the
top.

svn path=/trunk/; revision=16101
2002-03-11 19:25:42 +00:00
7ac88d8631 Use the FOLD_SIZE as a recommended folding size, but add a new
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
2002-02-28 01:09:05 +00:00
d56ec225b8 The day number has to be 2 chars wide, space filled to work properly with
2002-02-08  Not Zed  <NotZed@Ximian.com>

        * providers/local/camel-spool-summary.c
        (camel_spool_summary_build_from): The day number has to be 2 chars
        wide, space filled to work properly with pine, etc.

        * providers/local/camel-spoold-store.[ch]: new type of provider
        'spool directory', which lets you view external mbox dirs without
        adding any extra cruft.  Perhaps it should use . files to store
        summaries?  Still a bit experimental, there's a warning when you
        select it in the account editor.  Finished off most of #1185.
        Can't rename or move folders.

        * camel-mime-utils.c (header_decode_date): If the date is
        100->1900 then we actually want to use it as the year in the tm
        struct, not year+100.  e.g. year 102 -> 2002, not 2102.

2002-02-07  Not Zed  <NotZed@Ximian.com>

        * providers/local/camel-spool-store.c (get_folder): Pass path into
        spool_folder_new.

        * providers/local/camel-spool-folder.c (camel_spool_folder_new):
        (camel_spool_folder_construct): Take the full path to the folder
        and use that as the file path, independent of the full_name we
        use.

2002-02-07  Not Zed  <NotZed@Ximian.com>

        * providers/local/camel-local-provider.c: Added new type, spoold
        provider, spoold: for local directories.

        * providers/imap/camel-imap-store.c (get_one_folder_offline):
        Create offline uri's in a compatible manner to online ones.

svn path=/trunk/; revision=15606
2002-02-08 02:10:46 +00:00
e111399fba Use camel_mime_parser_read to read internal parser data.
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
2002-02-05 00:21:14 +00:00
42ffb93955 Oops, this was converting foo@[blah] to foo@[ blah ], fixed.
2002-01-31  Not Zed  <NotZed@Ximian.com>

        * camel-mime-utils.c (header_decode_domain): Oops, this was
        converting foo@[blah] to foo@[ blah ], fixed.

svn path=/trunk/; revision=15535
2002-01-31 02:30:36 +00:00
aeb798c028 New function to decode an enhanced status code. (smtp_set_exception): Sets
2002-01-28  Jeffrey Stedfast  <fejj@ximian.com>

	* providers/smtp/camel-smtp-transport.c (smtp_decode_status_code):
	New function to decode an enhanced status code.
	(smtp_set_exception): Sets an exception based on the
	Enhanced-Status-Code.
	(esmtp_get_authtypes): Don't diplicate the key in the hash since
	the key and value are the same.
	(smtp_rcpt): Include the failed recipient in the error message to
	be more helpful to the user.

	* camel-mime-utils.c (hex_decode): Make sure to allocate enough
	for the NUL byte.

svn path=/trunk/; revision=15500
2002-01-29 00:31:58 +00:00
cf8db42ff8 As a temporary solution, just printf ("\a"); to make a beep :-)
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
2002-01-21 23:28:20 +00:00
eea1e59abb Stop uudecoding once the CAMEL_UUDECODE_STATE_END state bit gets set. Set
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
2002-01-17 19:21:11 +00:00
ffa73cbd5c Don't try setting a content-type parameter if either the name or value is
2001-12-12  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-folder-summary.c (content_info_load): Don't try setting a
	content-type parameter if either the name or value is NULL.

	* camel-mime-utils.c (header_set_param): NULL-protection.

svn path=/trunk/; revision=15248
2002-01-04 22:20:29 +00:00
3460dc5c49 Completely rewritten. It is now a load faster and a heck of a lot more
2001-12-21  Jeffrey Stedfast  <fejj@ximian.com>

	* broken-date-parser.c (parse_broken_date): Completely
	rewritten. It is now a load faster and a heck of a lot more
	accurate, also now returns a time_t and sets the saveoffset
	variable rather than returning a new char* buffer for the normal
	camel date parser to re-parse. This saves a fair number of cpu
	cycles :-)

	* camel-mime-utils.c (header_decode_date): Cleanup the broken date
	parsing code.

svn path=/trunk/; revision=15205
2001-12-21 19:51:58 +00:00
081f6dbb1b Protect against either of the types being NULL.
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
2001-12-10 19:14:32 +00:00
5d3580719a Updates for compliance with rfc2231
2001-11-19  Jeffrey Stedfast  <fejj@ximian.com>

	Updates for compliance with rfc2231

	* camel-mime-utils.c (header_encode_param):
	camel_mime_special_table[c] & IS_ESAFE should have been
	!(camel_mime_special_table[c] & IS_ESAFE). Also added a few
	comments for how to improve the code at some future date.
	(header_decode_param): Now takes an argument rfc2184_part so our
	caller can get this information as well.
	(header_decode_param_list): Pass an rfc2184_part argument to
	header_decode_param and also added a few comments on where to
	improve on rfc2184/rfc2231 compliance.
	(rfc2047_decode_word): Updated to respect the updated ABNF syntax
	of rfc2047 encoded words, yay.

svn path=/trunk/; revision=14750
2001-11-19 19:27:46 +00:00
ebb0b83790 Removed unused variable.
2001-10-29  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-mime-utils.c (camel_mime_utils_init): Removed unused
	variable.

svn path=/trunk/; revision=14419
2001-10-30 04:26:28 +00:00
0
e01b1cb662 w(x) out some warnings.
2001-10-30    <NotZed@Ximian.com>

        * camel-mime-utils.c (header_decode_mailbox): w(x) out some warnings.

        * providers/local/camel-local-summary.c
        (camel_local_summary_load): Remove the warning about not loading
        summary file - its a valid case for new folders.

svn path=/trunk/; revision=14411
2001-10-30 03:27:28 +00:00
c764ec4132 Minor fix - should have been using a strNcmp when checking if it was an
2001-10-29  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-mime-utils.c (header_decode_param): Minor fix - should
	have been using a strNcmp when checking if it was an rfc2047
	encoded word.

svn path=/trunk/; revision=14360
2001-10-29 20:51:24 +00:00
9
c43aa966cb Turn off w() -> warnings.
2001-10-29    <NotZed@Ximian.com>

        * camel-mime-utils.c: Turn off w() -> warnings.

        * providers/imap/camel-imap-store.c (rename_folder): Also rename
        the message cache.
        (rename_folder): Fix subscribed folders table with rename(s).

        * providers/imap/camel-imap-folder.c (imap_rename): Implement,
        rename the cache dir pointer.

        * providers/imap/camel-imap-message-cache.c
        (camel_imap_message_cache_set_path): New method to set the path
        used by a message cache.

svn path=/trunk/; revision=14327
2001-10-29 08:24:00 +00:00
4ca07463a0 More fixing of the license texts.
svn path=/trunk/; revision=14217
2001-10-27 18:21:05 +00:00
5
5b449d9ca7 Remove the stupid warning that should never have been there in the first
2001-10-25    <NotZed@Ximian.com>

        * camel-search-private.c (utf8_get): Remove the stupid warning
        that should never have been there in the first place.

        * camel-sasl-digest-md5.c (digest_response): s/iconv/e_iconv/

        * camel-pgp-context.c (pgp_verify): "

        * camel-mime-utils.c (rfc2047_decode_word, rfc2047_decode_word,
        append_8bit, rfc2047_encode_word, rfc2184_decode,
        header_decode_param): "

        * camel-mime-part-utils.c (convert_buffer, convert_buffer): "

        * camel-mime-filter-charset.c (reset, complete, filter): "

svn path=/trunk/; revision=14113
2001-10-26 00:37:52 +00:00
66efbe69a2 Remove an extra * in one of the regexps that glibc apparently doesn't mind
* camel-mime-utils.c (mail_list_magic): Remove an extra * in one
	of the regexps that glibc apparently doesn't mind but bsd does.

svn path=/trunk/; revision=13942
2001-10-23 16:18:47 +00:00
7429141682 Use search_type_mlist for mailing list searches.
* 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
2001-10-22 21:08:05 +00:00
42d022008a (camel_search_header_match): Oops, missing i=0.
svn path=/trunk/; revision=13891
2001-10-22 19:12:06 +00:00
6
a009ea9f2d If no content, dont try and decode further and spit meaningless warnings.
2001-10-16    <NotZed@Ximian.com>

        * camel-mime-utils.c (header_address_decode): If no content, dont
        try and decode further and spit meaningless warnings.

svn path=/trunk/; revision=13702
2001-10-16 20:35:49 +00:00
1
a5fa3f992d Removed charset/locale charset lookup and iconv_open/close functions,
2001-10-11    <NotZed@Ximian.com>

        * camel-charset-map.[ch]: Removed charset/locale charset lookup
        and iconv_open/close functions, moved to gal.  Fixed all callers.

svn path=/trunk/; revision=13602
2001-10-11 22:08:20 +00:00
15b182a1fc Fix a slight error in logic. Just because the last word was an encoded
2001-10-06  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-mime-utils.c (header_decode_text): Fix a slight error in
	logic. Just because the last word was an encoded word doesn't mean
	we ignore the lwsp padding, we only ignore it if the last word and
	*this* word are encoded.

svn path=/trunk/; revision=13490
2001-10-06 23:44:46 +00:00
9ab12dd363 Implemented uuencoding and decoding. (complete): Implemented uuencoding
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
2001-10-06 07:19:41 +00:00
5
796292fb21 Try harder to get broken names out of addresses. Unencoded ,'s in names
2001-10-05    <NotZed@Ximian.com>

	* camel-mime-utils.c (header_decode_mailbox): Try harder to get
	broken names out of addresses.  Unencoded ,'s in names will still
	break it, but well what can you do eh?
	(header_decode_mailbox): Always add .'s into address we've scanned
	past a '.', even if we can't decode the next part.  Fix for some
	annoying bug #.

svn path=/trunk/; revision=13453
2001-10-05 18:52:21 +00:00