Commit Graph

95 Commits

Author SHA1 Message Date
6abd6e01b3 Added "offline_sync" option, which lets you synchronise all mail to local
2003-09-22  Not Zed  <NotZed@Ximian.com>

        * providers/imap/camel-imap-provider.c: Added "offline_sync"
        option, which lets you synchronise all mail to local storage
        automagically.

        * camel-disco-folder.c (cdf_folder_changed): hook onto the folder
        changed single, for all new messages, check that they are online
        using another thread, if the offline_sync option has been enabled
        for this store.

2003-09-21  Not Zed  <NotZed@Ximian.com>

        * camel-session.c (session_thread_destroy): call proper entry
        point for freeing the message.

2003-09-18  Not Zed  <NotZed@Ximian.com>

        * camel-folder.c (filter_filter): register the filtering process
        for progress, and do progress of the filtering process.

2003-09-17  Not Zed  <NotZed@Ximian.com>

        * camel.c (camel_init): init camel operation.

        * camel-operation.c (camel_operation_reset): removed, not used,
        not worth it.
        (camel_operation_mute): new method to stop all status updates
        permanently.
        (*): Changed to use thread specific data and a list rather than a
        hashtable.
        (cancel_thread): removed.
        (camel_operation_register): return the previously registered op.

svn path=/trunk/; revision=22648
2003-09-22 18:48:34 +00:00
2bd47d3cda Get rid of the #ifdef ENABLE_THREADS since we no longer plan to
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.

svn path=/trunk/; revision=21777
2003-07-09 19:05:13 +00:00
300101f470 Use camel_mkdir().
2003-07-07  Jeffrey Stedfast  <fejj@ximian.com>

	* providers/nntp/camel-nntp-folder.c (camel_nntp_folder_new): Use
	camel_mkdir().

	* providers/imap/camel-imap-folder.c (camel_imap_folder_new): Use
	camel_mkdir().

	* camel-session.c (get_storage_path): Use camel_mkdir().

	* camel-store.c (camel_mkdir_hier): Removed.

	* camel-data-cache.c (camel_data_cache_new): Updated to use
	camel_mkdir().
	(data_cache_path): Same.

	* camel-file-utils.c (camel_mkdir): Renamed and documented.
	(camel_file_util_safe_filename): Documented.
	(camel_read): Moved here from camel-io.c
	(camel_write): Same.

	* camel-io.[c,h]: Removed.

	* camel-uid-cache.c (camel_uid_cache_new): Use the
	camel-file-utils.c version of mkdir.

svn path=/trunk/; revision=21753
2003-07-07 20:58:24 +00:00
8bbe0f34af Updated for string-utils namespace changes.
2003-07-07  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-session.c (camel_session_init): Updated for string-utils
	namespace changes.

	* camel-provider.c: Updated for string-utils namespace changes.

	* camel-mime-part.c (init_header_name_table): Updated for
	string-utils namespace changes.

	* camel-mime-message.c (camel_mime_message_class_init): Updated
	for string-utils namespace changes.
	(camel_mime_message_init): Same.

	* camel-mime-filter-enriched.c
	(camel_mime_filter_enriched_class_init): Updated for string-utils
	namespace changes.

	* camel-folder-summary.c (camel_folder_summary_init): Updated for
	string-utils namespace changes.

	* camel-string-utils.[c,h]: Renamed from string-utils.[c,h] and
	also namespaced all functions.

svn path=/trunk/; revision=21751
2003-07-07 19:18:57 +00:00
c8de5a0059 Ensure cmdbuf is initialized to avoid compiler warning.
2003-05-16  Jeremy Katz  <katzj@redhat.com>

 	* providers/smtp/camel-smtp-transport.c (smtp_helo): Ensure cmdbuf
 	is initialized to avoid compiler warning.

 	* providers/local/camel-mbox-summary.c (summary_header_load): Cast
 	folder_size to uint32 to fix warning.
 	(camel_mbox_summary_sync_mbox): Update for new API.

 	* providers/imap/camel-imap-utils.c (parse_params):
 	imap_parse_nstring expects size_t, not int
 	(imap_body_decode): Likewise.

 	* camel-stream-filter.c (do_read): presize needs to be size_t
 	instead of int.
 	(do_write): Likewise.

 	* camel-seekable-substream.c (stream_read): Return ssize_t instead
 	of int to match prototypes.
 	(stream_write): Likewise.

 	* camel-mime-part.c (construct_from_parser): len needs to be
 	size_t instead of int.

 	* camel-mime-parser.c (folder_scan_step): datalength needs to be a
 	size_t* instead of an int* to make dependent APIs safe.
 	(camel_mime_parser_step): Likewise.
 	(folder_scan_content): Likewise.
 	* camel-mime-parser.h: Likewise.

 	* camel-mime-message.c (camel_mime_message_class_init): Use glib
 	macro for pointer/int conversions.
 	(construct_from_parser): Update for new API.

 	* camel-folder-summary.c
 	(camel_folder_summary_info_new_from_parser): Update len to be
 	size_t for new API.
 	(summary_build_content_info): Likewise.
 	* camel-http-stream.c (http_get_headers): Likewise.
 	* camel-mime-part-utils.c
 	(simple_data_wrapper_construct_from_parser): Likewise.
 	* camel-multipart-signed.c (signed_construct_from_parser): Likewise.
 	* camel-multipart.c (construct_from_parser): Likewise.

 	* camel-folder-search.c (match_words_index): Use glib macros for
 	pointer/int conversions.
 	* camel-html-parser.c (tokenise_setup): Likewise.
 	(convert_entity): Likewise.
 	* camel-block-file.c (block_hash_func): Likewise.
 	(camel_block_file_get_block): Likewise.
 	(camel_block_file_get_block): Likewise.
 	(camel_block_file_detach_block): Likewise.
 	* camel-session.c (session_thread_msg_new): Likewise.
 	(session_thread_msg_free): Likewise.
 	(session_thread_wait): Likewise.
 	* camel-text-index.c (text_index_compress_nosync): Likewise.
 	(text_index_compress_nosync): Likewise.
 	(camel_text_index_validate): Likewise.
 	* camel-vee-folder.c (vee_folder_remove_folder): Likewise.
 	(unmatched_check_uid): Likewise.
 	(folder_added_uid): Likewise.
 	(vee_folder_build_folder): Likewise.
 	(folder_changed_add_uid): Likewise.
 	(folder_changed_remove_uid): Likewise.
 	* providers/imap/camel-imap-search.c (imap_body_contains): Likewise.
 	* providers/pop3/camel-pop3-folder.c (cmd_list): Likewise.
 	(cmd_uidl): Likewise.

 	* camel-data-cache.c (data_cache_init): Cast to CamelCopyFunc.
 	Fixes a warning.

