Commit Graph

28 Commits

Author SHA1 Message Date
91195af48f New function to replace the one from camel-mime-part.c
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
2003-09-18 19:02:15 +00:00
87b5d92a77 ** See bug #47634.
2003-08-15  Not Zed  <NotZed@Ximian.com>

        ** See bug #47634.

        * tests/lib/messages.c (test_message_compare): check
        write_to_stream returns.
        (message_dump_rec): helper to dump message structure.

        * camel-mime-part-utils.c
        (simple_data_wrapper_construct_from_parser): dont set content
        encoding here.
        (camel_mime_part_construct_content_from_parser): set it here
        instead, on every part.  basically same as setting the
        mime_type_field always.

        * camel-multipart-signed.c (camel_multipart_signed_class_init):
        * camel-mime-message.c (camel_mime_message_class_init):
        * camel-multipart.c (camel_multipart_class_init): override
        decode_to_stream to always do the same as write_to_stream, since
        we can never be encoded.

svn path=/trunk/; revision=22252
2003-08-15 20:57:30 +00:00
b328a21e7c New test suite for the mime parser (which is where the below 2 fixes were
* 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
2003-08-11 17:57:45 +00:00
db1672cb69 removed #ifdef ENABLE_THREADS
svn path=/trunk/; revision=21779
2003-07-09 19:32:43 +00:00
a52720a921 clear nonfatal stuff.
2002-09-04  Not Zed  <NotZed@Ximian.com>

	* tests/folder/test4.c (main): clear nonfatal stuff.

	* tests/folder/test6.c (main): check inbox and 'another folder'
	because some servers do different things w/ inbox.

	* providers/imap/camel-imap-message-cache.c
	(camel_imap_message_cache_get): Dont try to open the directory
	instead of an empty "" uid.

	* providers/imap/camel-imap-folder.c (imap_get_message): we dont
	want to g_return_if_fail, we need to set an exception and always
	handle the case.
	(get_message_simple): Set an exception if we get a construct
	failure.
	(imap_refresh_info): if we're refreshing inbox, force a reselect.
	this is required for at least cryus.  CHECK doesnt work either :(

	* tests/lib/folders.c (test_folder_basic): for non-local stores,
	the folder will have an extra ref for selection, take this into
	account when checking ref leaks.
	(test_folder_message_ops): Dont try to delete folder with messages
	in it, it works generally with imap.  also, change params so we
	can test different mailbox types.
	(test_folder_message_ops): disconnect remote services before
	finishing off.  doesn't need to stricly but makes ref count
	checking more accurate.
	(test_folder_message_ops): removed explicit remote sync, imap does
	it itself now ...

	* providers/imap/camel-imap-store.c:
	(camel_imap_store_finalize): call service_disconnect, so it isn't
	called later in the finalise chain, to properly cleanup on exit.

svn path=/trunk/; revision=17962
2002-09-04 08:13:38 +00:00
577c14751f Don't register the noop timeout here anymore, we're gonna handle all this
2002-08-21  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-session.c (get_service): Don't register the noop timeout
	here anymore, we're gonna handle all this in the mailer now.
	(camel_session_register_timeout): Removed.
	(camel_session_remove_timeout): Removed.

svn path=/trunk/; revision=17830
2002-08-21 18:17:21 +00:00
5fb3a28aba Updated to pass the needed arguments to camel_init() and to init gthreads
2002-08-19  Jeffrey Stedfast  <fejj@ximian.com>

	* tests/lib/camel-test.c (camel_test_init): Updated to pass the
	needed arguments to camel_init() and to init gthreads before camel
	(since camel expectes it to be initialised already).

	* tests/lib/session.c: #include <config.h> needed for
	ENABLE_THREADS so that sizeof (CamelSessionClass) gives the
	correct size.

	* tests/*: Updated to work with camel API changes.

svn path=/trunk/; revision=17805
2002-08-19 20:14:15 +00:00
6ffa930086 Add a CamelMimeFilterStripHeader that removes a header from mime output. Used
by sendmail to strip the BCC from the email while still sending to the BCC
recipients.

camel:

2001-06-28  Peter Williams  <peterw@ximian.com>

        * camel-mime-filter-stripheader.c: New file. Filter that strips a
        header from mime output.

        * camel-mime-filter-stripheader.h: New file. Header for the above.

        * providers/smtp/camel-smtp-transport.c (smtp_data): Use the stripheader
        filter to remove the "Bcc" header.

        * Makefile.am: Add the stripheader files.

        * tests/lib/Makefile.am (INCLUDES): Get this to compile again.

        * tests/mime-filter/test-stripheader.c: New file. Test suite for
        the CamelMimeFilterStripHeader.

        * tests/mime-filter/Makefile.am: New test section: mime filters.

mail:

2001-06-28  Peter Williams  <peterw@ximian.com>

        * mail-ops.c (mail_send_message): Revert fejj's Bcc header removal;
        this unsets the BCC recipients and so doesn't send to the Bcc'd
        people at all.

svn path=/trunk/; revision=10576
2001-06-28 20:35:43 +00:00
e905364bee Only create a missing uid if we have indexing turned on.
2001-06-18  Not Zed  <NotZed@Ximian.com>

        * camel-folder-summary.c
        (camel_folder_summary_info_new_from_parser): Only create a missing
        uid if we have indexing turned on.

        * camel-lock-helper.c (setup_process): Function to setup
        process/sanity/security checks.  Change to the real uid as soon as
        we can.
        (lock_path): First try to lock as the real uid, if that fails, try
        the root uid.
        (unlock_id): Unlock as the uid we created the lock as.

        * Makefile.am (INCLUDES): Added -DCAMEL_SBINDIR for lock helper
        location.

        * providers/local/camel-spool-folder.c (spool_lock): Implemented,
        using lock helper locking.  Need to work out if the locking
        requires a root created lock?
        (spool_unlock): Likewise.

2001-06-15  Not Zed  <NotZed@Ximian.com>

        * camel-lock-helper.c: Setuid Lock helper process.  Creates and manages
        .locks, keeping them active, removing them, etc.  What real perms it
        needs is a little system dependent.

2001-06-14  Not Zed  <NotZed@Ximian.com>

        * providers/local/camel-maildir-store.c (get_folder_info): Implement.
        (scan_dir): Does the work of scanning for maildir directories.

2001-06-13  Not Zed  <NotZed@Ximian.com>

        * providers/local/camel-spool-store.c (get_folder_info):
        Implemented, just returns a hardcoded INBOX folder.
        (free_folder_info): implemented, free's the 1 possible level of
        folder info.

        * providers/local/camel-spool-folder.c
        (camel_spool_folder_construct): Set the real unread message
        count on the folder_created thing.

svn path=/trunk/; revision=10261
2001-06-18 14:36:44 +00:00
f14e85f771 A new provider, for spool mailboxes. Mostly a cut and paste of the mbox
2001-06-12  Not Zed  <NotZed@Ximian.com>

        * providers/local/camel-spool-*.[ch]: A new provider, for spool
        mailboxes.  Mostly a cut and paste of the mbox code, but not a
        subclass CamelLocal*.  Not tested a lot, doesn't lock yet, use
        with extreme caution.

        * tests/lib/folders.c (test_folder_message_ops): Added spool arg,
        spool folders can't be deleted, renamed, etc.
        (test_folder_basic): Same.

        * tests/folder/test2.c (main): Added checks for spool type.

        * tests/[message|stream|folder|misc|smime]/Makefile.am (LDADD):
        Added db3 flags, so make check compiles, doesn't run though.

2001-05-24  Not Zed  <NotZed@Ximian.com>

        * providers/local/camel-local-provider.c
        (camel_provider_module_init): Added spool provider.

svn path=/trunk/; revision=10198
2001-06-12 14:29:28 +00:00
618ce2988e Fix an fd leak
* tests/lib/messages.c (test_message_read_file): Fix an fd leak

	* tests/lib/session.c, tests/lib/session.h: a CamelSession
	subclass for the test programs.

	* tests/lib/Makefile.am: include session.[ch]

	* tests/folder/test*.c: Use a CamelTestSession from libcameltest
	instead of cut+pasting everywhere.

	* tests/misc/url.c (main): Update for a camel_url_new change at
	some point.

	* tests/*/.cvsignore: Add stuff.

	* camel-mime-utils.c (rfc2047_encode_word): Fix a silly ==/!=
	mixup.

svn path=/trunk/; revision=10023
2001-05-27 19:52:07 +00:00
881c6eb752 Added profiling temp files.
2001-01-22  Not Zed  <NotZed@Ximian.com>

        * .cvsignore */*/.cvsignore: Added profiling temp
        files.

svn path=/trunk/; revision=7705
2001-01-22 11:57:29 +00:00
4f5effdf88 Index: ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/camel/ChangeLog,v
retrieving revision 1.684
diff -r1.684 ChangeLog
0a1,34
> 2001-01-17  Not Zed  <NotZed@Ximian.com>
>
> 	* camel-folder.c (free_summary): Call
> 	camel_folder_summary_array_free() to do the work.
> 	(get_summary): Use camel_folder_summary_array() to get the array
> 	atomically.  These fixes allow folder/test8 to work again, and fix
> 	a sort of race where the summary size can change while we were
> 	making a copy of it.
>
> 	* camel-folder-summary.c (camel_folder_summary_array): Get the
> 	summary array atomically, so it can't contain empty records.
> 	(camel_folder_summary_array_free): And free it.
>
> 	* tests/lib/camel-test.c (die): If we are verbose & in threads,
> 	then goto sleep so we can debug.
>
> 	* tests/folder/test8.c (worker): Add a missing pull() for
> 	comnparing content.
>
> 	* camel-filter-search.c: Fix the symbol table, so match-all is an
> 	immediate function, as it should be.
>
> 	* tests/folder/test9.c (main): New test, tests some filtering
> 	things.
>
> 	* tests/message/test3.c (main): Dont use a boundary string with
> 	spaces in it.  Folding can corrupt it.  Maybe the folding isn't
> 	working entirely right, but anyway.
>
> 	* camel-session.c: Debug out the debug.
>
> 	* camel-filter-driver.c (camel_filter_driver_filter_folder): Plug
> 	a messageinfo leak.
>
1a36,94
>
> 	* camel-filter-search.c (header_exists): Changed to support
> 	multiple args (or'd together).
> 	(header_contains): Cleaned up to match the search code.  Why did
> 	fejj change it? I'll never know.
> 	(header_matches):
> 	(header_starts_with):
> 	(header_ends_with): Big cleanup of fejj's "i'm the cut & paste
> 	king" code.  Also properly handle or'ing of additional args to
> 	match what the folder-search code should do.
> 	(check_match): New function which does the annoying matching
> 	stuff (for header matches).
> 	(check_header): Similarly, handles or'ing of the matches together.
> 	(header_contains):
> 	(header_matches):
> 	(header_starts_with):
> 	(header_ends_with): Call check_header to do the actual work.
> 	(header_soundex): And here too.
> 	(match_all): Yeah like match-all isn't passed expression results,
> 	its passed expression terms.  Fix this so match-all works like it
> 	should, by executing the contained expression.
> 	(message_body_contains): Copied directly from
> 	camel-folder-search.c, a more robust/faster/simpler body search
> 	code.
> 	(mime_part_matches): Removed entirely.
> 	(handle_multipart): Removed entirely.
> 	(build_match_regex): Copied from camel-folder-search.  Builds a
> 	set of simple strings into a regex pattern that matches any of
> 	them (for faster & simpler matching).  Expanded to accept regex
> 	patterns itself, so it can merge them together.
> 	(body_contains): Use build match/match message to match using a
> 	built regex.
> 	(body_regex): Likewise, this time we tell it we're building a
> 	regex though.
> 	(header_full_regex): Use build_match_regex to take the drudgery
> 	out of it, and expand it to handle multiple regex's at once.
> 	(get_full_header): slightly cleaner (well i dunno, the sprintf
> 	stuff just got to me).
> 	(header_regex): Cleaned up to use build_match_Regex too, and to
> 	properly check types.
> 	(filter_message_search): Just allocate 'fms' on the stack.
>
> 	* camel-filter-driver.c (camel_filter_driver_finalise):
> 	(camel_filter_driver_init):
> 	(camel_filter_driver_class_init):
> 	(camel_filter_driver_get_type): Changed from gtk object to camel
> 	object.
> 	(camel_filter_driver_add_rule): New function to add a rule to be
> 	processed in sexp form.
> 	(camel_filter_driver_init): Init the rules list.
> 	(camel_filter_driver_finalise): Clear the rules/rules list.
> 	(camel_filter_driver_filter_message): Scan rules list directly
> 	rather than creating on the fly.
>
> 	* Makefile.am (libcamelinclude_HEADERS): Added camel-filter-driver.h
> 	(libcamel_la_SOURCES): Added camel-filter-driver.c, code taken
> 	from filter-driver, which can drive, uh, filters based on sexp's.
> 	(libcamelinclude_HEADERS):
> 	(libcamel_la_SOURCES): Added camel-filter-search.[ch]

svn path=/trunk/; revision=7560
2001-01-17 01:07:02 +00:00
356797dc29 fix includes for compilation
2001-01-04  JP Rosevear  <jpr@helixcode.com>

	* tests/lib/Makefile.am: fix includes for compilation

	* tests/message/Makefile.am: Build test3 again

	* tests/message/test2.c: Kill warnings with header includes

	* tests/message/test3.c: ditto

	* tests/lib/streams.c: ditto

	* tests/lib/camel-test.c: ditto

	* tests/lib/messages.c: ditto

	* tests/lib/folders.c: ditto

svn path=/trunk/; revision=7253
2001-01-04 19:40:10 +00:00
6de256c2a2 Lock the command channel while searching. (imap_body_contains): If
2000-12-24  Not Zed  <NotZed@HelixCode.com>

        * providers/imap/camel-imap-search.c (imap_body_contains): Lock
        the command channel while searching.
        (imap_body_contains): If performing a whole uid search, then add
        references to our own summary items, dont look it up in the
        folder.  This way they can't vanish unexpectedly.

        * providers/imap/camel-imap-folder.h (CamelImapFolder): Added a
        private field.

        * providers/imap/camel-imap-private.h: Added lock for imap
        searches.

        * Merge from camel-mt-branch.

        * providers/imap/camel-imap-folder.c (imap_update_summary): Merge
        fix, use the folder->summary.
        (imap_get_message_flags, imap_set_message_flags,
        imap_get_message_user_flag, imap_set_message_user_flag): Removed
        again.
        (camel_imap_folder_init): Setup private data/lock.
        (imap_finalize): Free private data/search lock.
        (imap_search_free): Lock the search_lock.
        (imap_search_by_expression): Lock the search lock when using the
        search object.  Also copy/ref hte summary, rather than getting it
        directly.
        (imap_refresh_info): Free any info lookups.  Use folder->summary
        not imap_folder->summary.  And lock around commands.

svn path=/trunk/; revision=7150
2000-12-24 00:46:20 +00:00
6621536150 Add missing .h file. (From campd.)
* tests/lib/Makefile.am: Add missing .h file. (From campd.)

svn path=/trunk/; revision=6951
2000-12-12 23:10:39 +00:00
a791b442b5 Change line no format so that emacs can detect it.
2000-12-06  Not Zed  <NotZed@HelixCode.com>

        * tests/lib/camel-test.h (check): Change line no format so that
        emacs can detect it.

svn path=/trunk/; revision=6848
2000-12-07 22:28:59 +00:00
e57a50f532 Stream testing stuff.
svn path=/trunk/; revision=6792
2000-12-05 12:07:01 +00:00
a8d65409de stream_flush does make sense for a substream afterall (if you have a
2000-12-05  Not Zed  <NotZed@HelixCode.com>

        * camel-seekable-substream.c (stream_flush): stream_flush does
        make sense for a substream afterall (if you have a stream_write).
        (stream_write): Implement this.
        (stream_seek): Change the STREAM_END behaviour to be more sane.
        if bounded go from the end of the bound, if unbounded, go from the
        end of the parent stream.

        * camel-stream-mem.c (stream_read): Dont return error if reading
        past the end of data, just return 0.

        * camel-stream-fs.c (camel_stream_fs_init): Initialise the stream
        to be unbound.
        (stream_seek): Fix the logic when seeking from the end of an
        unbounded stream.
        (camel_stream_fs_new_with_fd): If the fd is invalid (-1), then
        return NULL immediately.
        (stream_seek): Range check a SEEK_END so it fits within
        bound_start.

2000-12-01  Not Zed  <NotZed@HelixCode.com>

        * tests/lib/folders.c (test_folder_basic): New test to perform
        basic store operations on folders (taken from folders/test1).
        (test_folder_message_ops): Tkane the guts out of folders/test2.

svn path=/trunk/; revision=6790
2000-12-05 11:50:32 +00:00
a2391a3e11 added some imap tests, tho they dont get far yet and dont
recover automatically.

svn path=/trunk/; revision=6772
2000-12-04 12:59:01 +00:00
1fbfdbd43e Remove assertion that content is there, when it no longer can be.
2000-11-30  Not Zed  <NotZed@HelixCode.com>

	* providers/local/camel-mbox-folder.c (mbox_get_message): Remove
	assertion that content is there, when it no longer can be.

	* camel-folder-summary.h: Removed pos/bodypos/endpos from
	camelmeessagecontentinfo.
	(CamelMessageFlags): Added an attachments flag.

	* providers/local/camel-local-summary.h: Added load virtual
	function.

	* tests/lib/folders.c (test_message_info): Accessors.
	(test_folder_message): "

	* camel-folder-thread.c (get_root_subject): Fix accessors.
	(dump_tree_rec): "

	* camel-folder-search.c (camel_folder_search_execute_expression):
	Accessors for messageinfo.
	(search_match_all): "
	(search_header_contains): "
	(search_header_contains): "
	(search_body_contains): "
	(camel_folder_search_execute_expression): Use mepool_strdup.

	* providers/local/camel-mbox-summary.c (summary_update): Accessors
	for messageinfo.
	(mbox_summary_sync_full): "

	* providers/local/camel-mh-summary.c (remove_summary): Accessors
	for messageinfo.
	(mh_summary_check): "
	(mh_summary_sync_message): "
	(mh_summary_sync): "

	* providers/local/camel-mh-folder.c (mh_append_message): Use
	accessor for uid.

	* providers/local/camel-local-summary.c
	(local_summary_decode_x_evolution): Use accessor to uid.
	(local_summary_encode_x_evolution): Likewise.
	(message_info_new): And here.
	(camel_local_summary_load): Call virtual load function.
	(local_summary_load): Default load function, load summary.
	(camel_local_summary_load): Check file exists before trying to
	load.
	(camel_local_summary_construct): Turn off building content info!
	(CAMEL_LOCAL_SUMMARY_VERSION): Bump, since we dont build content
	info anymore.
	(camel_local_summary_load): After a successful load/check, do a
	save too so we dont have to go through it again randomly.

	* providers/nntp/camel-nntp-utils.c (get_XOVER_headers): Use
	accessors for messageinfo.

	* providers/nntp/camel-nntp-folder.c (nntp_folder_get_uids): Use
	accessors for uid.

	* providers/imap/camel-imap-folder.c (imap_refresh_info): Use
	accessor for uid.
	(imap_sync): Likewise.
	(imap_get_uids): Likewise.
	(imap_update_summary): And here.

	* providers/vee/camel-vee-folder.c (vfolder_remove_match): Use
	accessor for uid.
	(vfolder_add_match): Handle estrv stuff.
	(vfolder_change_match): Accessor for uid.
	(get_real_message): "
	(vee_get_uids): "
	(vee_folder_build): " + estrv.
	(vee_folder_build_folder): "

	* providers/local/camel-maildir-folder.c (maildir_append_message):
	Use acccessors for uid's.
	(maildir_get_message): Here too.

	* providers/local/camel-maildir-summary.c
	(camel_maildir_summary_init): Setup the string count for us.
	(message_info_new): Access the string array directly.
	(message_info_free): No need to free string if using array.
	(camel_maildir_summary_info_to_name): Use accessor to get to uid.
	(remove_summary): And here.
	(maildir_summary_check): Likewise.
	(maildir_summary_sync): And here.
	(maildir_summary_load): Load up a cache of uid->filename mappings
	before loading the actual summary file.  This saves us having to
	waste the diskspace storing the filenames in the summary itself,
	and also helps us sync the summary better on load.
	(message_info_load): If we have the load_map setup, and the uid
	exists, then set the filename cache from it, and update the flags
	from the name, incase our summary mismatches it.

	* camel-folder-summary.c (camel_folder_summary_init): Setup string
	count for compressed info record.  An optional compile mode which
	stores all strings for a given messageinfo into a packed array,
	which should save 36-50 bytes/record.
	(camel_folder_summary_info_new): Init the string array.
	(message_info_new): Set the string array items, as required.
	(message_info_load): And here too.
	(message_info_save): Use accessors to get to strings.
	(message_info_free): Free strings as one.
	(camel_message_info_dup_to): Handle packed array case.
	(camel_folder_summary_add): Use accessors.  And pack the strv
	before storing it.
	(summary_assign_uid): New function to assign a unique uid to a
	message, if it doesn't have one.
	(camel_folder_summary_add): Call assign_uid instead of doing it
	ourselves.
	(camel_folder_summary_info_new_from_parser): "
	(camel_folder_summary_info_new_from_message): "
	(camel_folder_summary_encode_string): constify.
	(camel_folder_summary_encode_token): "
	(summary_build_content_info_message): Fix accessors to messageinfo.
	(CAMEL_FOLDER_SUMMARY_VERSION): Bumped, for removal of
	contentinfo->pos data.
	(camel_folder_summary_info_new_from_parser): Calculate the size
	based on the parser position, not the removed contentinfo stuff.
	(camel_folder_summary_info_new_from_message): Remove size stuff.
	(camel_folder_summary_offset_content): Removed, no longer means anything.
	(content_info_new):
	(content_info_load):
	(content_info_save):
	(summary_build_content_info): Remove stuff for contentinfo->pos*.
	(summary_build_content_info): Take a msginfo argument, set
	attachments flag if we find any attachments.
	(summary_build_content_info_message): set attachments flag if we
	find any attachments.
	(camel_folder_summary_info_new_from_parser): Always scan the
	content info, even if we dont save it.
	(camel_folder_summary_info_new_from_message): And here too.
	(summary_build_content_info): Only create the contentinfo stuff if
	we have it turned on, otherwise just parse and discard.
	(summary_build_content_info_message): Likewise.

svn path=/trunk/; revision=6731
2000-11-30 11:05:36 +00:00
571a286c62 Builddir != srcdir loving.
svn path=/trunk/; revision=6712
2000-11-29 12:33:21 +00:00
d38a417de3 Add a missed unref.
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
2000-11-29 10:49:05 +00:00
0a68cff31e Shush
svn path=/trunk/; revision=6709
2000-11-29 03:54:10 +00:00
3998a03ae9 Set the info size's properly, oops!
2000-11-28  Not Zed  <NotZed@HelixCode.com>

	* providers/local/camel-maildir-summary.c
	(camel_maildir_summary_init): Set the info size's properly, oops!

	* tests/lib/folders.[ch]: Folder testing helpers.

	* tests/folder/test2.c: Test basic message ops on folders.

	* tests/folder/test1.c (main): Test basic folder ops on (local)
	stores.

	* providers/local/camel-local-provider.c
	(camel_provider_module_init): Removed some debug.

	* providers/local/camel-maildir-folder.c
	(camel_maildir_folder_class_init): fix parent class.

	* providers/local/camel-mh-folder.c (camel_mh_folder_class_init):
	Fix parent class (damn cut & paste).

	* providers/local/camel-maildir-store.c (get_folder): Call parent
	impl.
	(camel_maildir_store_class_init): Fix parent class setup.
	(delete_folder): Check the folder exists before trying to delete
	it.
	(delete_folder): Try and make the delete operation atomic/rollback
	failures.  e.g. if one directory isn't empty, then create the
	other empty ones back.  Also clear the tmp directory fully first.

	* providers/local/camel-mbox-store.c (get_folder): Call parent
	impl.
	(camel_mbox_store_class_init): parent class is camel_local_store,
	not camel_folder, oops.
	(delete_folder): Return an error if it doesn't exist, rather than
	covering it up.

	* providers/local/camel-mh-store.c (get_folder): Call parent impl.
	(camel_mh_store_class_init): fix parent class setup.
	(delete_folder): Error if it doesn't exist now.

	* camel-folder.c (camel_folder_move_message_to):
	(camel_folder_copy_message_to): Added warnings as these functions
	are going to be removed later.

	* camel-store.c (camel_store_get_root_folder): Fix for an early
	api change.  We want CAMEL_STORE_FOLDER_CREATE, not TRUE, since
	its a flag.
	(camel_store_get_default_folder): And here too.

	* providers/local/camel-local-store.c (xrename): Handle renaming
	folders differently to renaming files.
	(get_default_folder_name): local stores dont have a default
	folder, so make it so.  Or at least, it doesn't seem to make sense
	to have one.
	(get_root_folder_name): Same for root.
	(get_folder): Added parent implementation, that makes sure the
	service path exists, if we are creating a new folder (but doesn't
	create the folder).

2000-11-27  Not Zed  <NotZed@HelixCode.com>

	* providers/local/camel-local-store.c (xrename): Fixed races.  Use
	link/unlink, rather than rename, to properly detect overwriting
	another file.  And allow some files to be missing.

	* providers/Makefile.am: Removed mh, mbox, added local, to the default.

svn path=/trunk/; revision=6693
2000-11-28 13:13:23 +00:00
05aaadc66b little util to scan mailboxes for any and every address they contain.
* tests/data/getaddr.pl: little util to scan mailboxes for any and
	every address they contain.

	* tests/message/test2.c (main): Added a bunch of stuff to test
	decoding/reencoding/etc of internationalised addresses.

	* tests/message/lib/address-data.h: Copy of some unicode/other
	testing data.  **Beware** of editing this file in emacs, it'll
	probably try and convert all the characters to something
	unusable.

	* tests/lib/camel-test.c (camel_test_break): Add a debugger hook
	point.

	* camel-mime-utils.c (quoted_encode): Check for space and convert
	to _ separately.
	(header_decode_mailbox): Fixed the 'check comments for realname'
	code, problem was the domain getting code was skipping all
	whitespace/comments before we could get a look-in.  This is
	approximate but fairly robust.
	(header_decode_text): Dont use the c-type isspace func here, we
	want a specific whitespace only.
	(header_decode_text): If we have decoded words next to each other,
	do not insert whitespaces between them, which is what rfc2047 requires.
	(header_decode_text): Make c unsigned too.

svn path=/trunk/; revision=6658
2000-11-24 07:06:45 +00:00
189cb50426 Added at least some explanation of all this stuff.
2000-11-24  Not Zed  <NotZed@HelixCode.com>

	* tests/README: Added at least some explanation of all this stuff.

	* tests/lib/camel-test.h (check_msg): Added a non-gcc version of
	the fail command, we dont get the expression that failed, but no
	matter.  Should be (more) portable now.
	(check, check_msg): Put the file/lineno in the default message.

svn path=/trunk/; revision=6657
2000-11-24 03:54:55 +00:00
99e80d6ecf Add tests.
2000-11-24  Not Zed  <NotZed@HelixCode.com>

	* Makefile.am (SUBDIRS): Add tests.

	* camel-mime-filter-basic.c (filter): Well, I'll add the extra
	bytes here too, lathough not strictly needed, might save a
	re-malloc when we get to complete().

	* camel-mime-filter-charset.c (filter): Make sure we have room if
	we only convert very short data.
	(complete): and here too.

	* tests/Makefile.am: Initial test harness & tests.  Requires gcc
	for this.

	* camel-internet-address.c (d): Turn off debug.

	* camel-charset-map.c (camel_charset_step): Oops, & masks for set
	intersection, not | them.  Dunno how this got even close to
	working.

2000-11-23  Not Zed  <NotZed@HelixCode.com>

	* camel-mime-filter-basic.c (filter): For base64 encoding, the
	output size for 0, 1, or 2 bytes of input can exceed input*2, so
	make sure we account for that as well.
	(complete): And here.
	(complete): Similarly for qp encoding, if we have a trailing
	space, we need some extra bytes (not needed for 'filter()', as any
	such bytes are stored in state/save).

	* camel-mime-utils.c (quoted_decode_step): Removed fixme not required.
	(quoted_encode_close): Dont append a trailing afterall.  Otherwise
	a pass through the encode/decode will grow the message each time.

svn path=/trunk/; revision=6656
2000-11-24 03:18:20 +00:00