Commit Graph

77 Commits

Author SHA1 Message Date
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
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
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
b29855a647 add a missing #include
svn path=/trunk/; revision=6154
2000-10-24 22:20:44 +00:00
360675f54b lots of i18n fixes
svn path=/trunk/; revision=6143
2000-10-24 05:23:27 +00:00
e81e64f8dd Simple subclass of CamelFolderSummary that also keeps a UIDVALIDITY value
* providers/imap/camel-imap-summary.c: Simple subclass of
	CamelFolderSummary that also keeps a UIDVALIDITY value (and
	doesn't, for the moment, build content info).

	* providers/imap/camel-imap-folder.c:
	(various): Use a CamelImapSummary to store/fetch summary info.
	(camel_imap_folder_new): Take a path to a file to use for the
	summary. Set the folder's permanent_flags correctly according to
	the server response. Read in the summary (checking the
	UIDVALIDITY) and update it if it's out of date.
	(imap_refresh_info): Just fetch UIDs and flags. If the UIDs all
	match, update the flags as needed and be done with it. Otherwise,
	delete messages that have been expunged from the server and fetch
	full summary info for any new messages.
	(imap_sync): Save the summary to disk.
	(imap_update_summary): Renamed from imap_get_summary_internal. Can
	now be told to get summary for only a subset of messages. Use
	camel-mime-utils functions rather than rolling our own header
	parsing.
	(imap_get_message_info_internal): Merged into imap_update_summary.
	(imap_set_message_flags): Don't marked the message FOLDER_FLAGGED
	if we're not actually changing the value of any of the flags.
	(camel_imap_folder_changed): Deal with EXISTS rather than RECENT.

	* providers/imap/camel-imap-store.c (imap_connect): Call
	camel_session_get_storage_path and save the value.
	(get_folder): Create a local directory to store summary
	information and pass a summary file name to camel_imap_folder_new.
	Don't call camel_folder_refresh_info from here any more since
	camel_imap_folder_new does it again.

	* providers/imap/camel-imap-command.c (camel_imap_command): Add a
	special case to this to make it possible to get the repsonses from
	a SELECT and still have store->current_folder be updated
	correctly.
	(imap_read_response): parse EXISTS rather than RECENT

	* camel-session.c (camel_session_get_storage_path): Use
	e_mkdir_hier.

	* camel-folder-summary.c (camel_folder_summary_remove_index): New
	function.

	* camel-mime-utils.c (header_raw_append_parse): fix this.
	(camel-mime-parser.c doesn't use this code because of the MEMPOOL
	optimization, so nothing was ever actually calling it before.)

svn path=/trunk/; revision=5891
2000-10-12 20:55:11 +00:00
38c7385713 Make this not leak.
* camel-session.c (camel_session_get_storage_path): Make this not
	leak.

svn path=/trunk/; revision=5243
2000-09-07 21:00:56 +00:00
1fb4f1bfee Make this take a path to a directory that Camel can use for its own
* camel-session.c (camel_session_new): Make this take a path to a
	directory that Camel can use for its own nefarious purposes.
	(camel_session_get_storage_path): New function to return a path
	that a service can use for its own nefarious sub-purposes.

	* camel-service.c (camel_service_get_path): New method (and
	useful default implementation) to get a (relative) pathname
	corresponding to the service.

svn path=/trunk/; revision=5239
2000-09-07 19:59:53 +00:00
2bdcfe5c47 Make CamelServices connect only when told to (old behavior). Make CamelRemoteStore do its stuff in service::connect, not ::post_connect.
svn path=/trunk/; revision=5116
2000-08-30 17:09:42 +00:00
da570c6660 CamelRemoteStore: a new generic store for stores that connect to servers. Prepare for the ability to cancel operations (much better exception handling). Clean up IMAP like nobody's business
svn path=/trunk/; revision=5103
2000-08-29 21:28:46 +00:00
8cb514d6dd Merge with camel-async.
svn path=/trunk/; revision=4687
2000-08-10 17:30:50 +00:00
9f381f8245 remove some non-error case debugging messages.
* remove some non-error case debugging messages.

svn path=/trunk/; revision=3904
2000-07-06 01:52:51 +00:00
a7f40b2f5f Updated
2000-06-22  Jeffrey Stedfast  <fejj@helixcode.com>

	* providers/sendmail/camel-sendmail-provider.c:
	* providers/vee/camel-vee-provider.c:
	* providers/smtp/camel-smtp-provider.c:
	* providers/mbox/camel-mbox-provider.c:
	* providers/pop3/camel-pop3-provider.c:
	* providers/imap/camel-imap-provider.c: Updated

	* camel-session.c: Moved service_cache hash table into the
	providers.
	(service_cache_remove): Updated.
	(camel_session_get_service): Updated.

	* camel-url.c (camel_url_hash): Took out the hashing of
	url->passwd. We don't want this anymore.

	* providers/imap/camel-imap-folder.c (imap_init): Took out
	references to 'namespace'
	(camel_imap_folder_init): Same

	* providers/imap/camel-imap-folder.h: No more namespace. We are
	instead going to use url->path as the namespace.

svn path=/trunk/; revision=3700
2000-06-22 21:51:40 +00:00
9272361bba Only fetch the summary if the folder summary doesn't already exist. When
2000-06-20  Jeffrey Stedfast  <fejj@helixcode.com>

	* providers/imap/camel-imap-folder.c (imap_get_summary): Only
	fetch the summary if the folder summary doesn't already exist.
	When the summary *does* exist, start fetching from 1, not 0.
	(imap_free_summary): Don't do anything here.
	(imap_finalize): Free the summary here instead of in
	imap_free_summary().

	* camel-url.c (check_equal): No need to check s1 if s2 is NULL
	(camel_url_equal): Don't check the passwd component of the url.

and in mail/component-factory.c (create_imap_storage): removal of
debug statements
mail/folder-browser.c (folder_browser_load_folder): improved imap
service parser

svn path=/trunk/; revision=3649
2000-06-20 21:11:07 +00:00
2aefadf282 Add another argument, "mode", which can be CAMEL_AUTHENTICATOR_ASK or
* camel-session.c (camel_session_query_authenticator): Add another
	argument, "mode", which can be CAMEL_AUTHENTICATOR_ASK or
	CAMEL_AUTHENTICATOR_TELL, so callers can get the app to un-cache
	bad info.

	* providers/pop3/camel-pop3-store.c (pop3_connect): uncache the
	password if it doesn't work.

svn path=/trunk/; revision=3496
2000-06-09 22:00:53 +00:00
fd1304e14f Don't ref the services in the cache.
2000-06-02  Christopher James Lahey  <clahey@helixcode.com>

	* camel-session.c: Don't ref the services in the cache.

svn path=/trunk/; revision=3396
2000-06-02 19:15:22 +00:00
8d6afbe910 Ref and unref objects in the service cache properly.
2000-06-02  Christopher James Lahey  <clahey@helixcode.com>

	* camel-session.c: Ref and unref objects in the service cache
	properly.

	* camel-store.c: Ref the folder when returning it using
	lookup_folder.  Used the folder's full name for the key for the
	folder cache since that's used to uncache it.

svn path=/trunk/; revision=3388
2000-06-02 16:12:26 +00:00
631dda8ae0 Init filter_from to NULL, for exception case. (mbox_get_message_by_uid):
2000-05-30  Not Zed  <NotZed@HelixCode.com>

        * providers/mbox/camel-mbox-folder.c (mbox_append_message): Init
        filter_from to NULL, for exception case.
        (mbox_get_message_by_uid): Cast off_t to long int for diagnostics.

        * camel-url.c (camel_url_hash): Hash funciton for using camel
        url's as hash keys.
        (camel_url_equal): equal function for same.

        * camel-session.c (camel_session_finalise): Free cached services.
        (camel_session_init): Init service cache.
        (service_cache_remove): destroy callback to remove a service from
        the cache.

        * camel-store.c (get_folder_internal): Remove the extra ref of the
        folder.  That seems the right behaviour ...?
        (camel_store_get_type): Doh, actually call store init, so the
        cache works.
        (cache_folder): strdup the folder name!  no wonder it never found
        it again.

svn path=/trunk/; revision=3298
2000-05-30 22:35:40 +00:00
580d885820 Make camel not leak like a sieve.
* camel-object.c: New subclass of GtkObject which is now the base
	of the Camel object hierarchy. Currently the only difference
	between CamelObject and GtkObject is that CamelObjects don't start
	out floating.

	* *.h: Move a bunch of typedefs to camel-types.h. Standardize on
	using <camel/foo.h> in header files rather than <foo.h>, "foo.h",
	or "camel/foo.h". Remove some unneeded includes.

	* camel-address.c, camel-data-wrapper.c, camel-folder-search.c,
	camel-folder-summary.c, camel-folder.c, camel-mime-filter.c,
	camel-mime-parser.c, camel-service.c, camel-session.c,
	camel-stream.c: These are now subclasses of CamelObject.

	* camel-data-wrapper.c (set_output_stream):
	* camel-medium.c (set_content_object):
	* camel-seekable-substream.c
	(init_with_seekable_stream_and_bounds):
	* providers/mbox/camel-mbox-folder.c (mbox_get_message_by_uid):
	remove gtk_object_sink calls.

	* camel-stream-buffer.c (init_vbuf):
	* camel-stream-filter.c (camel_stream_filter_new_with_stream):
	ref the original stream.

	* camel-folder-summary.c (camel_folder_summary_finalise): unref
	the filters when finalizing.

	* camel-mime-part-utils.c
	(simple_data_wrapper_construct_from_parser,
	camel_mime_part_construct_content_from_parser):
	* camel-mime-part.c (camel_mime_part_set_content): Unref objects
	that are created only to be handed off to other objects. If
	they're going to be needed later, they will have been additionally
	ref'ed by the object that needs them.

	* providers/pop3/camel-pop3-folder.c (get_message_by_number):
	unref the message stream after creating the data from it.

	* camel-stream.c, camel-stream-buffer.c, camel-stream-filter.c,
	camel-stream-fs.c, camel-stream-mem.c: Remove camel_stream_close,
	since its semantics are dubious (what happens when you close a
	stream other people still have references on?).

	* providers/nntp/camel-nntp-store.c:
	* providers/smtp/camel-smtp-transport.c:
	* providers/pop3/camel-pop3-store.c:
	replace camel_stream_close calls with gtk_object_unref.

	* providers/mbox/camel-mbox-folder.c:
	* providers/nntp/camel-nntp-folder.c:
	* providers/sendmail/camel-sendmail-transport.c:
	replace camel_stream_close with camel_stream_flush +
	gtk_object_unref

svn path=/trunk/; revision=2882
2000-05-07 21:56:32 +00:00