svn path=/trunk/; revision=21220
2003-05-16 18:47:59 +00:00
2f37afc6f8 oops, the service owns the url after we construct it.
2003-04-23  Not Zed  <NotZed@Ximian.com>

        * camel-session.c (get_service): oops, the service owns the url
        after we construct it.

svn path=/trunk/; revision=20931
2003-04-23 04:44:58 +00:00
41e808deca ** Should fix #41629, #41448, et al.
2003-04-22  Not Zed  <NotZed@Ximian.com>

        ** Should fix #41629, #41448, et al.

        * tests/folder/test10.c: a new torture test for object bag
        creation/unreffing.

        * camel-url.c (camel_url_copy): new function to copy a url.

        * camel-object.c (camel_object_bag_new): add arguments for key
        copy and key free functions.  Fixed all callers.
        (camel_object_bag_destroy): fix a memleak, free the bag key.
        (camel_object_bag_get, camel_object_bag_reserve)
        (camel_object_bag_abort, save_bag, save_object): Make the key a
        void type, rather than char *.
        (camel_object_bag_add): As above, and also copy the key.
        (camel_object_bag_remove_unlocked): free the key using
        bag->free_key.

        * camel-session.c (register_provider)
        (camel_session_destroy_provider, get_service): Changed to use an
        object bag instead of a hash table for the service 'cache'.
        (service_cache_remove): Removed, no longer required.

svn path=/trunk/; revision=20930
2003-04-23 01:34:03 +00:00
9720adbb52 Fixes for bug #39170
2003-03-06  Jeffrey Stedfast  <fejj@ximian.com>

	Fixes for bug #39170

	* camel-store-summary.c (camel_store_info_set_string): Remove
	return keyword.

	* camel-session.c (camel_session_thread_msg_free): Remove return
	keyword.
	(camel_session_thread_wait): Same.

	* camel-index.c (camel_index_cursor_reset): Remove return keyword.

svn path=/trunk/; revision=20188
2003-03-06 14:47:05 +00:00
6545e80191 Same as the gpg and pkcs7 contexts.
2003-02-14  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-smime-context.c (smime_get_password): Same as the gpg and
	pkcs7 contexts.

	* camel-sasl-popb4smtp.c (popb4smtp_challenge): Updated for
	camel_session_get_password().

	* camel-pkcs7-context.c (get_password): Same as the gpg code.

	* camel-gpg-context.c (gpg_ctx_parse_status): Updated for
	camel_session_get_password().

	* providers/smtp/camel-smtp-transport.c (smtp_connect): No need to
	set USER_CANCEL exception here as it is done by
	camel_session_get_password(). Also updated for the new
	get_password() API change.

	* providers/imap/camel-imap-store.c (imap_auth_loop): Updated for
	camel_session_get_password() changes. We don't need to play the
	"bad passwd" game here too, do we? Bah, probably should but I
	don't feel like it for now. Maybe when we rewrite the IMAP
	provider.

	* camel-session.c (camel_session_get_password): Now takes a
	'reprompt' argument that will force user-input to be given even if
	we have the passwd cached.

	* providers/pop3/camel-pop3-store.c (pop3_connect): Instead of
	uncaching the passwd after we receive a -ERR from the POP server,
	set 'reprompt' to TRUE to force user-input for the next password
	prompt (ie, make sure the front-end knows not to just return the
	cached value). The front-end can then decide to fill-in the
	user-input field with the last passwd that the user supplied.
	(pop3_try_authenticate): Now takes a reprompt argument which we
	pass into camel_session_get_password().

svn path=/trunk/; revision=19912
2003-02-14 20:11:53 +00:00
d980a70afc add a "translation_domain" field. (NULL for all providers in the camel
* camel-provider.h (CamelProvider): add a "translation_domain"
	field. (NULL for all providers in the camel source tree itself).

	* camel-session.c (register_provider): Translate provider strings
	in the correct domain

svn path=/trunk/; revision=19265
2003-01-07 21:03:56 +00:00
29748a7520 Removed hash-table-utils.[c,h] from the build.
2002-10-31  Jeffrey Stedfast  <fejj@ximian.com>

	* Makefile.am: Removed hash-table-utils.[c,h] from the build.

	* hash-table-utils.[c,h]: Removed.

	* string-util.c: Imported g_strcase[hash,equal] into here so we
	can remove hash-table-utils.[c,h].

	* camel-medium.c: Removed #include "hash-table-utils.h"

	* camel-mime-message.c: Same here.

	* camel-mime-part.c: And here.

	* camel-session.c: Here too.

	* providers/imap/camel-imap-store-summary.c: #include
	string-utils.h instead of hash-table-utils.h

	* camel-charset-map.c: Same.

	* camel-folder-summary.c: Here too.

	* camel-provider.c: Again here.

	* camel-store-summary.c: And again...

svn path=/trunk/; revision=18473
2002-10-31 21:57:29 +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
ccc74517d3 up the timeout to 10 minutes
svn path=/trunk/; revision=17823
2002-08-20 22:07:59 +00:00
164f4653dd Override the default noop implementation.
2002-08-20  Jeffrey Stedfast  <fejj@ximian.com>

	* providers/imap/camel-imap-store.c (imap_noop): Override the
	default noop implementation.

	* camel-store.c (camel_store_noop): New virtual method to ping a
	store.

	* camel-session.c (get_service): Register a timeout that calls
	camel_store_noop() every 10 minutes.

svn path=/trunk/; revision=17822
2002-08-20 21:44:29 +00:00
51921b3993 Set CAMEL_URL_NEED_PATH for the vFolder provider.
2002-08-20  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-session.c: Set CAMEL_URL_NEED_PATH for the vFolder
	provider.

svn path=/trunk/; revision=17817
2002-08-20 17:44:28 +00:00
e851cec11e If the passed-in URL contains a path, but the service doesn't allow paths,
* camel-session.c (get_service): If the passed-in URL contains a
	path, but the service doesn't allow paths, then the path part must
	be a folder name, and we should ignore it here. #29010

svn path=/trunk/; revision=17797
2002-08-19 13:28:10 +00:00
df281e2719 make service_cache be an array of CAMEL_NUM_PROVIDER_TYPES elements so you
* camel-provider.h (CamelProvider): make service_cache be an array
	of CAMEL_NUM_PROVIDER_TYPES elements so you can have a single
	provider offer both stores and transports. (Eg, Exchange, NNTP)

	* providers/imap/camel-imap-provider.c: Don't initialize
	service_cache here. (The session code can do it itself since the
	url_hash and url_equal functions are stored as part of the
	provider.)

	* providers/nntp/camel-nntp-provider.c: Likewise.

	* providers/local/camel-local-provider.c: Likewise.

	* providers/pop3/camel-pop3-provider.c: Likewise.

	* providers/sendmail/camel-sendmail-provider.c: Likewise.

	* providers/smtp/camel-smtp-provider.c: Likewise.

	* camel-session.c (register_provider): Initialize the provider's
	service cache(s) here.
	(camel_session_class_init): Don't initialize.
	vee_provider.service_cache here.
	(camel_session_destroy_provider): Update to destroy multiple
	service_caches.
	(service_cache_remove, get_service): Tweak these a bit to deal
	with multiple service_caches.

svn path=/trunk/; revision=16330
2002-04-03 18:18:31 +00:00
e19514f131 Now takes a url argument.
2002-03-12  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-digest-store.c (camel_digest_store_new): Now takes a url
	argument.

	* camel-digest-folder.c (digest_add_multipart): Fixed some memory
	corruption and also modified to use CAMEL_IS_MIME_MESSAGE() rather
	than comparing content-type strings.
	(digest_get_message): Fixed a logic blooper.

	* camel-folder-summary.c (camel_message_info_new_from_header): Set
	the date fields of the CamelMessageInfo as well. This may even fix
	some filter-related bugs where the user was trying to compare
	dates.

svn path=/trunk/; revision=16126
2002-03-12 20:36:08 +00:00
b894c24f03 Changed name from "NT Login" to simply "Login".
2002-01-30  Not Zed  <NotZed@Ximian.com>

        * camel-sasl-login.c: Changed name from "NT Login" to simply
        "Login".

        * providers/pop3/*: Entirely new pop implmentation, supporting
        pipelining.

2002-01-29  Not Zed  <NotZed@Ximian.com>

        * camel-data-cache.c (free_busy): We dont want to unref the
        stream, instead, stop listening to the finalised events, and free
        the path only.

2002-01-25  Not Zed  <NotZed@Ximian.com>

        * camel-data-cache.c (stream_finalised): Remove the object from
        the busy_stream hashtable, not the busy_path hashtable.

svn path=/trunk/; revision=15521
2002-01-30 05:14:48 +00:00
08fb7329cb Fixing the license text.
svn path=/trunk/; revision=14212
2001-10-27 16:59:46 +00:00
02dcd0aadf Update the licensing information to require version 2 of the GPL
(instead of version 2 or any later version).

svn path=/trunk/; revision=14190
2001-10-27 00:25:49 +00:00
9
46b2a9d359 When registering provider, translate all strings.
2001-10-19    <NotZed@Ximian.com>

        * camel-session.c (register_provider): When registering provider,
        translate all strings.

svn path=/trunk/; revision=13809
2001-10-19 22:25:54 +00:00
a9decdd879 Fix up the provider flags to specify things more completely so we don't
* camel-provider.h: Fix up the provider flags to specify things
	more completely so we don't have to hardcode provider names in the
	mailer.

	* providers/local/camel-local-provider.c: MH, mbox, and Maildir
	are LOCAL. MH and mbox are no longer STORAGE by the new
	definition.

	* camel-session.c (vee_provider): The vfolder store is a STORAGE.

svn path=/trunk/; revision=13276
2001-10-01 19:43:14 +00:00
61e47e195e Init the nntp url hash and url_equal functions.
2001-09-28  Jeffrey Stedfast  <fejj@ximian.com>

	* providers/nntp/camel-nntp-provider.c
	(camel_provider_module_init): Init the nntp url hash and url_equal
	functions.

	* providers/sendmail/camel-sendmail-provider.c
	(camel_provider_module_init): Init the sendmail url hash and
	url_equal functions.

	* providers/smtp/camel-smtp-provider.c
	(camel_provider_module_init): Init the smtp url hash and url_equal
	functions.

	* providers/pop3/camel-pop3-provider.c
	(camel_provider_module_init): Init the pop3 url hash and url_equal
	functions.

	* providers/imap/camel-imap-provider.c
	(camel_provider_module_init): Init the imap url hash and url_equal
	functions.

	* providers/local/camel-local-provider.c
	(camel_provider_module_init): Init the local url hash and
	url_equal functions.

	* camel-session.c (camel_session_class_init): Init the vfolder url
	hash and url_equal functions.

	* camel-provider.h: Added url_hash and url_equal function pointers
	to the structure.

	* camel-vtrash-folder.c (vtrash_move_messages_to): Oops, a
	CamelFolder is not a CamelFolderClass.

svn path=/trunk/; revision=13237
2001-09-28 22:38:08 +00:00
5120d7098b Change "gboolean connected" to "CamelServiceConnectionStatus status",
* camel-service.c: Change "gboolean connected" to
	"CamelServiceConnectionStatus status", which can be disconnected,
	connecting, connected, or disconnecting.
	(camel_service_init, camel_service_finalize): create/destroy the
	connect_op_lock. Refer to service->status rather than
	service->connected.
	(camel_service_connect): When connecting, note the current
	operation (and create a new one if there's none registered) and
	mark the connection "connecting" until we succeed or fail.
	(camel_service_disconnect): Likewise in reverse.
	(camel_service_cancel_connect): New function to cancel a
	connection attempt.
	(cancel_connect): Default implementation: Call
	camel_operation_cancel on the connect_op.

	* camel-disco-store.c (disco_connect): Only call
	CamelRemoteStore's connect func if we're online.
	(disco_cancel_connect): Fall back to offline if a connection gets
	cancelled.
	(disco_get_folder_info): Kludge: call connect explicitly before
	deciding whether to do the online or offline version, so if the
	connect fails, we fall back correctly.

	* camel-session.c (camel_session_get_service_connected):
	s/svc->connected/svc->status/

	* camel-remote-store.c (camel_remote_store_finalise):
	Change service->connected check to service->status check.
	(remote_connect): Don't set service->connected here:
	camel_service_connect() itself does that.

	* camel-operation.c (camel_operation_registered): Deal with the
	possibility that there's no registered op.

svn path=/trunk/; revision=13191
2001-09-27 14:39:39 +00:00
9
bef39dc4e0 General cleanup of camel debug printfs.
2001-09-19    <NotZed@Ximian.com>

        * General cleanup of camel debug printfs.

        * camel-lock.c (camel_lock_fcntl): Changed to return 'success' if
        the error indicates file locking isn't supported on this
        filesystem.  Still return a warning just incase (if its the first
        time).  Might fix a lot of reported bugs.

        * providers/local/camel-spool-store.c (get_folder_info): Dont
        include the empty // host part in the uri.  This 'breaks' the
        service lookup.

svn path=/trunk/; revision=12973
2001-09-19 08:28:36 +00:00
8
8347ce1403 If filter inbox is set on the store, and we're opening inbox '', then
2001-09-18    <NotZed@Ximian.com>

	* providers/local/camel-maildir-folder.c
	(camel_maildir_folder_new): If filter inbox is set on the store,
	and we're opening inbox '', then enable filtering on new messages.

	* providers/local/camel-local-folder.c
	(camel_local_folder_construct): After loading the summary, check
	it, and only abort if that fails.  Also maintain the changes
	count.

	* providers/local/camel-local-summary.c
	(camel_local_summary_load): Remove summary_check code from here.
	(camel_local_summary_check): Sync index/summary here, if we were
	successful.

	* providers/local/camel-spool-folder.c
	(camel_spool_folder_new): If we have filter-new-messages-on-inbox
	set and we just opened inbox, turn on filtering on this folder.
	(camel_spool_folder_construct): Keep track of changes for the
	folder, so that filter-new-messages works right (?)

	* providers/local/camel-spool-store.c (get_folder): Pass 'INBOX'
	as the folder name, not the path.

	* camel-folder-search.c (search_not): Modified patch from
	<peterw@ximian.com> since the summary is messageinfo's, not
	strings.

	** Ok so the problem with the stuff below is that maildir/spool
	'summary_load' throws away all events, including recents, joy eh?

	* providers/local/camel-maildir-summary.c (maildir_summary_check):
	Add new messages to the recent changeinfo.

	* providers/local/camel-spool-summary.c: Mark 'new' message as
	recent, for later processing if required (i.e. 'filter new
	messages').

	* camel-store.c (construct): new function, cascade up construct
	method and check for 'filter' param, and set accordingly for any
	one that might want it.

	* providers/imap/camel-imap-store.c (construct): map the
	param_filter_inbox flag to the store->flags as
	CAMEL_STORE_FILTER_INBOX.

	* camel-store.h (CAMEL_STORE_FILTER_INBOX): new flag to tell it to
	filter inbox.

	* providers/imap/camel-imap-folder.h: Removed do_filtering flag
	from CamelImapFolder.

	* providers/imap/camel-imap-folder.c (imap_update_summary): Remove
	the 'recents' parameter, use the 'changes' parameter instead to
	convey this info.
	(camel_imap_folder_changed): Changed for update_summary api
	change.  Now always just emit the changed event if we have any
	changes to report, filtering code removed, handled upstream.
	(filter_proc):
	(filter_free): Removed old filtering code.
	(camel_imap_folder_new): Set the filter_recent flag on the folder
	if we're the inbox and filtering of inbox is enabled.

	* camel-folder.c (folder_changed): If we have 'recent' messages,
	and are set to filter recents, then freeze the folder and launch a
	thread to do the processing (or similar if threading not enabled).
	(thaw): Make sure we emit the changed signal outside of owning the
	lock and if things have changed.  Also, no longer bother
	downgrading folder_changed events to message_changed events.

	* camel-folder.h (struct _CamelFolder): Added filter_recent flag
	-> signifies all recent messages in folder should be filtered.

	* camel-session.c: (camel_session_thread_msg_new,
	camel_session_thread_msg_free, camel_session_thread_queue,
	camel_session_thread_wait): code to handle async operations as
	part of camel processing.
	(camel_session_finalise): free thread_lock, destroy thread, active
	hash, etc.
	(camel_session_init): init thread, active hash, etc.
	(camel_session_class_init): Init virtual functions.
	(session_thread_msg_new, session_thread_msg_free,
	session_thread_destroy, session_thread_received,
	session_thread_queue, session_thread_wait): default implementation
	of session threads stuff.

2001-09-17    <NotZed@Ximian.com>

	* camel-folder.c (camel_folder_change_info_recent_uid): New
	function to add a 'recent' uid to the change info.
	(camel_folder_change_info_clear): Clear recent list.
	(camel_folder_change_info_free): Free recent list.
	(camel_folder_change_info_new): Setup recent list.

	* camel-folder.h: Added a uid_recent item to the folder_changed
	event data.

	* providers/local/camel-maildir-store.c (scan_dir): Free new in
	the right block.

	* providers/local/camel-local-provider.c: Add local config entries
	to filter on new messages in spool and maildir provider.

	* camel-vee-folder.c (vee_folder_construct): Remove the assertion
	which stops ? in names from being allowed.

svn path=/trunk/; revision=12956
2001-09-18 21:43:00 +00:00
5dfe756f5f Properly determine match type to pass to header_match.
2001-08-08  Not Zed  <NotZed@Ximian.com>

        * camel-filter-search.c (check_header): Properly determine match
        type to pass to header_match.
        (address_matches_exactly): Removed, effectively added to
        camel_search_header_match.

        * camel-folder-search.c (check_header): Properly determine the
        match type to pass to header_match.

        * camel-search-private.c (camel_search_header_match): Add a new
        parameter 'type' which is the type of header we're matching
        against.  ASIS means utf8 format, ADDRESS means an internet
        address ('formatted'), ADDRESS_ENCODED means a raw address header,
        ENCODED means rfc 2047 encoded text.
        (header_match): Move original logic here, have search_header_match
        call it as appropriate for the 'type' of match.

2001-08-07  Not Zed  <NotZed@Ximian.com>

        * camel-session.c (camel_session_class_init): Only init the vee
        provider struct once (if we're subclassed this will get called
        multiple times).

        * camel-object.c (obj_finalize): Removed a bit of a debug that
        crept in with jacob's poolv patch (?).

svn path=/trunk/; revision=11772
2001-08-08 09:37:40 +00:00
e8aa23866a Clean up some exception misusage.
2001-07-17  Peter Williams  <peterw@ximian.com>

	Clean up some exception misusage.

	* providers/imap/camel-imap-command.c (camel_imap_command): Use
	our own internal exception for sending the string and transfer it
	to @ex if anything goes wrong.
	(imap_read_response): Use our own internal exception for reading
	the untagged responses and blah blah blah.

	* camel-session.c (get_service): Use our own internal exception
	when constructing the service and transfer it to @ex if anything
	goes wrong.

	* camel-remote-store.c (remote_recv_line): Instead of having
	gboolean exception, use our own internal exception and copy
	it to @ex if anything goes wrong.

	* camel-store.c (store_sync): Create an internal exception
	because sync_folder() checks it for validity. Transfer it to
	@ex when done.

	* camel-exception.c (camel_exception_get_description): If @ex is
	NULL, complain - passing NULL exceptions to Camel is okay, but
	there should be no circumstances under which they're then
	examined.
	(camel_exception_get_id): Same here,
	(camel_exception_xfer): NULL-protect and warn if transferring from
	a NULL exception.

svn path=/trunk/; revision=11177
2001-07-17 21:22:20 +00:00
faac871501 new method to get an application-initialized filter driver.
* camel-session.c (camel_session_get_filter_driver): new method to
	get an application-initialized filter driver.

	* camel-filter-driver.c (camel_filter_driver_new): Remove the
	get_folder function and data args from here...
	(camel_filter_driver_set_folder_func): ...and add this function to
	set/change them.

	* providers/imap/camel-imap-folder.c (camel_imap_folder_new): If
	this folder is INBOX and we're filtering INBOX, set a flag on the
	folder for later.
	(imap_update_summary): Add another argument (GPtrArray *recents),
	and if it's non-NULL, add the uids of any \Recent new messages to
	it.
	(camel_imap_folder_changed): If doing filtering in this folder,
	create a recents array and pass it to imap_update_summary. Then
	get a filter driver and use it to filter the recent messages.

	* providers/imap/camel-imap-summary.h:
	* providers/imap/camel-imap-utils.c (imap_parse_flag_list): Add
	support for the \Recent flag.

	* providers/imap/camel-imap-provider.c (imap_conf_entries): enable
	the "filter" option.

	* camel-types.h: add CamelFilterDriver typedef here

svn path=/trunk/; revision=10681
2001-07-02 15:03:49 +00:00
7c76386907 The service can be NULL here too, thanks to Wayne Davis for pointing this
2001-05-16  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-session.c (camel_session_forget_password): The service can
	be NULL here too, thanks to Wayne Davis for pointing this out.

svn path=/trunk/; revision=9863
2001-05-17 00:34:02 +00:00
42f9d72254 Don't abort if the Service is NULL, this is perfectly valid for cipher
2001-05-10  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-session.c (camel_session_get_password): Don't abort if the
	Service is NULL, this is perfectly valid for cipher contexts.

svn path=/trunk/; revision=9748
2001-05-10 20:42:22 +00:00
630241d74b Set the disconnected status. (camel_disco_store_can_work_offline): Return
* camel-disco-store.c (camel_disco_set_status): Set the
	disconnected status.
	(camel_disco_store_can_work_offline): Return whether or not a
	given CamelDiscoStore can work offline or not.

	* camel-disco-folder.c (camel_disco_folder_cache_message):
	Explicitly tell a folder to cache a message. (Better than using
	get_message, because for IMAP that doesn't guarantee you'll get
	all the message parts.)
	(camel_disco_folder_prepare_for_offline): Prepare a folder for
	offline use by caching all messages meeting given search criteria
	(and doing anything else the particular folder implementation
	needs).

	* camel-session.c (camel_session_set_online,
	camel_session_is_online): A session-wide online/offline toggle.
	(camel_session_init): Set online to TRUE.

	* providers/imap/camel-imap-store.c (can_work_offline):
	Implementation of CamelDiscoStore::can_work_offline. (Checks that
	the store has been used online at least once.)
	(imap_get_folder_online, imap_get_folder_offline): Deal with
	request for "inbox" properly. ("Don't you mean... 'INBOX'?").

	* providers/imap/camel-imap-folder.c (imap_cache_message):
	Implementation of CamelDiscoFolder::cache_message.

	* camel.h: Add camel-disco-store.h and camel-disco-folder.h

svn path=/trunk/; revision=9738
2001-05-09 21:57:32 +00:00
63e96e1002 Redo this a lot so that instead of having a class full of callbacks, we
* camel-session.c: Redo this a lot so that instead of having a
	class full of callbacks, we have a subclassable class. Also,
	replace the increasingly horrifying
	camel_session_query_authenticator with three new routines,
	camel_session_get_password, camel_session_forget_password, and
	camel_session_alert_user.

	* camel-pgp-context.c:
	* camel-pkcs7-context.c:
	* camel-smime-context.c:
	* providers/imap/camel-imap-store.c:
	* providers/pop3/camel-pop3-store.c:
	* providers/smtp/camel-smtp-transport.c:
	Use camel_session_get_password / camel_session_forget_password.

	* camel-tcp-stream-ssl.c (ssl_bad_cert): Use
	camel_session_alert_user.

svn path=/trunk/; revision=9617
2001-04-27 21:08:08 +00:00
8cc3a0e4dc Remove the EXTRA_GNOME_CFLAGS include.
2001-04-16  Jeffrey Stedfast  <fejj@ximian.com>

	* Makefile.am: Remove the EXTRA_GNOME_CFLAGS include.

	* camel-store.c (camel_mkdir_hier): Convenience function that it
	seems a number of camel-store implementations used gal for.

	* providers/nntp/camel-nntp-store.c (ensure_news_dir_exists): Lets
	not depend on gal for just e_mkdir_hier() - use camel_mkdir_hier()
	instead.

	* providers/nntp/camel-imap-store.c: Lets not depend on gal for
	just e_mkdir_hier() - use camel_mkdir_hier() instead.

	* camel-session.c (camel_session_get_storage_path): Don't depend
	on e_mkdir_heir() anymore, use the CamelStore version.

	* camel-folder-search.h: Removed gal dependency, why was this even
	there in the first place?

	* providers/imap/camel-imap-folder.c: Don't need gal/util/e-util.h
	here, so remove it.

	* string-utils.c (strstrcase): New function, well more like old
	function brought back to life so we don't have to depend on gal.

	* providers/imap/camel-imap-store.c (imap_store_setup_online): Use
	strstrcase rather than e_strstrcase so we don't depend on gal.
	(get_unread_online): Same here.

	* providers/smtp/camel-smtp-transport.c (smtp_helo): Use
	strstrcase.

svn path=/trunk/; revision=9383
2001-04-16 17:09:38 +00:00
fe962a2055 Big header cleanups and nntp compile fix
svn path=/trunk/; revision=9024
2001-03-29 20:31:40 +00:00
d3ce110bb7 New. Return the provider for a URL.
* camel-session.c (camel_session_get_provider): New. Return
	the provider for a URL.

svn path=/trunk/; revision=8941
2001-03-26 14:01:33 +00:00
a0b95ac74d eh, changed my mind, put the exception back in camel_url_new()
svn path=/trunk/; revision=8934
2001-03-25 23:04:14 +00:00
182c699c39 New URL parser with full RFC1808 relative URL support. Yum.
* camel-url.c (camel_url_new_with_base): New URL parser with full
	RFC1808 relative URL support. Yum.
	(camel_url_new): Wrapper around camel_url_new_with_base now.
	Removed the CamelException since no one ever used it...

	* tests/Makefile.am: add misc subdir

	* tests/misc/url.c: relative URL test cases from RFC 1808

	* camel-session.c (camel_session_get_service): Update
	camel_url_new call.

svn path=/trunk/; revision=8933
2001-03-25 22:55:27 +00:00
5d562c3d3d add a "GList *authtypes", so you can get the list of authtypes used by a
* camel-provider.h: (CamelProvider) add a "GList *authtypes", so
	you can get the list of authtypes used by a provider without
	needing to have an actual CamelService object handy. (Will be
	needed by the new config druid.)
	(CAMEL_PROVIDER_ALLOWS, CAMEL_PROVIDER_NEEDS): New macros to test
	the URL part stuff, since the way it works is too complicated and
	everyone always does it wrong.

	* camel-service.c (camel_service_query_auth_types): Remove the
	@connected arg again: if you don't want to connect, you can just
	get the list of authtypes off the provider.
	(camel_service_free_auth_types): Remove this. All existing
	implementations do authtypes the same way, so just say the caller
	should "g_list_free" the list. (Oh, look, removing this function
	doesn't actually cause the mailer to not build. How 'bout that.)
	(construct, get_path): Use the new URL part macros.

	* camel-remote-store.c (remote_query_auth_types): Update
	(remote_free_auth_types): Nuke
	(camel_remote_store_authtype_list): New function for use by
	subclasses.

	* providers/imap/camel-imap-provider.c:
	* providers/pop3/camel-pop3-provider.c:
	* providers/smtp/camel-smtp-provider.c: Update CamelProvider
	structures.
	(camel_provider_module_init): Put all the SSL parts together so
	there's only 1 #ifdef. Set up the provider authtypes field using
	the SASL, CamelRemoteStore, and standard authtypes, as
	appropriate. Copy that from the normal provider to the SSL
	provider.

	* providers/local/camel-local-provider.c:
	* providers/sendmail/camel-sendmail-provider.c:
	* camel-session.c: Update CamelProvider structures.

	* providers/imap/camel-imap-store.c (query_auth_types):
	* providers/pop3/camel-pop3-store.c (query_auth_types): Update

	* providers/smtp/camel-smtp-store.c (query_auth_types): Update.
	Remove the no_authtype, because that's what "ALLOW_AUTH" rather
	than "NEED_AUTH" means.
	(free_auth_types): Nuke.

svn path=/trunk/; revision=8872
2001-03-21 22:20:29 +00:00
2da82ca262 So it turns out that NSS_Init *isn't* idempotent, so we have to protect
2001-03-14  Jeffrey Stedfast  <fejj@ximian.com>

	* camel.c (camel_init): So it turns out that NSS_Init *isn't*
	idempotent, so we have to protect against initializing it more
	than once(contrary to what their design specs suggest).

	* camel-session.c (camel_session_get_service): Use
	camel_exception_is_set() - Makes no difference but it's more
	consistant with how we normally do it.

	* camel-provider.h (CAMEL_URL_ALLOW_SSL): We don't need this.

	* providers/imap/camel-imap-provider.c: Define the imaps provider.
	(camel_provider_module_init): Register the imaps provider.

	* camel-provider.c (camel_provider_init): Only add the protocol to
	the hash table if it's non empty. Also, g_strdup() the filename
	into the hash table.

	* providers/imap/camel-imap-store.c (camel_imap_store_init): Eek!
	So the service's URL isn't set until after this is
	initialized. This means we can't check for SSL here.
	(imap_connect): Set the SSL options here instead.

svn path=/trunk/; revision=8718
2001-03-15 01:59:00 +00:00
abe164fb39 Created a new mode (CAMEL_AUTHENTICATOR_ACCEPT) which is a Yes/No prompt
2001-03-09  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-session.c (camel_session_query_authenticator): Created a
	new mode (CAMEL_AUTHENTICATOR_ACCEPT) which is a Yes/No prompt to
	the user. This will be needed by the SSL/TLS code to come. Also
	changed the return value to a gpointer rather than a char* to
	allow the returning of TRUE/FALSE values.

	* camel.c: Wrap stuff with HAVE_NSS

svn path=/trunk/; revision=8623
2001-03-10 00:15:49 +00:00
c81bce50bb Removed all files.
2001-02-22  Not Zed  <NotZed@Ximian.com>

        * providers/vee/*: Removed all files.

        * camel-private.h: Move camel-vee-private.h stuff into here.

        * camel-session.c: Move the vee_provider here, and initialise it
        always as part of a session.  The vfolder provider is always
        available.

        * providers/Makefile.am: Remove "vee" from the build list, now
        built as part of the main library.

        * Makefile.am (libcamelinclude_HEADERS):
        (libcamel_la_SOURCES): Added camel-vee-store.[ch],
        camel-vee-folder.[ch].

svn path=/trunk/; revision=8340
2001-02-21 20:30:29 +00:00
65eb577ecd Rewrite a bunch. Replace the existing folder cache stuff with much simpler
* camel-store.c: Rewrite a bunch. Replace the existing folder
	cache stuff with much simpler code that still handles all the
	existing cases. Now the folder hash table is always created by the
	base class, using hash and compare functions provided by the class
	implementation. (If they are set to NULL, CamelStore won't cache
	folders.) lookup_folder, cache_folder, and uncache_folder are no
	longer class methods, and get_name is gone completely.

	(camel_store_get_inbox): Renamed from
	camel_store_get_default_folder, since that wasn't being used, and
	this is what we actually need.
	(camel_store_get_root_folder): Removed, since it's not needed for
	anything given get_folder_info.

	* camel-remote-store.c:
	* providers/local/camel-local-store.c:
	* providers/local/camel-mbox-store.c:
	* providers/local/camel-mh-store.c:
	* providers/local/camel-maildir-store.c:
	* providers/nntp/camel-nntp-store.c:
	* providers/pop3/camel-pop3-store.c:
	* providers/vee/camel-vee-store.c: Minor updates for CamelStore
	changes

	* providers/imap/camel-imap-store.c (camel_imap_store_class_init):
	Update for CamelStore changes.
	(hash_folder_name, compare_folder_name): treat INBOX
	case-insensitively, otherwise use g_str_hash and g_str_equal.

	* camel-service.c (camel_service_construct): Remove
	camel_service_new and create camel_service_construct (as a class
	method) in its place.

	* camel-session.c (camel_session_get_service): Use
	camel_object_new and camel_service_construct to replace
	camel_service_new.

	* providers/local/camel-local-store.c (construct): Append a '/' to
	the URL path if it doesn't end with one

svn path=/trunk/; revision=8145
2001-02-09 16:43:22 +00:00
49f8a687a4 Changed to push the operation into a status stack.
2001-02-07  Not Zed  <NotZed@Ximian.com>

        * camel-operation.c (camel_operation_start): Changed to push the
        operation into a status stack.
        (camel_operation_progress): Changed to only accept % complete.
        (camel_operation_reset): Free status stack as well.

        * providers/pop3/camel-pop3-folder.c (pop3_get_message): Get the
        octect count from the return line, and pass it to
        get_additional_data().
        (pop3_refresh_info): Added status stuff.

        * providers/pop3/camel-pop3-store.c
        (camel_pop3_command_get_additional_data): Added a total bytes
        expected argument for progress reporting & fixed callers.
        (camel_pop3_command_get_additional_data): Added progress
        reporting.

        * providers/local/camel-mbox-summary.c (mbox_summary_sync_full):
        (mbox_summary_sync_quick):
        (summary_rebuild): Added progress reporting stuff.

svn path=/trunk/; revision=8095
2001-02-08 01:42:53 +00:00
ebd3b72501 Add missing header for cancel check stuff.
2001-02-02  Not Zed  <NotZed@Ximian.com>

        * camel-stream-fs.c: Add missing header for cancel check stuff.

        * camel-session.c (camel_cancel_cancel): Fix a wrong cast.

        * camel-mime-part.c (init_header_name_table): Setup a new table
        header_formatted_table, that lists headers that we dont want to
        fold (they've already been folded).
        (write_to_stream): Check for already formatted headers, and dont
        try and fold them.  This is a fix for bug #1097.

svn path=/trunk/; revision=7941
2001-02-02 02:13:13 +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
405f1c5229 Ugh, this design is ugly like my butt.
2001-01-16  Jeffrey Stedfast  <fejj@ximian.com>

	Ugh, this design is ugly like my butt.

	* camel-session.c (camel_session_query_cert_authenticator): New
	function which will be useful when we integrate SSL.

	* camel-tcp-stream-ssl.c (ssl_auth_cert): Callback to authenticate
	a certificate.
	(ssl_bad_cert): Callback that gets the reason the certificate is
	bad and then calls camel's cert-authenticator callback to notify
	the user and to allow the user to override the check.
	(stream_connect): Set the URL we expect to connect with and setup
	the auth_cert and bad_cert callbacks.
	(camel_tcp_stream_ssl_new): Now takes a CamelSession and a
	expected_host argument that it will use for certificate
	authentication.
	(camel_tcp_stream_ssl_finalize): Unref the session and free the
	expected_host.

svn path=/trunk/; revision=7531
2001-01-16 07:19:49 +00:00
e3a451cb33 Chganged len back to be unsigned. And do a simple range check on the
2001-01-16  Not Zed  <NotZed@Ximian.com>

        * camel-folder-summary.c (camel_folder_summary_decode_string):
        Chganged len back to be unsigned.  And do a simple range check on
        the string value to try and detect corrupted summary files.

        * providers/imap/camel-imap-command.c (imap_read_untagged): Handle
        cancelled stream reads with an appropriate exception.

        * providers/imap/camel-imap-private.h: Fix the include-once
        macro.  Doh, confliced with camel-private.h.

        * providers/imap/camel-imap-store.c (imap_store_refresh_folders):
        A copy of camel_remote_store_refresh_folders.  We avoid locking
        each folder when we call it though.  This should be removed when i
        can work out how to remove the folder lock from this function
        easily.

        * camel-stream-fs.c (stream_write): Fix n' argument of select.
        (stream_read): Likewise.

        * camel-remote-store.c (socket_connect): Bump the connect timeout
        upto 4 minutes.
        (socket_connect): Oops, fix the 'n' argument of select.

        * camel-session.c (camel_cancel_cancel): If we are given no
        cancellation node, then do it for all active ones.

svn path=/trunk/; revision=7526
2001-01-16 03:54:45 +00:00
b64ffc9183 A cancellable connection routine. (remote_send_string): Return cancelled
2001-01-15  Not Zed  <NotZed@Ximian.com>

        * camel-remote-store.c (socket_connect): A cancellable connection
        routine.
        (remote_send_string): Return cancelled exception if we were.
        (remote_send_stream): "
        (remote_recv_line): "

        * camel-stream-fs.c (stream_read): First cut at cancellation
        stuff.  Its looking a bit ugly.

svn path=/trunk/; revision=7496
2001-01-15 07:55:30 +00:00