aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/imap
Commit message (Collapse)AuthorAgeFilesLines
* new abstract class for disconnectable remote storesDan Winship2001-05-044-502/+479
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * camel-disco-store.c: new abstract class for disconnectable remote stores * camel-disco-folder.c: new abstract class for folders on disconnectable stores. * Makefile.am: Add camel-disco-folder.[ch] and camel-disco-store.[ch]. * providers/imap/camel-imap-store.c: Make this a subclass of CamelDiscoStore, and fix up the offline interfaces for the changes since they were first written (particularly the fact that some IMAP stores don't just use subscribed folders). * providers/imap/camel-imap-folder.c: Make this a subclass of CamelDiscoFolder, although most ops still fail in disconnected mode. * camel-store.c (camel_store_get_folder_info): Change gboolean, gboolean, gboolean to guint32 in the prototype for this function. * providers/local/camel-local-store.c (get_folder_info): Update for prototype change. svn path=/trunk/; revision=9659
* Clean this up a bit. Add a "tag_prefix" member. Move "useful_lsub" intoDan Winship2001-05-033-18/+19
| | | | | | | | | | | | | | | | * providers/imap/camel-imap-store.h: Clean this up a bit. Add a "tag_prefix" member. Move "useful_lsub" into capabilities. * providers/imap/camel-imap-store.c (camel_imap_store_init): Initialize the tag_prefix, based on a static variable. * providers/imap/camel-imap-command.c (camel_imap_command): Use the store's tag_prefix character rather than "A" at the start of the tag. Makes the verbose debug output easier to parse when connected to multiple IMAP servers. (Well, unless you're connected to more than 26 servers...) svn path=/trunk/; revision=9649
* Fix this up... it was losing count in some cases and giving a more verboseDan Winship2001-05-031-14/+8
| | | | | | | | * providers/imap/camel-imap-utils.c (imap_uid_array_to_set): Fix this up... it was losing count in some cases and giving a more verbose answer than it needed to. svn path=/trunk/; revision=9644
* Redo command locking. Since command_lock is recursive, we can just get aDan Winship2001-05-026-197/+211
| | | | | | | | | | | | | | | | | | | | | | | | | * providers/imap/camel-imap-command.c (camel_imap_command): Redo command locking. Since command_lock is recursive, we can just get a lock here, and release it either on error, or when the caller frees the response data. (This simplifies a lot of stuff, and fixes some problems with camel_imap_folder_changed being called without the command_lock locked because of the 2001-03-22 change.) (camel_imap_response_free): (camel_imap_response_free_without_processing): (camel_imap_response_extract): (camel_imap_response_extract_continuation): These all take a CamelImapStore now as well, to deal with locking. * providers/imap/camel-imap-private.h: Add CAMEL_IMAP_STORE_ASSERT_LOCKED, which defaults to a noop, but can be made to call e_mutex_assert_locked. * providers/imap/camel-imap-folder.c, camel-imap-search.c, camel-imap-store.c: Simplify using new locking stuff. Add a few CAMEL_IMAP_STORE_ASSERT_LOCKED checks. svn path=/trunk/; revision=9639
* remove unused assignment that calls non-existent function.Dan Winship2001-05-011-2/+0
| | | | svn path=/trunk/; revision=9636
* Support the IMAP UIDPLUS extension (RFC 2359), which lets youDan Winship2001-05-015-73/+437
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | resync after disconnected operation more efficiently, but also makes it possible to do appends and moves/copies more efficiently now. * providers/imap/camel-imap-folder.c (imap_append_message): If the server supports UIDPLUS, grab the APPENDUID response and cache the message into the folder's message cache. (imap_copy_messages_to): Likewise, for COPYUID, copy any message parts we have cached between the source and destination folder caches. (imap_get_message): If the entire message is already in the cache, just return that rather than building it from parts. (imap_update_summary): Fetch just the "UID FLAGS RFC822.SIZE" of the new messages first, then only fetch the headers for messages where we don't already have the headers cached. * providers/imap/camel-imap-message-cache.c: Add gtk-doc comments. (cache_put): Fix refcounting stuff here. (camel_imap_message_cache_insert_stream, camel_imap_message_cache_insert_wrapper): New. (camel_imap_message_cache_get): Fix a bug here so the memory caching actually works. (camel_imap_message_cache_copy): New routine, used by imap_copy_messages_to. * providers/imap/camel-imap-utils.c (imap_uid_set_to_array): Inverse operation of imap_uid_array_to_set. Used to parse COPYUID response. svn path=/trunk/; revision=9635
* New-and-improved version of get_uid_set() from camel-imap-folder.c. LooksDan Winship2001-05-013-38/+77
| | | | | | | | | | | | | | * providers/imap/camel-imap-utils.c (imap_uid_array_to_set): New-and-improved version of get_uid_set() from camel-imap-folder.c. Looks at the summary as it goes so that if you ask for messages 5, 6, 8, and 9, and there is no message 7, then you get "5:9" instead of "5:6,8:9" * providers/imap/camel-imap-folder.c (imap_copy_messages_to): Use imap_uid_array_to_set() rather than get_uid_set(). (get_uid_set): Gone svn path=/trunk/; revision=9632
* Redo this a lot so that instead of having a class full of callbacks, weDan Winship2001-04-281-6/+5
| | | | | | | | | | | | | | | | | | | | | | * 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
* New file, with the int, string, time_t, and off_t encode/decode routinesDan Winship2001-04-272-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | * camel-file-utils.c: New file, with the int, string, time_t, and off_t encode/decode routines from camel-folder-summary.c moved here and renamed, for the enjoyment of non-CamelFolderSummary subclasses. * Makefile.am (libcamel_la_SOURCES): Add camel-file-utils.c (libcamelinclude_HEADERS): and camel-file-utils.h * camel-folder-summary.c: Remove functions that were moved to camel-file-utils.c, update uses of them for the new names. (camel_folder_summary_{en,de}code_token are still here.) * providers/local/camel-mbox-summary.c: Use camel_file_util_* names * providers/imap/camel-imap-summary.c: Use camel_file_util_* names * providers/imap/camel-imap-store.c (imap_store_setup_online, imap_store_setup_offline): Use camel_file_util_* names, which makes much more sense since this isn't folder summary stuff. svn path=/trunk/; revision=9590
* Free base_url and storage_path.Dan Winship2001-04-191-0/+4
| | | | | | | | | | | | | | | | * providers/imap/camel-imap-store.c (camel_imap_store_finalize): Free base_url and storage_path. * providers/pop3/camel-pop3-store.c (finalize): Free the implementation string. (camel_pop3_command): Clarify documentation to mention that @ex isn't set (and *@ret is) on CAMEL_POP3_ERR. (connect_to_server): Set @ex properly on CAMEL_POP3_ERR. * providers/pop3/camel-pop3-folder.c (pop3_refresh_info, pop3_get_message): Set @ex properly on CAMEL_POP3_ERR. svn path=/trunk/; revision=9450
* Remove the EXTRA_GNOME_CFLAGS include.Jeffrey Stedfast2001-04-172-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* s/imap_store/store/, fixing a typo that was causing the build to fail.Jon Trowbridge2001-04-141-4/+4
| | | | | | | | | | 2001-04-13 Jon Trowbridge <trow@ximian.com> * providers/imap/camel-imap-store.c (imap_disconnect): s/imap_store/store/, fixing a typo that was causing the build to fail. svn path=/trunk/; revision=9306
* Plug leaks.Dan Winship2001-04-141-1/+10
| | | | | | | | | | | | | | | | * camel-object.c (camel_object_hook_event): * camel-uid-cache.c (camel_uid_cache_get_new_uids): * camel-url.c (camel_url_new_with_base): Plug leaks. * camel-remote-store.c (camel_remote_store_init): Don't re-initialize the folders hash table. * providers/imap/camel-imap-store.c (imap_disconnect): Free authtypes since they'll be re-read on re-connect. (get_folder_info): Free folderinfos that we're discarding from the list. svn path=/trunk/; revision=9302
* Plug memory leaks.Dan Winship2001-04-131-0/+1
| | | | | | | | * providers/imap/camel-imap-message-cache.c (camel_imap_message_cache_remove): * camel-url.c (camel_url_to_string): Plug memory leaks. svn path=/trunk/; revision=9271
* Simplify peterw's imap_is_atom_char fix.Dan Winship2001-04-121-2/+2
| | | | | | | * providers/imap/camel-imap-utils.c (imap_parse_string_generic): Simplify peterw's imap_is_atom_char fix. svn path=/trunk/; revision=9250
* Check if gethostbyname_r take five paramsJP Rosevear2001-04-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-04-11 JP Rosevear <jpr@ximian.com> * configure.in: Check if gethostbyname_r take five params * acconfig.h: add GETHOSTBYNAME_R_FIVE_ARGS 2001-04-11 JP Rosevear <jpr@ximian.com> * providers/imap/Makefile.am: user GNOME_INCLUDEDIR since gnome files are included in the top level camel headers and the gtk include dir is now versioned and such * providers/local/Makefile.am: ditto * providers/pop3/Makefile.am: ditto * providers/smtp/Makefile.am: ditto * providers/sendmail/Makefile.am: ditto * camel-service.c: use five arg version of gethostbyname_r if appropriate (camel_get_host_byname): check if msg->herr is non-zero instead of checking if msg->hp is null since we may not always have msg->hp svn path=/trunk/; revision=9239
* It would be a good idea to recognize '\0'. Before, this code was runningPeter Williams2001-04-081-1/+1
| | | | | | | | | | | 001-04-07 Peter Williams <peterw@ximian.com> * providers/imap/camel-imap-utils.c (imap_parse_string_generic): It would be a good idea to recognize '\0'. Before, this code was running off the ends of strings and intermittently coredumping (if it didn't hit an imap_atom_char first) -- whoops! svn path=/trunk/; revision=9202
* (imap_update_summary): When reading message flags, set theDan Winship2001-04-041-2/+9
| | | | | | | | server_flags field as well, and don't overwrite any flags set by camel_folder_summary_info_new_from_message. Might help with some of the flag problems... svn path=/trunk/; revision=9149
* (imap_get_message): If the server_level < IMAP4rev1, always fetchDan Winship2001-04-041-3/+6
| | | | | | | messages all-at-once, since they don't support the [#.MIME] syntax. svn path=/trunk/; revision=9145
* If we don't change any flags or expunge, send a NOOP to give the server aDan Winship2001-04-041-1/+11
| | | | | | | | * providers/imap/camel-imap-folder.c (imap_sync): If we don't change any flags or expunge, send a NOOP to give the server a chance to send EXISTS, etc, messages. svn path=/trunk/; revision=9142
* Updated the authtype values.Jeffrey Stedfast2001-04-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 2001-04-01 Jeffrey Stedfast <fejj@ximian.com> * camel-sasl-plain.c: * camel-sasl-anonymous.c: * camel-sasl-digest-md5.c: * camel-sasl-cram-md5.c: * camel-sasl-kerberos4.c: Updated the authtype values. * camel-service.h: Added another field to CamelServiceAuthType that specifies whether or not the mechanism supports "quick auth" which means that the client can send the initial challenge in the AUTH request. * camel-sasl.c (camel_sasl_new): Add support for LOGIN. (camel_sasl_authtype_list): Here too. (camel_sasl_authtype): And finally here. * camel-sasl-plain.c: Define camel_sasl_login_authtype. * providers/smtp/camel-smtp-transport.c (smtp_auth): Only unref the SASL object if it exists. svn path=/trunk/; revision=9086
* removed a g_warning for debuggingJeffrey Stedfast2001-03-301-2/+0
| | | | svn path=/trunk/; revision=9037
* Don't blindly append "/INBOX", construct a CamelURL and set the path thatJeffrey Stedfast2001-03-301-7/+34
| | | | | | | | | | | | | | 2001-03-29 Jeffrey Stedfast <fejj@ximian.com> * providers/imap/camel-imap-store.c (get_folder_info): Don't blindly append "/INBOX", construct a CamelURL and set the path that way. (parse_list_response_as_folder_info): Don't blindly append "/<foldername>", construct a CamelURL and set the path that way instead. (get_folders_offline): And again here. svn path=/trunk/; revision=9036
* Big header cleanups and nntp compile fixKjartan Maraas2001-03-309-13/+24
| | | | svn path=/trunk/; revision=9024
* change "gboolean show_passwd" to "guint32 flags".Dan Winship2001-03-301-14/+8
| | | | | | | | | | | | | | | | | | * camel-url.c (camel_url_to_string): change "gboolean show_passwd" to "guint32 flags". * tests/misc/url.c (main): Update calls to camel_url_to_string * providers/imap/camel-imap-store.c (construct): Call camel_url_to_string with flags to hide password, authtype, and params to create the base_url. (etc): Update for the fact that the base_url no longer has the "/" at the end. * camel-service.c (construct): Update calls to camel_url_to_string (pass CAMEL_URL_HIDE_PASSWORD) svn path=/trunk/; revision=9014
* add an argument to say whether or not you want "PLAIN" in the list (so youDan Winship2001-03-272-2/+2
| | | | | | | | | | | | | | | | * camel-sasl.c (camel_sasl_authtype_list): add an argument to say whether or not you want "PLAIN" in the list (so you don't end up with "Password" twice in the config dialog). * providers/imap/camel-imap-provider.c (camel_provider_module_init): * providers/imap/camel-imap-store.c (query_auth_types): We don't want PLAIN. * providers/smtp/camel-smtp-provider.c (camel_provider_module_init): * providers/smtp/camel-smtp-transport.c (query_auth_types): But we do. svn path=/trunk/; revision=8972
* Add an "extra_conf" field to CamelProvider with structures and defines andDan Winship2001-03-274-83/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * camel-provider.h: Add an "extra_conf" field to CamelProvider with structures and defines and stuff, for providers to specify additional configuration options that they want. Also add a "supports ssl" flag to the provider flags. * camel-remote-store.c: add a "default_ssl_port" field. (remote_construct): If the URL has the "use_ssl" parameter, set the store's use_ssl flag. (remote_connect): If using SSL and no port specified, use the default_ssl_port rather than the default_port. * providers/smtp/camel-smtp-provider.c (smtp_provider): add CAMEL_PROVIDER_SUPPORTS_SSL and CAMEL_URL_ALLOW_USER. (The config gui code knows that the ALLOW_USER and ALLOW_AUTH go together.) (ssmtp_provider): gone * providers/smtp/camel-smtp-transport.c (smtp_construct): Set a flag if "use_ssl" param is set. (smtp_connect): Check the CamelSmtpTransport use_ssl flag rather than checking if this is smtp or ssmtp. * providers/imap/camel-imap-provider.c (imap_conf_entries): Add a bunch of IMAP-specific configuration options, like "check for new mail in all folders" (default TRUE), "show only subscribed folders" (default TRUE), "ignore server-supplied namespace", and "apply filters to INBOX" (not yet implemented). (imap_provider): We support SSL and we no longer allow a path in the URL. (namespace is handled via extra_conf) (simap_provider): Gone * providers/imap/camel-imap-store.c (camel_imap_store_init): Set default_ssl_port, don't set CAMEL_STORE_SUBSCRIPTIONS here (construct): remove simap stuff, deal with "use_lsub", "namespace", "check_all", and "filter" parameters. Set base_url to not include params. (imap_store_setup_online): Don't ask for the namespace if it was set explicitly. Don't get subscribed folders if !use_lsub. (imap_concat): Fix a bug. (get_folder_info): Support for not checking all folders. * providers/pop3/camel-pop3-provider.c (pop3_conf_entries): "keep on server" (currently still implemented by the mailer code, not here), "delete after N days" (not yet implemented). (pop3_provider): we support SSL (spop_provider): gone * providers/pop3/camel-pop3-store.c (camel_pop3_store_init): Set default_ssl_port (pop3_connect): Remove spop code svn path=/trunk/; revision=8968
* Rewrite to use imap_store->namespace, not service->url->pathDan Winship2001-03-271-8/+12
| | | | | | | * providers/imap/camel-imap-folder.c (imap_get_full_name): Rewrite to use imap_store->namespace, not service->url->path svn path=/trunk/; revision=8966
* Use camel_vtrash_folder_new() to create the vtrash folder now.Jeffrey Stedfast2001-03-271-50/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-03-26 Jeffrey Stedfast <fejj@ximian.com> * camel-store.c (init_trash): Use camel_vtrash_folder_new() to create the vtrash folder now. * camel-vtrash-folder.[c,h]: New subclass of CamelVeeFolder for our vTrash folders. * camel-folder.c (camel_folder_copy_messages_to): Don't watch for vtrash folders anymore. (camel_folder_move_messages_to): Same. * camel-vee-folder.c (camel_vee_folder_class_init): Update. (vee_move_messages_to): Rewrite to use the new move API. * camel-filter-driver.c (do_copy): Updated to reflect copy_message_to changes. Create a temporary uid array and use that. (do_move): Same. (camel_filter_driver_filter_message): And again, here... * providers/imap/camel-imap-folder.c (imap_copy_messages_to): Update to the new API. (imap_move_messages_to): Same. (get_uid_set): New function to create a `set' string based on an array of UIDs for use with imap_copy_messages_to. * camel-folder.c (camel_folder_copy_messages_to): Replaces camel_folder_copy_message_to (camel_folder_move_message_to): Replaces camel_folder_move_message_to. svn path=/trunk/; revision=8960
* keep a reference on the store's current_folder.Dan Winship2001-03-272-2/+11
| | | | | | | | | | * providers/imap/camel-imap-command.c (camel_imap_command): keep a reference on the store's current_folder. * providers/imap/camel-imap-store.c (camel_imap_store_finalize): (imap_disconnect): unref the current_folder before clearing it. svn path=/trunk/; revision=8945
* Don't look at untagged responses other than "* BYE"...Dan Winship2001-03-234-85/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | * providers/imap/camel-imap-command.c (imap_read_response): Don't look at untagged responses other than "* BYE"... (camel_imap_response_free): ...do it here instead... (camel_imap_response_free_without_processing): ...but not here. * providers/imap/camel-imap-folder.c (camel_imap_folder_selected): Remove the "EXISTS" line from the response so camel_imap_response_free won't try to process it. (camel_imap_folder_selected): If we get an EXISTS response mixed in with the FETCH responses, record the new EXISTS value. Use camel_imap_response_free_without_processing so that an EXISTS response won't cause a loop. (imap_rescan): Use camel_imap_response_free_without_processing. (imap_update_summary): Use camel_imap_response_free_without_processing. If an EXISTS response shows up, call imap_update_summary again to get the new messages. (imap_protocol_get_summary_specifier): Use BODY.PEEK[0], not RFC822.HEADER for prev IMAP4rev1, since the FETCH parser won't deal with RFC822.HEADER responses. * providers/imap/camel-imap-store.c (get_folder_info): Fix an uninitialized variable svn path=/trunk/; revision=8905
* add a "GList *authtypes", so you can get the list of authtypes used by aDan Winship2001-03-222-37/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Function to check if the store is online and set an exception if not.Dan Winship2001-03-218-190/+402
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * providers/imap/camel-imap-store.c (camel_imap_store_check_online): Function to check if the store is online and set an exception if not. Currently controlled by an environment variable, but eventually there will be both a global (session-level) setting and a per-store setting. (construct): Set up storage_path and base_url here rather than at connect-time. (imap_auth_loop): Split out from imap_connect. (imap_setup_online): Split out from imap_connect. Do the post-authentication connection setup, and cache the results to disk. (imap_setup_offline): Set up a CamelImapStore with information saved from a previous imap_setup_online. (imap_connect): If online, do connect_to_server(), imap_auth_loop(), and imap_setup_online(). Otherwise, do imap_setup_offline(). (get_folder, get_folder_info): Add offline support. (create_folder, subscribe_folder, unsubscribe_folder): Disable these when offline (for now). * providers/imap/camel-imap-folder.c (camel_imap_folder_new): Remove the sync'ing-with-server stuff... it's done by camel_imap_folder_selected now, which only gets called if the store is online. (camel_imap_folder_selected): add the code removed from camel_imap_folder_new. Besides simplifying the folder_new and summary_new code, this also means now that we'll DTRT if a folder's UIDVALIDITY changes while we're connected. Also, when that happens, clear the message cache explicitly. (imap_refresh_info, imap_sync): These are no-ops when offline. (imap_expunge, imap_append_message, imap_copy_message_to, imap_search_by_expression): These don't yet work offline. (imap_get_message, camel_imap_folder_fetch_data): Return an error when trying to fetch a non-cached body part when we're offline. * providers/imap/camel-imap-summary.c (camel_imap_summary_new): Rewrite to not check the validity here. (We'll do it from camel_imap_folder_selected instead.) * providers/imap/camel-imap-command.c (camel_imap_command): Call camel_imap_folder_selected even when the selection is all we're doing, to match the changes in camel-imap-folder.c. * providers/imap/camel-imap-message-cache.c (camel_imap_message_cache_clear): New function to clear out a message cache. svn path=/trunk/; revision=8851
* translate NIL to "" in fetch body part responseDan Winship2001-03-161-1/+3
| | | | svn path=/trunk/; revision=8744
* First batch of disconnected IMAP-related stuff. This adds localDan Winship2001-03-1612-268/+739
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | caching of message parts, but NOT any actual disconnected support. (But it should speed up IMAP use.) * providers/imap/camel-imap-message-cache.c: New class for caching message data to disk, and removing it when it's no longer relevant. Will eventually also support merging message parts together to save on files. Or maybe using a db instead of files? * providers/imap/camel-imap-private.h: Add a cache_lock to CamelImapFolderPrivate. This lock must be recursive, so make both locks EMutexes rather than GMutex. * providers/imap/camel-imap-folder.c (parse_fetch_response): "The only FETCH response parser you need!" Replaces the various almost-correct bits of code formerly scattered throughout this file with a single fully-correct function that can handle any FETCH response at any time, so we don't get confused by seeing a flags update when we were only expecting a message body, etc. (camel_imap_folder_fetch_data): FETCH a message body part either from the cache or the server (camel_imap_folder_changed): Remove expunged messages from the message cache. (camel_imap_folder_new): Change to take a directory instead of a summary file name. Create a CamelImapMessageCache for the folder. (imap_finalize): Unref the message cache. (camel_imap_folder_selected, imap_rescan, get_content, get_message, imap_get_message, imap_update_summary): Redone a bunch to use parse_fetch_data, CamelImapMessageCache, etc. * providers/imap/camel-imap-store.c (get_folder): Pass directory name to camel_imap_folder_new, not summary filename. Use e_path_to_physical to generate a path with /subfolders/ inserted between directory components. * providers/imap/camel-imap-wrapper.c (camel_imap_wrapper_new): Call camel_imap_folder_fetch_data (with cache_only TRUE) and if the data is cached, return an online datawrapper rather than an offline one. (write_to_stream): Use camel_imap_folder_fetch_data (with cache_only FALSE) here too * providers/imap/camel-imap-utils.c (imap_skip_list): Renamed from skip_list and made non-static. svn path=/trunk/; revision=8743
* Uninclude prnetdb.h since it's not needed here.Jeffrey Stedfast2001-03-161-5/+0
| | | | | | | | | | | | | | | | 2001-03-15 Jeffrey Stedfast <fejj@ximian.com> * camel-tcp-stream-ssl.h: Uninclude prnetdb.h since it's not needed here. * providers/smtp/camel-smtp-transport.c: #include prnetdb.h here instead of making camel-tcp-stream-ssl.h include it. Prevents some header bloat. * providers/smtp/Makefile.am: Include the NSPR_CFLAGS and NSS_CFLAGS. svn path=/trunk/; revision=8738
* defined "ssmtp"Jeffrey Stedfast2001-03-151-4/+4
| | | | | | | | | | | | 2001-03-14 Jeffrey Stedfast <fejj@ximian.com> * providers/smtp/libcamelsmtp.urls: defined "ssmtp" * providers/smtp/camel-smtp-provider.c: Defined the Secure SMTP provider. (camel_provider_module_init): Register the Secure SMTP provider. svn path=/trunk/; revision=8726
* also change the protocol name in the providersJeffrey Stedfast2001-03-151-1/+1
| | | | svn path=/trunk/; revision=8725
* Check for "simap" instead of "imaps".Jeffrey Stedfast2001-03-152-2/+2
| | | | | | | | | | | | | | | | | 2001-03-14 Jeffrey Stedfast <fejj@ximian.com> * providers/imap/camel-imap-store.c (imap_connect): Check for "simap" instead of "imaps". * providers/pop3/camel-pop3-store.c (pop3_connect): Change the port to be 995 for spop. * providers/pop3/libcamelpop3.urls: Change to "spop". * providers/imap/libcamelimap.urls: Change "imaps" to "simap" to correspond to /etc/services. svn path=/trunk/; revision=8724
* So it turns out that NSS_Init *isn't* idempotent, so we have to protectJeffrey Stedfast2001-03-151-5/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Eek! So the service's URL isn't set until after this is initialized. ThisJeffrey Stedfast2001-03-151-13/+12
| | | | | | | | | | | 2001-03-14 Jeffrey Stedfast <fejj@ximian.com> * 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=8715
* Numerous fixes to get it to build correctly with NSS enabled.Jeffrey Stedfast2001-03-153-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | 2001-03-14 Jeffrey Stedfast <fejj@ximian.com> * camel-tcp-stream-ssl.c: Numerous fixes to get it to build correctly with NSS enabled. * camel-remote-store.c (remote_connect): Pass in the session and expected host args, oops. * camel-provider.h (CAMEL_URL_ALLOW_SSL): Defined. * providers/imap/camel-imap-store.c (camel_imap_store_init): Check to see if we are supposed to use SSL and set the options accordingly. (imap_connect): Return FALSE here instead of NULL. * providers/imap/camel-imap-provider.c: Add CAMEL_URL_ALLOW_SSL. * providers/imap/libcamelimap.urls: Add "imaps" which is the protocol for Secure IMAP. svn path=/trunk/; revision=8711
* When trying again after a failed password attempt, check if the connectionDan Winship2001-03-141-0/+8
| | | | | | | | * providers/imap/camel-imap-store.c (imap_connect): When trying again after a failed password attempt, check if the connection got dropped (which Courier will do) and deal accordingly. svn path=/trunk/; revision=8675
* i18n'd some strings in here.Jeffrey Stedfast2001-03-061-6/+4
| | | | | | | | | | | | | 2001-03-05 Jeffrey Stedfast <fejj@ximian.com> * providers/imap/camel-imap-store.c (imap_connect): i18n'd some strings in here. * providers/smtp/camel-smtp-transport.c (smtp_connect): Keep trying to authenticate until either we succeed or until the user cancels. svn path=/trunk/; revision=8561
* Don't forget to unref the SASL object.Jeffrey Stedfast2001-03-031-1/+7
| | | | | | | | | | | | | | | | | | | | 2001-03-02 Jeffrey Stedfast <fejj@ximian.com> * providers/imap/camel-imap-store.c (try_auth): Don't forget to unref the SASL object. * providers/smtp/camel-smtp-transport.c (query_auth_types): Implemented. (smtp_auth): Implemented. (smtp_helo): Don't bother parsing the authtypes if we already have them. (smtp_connect): call smtp_auth() here if we found any authtypes. (smtp_disconnect): Updated as I now use a hash table for the supported authtypes rather than a linked list. (esmtp_get_authtypes): modify to use a hash table instead of a linked list and also use isspace() rather than == ' '. svn path=/trunk/; revision=8525
* Add an "authtypes" hash table to CamelImapStore recording the supportedDan Winship2001-03-025-286/+134
| | | | | | | | | | | | | | | | | | | | | * providers/imap/camel-imap-store.c: Add an "authtypes" hash table to CamelImapStore recording the supported authtypes. (connect_to_server): Record supported authtypes in the authtypes hash rather than the capabilities bitmask, since now the IMAP code is no longer responsible for keeping track of which authtypes we support. (query_auth_types): Use camel_sasl_authtype_list to get the SASL-supported authtypes. (try_auth): New function to try a SASL auth mechanism. Sort of formerly imap_try_kerberos_v4_auth. (imap_connect): Get rid of the krb4-specific bits and genericize them for any SASL authtype. * providers/imap/Makefile.am: Remove camel-imap-auth.[ch] (moved into camel-imap-store.c since it's now constant size) and the KRB4_CFLAGS and KRB4_LDFLAGS references. svn path=/trunk/; revision=8463
* Added camel-sasl*.[c,h] to the build.Jeffrey Stedfast2001-03-011-25/+1
| | | | | | | | | | | | | | | | | | | | | | 2001-02-28 Jeffrey Stedfast <fejj@ximian.com> * Makefile.am: Added camel-sasl*.[c,h] to the build. * camel-sasl.[c,h]: new "abstract" SASL class * camel-sasl-kerberos4.[c,h]: new SASL class for KERBEROS_V4 * camel-sasl-cram-md5.[c,h]: new SASL class for CRAM-MD5 * camel-sasl-plain.[c,h]: new SASL class for PLAIN * providers/imap/camel-imap-auth.c: Removed the base64 functions. * camel-mime-utils.c (base64_encode_simple): Moved here from camel-imap-auth.c (base64_decode_simple): Same. svn path=/trunk/; revision=8428
* Group messages into sets with the same flags and use the IMAP message setDan Winship2001-02-271-33/+144
| | | | | | | | | | | | | | * providers/imap/camel-imap-folder.c (imap_sync): Group messages into sets with the same flags and use the IMAP message set notation rather than doing a separate STORE FLAGS for each one. This cuts the network traffic down to just a handful of commands per sync rather than one per changed message. Removed the progress notification stuff since it's no longer meaningful and should hopefully be unnecessary. (imap_copy_message_to): move the former sync_message function into here, since it's no longer shared with imap_sync. svn path=/trunk/; revision=8396
* Add some internal progress reporting. (imap_rescan): Do some progressNot Zed2001-02-231-1/+18
| | | | | | | | | | | | | 2001-02-23 Not Zed <NotZed@Ximian.com> * providers/imap/camel-imap-folder.c (imap_sync): Add some internal progress reporting. (imap_rescan): Do some progress reporting. * camel-mime-part.c (init_header_name_table): Add the message-id to the formatted table, so we dont try and wrap it, and break it. svn path=/trunk/; revision=8350
* #define this as the set of all IMAP system flagsDan Winship2001-02-222-1/+8
| | | | | | | | | | | | | * providers/imap/camel-imap-summary.h (CAMEL_IMAP_SERVER_FLAGS): #define this as the set of all IMAP system flags * providers/imap/camel-imap-folder.c (sync_message): after syncing flags, set server_flags to (flags & CAMEL_IMAP_SERVER_FLAGS) rather than just "flags", since any other flags won't have been synced. Prevents the CAMEL_MESSAGE_ATTACHMENTS flag from getting lost. svn path=/trunk/; revision=8344
* Fixes for IMAP4-pre-rev1 from Torsten Schulz.Dan Winship2001-02-221-2/+8
| | | | | | | * providers/imap/camel-imap-folder.c (fetch_medium): Fixes for IMAP4-pre-rev1 from Torsten Schulz. svn path=/trunk/; revision=8318
* Emit the folder_created signal here.Jeffrey Stedfast2001-02-161-1/+38
| | | | | | | | | | | | | | | | | | | | | | | 2001-02-15 Jeffrey Stedfast <fejj@ximian.com> * providers/vee/camel-vee-folder.c (camel_vee_folder_new): Emit the folder_created signal here. * providers/local/camel-local-folder.c (camel_local_folder_construct): Emit the folder_created signal. * providers/local/camel-local-store.c (delete_folder): On error, free the 'name' string so we don't leak. Also emit the folder_deleted signal. * providers/imap/camel-imap-store.c (subscribe_folder): Emit the folder_created signal. (unsubscribe_folder): Emit the folder_deleted signal. * camel-store.c (camel_store_class_init): Added folder_created and folder_deleted signal defs. svn path=/trunk/; revision=8246
* IMAP4 (pre-rev1) doesn't allow BODY.PEEK[], so use RFC822.PEEK instead inDan Winship2001-02-161-3/+8
| | | | | | | | * providers/imap/camel-imap-folder.c (fetch_medium): IMAP4 (pre-rev1) doesn't allow BODY.PEEK[], so use RFC822.PEEK instead in that case. svn path=/trunk/; revision=8244
* (create_folder): Oops, and fix bug involving namespacesDan Winship2001-02-151-4/+3
| | | | svn path=/trunk/; revision=8233
* New method to create a folder when you don't know its full name.Dan Winship2001-02-151-8/+39
| | | | | | | | | * camel-store.c (camel_store_create_folder): New method to create a folder when you don't know its full name. * providers/imap/camel-imap-store.c (create_folder): Implement. svn path=/trunk/; revision=8231
* Rewrite a bunch. Replace the existing folder cache stuff with much simplerDan Winship2001-02-101-22/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Updated.Jeffrey Stedfast2001-02-061-9/+16
| | | | | | | | | | | | | | | | | | | 2001-02-05 Jeffrey Stedfast <fejj@ximian.com> * providers/smtp/camel-smtp-transport.c (query_auth_types): Updated. * providers/nntp/camel-nntp-store.c (nntp_store_query_auth_types): Updated. * providers/pop3/camel-pop3-store.c (query_auth_types): Updated. * providers/imap/camel-imap-store.c (query_auth_types): Updated. * camel-service.c (camel_service_query_auth_types): Now takes a boolean value to specify whether or not to connect when constructing a supported authtype list. svn path=/trunk/; revision=7979
* Include the terminating NUL in the calculated string length. This hitNot Zed2001-01-291-1/+1
| | | | | | | | | | 2001-01-29 Not Zed <NotZed@Ximian.com> * providers/imap/camel-imap-command.c (imap_command_strdup_vprintf): Include the terminating NUL in the calculated string length. This hit memcheck. svn path=/trunk/; revision=7884
* Changed the subject search to handle case sensitive when it is mixed case.Not Zed2001-01-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-01-25 Not Zed <NotZed@Ximian.com> * tests/folder/test3.c: Changed the subject search to handle case sensitive when it is mixed case. * Makefile.am (libcamel_la_SOURCES): Added camel-ssearch-private.c (noinst_HEADERS): Added camel-search-private.h * camel-folder-search.c (check_header): New function to do the work of the various header checks. (search_header_matches): (search_header_starts_with): (search_header_ends_with): (search_header_contains): Use check_header to do the work. (build_match_regex): Removed. * camel-search-private.c (header_soundex): New function to match words to phrases using soundex algorithm. * camel-filter-search.c (soundexcmp): Removed. (check_match): Moved to search-private.h 2001-01-24 Not Zed <NotZed@Ximian.com> * camel-search-private.c (camel_search_build_match_regex): Added extra flags, so the same function can be used for start/end/whole/partial matches. (camel_search_header_match): Convenience function to check a single header against all sorts of different matches. * providers/imap/camel-imap-search.c (imap_body_contains): Fix for e_sexp api changes. * camel-folder-search.c: Fix for e_sexp api changes. (search_header_contains): Free args/quit on unknown header. (search_header_matches): " (search_header_starts_with): " (search_header_ends_with): " (match_message): Add an exception argument. (search_body_contains): Free args/quit on fatal error. (message_body_contains): Removed (moved to camel-search-private.c), fixed callers. * camel-filter-search.c: Fix for e_sexp api changes. (build_match_regex, message_body_contains): Moved into camel-filter-private.c Fixed callers. (check_header): moved guts to camel-search-private, and changed to use regex's for everything. Just calls that with the right args. (check_header): GEts the header, decodes it, and checks for failure, and whatnot. (check_match): Removed. (header_soundex): Changed significantly. Now it soundexes each word in the header separately, and compares it to the first argument. * tests/folder/test9.c (main): Fix for api changes. (main): Added tests to see that invalid match and action rules are properly detected. * camel-filter-driver.c (camel_filter_driver_filter_mbox): Remove the 'finished message' bit. (camel_filter_driver_filter_message): Remove an accidentally checked in debug. (camel_filter_driver_filter_message): Fix for e-sexp api changes. svn path=/trunk/; revision=7796
* Add a lock around the delayed loading, so two threads won't try to do itDan Winship2001-01-243-2/+40
| | | | | | | | * providers/imap/camel-imap-wrapper.c: Add a lock around the delayed loading, so two threads won't try to do it at the same time. svn path=/trunk/; revision=7752
* Removed some debug 'warnings', as they should now be displayed at theNot Zed2001-01-231-10/+7
| | | | | | | | | | | | | | | | | | | | | 2001-01-23 Not Zed <NotZed@Ximian.com> * providers/imap/camel-imap-summary.c (message_info_load): Removed some debug 'warnings', as they should now be displayed at the toplevel loader, and just made the code match similar code elsewhere. * providers/local/camel-mbox-summary.c (message_info_load): Error handling. (message_info_save): more error handling. * camel-folder-summary.c (message_info_load): Add error handling and sanity checking. (camel_folder_summary_load): Add error checks. (perform_content_info_load): Error + sanity checks. (content_info_load): error + sanity checks. svn path=/trunk/; revision=7737
* Change the callbacks in this file to match the callback function types.Christopher James Lahey2001-01-231-1/+1
| | | | | | | | | 2001-01-22 Christopher James Lahey <clahey@helixcode.com> * component/e-summary-url.c: Change the callbacks in this file to match the callback function types. Fixes warnings. svn path=/trunk/; revision=7723
* Added profiling temp files.Not Zed2001-01-221-0/+4
| | | | | | | | | 2001-01-22 Not Zed <NotZed@Ximian.com> * .cvsignore */*/.cvsignore: Added profiling temp files. svn path=/trunk/; revision=7705
* (subscribe_folder): add a missing UNLOCKDan Winship2001-01-201-0/+1
| | | | svn path=/trunk/; revision=7657
* If LISTing a subscribed folder doesn't return a LIST response, just ignoreDan Winship2001-01-201-3/+6
| | | | | | | | | * providers/imap/camel-imap-store.c (get_subscribed_folders_by_hand): If LISTing a subscribed folder doesn't return a LIST response, just ignore that folder. Yay RFC2060. svn path=/trunk/; revision=7650
* More tweaking... skip separator characters after the namespace character.Dan Winship2001-01-191-1/+1
| | | | | | | | | | | | | | | * camel-store.c (camel_folder_info_build): More tweaking... skip separator characters after the namespace character. (Gets rid of the shell folder registration warning some people have had with IMAP) * providers/imap/camel-imap-store.c (imap_connect): I'm sure there was some clever reason I was storing the flags of the folder in the hash table rather than just "1", but I don't remember what it was now. Anyway, since we only ever test NULL/non-NULL, store 1, since flags is sometimes 0. svn path=/trunk/; revision=7628
* Oops. Somewhere in one of the reorgs, the code to add new messages to theDan Winship2001-01-191-1/+2
| | | | | | | | * providers/imap/camel-imap-folder.c (imap_update_summary): Oops. Somewhere in one of the reorgs, the code to add new messages to the CamelFolderChangeInfo structure got removed. Fix that. svn path=/trunk/; revision=7627
* Add some g_warnings() to help debug later if I ever get the segfaults IJeffrey Stedfast2001-01-181-1/+5
| | | | | | | | | | | | | | | 2001-01-17 Jeffrey Stedfast <fejj@ximian.com> * providers/imap/camel-imap-summary.c (message_info_load): Add some g_warnings() to help debug later if I ever get the segfaults I was getting earlier. Can't seem to reproduce them after my previous "fix". * camel-folder-summary.c (camel_folder_summary_load): Undid my change here, NotZed said it was wrong and that if it gets a NULL mi then it should abort and not continue. svn path=/trunk/; revision=7609
* Delayed loading of IMAP message parts.Dan Winship2001-01-177-157/+884
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * camel-types.h: typedef CamelMessageInfo and CamelMessageContentInfo here * camel-folder-summary.h: Add a "size" field to CamelMessageContentInfo. * camel-folder-summary.c (camel_folder_summary_content_info_new, camel_folder_summary_content_info_free): Renamed and made non-static for providers that construct their own content info. (content_info_load, content_info_save): load/save size * camel-data-wrapper.c (camel_data_wrapper_is_offline): New function to return if a data wrapper's contents are "offline". (So that, for example, we don't make thumbnails of images that haven't been loaded off the IMAP server yet.) Defaults to FALSE. * providers/imap/camel-imap-folder.c (camel_imap_folder_selected): Fix a bug in re-selecting a folder when messages have been expunged from it by another client in the meantime. (imap_get_message): Rewrite. If the message is larger than a certain size, just create a skeleton message containing CamelImapWrappers that will read parts as needed. This way, large attachments only need to be downloaded if the user looks at them, and multipart/alternative alternatives that aren't used will never be downloaded at all. (imap_update_summary): Rewrite this a bunch too to make the parsing more robust. * providers/imap/camel-imap-summary.c (CAMEL_IMAP_SUMMARY_VERSION): bump. (camel_imap_summary_new): Set build_content to TRUE. (content_info_load, content_info_save): Only save/load the content for messages that have it. (The content info gets created as a side effect of imap_get_message.) * providers/imap/camel-imap-utils.c (imap_parse_body): New routine (and helpers) to parse an IMAP 'body' FETCH response and fill in a CamelMessageContentInfo from it. * providers/imap/Makefile.am (libcamelimap_la_SOURCES, libcamelimap_la_HEADERS): add camel-imap-wrapper. svn path=/trunk/; revision=7557
* Ugh, this design is ugly like my butt.Jeffrey Stedfast2001-01-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Chganged len back to be unsigned. And do a simple range check on theNot Zed2001-01-163-4/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Lock around the imap_rescan, which needs it.Peter Williams2001-01-161-0/+2
| | | | | | | | | 2001-01-15 Peter Williams <peterw@ximian.com> * providers/imap/camel-imap-folder.c (camel_imap_folder_new): Lock around the imap_rescan, which needs it. svn path=/trunk/; revision=7513
* (imap_copy_message_to): Fix this up: sync flags to the serverDan Winship2001-01-121-33/+50
| | | | | | | | | | | before copying so that they end up correct in the remote folder. And poke the destination folder after doing the copy so it notices the new message right away. (imap_move_message_to): Call imap_copy_message_to for most of the work rather than duplicating the code (since it's much more complicated now). svn path=/trunk/; revision=7419
* Fix a bug in previous commit: don't check for deleted messages if thereDan Winship2001-01-121-30/+33
| | | | | | | | | * providers/imap/camel-imap-folder.c (camel_imap_folder_selected): Fix a bug in previous commit: don't check for deleted messages if there are no known messages in the folder (because it would end up sending "FETCH 0 ..."). svn path=/trunk/; revision=7412
* New function to check for added/deleted messages when re-selecting aDan Winship2001-01-123-4/+83
| | | | | | | | | | | | | | * providers/imap/camel-imap-folder.c (camel_imap_folder_selected): New function to check for added/deleted messages when re-selecting a folder. (imap_refresh_info, imap_rescan, imap_update_summary): Various locking tweaks that turn out to be irrelevant since command_lock is recursive, but whatever. * providers/imap/camel-imap-command.c (camel_imap_command): When selecting a new folder, call camel_imap_folder_selected on it. svn path=/trunk/; revision=7410
* New header to prevent recursive #include problemsDan Winship2001-01-111-0/+39
| | | | | | | * providers/imap/camel-imap-types.h: New header to prevent recursive #include problems svn path=/trunk/; revision=7368
* New header to prevent recursive #include problemsDan Winship2001-01-118-9/+14
| | | | | | | | | | | | | | | | | * providers/imap/camel-imap-types.h: New header to prevent recursive #include problems * providers/imap/*.h: Replace some #includes with #include "camel-imap-types.h", remove typedefs that were moved to camel-imap-types.h * providers/imap/*.c: Add #includes to make up for #includes removed from .h files * providers/imap/Makefile.am (libcamelimapinclude_HEADERS): Add camel-imap-types.h svn path=/trunk/; revision=7367
* New class function, parallel to camel_folder_sync. (The defaultDan Winship2001-01-111-0/+18
| | | | | | | | | | | | | | | * camel-store.c (camel_store_sync): New class function, parallel to camel_folder_sync. (The default implementation just calls camel_folder_sync on each cached folder.) * providers/imap/camel-imap-store.c (get_folder_info): Call camel_store_sync before doing anything else so that the IMAP server and Camel are working from the same data. Don't ask the server for the unread message count of the current folder, since UW will return often-incorrect cached data, and we can calculate it without talking to the server anyway. svn path=/trunk/; revision=7365
* Mostly IMAP changes. Use the NAMESPACE extension (whereDan Winship2001-01-102-146/+258
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | available). Deal with servers that don't return LIST flags in response to LSUB (like UW) to get rid of the "not a selectable folder" error messages in the UI. Take advantage of the \Marked and \Unmarked flags to try to speed up the folder scan by not doing STATUS on unmarked folders. Some further tweaks on the shape of the resulting folder tree in various situations... * camel-store.h: Remove the (read) message_count, since nothing uses it, and we can speed up IMAP a bit this way. * camel-store.c (camel_folder_info_build): Redo this a bit to make it more useful for IMAP since that's the only thing that uses it. * camel-remote-store.c (camel_remote_store_connected): Public function to check if the store is connected, and try to connect it if it's not. (remote_send_string, remote_send_stream, remote_recv_line): Use that. * providers/imap/camel-imap-store.c (camel_imap_store_finalize): fix up for changes. (camel_imap_store_init): Initialize subscribed_folders to NULL rather than an empty hash table. (imap_connect): Get the list of subscribed folders here. If the server doesn't claim that any of them are either Marked or Unmarked, then assume that it doesn't do that for LSUB and remember that for later. If the server supports the NAMESPACE extension and the user didn't specify a namespace, use the server-provided one. (imap_disconnect): Free the list of subscribed folders, and the namespace. (get_folder): check camel_remote_store_connected (get_folder_info): check camel_remote_store_connected. Add a bunch of new cleverness. If we learned that the server doesn't do LSUB usefully, do a bunch of LISTs by hand. Then, if we're getting unread counts, only do it for folders that weren't listed as Unmarked. Also, deal with namespaces that end with the separator character, and update for changes to camel_folder_info_build. (folder_subscribed): Add a g_return_val_if_fail. (subscribe_folder, unsubscribe_folder): check camel_remote_store_connected. * providers/nntp/camel-nntp-store.c (build_folder_info, build_folder_info_from_grouplist, nntp_store_get_folder_info): Don't fill in message_count since it doesn't exist any more. svn path=/trunk/; revision=7343
* Kill off a long-hated Camel kludge: "empty" URLs andDan Winship2001-01-101-18/+4
| | | | | | | | | | | | | | | | | | | | | | | | query_auth_types_generic. * camel-url.c: Remove "empty" from CamelURL. (camel_url_new): No longer set it. (camel_url_to_string): Treat "" as equivalent to NULL for authmech. (Unrelated change, but it simplifies some stuff with the new config dialog.) * camel-service.c (camel_service_new): Remove url->empty check: if the URL isn't valid, we don't create the service. (camel_service_query_auth_types): No longer need to switch between generic and connected variants. * providers/smtp/camel-smtp-transport.c (query_auth_types): * providers/pop3/camel-pop3-store.c (query_auth_types): * providers/nntp/camel-nntp-store.c (nntp_store_query_auth_types): * providers/imap/camel-imap-store.c (query_auth_types): * camel-remote-store.c (remote_query_auth_types): Remove generic version, rename connected version. svn path=/trunk/; revision=7327
* oops. commit-oDan Winship2001-01-051-509/+0
| | | | svn path=/trunk/; revision=7252
* Fix two problems in figuring out server-expunged messages.Dan Winship2001-01-051-2/+1
| | | | | | | * providers/imap/camel-imap-folder.c (imap_rescan): Fix two problems in figuring out server-expunged messages. svn path=/trunk/; revision=7251
* Fix two problems in figuring out server-expunged messages.Dan Winship2001-01-051-0/+509
| | | | | | | * providers/imap/camel-imap-folder.c (imap_rescan): Fix two problems in figuring out server-expunged messages. svn path=/trunk/; revision=7247
* Initialize the exists variable so that we don't do random things if theChristopher James Lahey2001-01-041-1/+1
| | | | | | | | | | 2001-01-03 Christopher James Lahey <clahey@helixcode.com> * providers/imap/camel-imap-folder.c (camel_imap_folder_new): Initialize the exists variable so that we don't do random things if the imap server misbehaves. svn path=/trunk/; revision=7235
* fix off-by-oneDan Winship2001-01-031-1/+1
| | | | svn path=/trunk/; revision=7217
* IMAP randomness.Dan Winship2001-01-037-404/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * providers/imap/camel-imap-stream.[ch]: Remove. To be replaced. * providers/imap/Makefile.am (libcamelimapinclude_HEADERS): Remove camel-imap-stream.h * providers/imap/camel-imap-utils.c (imap_parse_flag_list): Take a char ** instead of char *, to return the position at the end of parsing like the string parsing functions. (imap_parse_string_generic): New function to parse a string, nstring, or astring. (imap_parse_nstring, imap_parse_astring): Now macros (imap_parse_string): Added * providers/imap/camel-imap-folder.h: Remove the "exists" field from CamelImapFolder. * providers/imap/camel-imap-folder.c: Remove unused include of camel-imap-stream.h. (camel_imap_folder_init): Remove no-longer-relevant summary initialization. (camel_imap_folder_new): Update for imap_parse_flag_list change, exists removal, and imap_rescan. (imap_rescan): New function that does most of the work of the old imap_refresh_info, but taking "exists" as an argument instead of getting it from the folder. Also calls camel_imap_folder_changed to do the summary updating and signalling, rather than duplicating that code. (imap_refresh_info): Just call imap_rescan (using the size of the folder summary as "exists"). (imap_update_summary): Update for imap_parse_flag_list change (camel_imap_folder_changed): Update for "exists" change. svn path=/trunk/; revision=7216
* (camel_imap_folder_changed): Make sure we unref the summary lookup.Michael Zucci2000-12-241-0/+1
| | | | svn path=/trunk/; revision=7156
* clean up a stubborn and hard to remove imap_folder->summary.Michael Zucci2000-12-242-5/+4
| | | | svn path=/trunk/; revision=7155
* Minor compilation fixes.Michael Zucci2000-12-242-14/+6
| | | | svn path=/trunk/; revision=7151
* Lock the command channel while searching. (imap_body_contains): IfNot Zed2000-12-249-174/+248
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* When getting the top-level folder list, include INBOX even if it's notDan Winship2000-12-231-12/+19
| | | | | | | | | | * providers/imap/camel-imap-store.c (get_folder_info): When getting the top-level folder list, include INBOX even if it's not subscribed. Don't show subscribed folders outside of the given namespace. Do a better job of pruning the namespace from the returned folder tree. svn path=/trunk/; revision=7131
* New CamelFolderSearch subclass that just reimplements body_contains (usingDan Winship2000-12-227-441/+211
| | | | | | | | | | | | | | | | | | * providers/imap/camel-imap-search.c: New CamelFolderSearch subclass that just reimplements body_contains (using the IMAP SEARCH command). All other kinds of searching are done against the local summary. * providers/imap/camel-imap-folder.c (imap_search_by_expression): Use a CamelImapSearch to do searching. * providers/imap/camel-imap-utils.c (imap_translate_sexp, etc): No longer needed. * camel-folder-search.h: Add missing CAMEL_FOLDER_SEARCH_TYPE #define svn path=/trunk/; revision=7119
* Oops. Don't do "FETCH 1:0" when the folder is empty.Dan Winship2000-12-201-31/+40
| | | | | | | | | | * providers/imap/camel-imap-folder.c (imap_refresh_info): Oops. Don't do "FETCH 1:0" when the folder is empty. (imap_protocol_get_summary_specifier): Request RFC822.SIZE too. (imap_update_summary): Parse RFC822.SIZE and add it to the summary. svn path=/trunk/; revision=7088
* Add "guint32 server_flags" to CamelImapMessageInfo to keep track of theDan Winship2000-12-203-62/+89
| | | | | | | | | | | | | | | | | | * providers/imap/camel-imap-summary.c: Add "guint32 server_flags" to CamelImapMessageInfo to keep track of the last known message flag state on the server. (message_info_save, message_info_load): Save/load the server_flags. * providers/imap/camel-imap-folder.c: Make this use CamelFolderChangeInfo and emit folder_changed notifications as it gets them rather than only on refresh_info. (imap_refresh_info): Notice flags that get cleared on the server as well as flags that get set. (imap_update_summary): Remove a comment that never actually applied to the committed code. svn path=/trunk/; revision=7086
* Change the semantics of fmt: Now %S (capital S) means an IMAP "string",Dan Winship2000-12-195-21/+175
| | | | | | | | | | | | | | | | | | | | | * providers/imap/camel-imap-command.c (camel_imap_command): Change the semantics of fmt: Now %S (capital S) means an IMAP "string", (which can be sent as either a quoted string or a literal). If the server supports LITERAL+, these will be sent as extended literals (which don't require any special escaping). Otherwise they'll be sent as quoted strings (and it now properly deals with " or \ in the string). (imap_command_strdup_vprintf): Utility routine that does the real work for the functionality mentioned above. * providers/imap/camel-imap-utils.c (imap_quote_string): Turns a string into a proper IMAP "quoted string". * providers/imap/camel-imap-store.c: * providers/imap/camel-imap-folder.c: Use %S instead of "%s" where appropriate. svn path=/trunk/; revision=7070
* change a bunch of IS_CAMEL_* macros to CAMEL_IS_*Dan Winship2000-12-142-2/+2
| | | | | | | * Namespace cleanup: change a bunch of IS_CAMEL_* macros to CAMEL_IS_* svn path=/trunk/; revision=6972
* add #include <sys/types.h> for freebsd.Chris Toshok2000-12-141-0/+1
| | | | | | | | | 2000-12-13 Chris Toshok <toshok@helixcode.com> * providers/imap/camel-imap-auth.c: add #include <sys/types.h> for freebsd. svn path=/trunk/; revision=6971
* Added #ifndef NO_WARNINGS around a #warning. Added (void) to the prototypeChristopher James Lahey2000-12-133-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-12-12 Christopher James Lahey <clahey@helixcode.com> * camel-folder-summary.c, camel-folder-summary.h: Added #ifndef NO_WARNINGS around a #warning. Added (void) to the prototype and declaration of camel_message_info_new. * camel-mime-message.h: Added an include for camel-mime-filter-bestenc.h. Added a prototype for camel_mime_message_set_best_encoding. Reformatted prototypes to line up. * camel-mime-parser.c: Added #if d(!)0 around the states string lookup table since it's only used in debugging output. * camel-seekable-substream.c (stream_flush): Added a cast. * providers/imap/camel-imap-auth.c: Added #include <netinet/in.h>. * providers/imap/camel-imap-folder.c (imap_refresh_info): Made uid and flags const to fix warnings here. * providers/imap/camel-imap-store.c (get_folder_info): Made p const to fix warnings here. svn path=/trunk/; revision=6954
* We want to bitwise-or the server and cached flags here so that we keep theJeffrey Stedfast2000-12-071-2/+6
| | | | | | | | | | | 2000-12-06 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (imap_refresh_info): We want to bitwise-or the server and cached flags here so that we keep the flags that we have set locally and set any additional flags that a parallel connection may have set. svn path=/trunk/; revision=6834
* (imap_refresh_info): Fix a really really really dumb bug.Dan Winship2000-12-061-1/+1
| | | | svn path=/trunk/; revision=6801
* use BODY.PEEK[] rather than RFC822, so the message doesn't get marked asDan Winship2000-12-061-2/+2
| | | | | | | | * providers/imap/camel-imap-folder.c (imap_get_message): use BODY.PEEK[] rather than RFC822, so the message doesn't get marked as \Seen. svn path=/trunk/; revision=6800
* Fix the check for "flags aren't actually changing".Dan Winship2000-12-061-2/+4
| | | | | | | | | | | | | | | * providers/imap/camel-imap-folder.c (imap_set_message_flags): Fix the check for "flags aren't actually changing". * providers/local/camel-local-folder.c (local_set_message_flags, local_set_message_user_flag, local_set_message_user_tag): Don't emit message_changed unless the flags actually changed. * providers/nntp/camel-nntp-folder.c (nntp_folder_set_message_flags): Don't emit message_changed unless the flags actually changed. Fix the check for marked as seen. svn path=/trunk/; revision=6797
* Fix a possible bug where 'name' could be uninitialized.Jeffrey Stedfast2000-12-011-1/+1
| | | | | | | | | | | | | | 2000-11-30 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-store.c (parse_list_response_as_folder_info): Fix a possible bug where 'name' could be uninitialized. * camel-folder-summary.c (camel_message_info_new): New convenience function, doesn't do much but it sure makes code cleaner to read. (camel_message_info_new_from_header): This one makes my life heaven. svn path=/trunk/; revision=6752
* Handle the case where the summary failed to load - clear the summary andJeffrey Stedfast2000-12-011-2/+6
| | | | | | | | | | | 2000-11-30 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-summary.c (camel_imap_summary_new): Handle the case where the summary failed to load - clear the summary and then set the dirty bit so that it is sure to save later. Is this the right fix? svn path=/trunk/; revision=6743
* Remove assertion that content is there, when it no longer can be.Not Zed2000-11-301-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-11-30 Not Zed <NotZed@HelixCode.com> * providers/local/camel-mbox-folder.c (mbox_get_message): Remove assertion that content is there, when it no longer can be. * camel-folder-summary.h: Removed pos/bodypos/endpos from camelmeessagecontentinfo. (CamelMessageFlags): Added an attachments flag. * providers/local/camel-local-summary.h: Added load virtual function. * tests/lib/folders.c (test_message_info): Accessors. (test_folder_message): " * camel-folder-thread.c (get_root_subject): Fix accessors. (dump_tree_rec): " * camel-folder-search.c (camel_folder_search_execute_expression): Accessors for messageinfo. (search_match_all): " (search_header_contains): " (search_header_contains): " (search_body_contains): " (camel_folder_search_execute_expression): Use mepool_strdup. * providers/local/camel-mbox-summary.c (summary_update): Accessors for messageinfo. (mbox_summary_sync_full): " * providers/local/camel-mh-summary.c (remove_summary): Accessors for messageinfo. (mh_summary_check): " (mh_summary_sync_message): " (mh_summary_sync): " * providers/local/camel-mh-folder.c (mh_append_message): Use accessor for uid. * providers/local/camel-local-summary.c (local_summary_decode_x_evolution): Use accessor to uid. (local_summary_encode_x_evolution): Likewise. (message_info_new): And here. (camel_local_summary_load): Call virtual load function. (local_summary_load): Default load function, load summary. (camel_local_summary_load): Check file exists before trying to load. (camel_local_summary_construct): Turn off building content info! (CAMEL_LOCAL_SUMMARY_VERSION): Bump, since we dont build content info anymore. (camel_local_summary_load): After a successful load/check, do a save too so we dont have to go through it again randomly. * providers/nntp/camel-nntp-utils.c (get_XOVER_headers): Use accessors for messageinfo. * providers/nntp/camel-nntp-folder.c (nntp_folder_get_uids): Use accessors for uid. * providers/imap/camel-imap-folder.c (imap_refresh_info): Use accessor for uid. (imap_sync): Likewise. (imap_get_uids): Likewise. (imap_update_summary): And here. * providers/vee/camel-vee-folder.c (vfolder_remove_match): Use accessor for uid. (vfolder_add_match): Handle estrv stuff. (vfolder_change_match): Accessor for uid. (get_real_message): " (vee_get_uids): " (vee_folder_build): " + estrv. (vee_folder_build_folder): " * providers/local/camel-maildir-folder.c (maildir_append_message): Use acccessors for uid's. (maildir_get_message): Here too. * providers/local/camel-maildir-summary.c (camel_maildir_summary_init): Setup the string count for us. (message_info_new): Access the string array directly. (message_info_free): No need to free string if using array. (camel_maildir_summary_info_to_name): Use accessor to get to uid. (remove_summary): And here. (maildir_summary_check): Likewise. (maildir_summary_sync): And here. (maildir_summary_load): Load up a cache of uid->filename mappings before loading the actual summary file. This saves us having to waste the diskspace storing the filenames in the summary itself, and also helps us sync the summary better on load. (message_info_load): If we have the load_map setup, and the uid exists, then set the filename cache from it, and update the flags from the name, incase our summary mismatches it. * camel-folder-summary.c (camel_folder_summary_init): Setup string count for compressed info record. An optional compile mode which stores all strings for a given messageinfo into a packed array, which should save 36-50 bytes/record. (camel_folder_summary_info_new): Init the string array. (message_info_new): Set the string array items, as required. (message_info_load): And here too. (message_info_save): Use accessors to get to strings. (message_info_free): Free strings as one. (camel_message_info_dup_to): Handle packed array case. (camel_folder_summary_add): Use accessors. And pack the strv before storing it. (summary_assign_uid): New function to assign a unique uid to a message, if it doesn't have one. (camel_folder_summary_add): Call assign_uid instead of doing it ourselves. (camel_folder_summary_info_new_from_parser): " (camel_folder_summary_info_new_from_message): " (camel_folder_summary_encode_string): constify. (camel_folder_summary_encode_token): " (summary_build_content_info_message): Fix accessors to messageinfo. (CAMEL_FOLDER_SUMMARY_VERSION): Bumped, for removal of contentinfo->pos data. (camel_folder_summary_info_new_from_parser): Calculate the size based on the parser position, not the removed contentinfo stuff. (camel_folder_summary_info_new_from_message): Remove size stuff. (camel_folder_summary_offset_content): Removed, no longer means anything. (content_info_new): (content_info_load): (content_info_save): (summary_build_content_info): Remove stuff for contentinfo->pos*. (summary_build_content_info): Take a msginfo argument, set attachments flag if we find any attachments. (summary_build_content_info_message): set attachments flag if we find any attachments. (camel_folder_summary_info_new_from_parser): Always scan the content info, even if we dont save it. (camel_folder_summary_info_new_from_message): And here too. (summary_build_content_info): Only create the contentinfo stuff if we have it turned on, otherwise just parse and discard. (summary_build_content_info_message): Likewise. svn path=/trunk/; revision=6731
* Fix some off-by-one-ness.Dan Winship2000-11-301-3/+3
| | | | | | | | | | * providers/imap/camel-imap-command.c (imap_read_untagged): Fix some off-by-one-ness. * camel-stream-buffer.c (stream_read): Fix another bug found in previously-unused code here. svn path=/trunk/; revision=6718
* Make this gratuitously more complicated. No wait, I mean, fix bugs. NowDan Winship2000-11-281-48/+89
| | | | | | | | | | | | | * providers/imap/camel-imap-command.c (imap_read_untagged): Make this gratuitously more complicated. No wait, I mean, fix bugs. Now fully handles NULs in the data stream (which "can't happen" but do) and also handles responses containing multiple literals. Also does less copying than the original code. * camel-stream-buffer.c (stream_read): Fix a bug that could make it lose sync and/or overrun buffers. svn path=/trunk/; revision=6688
* Fixed to return the correct bytecount in all cases which is the real fixJeffrey Stedfast2000-11-212-6/+3
| | | | | | | | | | | | | | | | 2000-11-20 Jeffrey Stedfast <fejj@helixcode.com> * camel-remote-store.c (remote_recv_line): Fixed to return the correct bytecount in all cases which is the real fix to imap_parse_nstring. * providers/imap/camel-imap-command.c (imap_read_untagged): Again, don't use strlen for the post-data, use 'n'. * providers/imap/camel-imap-utils.c (imap_parse_nstring): Undo my previous temp-fix. svn path=/trunk/; revision=6621
* lso make sure not to go past the end of the buffer ;-)Jeffrey Stedfast2000-11-171-1/+1
| | | | svn path=/trunk/; revision=6601
* When extracting a literal string, capture up until the end of the lastJeffrey Stedfast2000-11-171-0/+4
| | | | | | | | | | | | | | | | | | | | | 2000-11-17 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-utils.c (imap_parse_nstring): When extracting a literal string, capture up until the end of the last line - this we we don't lose any data if the byte count is off. * providers/imap/camel-imap-command.c (imap_read_untagged): Use the byte-read count to decrement the number of bytes left to read rather than using strlen. Not only does this protect against a DoS (embedded NUL chars in the literal string would make strlen inaccurate) but it also improves performace a little. * camel-remote-store.c (remote_recv_line): *Sigh* Return the number of bytes read on success rather than 0. Also don't use camel_stream_buffer_read_line since we can't get an accurate octet count. svn path=/trunk/; revision=6600
* Use the byte-read count to decrement the number of bytes left to readJeffrey Stedfast2000-11-171-5/+5
| | | | | | | | | | | | | | | | | 2000-11-17 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-command.c (imap_read_untagged): Use the byte-read count to decrement the number of bytes left to read rather than using strlen. Not only does this protect against a DoS (embedded NUL chars in the literal string would make strlen inaccurate) but it also improves performace a little. * camel-remote-store.c (remote_recv_line): *Sigh* Return the number of bytes read on success rather than 0. Also don't use camel_stream_buffer_read_line since we can't get an accurate octet count. svn path=/trunk/; revision=6599
* Fix error handling. (Only send a "*" to bail out of authentication if theDan Winship2000-11-101-9/+13
| | | | | | | | * providers/imap/camel-imap-auth.c (imap_try_kerberos_v4_auth): Fix error handling. (Only send a "*" to bail out of authentication if the server hasn't already bailed on us.) svn path=/trunk/; revision=6520
* Two segfault fixesPeter Williams2000-11-071-1/+1
| | | | svn path=/trunk/; revision=6472
* Add an "url_flags" field to CamelProvider. Move the CAMEL_SERVICE_URL_*Dan Winship2000-11-042-7/+5
| | | | | | | | | | | | | | | | | | | | * camel-provider.h: Add an "url_flags" field to CamelProvider. Move the CAMEL_SERVICE_URL_* defines here and remove the SERVICE_ part of the name. * camel-service.h: Remove CAMEL_SERVICE_URL_* flags and service->url_flags field. * camel-service.c (check_url, get_path): Get URL flags from service->provider, update for changed flag names. * providers/*/camel-*-provider.c: Add URL flags to provider structures. * providers/*/camel-*-{store,transport}.c, camel-remote-store.c: Remove service->url_flags initialization. svn path=/trunk/; revision=6370
* Quote foldernames when sending to the IMAP server because the folder nameJeffrey Stedfast2000-11-021-1/+1
| | | | | | | | | | 2000-11-02 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-store.c (get_folder_info): Quote foldernames when sending to the IMAP server because the folder name might contain spaces. svn path=/trunk/; revision=6344
* Remove old subbed folders from hash table after freeing them.Dan Winship2000-11-021-3/+11
| | | | | | | * providers/imap/camel-imap-store.c (get_folder_info): Remove old subbed folders from hash table after freeing them. svn path=/trunk/; revision=6335
* Deal correctly with namespace == ""Dan Winship2000-11-021-1/+1
| | | | | | | * providers/imap/camel-imap-folder.c (imap_get_full_name): Deal correctly with namespace == "" svn path=/trunk/; revision=6322
* Add a new argument, clean, that says whether or not to try to disconnectDan Winship2000-11-011-7/+7
| | | | | | | | | | | | | | | | | | * camel-service.c (service_disconnect): Add a new argument, clean, that says whether or not to try to disconnect cleanly. * camel-remote-store.c (remote_send_string, remote_send_stream, remote_recv_line): disconnect uncleanly on failure to prevent infinite loops when providers would normally send commands from disconnect(). Remove some unneeded CamelException goo. * providers/smtp/camel-smtp-transport.c (smtp_disconnect): * providers/pop3/camel-pop3-store.c (pop3_disconnect): * providers/nntp/camel-nntp-store.c (nntp_store_disconnect): * providers/imap/camel-imap-store.c (imap_disconnect): Don't send QUIT/LOGOUT if !clean. svn path=/trunk/; revision=6303
* Camel IMAP authentication includes (forgotten in last commit)Dan Winship2000-10-311-0/+39
| | | | svn path=/trunk/; revision=6275
* New file with code for IMAP authentication mechanisms. (Currently justDan Winship2000-10-314-84/+357
| | | | | | | | | | | | | | | | | | | | | * providers/imap/camel-imap-auth.c: New file with code for IMAP authentication mechanisms. (Currently just krb4, and without integrity/privacy protection). * providers/imap/Makefile.am: Add camel-imap-auth.[ch] and krb4 CFLAGS/LDFLAGS * providers/imap/camel-imap-store.c (connect_to_server): Split out from imap_connect. Just does the basic connect and CAPABILITY check. Redo the CAPABILITY code more robustly. (query_auth_types_connected): Do this right rather than punting to query_auth_types_generic. Check for KERBEROS_V4 if compiled with krb4 support. (query_auth_types_generic): Mention KERBEROS_V4 if compiled with krb4 support. (imap_connect): Use connect_to_server(). svn path=/trunk/; revision=6272
* Improved IMAP namespace handling: leave the namespace in theDan Winship2000-10-307-274/+297
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | folder names rather than constantly prepending it and stripping it off. Also some subscription fixes. * camel-store.c (camel_folder_info_build): Fix for the case where @top isn't in @folders. * providers/imap/camel-imap-folder.c (camel_imap_folder_new): Add a "short_name" argument rather than figuring it out ourselves. (imap_get_full_name): Implementation of CamelFolder::get_full_name that strips off namespace so the user doesn't have to see it. (imap_append_message, imap_copy_message_to, imap_move_message_to): Use folder->full_name rather than calling camel_imap_store_get_folder_path. * providers/imap/camel-imap-utils.c (imap_parse_list_response): Update this: make @flags a bitmask and @sep a char rather than a string. Make all of the out arguments optional. Handle literals in the server response. * providers/imap/camel-imap-store.c (imap_connect): Do a better job of getting the correct dir_sep for the namespace we're using. Construct a base_url here that will be used by get_folder_info. (camel_imap_store_folder_path): Removed (imap_folder_exists): Add an argument to return the short name of the folder (parsed out of the LIST response). Update for imap_parse_list_response change. (get_folder): Update for the various other changes. (get_folder_info): Update for the various other changes. Be more consistent about the returned layout: put everything underneath the "namespace" directory, including INBOX, even if it doesn't belong there. Don't destroy the list of subscribed folders until we've actually gotten the new list. (folder_subscribed, subscribe_folder, unsubscribe_folder): Use folder_name directly rather than camel_imap_store_folder_Path. * providers/imap/camel-imap-command.c (camel_imap_command): Update for folder name changes. svn path=/trunk/; revision=6256
* Fix folder listing code infinite loop.Dan Winship2000-10-261-1/+1
| | | | | | | * providers/imap/camel-imap-store.c (get_folder_info): Fix folder listing code infinite loop. svn path=/trunk/; revision=6178
* Add a "parent" field to CamelFolderInfo.Dan Winship2000-10-251-13/+18
| | | | | | | | | | | | | | | | | | | | | | * camel-store.h: Add a "parent" field to CamelFolderInfo. * camel-store.c (camel_folder_info_build): Deal with "parent" (camel_store_folder_subscribed, camel_store_subscribe_folder, camel_store_unsubscribe_folder): Add g_return_if_fails checking that the folder supports subscriptions. * providers/imap/camel-imap-store.c (folder_subscribed, subscribe_folder, unsubscribe_folder): Remove "+ 1"s since the mail subscribe UI won't prepend / to the folder names now. (get_folder_info): Clear the "parent" field of the folderinfos when removing an empty top level. * providers/nntp/camel-nntp-store.c (nntp_store_folder_subscribed, nntp_store_subscribe_folder, nntp_store_unsubscribe_folder): Remove "+ 1"s since the mail subscribe UI won't prepend / to the folder names now. svn path=/trunk/; revision=6167
* add subscribed_folders.Chris Toshok2000-10-252-4/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-10-24 Chris Toshok <toshok@helixcode.com> * providers/imap/camel-imap-store.h: add subscribed_folders. * providers/imap/camel-imap-store.c (camel_imap_store_class_init): fill in vtable entries for subscription functions. (camel_imap_store_finalize): new function, so we can free up our subscribed_folders hashtable. (camel_imap_store_init): set CAMEL_STORE_SUBSCRIPTIONS in the CamelStore flags, and create our subscribed_folders hashtable. (camel_imap_store_get_type): camel_imap_store_finalize is our finalize function. (get_folder_info): if we're looking at subscribed_only, clear out the subscribed_folders hashtable, use LSUB instead of LIST, and insert folder paths (prepended by their namespace if there is one) into subscribed_folders. INBOX subscription support needs work, since we always show it, regardless of it's subscribed state. (folder_subscribed): new function. just look up the folder_path in the hashtable. (subscribe_folder): new function. use the imap SUBSCRIBE command, and if successful add it to the hashtable. (unsubscribe_folder): new function. use the imap UNSUBSCRIBE command, and if successful remove it from the hashtable. svn path=/trunk/; revision=6157
* Fill in the message_count and unread_message_count flags (if !fast).Dan Winship2000-10-251-5/+34
| | | | | | | * providers/imap/camel-imap-store.c (get_folder_info): Fill in the message_count and unread_message_count flags (if !fast). svn path=/trunk/; revision=6151
* lots of i18n fixesDan Winship2000-10-244-23/+21
| | | | svn path=/trunk/; revision=6143
* Fix a "how could this have been working before" memory overrun bug foundDan Winship2000-10-241-0/+3
| | | | | | | | * providers/imap/camel-imap-command.c (imap_read_untagged): Fix a "how could this have been working before" memory overrun bug found by Vlad. svn path=/trunk/; revision=6129
* Fix a bug with "INBOX" (or anything else with NIL hierarchy separator) asDan Winship2000-10-201-1/+1
| | | | | | | | * providers/imap/camel-imap-utils.c (imap_parse_list_response): Fix a bug with "INBOX" (or anything else with NIL hierarchy separator) as the namespace. svn path=/trunk/; revision=6065
* Emit message_changed and folder_changed as appropriate.Dan Winship2000-10-201-2/+20
| | | | | | | * providers/imap/camel-imap-folder.c (imap_refresh_info): Emit message_changed and folder_changed as appropriate. svn path=/trunk/; revision=6064
* Update comment here so refresh_info isn't just for reconnects any more.Dan Winship2000-10-201-10/+19
| | | | | | | | | | | | | | | | | | | | | | * camel-folder.c (camel_folder_refresh_info): Update comment here so refresh_info isn't just for reconnects any more. Make the default implementation a no-op rather than an error. * providers/nntp/camel-nntp-folder.c: Move refresh_info impl into camel_nntp_folder_new, since it would have leaked memory and not done anything useful if it was called later. * providers/mbox/camel-mbox-folder.c: Remove no-longer-necessary refresh_info impl. * providers/imap/camel-imap-folder.c (camel_imap_folder_changed): Update imap_folder->exists, but don't actually load the new messages. This is a temporary workaround to deal with the IMAP provider stealing the message list focus at annoying times. (imap_copy_message_to, imap_move_message_to): Emit a folder_changed by hand, for now. svn path=/trunk/; revision=6046
* Build fixes from Jacob, same as the other branch.Ettore Perazzoli2000-10-201-0/+1
| | | | svn path=/trunk/; revision=6035
* No, we must not encode the headers here. These interfaces ARE rawNot Zed2000-10-181-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-10-18 Not Zed <NotZed@HelixCode.com> * camel-mime-part.c (add_header): No, we must not encode the headers here. These interfaces ARE raw interfaces as they are defined in camel_medium. Also removed a bogus/meaningless FIXME. (set_header): Likewise here, we must not. (process_header): Removed another bogus comment. * camel-object.c (shared_is_of_type): Comment out the spitting of a big warning when we're trying to determine types from code. * providers/mbox/camel-mbox-summary.c (message_info_new_from_parser): Only call ibex funcitons if we have an index. * providers/mh/camel-mh-summary.c (camel_mh_summary_add): Only call ibex functions if we have an index. (remove_summary): Likewise. (camel_mh_summary_check): Likewise. * providers/nntp/camel-nntp-store.c (nntp_store_get_folder): get_folder -> flags argument. * providers/vee/camel-vee-store.c (vee_get_folder): create->flags. * providers/pop3/camel-pop3-store.c (get_folder): Changed create -> flags. * providers/imap/camel-imap-store.c (get_folder): Added flags argument. * providers/mh/camel-mh-folder.c (camel_mh_folder_new): Added flags argument, and fixed code appropriately. * providers/mh/camel-mh-store.c (get_folder): Added flags argument. * camel-folder-search.c (message_body_contains): Perform a regex match on the contents of messages. This wont quite work yet as message contents are encoded when written to a stream. (build_match_regex): Converts a number of strings into a regex matching pattern, escaping special chars. (match_message): match a single message from a folder, by uid. Slow. (search_body_contains): Changed to support matching where no index is supplied. Matches are performed by retrieving message contents, etc. () WTF? camel should not be including any widget headers. * providers/mbox/camel-mbox-folder.c (camel_mbox_folder_new): Added flags argument. (mbox_refresh_info): Changed into a NOP, the refresh info code moved into the new function. (camel_mbox_folder_new): If we have an index requested, build one, otherwise, remove an old one, or just dont do anything. * providers/mbox/camel-mbox-store.c (get_folder): Changed create to flags, changed code to suit. * camel-store.c (camel_store_get_folder): Changed create to flags. (get_folder_internal): And here. (get_folder): And here too. * camel-store.h (camel_store_get_folder): Change the create argument to be a flags argument. svn path=/trunk/; revision=5978
* (camel_imap_folder_new): Move the summary creation to after theDan Winship2000-10-181-9/+9
| | | | | | | folder selection again, since it depends on the uidvalidity having been set. svn path=/trunk/; revision=5976
* Remove cached info at the end of the summary when the folder shrinksDan Winship2000-10-182-9/+14
| | | | | | | | | | | * providers/imap/camel-imap-folder.c (imap_refresh_info): Remove cached info at the end of the summary when the folder shrinks between sessions. Also remove an untrue comment. * providers/imap/camel-imap-store.c (get_folder): Fix up summary_file to not include the namespace twice. svn path=/trunk/; revision=5974
* Don't imap_next_word(respbuf + 2), instead use imap_next_word(respbuf) orJeffrey Stedfast2000-10-171-1/+1
| | | | | | | | | | | 2000-10-16 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-command.c (imap_read_response): Don't imap_next_word(respbuf + 2), instead use imap_next_word(respbuf) or else we'll skip over the second token. svn path=/trunk/; revision=5961
* Don't free 'resp' as it doesn't point to the beginning of the allocatedJeffrey Stedfast2000-10-171-10/+11
| | | | | | | | | | | | | | | | | 2000-10-16 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-command.c (camel_imap_response_extract): Don't free 'resp' as it doesn't point to the beginning of the allocated data, instead free response->untagged->pdata[i]. Also, if '*resp' is equal to a space character, then set resp = imap_next_word (resp) rather than expecting resp++ to work (there's a list broken IMAP daemons that like to put extra spaces between tokens). (imap_read_response): Don't expect 'respbuf+2' to be where the untagged number response to start (see above fix for an explanation). svn path=/trunk/; revision=5960
* Only send the LOGOUT command if the store is connected. (imap_connect):Jeffrey Stedfast2000-10-173-10/+28
| | | | | | | | | | | | | | | | | | | 2000-10-16 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-store.c (imap_disconnect): Only send the LOGOUT command if the store is connected. (imap_connect): Set the 'connected' state to TRUE when we successfully connect. (get_folder_info): if (!topfi), 'topfi' was allocated but then 'fi' was set. I think Dan meant to set topfi since fi is an uninitialized value at this point. * providers/imap/camel-imap-command.c (imap_read_response): Check for the untagged BYE response and set the 'connected' state to FALSE if we receive the BYE response. Return NULL if we get a BYE response. svn path=/trunk/; revision=5944
* Deal with the possibility of not getting a LIST response back for the topDan Winship2000-10-171-12/+14
| | | | | | | | * providers/imap/camel-imap-store.c (get_folder_info): Deal with the possibility of not getting a LIST response back for the top level. svn path=/trunk/; revision=5941
* Simple subclass of CamelFolderSummary that also keeps a UIDVALIDITY valueDan Winship2000-10-138-517/+541
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Removed temp_message_buffer, and content_input_stream fields which seem toNot Zed2000-10-121-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-10-11 Not Zed <NotZed@HelixCode.com> * camel-mime-part.h (struct _CamelMimePart): Removed temp_message_buffer, and content_input_stream fields which seem to have come from nowhere, and are unused. * camel-mime-utils.c: Added a note about touching this file. Nobody is to touch it without asking me first. That goes for you too Jeff. (header_decode_text): In what way is this broken? 2000-10-10 Not Zed <NotZed@HelixCode.com> * providers/imap/camel-imap-folder.c (imap_get_summary_internal): Fix camel_summary_* function rename (imap_get_message_info_internal): Likewise. * camel-mime-parser.c (camel_mime_parser_finalise): Fixed a spelling mistake. * camel-folder-summary.c (camel_summary_format_address): Uh, why do we encode and then decode here ... sigh. This is not the way to fix this. (camel_folder_summary_format_address): Renamed to a proper name, this was only supposed to be a private function. (camel_folder_summary_format_string): Likewise. Oh i see why it was made public, code reuse by cut & paste. Joy. svn path=/trunk/; revision=5881
* Quote the mailbox name as it may contain spaces. (imap_copy_message_to):Jeffrey Stedfast2000-10-121-2/+2
| | | | | | | | | | 2000-10-11 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (imap_move_message_to): Quote the mailbox name as it may contain spaces. (imap_copy_message_to): Same. svn path=/trunk/; revision=5853
* Check before deferencing the sep pointer.Joe Shaw2000-10-111-1/+2
| | | | | | | | | | 2000-10-10 Joe Shaw <joe@helixcode.com> * providers/imap/camel-imap-store.c (parse_list_response_as_folder_info): Check before deferencing the sep pointer. svn path=/trunk/; revision=5822
* add camel-nntp-grouplist.h (libcamelnntp_la_SOURCES): addChris Toshok2000-10-061-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-10-06 Chris Toshok <toshok@helixcode.com> * providers/nntp/Makefile.am (libcamelnntpinclude_HEADERS): add camel-nntp-grouplist.h (libcamelnntp_la_SOURCES): add camel-nntp-grouplist.c * providers/nntp/camel-nntp-provider.c: add our own hash functions for nntp urls. * providers/nntp/camel-nntp-newsrc.c (camel_nntp_newsrc_group_is_subscribed): new function. (camel_nntp_newsrc_subscribe_group): new function. (camel_nntp_newsrc_unsubscribe_group): new function. * providers/nntp/camel-nntp-newsrc.h: add prototypes for _group_is_subscribed, _subscribe_group, and _unsubscribe_group. * providers/nntp/camel-nntp-store.c (build_folder_info_from_grouplist): new function. (nntp_store_get_folder_info): add subscribed_only_parameter. if it's FALSE, load the grouplist and call build_folder_info_from_grouplist. (nntp_store_folder_subscribed): implement. (nntp_store_subscribe_folder): implement. (nntp_store_unsubscribe_folder): implement. (camel_nntp_store_init): add CAMEL_STORE_SUBSCRIPTIONS to the store's flags. * providers/mh/camel-mh-store.c (get_folder_info): add subscribed_only parameter. * providers/mbox/camel-mbox-store.c (get_folder_info): add subscribed_only parameter. * providers/imap/camel-imap-store.c (get_folder_info): add subscribed_only parameter. * camel-store.c (camel_store_supports_subscriptions): new function. (camel_store_folder_subscribed): new function. (camel_store_subscribe_folder): new function. (camel_store_unsubscribe_folder): new function. * camel-store.h: add prototypes and virtual functions for the subscribe implementation. also, add a subscribed_only argument to camel_store_get_folder_info. svn path=/trunk/; revision=5760
* IMAP4 (pre-rev1) doesn't support the 'LIST "" ""' idiom, so don't use it.Dan Winship2000-10-051-19/+28
| | | | | | | | * providers/imap/camel-imap-store.c (imap_connect): IMAP4 (pre-rev1) doesn't support the 'LIST "" ""' idiom, so don't use it. Just assume the dir_sep is '/'. Shrug. svn path=/trunk/; revision=5714
* Quote the mailbox name when sending a SELECT request otherwise mailboxesJeffrey Stedfast2000-10-041-1/+1
| | | | | | | | | | | | | | 2000-10-03 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-command.c (camel_imap_command): Quote the mailbox name when sending a SELECT request otherwise mailboxes with spaces in their names will cause problems. * camel-mime-message.c (camel_mime_message_set_reply_to): encode before setting. (camel_mime_message_set_from): Same. svn path=/trunk/; revision=5697
* New file containing camel_imap_command and friends. MajorDan Winship2000-10-048-1194/+713
| | | | | | | | | | | | | | | | | | | | | | | | * providers/imap/camel-imap-command.c: New file containing camel_imap_command and friends. Major camel_imap_command rewrite to remove duplicated code, make the parsing of literals be more safe/correct, deal with RECENT/EXPUNGE responses more consistently, and make it possible to implement the AUTHENTICATE command. * providers/imap/camel-imap-utils.c (imap_parse_nstring): New function, to parse an IMAP "nstring". * providers/imap/camel-imap-store.c: Move command stuff to camel-imap-command.c. Update for camel_imap_command changes. * providers/imap/camel-imap-folder.c: Update for camel_imap_command changes. (imap_append_message): CRLF filter the message before sending it. * providers/imap/Makefile.am: Add camel-imap-command.[ch], remove camel-imap-stream.[ch] for now. svn path=/trunk/; revision=5693
* Remove default_ports.Dan Winship2000-10-032-1/+3
| | | | | | | | | | | | | | * camel-provider.h: Remove default_ports. * camel-remote-store.c (remote_connect): Get default_port from CamelRemoteStore rather than CamelProvider. * providers/{imap,nntp,pop3}/camel-*-store.c: Initialize CamelRemoteStore::default_port * providers/*/camel-*-provider.c: Remove default_ports. svn path=/trunk/; revision=5669
* Remove camel_folder_{get,free}_subfolder_info, as we want to be able toDan Winship2000-10-035-159/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * camel-folder.[ch]: Remove camel_folder_{get,free}_subfolder_info, as we want to be able to scan the whole subfolder tree without having to open any folders, so this needs to be in CamelStore. Remove can_hold_folders and can_hold_messages flags; things that don't hold messages are no longer considered CamelFolders. * camel-folder-summary.[ch]: Remove CamelFolderInfo stuff. * camel-store.[ch]: Add camel_store_{get,free}_folder_info, as well as camel_store_free_folder_info_full and ..._nop for default implementations, and camel_folder_info_free and camel_folder_info_build as convenience functions. Turn CamelFolderInfo into a tree structure and also add an "url" member. * providers/*/camel-*-folder.c: Remove subfolder_info and can_hold stuff. * providers/*/camel-*-store.c: Add folder_info stuff. * providers/imap/camel-imap-folder.c (imap_summary_free): Free the summary elements with camel_message_info_free, not camel_folder_info_free. Oops. * providers/imap/camel-imap-utils.c: const poison svn path=/trunk/; revision=5663
* When getting a literal string response, don't include the \r\n after theJeffrey Stedfast2000-09-293-1/+10
| | | | | | | | | | | | 2000-09-28 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (imap_get_message): When getting a literal string response, don't include the \r\n after the closing } (as in: "... {798}\r\n...") * providers/imap/camel-imap-stream.c (stream_read): Same. svn path=/trunk/; revision=5621
* Return untagged data in a GPtrArray rather than a string, since it savesDan Winship2000-09-284-142/+191
| | | | | | | | | | | | | | | | | | | | | | | | | * providers/imap/camel-imap-store.c (camel_imap_command_extended): Return untagged data in a GPtrArray rather than a string, since it saves processing time and is much easier to deal with for several commands. Update for camel_imap_folder_changed change. (camel_imap_fetch_command): Update for camel_imap_folder_changed change. (imap_connect, imap_folder_exists): Update for camel_imap_command_extended change. * providers/imap/camel-imap-folder.c (imap_get_message_count_internal, imap_get_subfolder_info_internal, imap_search_by_expression): Update for camel_imap_command_extended change. (imap_get_summary_internal, imap_get_message_info_internal): Use camel_imap_fetch_command here now to get around the camel_imap_command_extended change. (camel_imap_folder_changed): turn expunged into a GArray of ints rather than a GPtrArray of strings representing ints. svn path=/trunk/; revision=5608
* Quote the folder name as it may contain spaces.Jeffrey Stedfast2000-09-271-22/+21
| | | | | | | | | | | | | | | | | | | | 2000-09-26 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (imap_get_message_count_internal): Quote the folder name as it may contain spaces. (imap_get_subfolder_info_internal): Same. * providers/imap/camel-imap-utils.c (imap_parse_list_response): Do proper unquoting for folder names. (func_get_current_date): Implemented. * providers/imap/camel-imap-store.c (imap_folder_exists): Quote the folder name as it may have spaces. (imap_create): Same. (check_current_folder): Same. svn path=/trunk/; revision=5592
* Again...wrap the folder names in quotesJeffrey Stedfast2000-09-233-8/+9
| | | | | | | | | | | | | | | | | | | | 2000-09-22 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (imap_get_message_count_internal): Again...wrap the folder names in quotes * providers/imap/camel-imap-store.c (imap_folder_exists): Wrap the mailbox name in the LIST command in quotes just in case the folder has spaces in the name. (imap_create): Again, wrap folder name in quotes. (check_current_folder): Same... * providers/imap/camel-imap-utils.c (imap_parse_list_response): Update to unquote mailbox if it's quoted (allows us to get folders with spaces in the name). svn path=/trunk/; revision=5556
* The root folder's name is "", not the namespace. (camel_imap_folder_new):Dan Winship2000-09-233-11/+7
| | | | | | | | | | | | | * providers/imap/camel-imap-folder.c (imap_get_subfolder_info_internal): The root folder's name is "", not the namespace. (camel_imap_folder_new): constify folder_name. * providers/imap/camel-imap-store.c (get_folder): Create the folder with folder_name, not folder_path. (camel_imap_command_preliminary): Don't free cmdid here. svn path=/trunk/; revision=5552
* New function to convert Camel flags to an IMAP flag_list.Dan Winship2000-09-224-223/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | * providers/imap/camel-imap-utils.c (imap_create_flag_list): New function to convert Camel flags to an IMAP flag_list. (imap_parse_flag_list): Contrariwise. * providers/imap/camel-imap-store.c (camel_imap_command_*): Make the @ret arg actually optional, as (mostly) documented. (various): Don't pass "&result" to camel_imap_command_* if we're just going to immediately free it. Don't record status if we're not going to look at it. * providers/imap/camel-imap-folder.c: Likewise. (imap_summary_free): Use camel_folder_info_free. (imap_sync): Use imap_create_flag_list. Clear CAMEL_MESSAGE_FOLDER_FLAGGED after syncing so we don't keep re-syncing. (imap_append_message): Use imap_create_flag_list. Don't leak the memstream if the append fails. (imap_move_message_to): Use camel_folder_delete_message rather than doing it by hand. (imap_get_summary_internal, imap_get_message_info_internal): Use imap_parse_flag_list and header_raw_clear. (camel_imap_folder_changed): Use camel_message_info_free. svn path=/trunk/; revision=5544
* INBOX is case-insensitive. (get_root_folder_name): Make the root folder ""Dan Winship2000-09-223-263/+110
| | | | | | | | | | | | | | | | | | | | | | | | * providers/imap/camel-imap-store.c (get_folder_name): INBOX is case-insensitive. (get_root_folder_name): Make the root folder "" rather than "/". (get_folder): Update for root folder name change. (camel_imap_store_get_toplevel_dir): Removed. (Unused, unneeded.) (camel_imap_store_folder_path): New function to turn a Camel folder name into the corresponding namespaced IMAP path. (imap_folder_exists): Make this take a store and a path rather than a folder. (imap_create): Likewise (get_folder): Update for camel_imap_store_folder_path and other changes. (check_current_folder): Likewise. * providers/imap/camel-imap-folder.c: Change a bunch of CamelStore variables to CamelImapStore (and add a few more) to prevent excess gratuitous casting. Use camel_imap_store_folder_path where appropriate. (camel_imap_folder_new): Update for root folder name change. svn path=/trunk/; revision=5541
* Fix the case where INBOX isn't returned in the folder listing.Dan Winship2000-09-201-1/+6
| | | | | | | | * providers/imap/camel-imap-folder.c (imap_get_subfolder_info_internal): Fix the case where INBOX isn't returned in the folder listing. svn path=/trunk/; revision=5505
* Removed (camel_folder_init, camel_folder_construct): New object initDan Winship2000-09-203-74/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * camel-folder.c: (init): Removed (camel_folder_init, camel_folder_construct): New object init function and public object constructor to replace the old init method in a more Gtk-like fashion. (get_parent_folder, camel_folder_get_parent_folder): Removed. No CamelFolder subclass was ever setting the parent_folder member, no code has ever needed to look at it, and fixing it would actually be pretty hard. (get_subfolder_info, camel_folder_get_subfolder_info): Renamed from ..._names. Deals in CamelFolderInfo now. (free_subfolder_info, camel_folder_free_subfolder_info): Likewise. (get_subfolder, camel_folder_get_subfolder): Removed. CamelFolderInfo contains the subfolder's full name, so this is unnecessary now, and removing it lets us get rid of the CamelFolder separator member, which is needed for the default implementation of this function, but not otherwise needed for most providers. Also, lots of code style fixes. * providers/*: Update CamelFolder subclasses for changes, although none of them fill in the message counts in the CamelFolderInfo yet. svn path=/trunk/; revision=5503
* Added check for gnome-app-lib. Removed directories that have been moved toChristopher James Lahey2000-09-182-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-09-18 Christopher James Lahey <clahey@helixcode.com> * configure.in: Added check for gnome-app-lib. Removed directories that have been moved to gal. From addressbook/ChangeLog: 2000-09-18 Christopher James Lahey <clahey@helixcode.com> * backend/ebook/Makefile.am, contact-editor/Makefile.am, ename/Makefile.am, gui/component/Makefile.am, gui/widgets/Makefile.am: Added $(EXTRA_GNOME_CFLAGS) and $(EXTRA_GNOME_LIBS). Removed unneeded libraries. * backend/ebook/e-card.c, backend/pas/pas-backend-file.c, contact-editor/e-contact-editor-address.c, contact-editor/e-contact-editor-categories.c, contact-editor/e-contact-editor-categories.h, contact-editor/e-contact-editor-fullname.c, contact-editor/e-contact-editor.c, contact-editor/e-contact-save-as.c, ename/e-address-western.c, ename/test-ename-western-gtk.c, gui/component/addressbook-factory.c, gui/component/addressbook.c, gui/component/e-cardlist-model.h, gui/component/e-ldap-storage.c, gui/component/select-names/e-select-names-bonobo.c, gui/component/select-names/e-select-names-manager.c, gui/component/select-names/e-select-names-model.c, gui/component/select-names/e-select-names-table-model.c, gui/component/select-names/e-select-names-table-model.h, gui/component/select-names/e-select-names-text-model.h, gui/component/select-names/e-select-names.c, gui/component/select-names/e-select-names.h, gui/search/e-addressbook-search-dialog.c, gui/widgets/e-addressbook-model.h, gui/widgets/e-addressbook-view.c, gui/widgets/e-minicard-label.c, gui/widgets/e-minicard-view-widget.c, gui/widgets/e-minicard-view-widget.h, gui/widgets/e-minicard-view.c, gui/widgets/e-minicard-view.h, gui/widgets/e-minicard-widget.h, gui/widgets/e-minicard.c, gui/widgets/test-minicard-label.c, gui/widgets/test-reflow.c, printing/e-contact-print.c: Fixed the #include lines to deal properly with gal. From calendar/ChangeLog: 2000-09-18 Christopher James Lahey <clahey@helixcode.com> * gui/Makefile.am: Added $(EXTRA_GNOME_CFLAGS) and $(EXTRA_GNOME_LIBS). Removed unneeded libraries. * gui/calendar-model.h, gui/e-calendar-table.c, gui/e-day-view.c, gui/e-week-view-event-item.c, gui/e-week-view.c, gui/event-editor.c, gui/gncal-todo.c, gui/gnome-cal.c, gui/main.c, gui/print.c, gui/dialogs/task-editor.c: Fixed the #include lines to deal properly with gal. * gui/check-filled.xpm: New file since we can't include it from e-table anymore. From camel/ChangeLog: 2000-09-18 Christopher James Lahey <clahey@helixcode.com> * camel-folder-search.c, camel-folder-search.h, camel-remote-store.c, providers/imap/camel-imap-folder.c, providers/imap/camel-imap-store.c: Fixed the #include lines to deal properly with gal. From composer/ChangeLog: 2000-09-18 Christopher James Lahey <clahey@helixcode.com> * Makefile.am: Added $(EXTRA_GNOME_CFLAGS) and $(EXTRA_GNOME_LIBS). Removed unneeded libraries. * e-msg-composer-address-dialog.c, e-msg-composer-address-entry.c, e-msg-composer-attachment.c, e-msg-composer-hdrs.c, e-msg-composer.c: Fixed the #include lines to deal properly with gal. From e-util/ChangeLog: 2000-09-18 Christopher James Lahey <clahey@helixcode.com> * Makefile.am: Removed all the files moved to gal. * e-dialog-widgets.c: Fixed the #include lines to deal properly with gal. * e-gui-utils.c, e-gui-utils.h: Removed all of the functionality that was moved to gal. * e-canvas-utils.c, e-canvas-utils.h, e-canvas-vbox.c, e-canvas-vbox.h, e-canvas.c, e-canvas.h, e-cursors.c, e-cursors.h, e-font.c, e-font.h, e-popup-menu.c, e-popup-menu.h, e-printable.c, e-printable.h, e-unicode.c, e-unicode.h, e-util.c, e-util.h, e-xml-utils.c, e-xml-utils.h: Moved to gal. From filter/ChangeLog: 2000-09-18 Christopher James Lahey <clahey@helixcode.com> * filter-editor.c, filter-filter.c, filter-folder.c, filter-input.c, filter-message-search.c, filter-option.c, filter-rule.c, score-editor.c, vfolder-editor.c, vfolder-rule.c: Fixed the #include lines to deal properly with gal. From mail/ChangeLog: 2000-09-18 Christopher James Lahey <clahey@helixcode.com> * Makefile.am: Added $(EXTRA_GNOME_CFLAGS) and $(EXTRA_GNOME_LIBS). Removed unneeded libraries. * component-factory.c, folder-browser-factory.c, folder-browser.c, mail-callbacks.c, mail-config-gui.c, mail-display.c, mail-display.h, main.c, message-list.c, message-list.h: Fixed the #include lines to deal properly with gal. From po/ChangeLog: 2000-09-18 Christopher James Lahey <clahey@helixcode.com> * POTFILES.in: Removed files that have been moved to gal. From shell/ChangeLog: 2000-09-18 Christopher James Lahey <clahey@helixcode.com> * Makefile.am: Added $(EXTRA_GNOME_CFLAGS) and $(EXTRA_GNOME_LIBS). Removed unneeded libraries. * e-component-registry.c, e-corba-storage-registry.c, e-corba-storage.c, e-folder-type-registry.c, e-folder.c, e-local-folder.c, e-local-storage.c, e-shell-folder-creation-dialog.c, e-shell-folder-selection-dialog.c, e-shell-folder-title-bar.c, e-shell-view.c, e-shell.c, e-shortcuts-view.c, e-shortcuts.c, e-storage-set-view.c, e-storage-set-view.h, e-storage-set.c, e-storage.c, evolution-local-storage.c, evolution-session.c, evolution-shell-client.c, evolution-shell-component-client.c, evolution-shell-component.c, evolution-shell-view.c, evolution-storage-listener.c, evolution-storage.c, main.c: Fixed the #include lines to deal properly with gal. From widgets/meeting-time-sel/ChangeLog: 2000-09-18 Christopher James Lahey <clahey@helixcode.com> * Makefile.am: Added $(EXTRA_GNOME_CFLAGS) and $(EXTRA_GNOME_LIBS). Removed unneeded libraries. * e-meeting-time-sel-list-item.c, e-meeting-time-sel.c, e-meeting-time-sel.h: Fixed the #include lines to deal properly with gal. If you've read this far, you deserve a prize. The first email in my mailbox with the subject "What a commit message!" (and your physical mailing address somewhere in the message) will receive a free Helix Code T-shirt mailed to anywhere within the continental United States. I cannot be held responsible for problems with email systems anywhere. This is supposed to be for fun, so please don't make a fuss if something goes wrong and your mail doesn't reach me. Find my email elsewhere in this message, and if it's been more than a few days, you're probably too late. From widgets/misc/ChangeLog: 2000-09-18 Christopher James Lahey <clahey@helixcode.com> * Makefile.am: Added $(EXTRA_GNOME_CFLAGS) and $(EXTRA_GNOME_LIBS). Removed unneeded libraries. * e-calendar-item.c, e-calendar.c, e-calendar.h, e-title-bar.c: Fixed the #include lines to deal properly with gal. * e-scroll-frame.c, e-scroll-frame.h: Moved to gal. From widgets/shortcut-bar/ChangeLog: 2000-09-18 Christopher James Lahey <clahey@helixcode.com> * Makefile.am: Added $(EXTRA_GNOME_CFLAGS) and $(EXTRA_GNOME_LIBS). Removed unneeded libraries. * e-icon-bar.c, e-icon-bar.h, e-shortcut-bar.c, e-shortcut-model.c, test-shortcut-bar.c: Fixed the #include lines to deal properly with gal. From widgets/ChangeLog: 2000-09-18 Christopher James Lahey <clahey@helixcode.com> * Makefile.am: Removed directories that have been moved to gal. * e-paned/.cvsignore, e-paned/Makefile.am, e-paned/e-hpaned.c, e-paned/e-hpaned.h, e-paned/e-paned.c, e-paned/e-paned.h, e-paned/e-vpaned.c, e-paned/e-vpaned.h: Moved to gal. * e-reflow/.cvsignore, e-reflow/Makefile.am, e-reflow/e-reflow-sorted.c, e-reflow/e-reflow-sorted.h, e-reflow/e-reflow.c, e-reflow/e-reflow.h: Moved to gal. * e-table/.cvsignore, e-table/ChangeLog, e-table/LICENSE, e-table/Makefile.am, e-table/ROADMAP.e-table, e-table/TODO, e-table/add-col.xpm, e-table/arrow-down.xpm, e-table/arrow-up.xpm, e-table/check-empty.xpm, e-table/check-filled.xpm, e-table/clip.png, e-table/e-cell-checkbox.c, e-table/e-cell-checkbox.h, e-table/e-cell-string.c, e-table/e-cell-text.c, e-table/e-cell-text.h, e-table/e-cell-toggle.c, e-table/e-cell-toggle.h, e-table/e-cell-tree.c, e-table/e-cell-tree.h, e-table/e-cell.c, e-table/e-cell.h, e-table/e-table-click-to-add.c, e-table/e-table-click-to-add.h, e-table/e-table-col-dnd.h, e-table/e-table-col.c, e-table/e-table-col.h, e-table/e-table-column-model.h, e-table/e-table-column.c, e-table/e-table-config.c, e-table/e-table-config.glade, e-table/e-table-config.glade.h, e-table/e-table-config.h, e-table/e-table-defines.h, e-table/e-table-example-1.c, e-table/e-table-example-2.c, e-table/e-table-field-chooser-dialog.c, e-table/e-table-field-chooser-dialog.h, e-table/e-table-field-chooser-item.c, e-table/e-table-field-chooser-item.h, e-table/e-table-field-chooser.c, e-table/e-table-field-chooser.glade, e-table/e-table-field-chooser.glade.h, e-table/e-table-field-chooser.h, e-table/e-table-group-container.c, e-table/e-table-group-container.h, e-table/e-table-group-leaf.c, e-table/e-table-group-leaf.h, e-table/e-table-group.c, e-table/e-table-group.glade, e-table/e-table-group.glade.h, e-table/e-table-group.h, e-table/e-table-header-item.c, e-table/e-table-header-item.h, e-table/e-table-header.c, e-table/e-table-header.h, e-table/e-table-item.c, e-table/e-table-item.h, e-table/e-table-model.c, e-table/e-table-model.h, e-table/e-table-one.c, e-table/e-table-one.h, e-table/e-table-scrolled.c, e-table/e-table-scrolled.h, e-table/e-table-selection-model.c, e-table/e-table-selection-model.h, e-table/e-table-simple.c, e-table/e-table-simple.h, e-table/e-table-size-test.c, e-table/e-table-sort-info.c, e-table/e-table-sort-info.h, e-table/e-table-sorted-variable.c, e-table/e-table-sorted-variable.h, e-table/e-table-sorted.c, e-table/e-table-sorted.h, e-table/e-table-sorter.c, e-table/e-table-sorter.h, e-table/e-table-subset-variable.c, e-table/e-table-subset-variable.h, e-table/e-table-subset.c, e-table/e-table-subset.h, e-table/e-table-text-model.c, e-table/e-table-text-model.h, e-table/e-table-tooltip.h, e-table/e-table-tree.h, e-table/e-table.c, e-table/e-table.h, e-table/e-tree-example-1.c, e-table/e-tree-example-2.c, e-table/e-tree-model.c, e-table/e-tree-model.h, e-table/e-tree-simple.c, e-table/e-tree-simple.h, e-table/image1.png, e-table/image2.png, e-table/image3.png, e-table/remove-col.xpm, e-table/sample.table, e-table/table-test.c, e-table/table-test.h, e-table/test-check.c, e-table/test-cols.c, e-table/test-table.c: Moved to gal. * e-text/.cvsignore, e-text/Makefile.am, e-text/e-entry-test.c, e-text/e-entry.c, e-text/e-entry.h, e-text/e-text-event-processor-emacs-like.c, e-text/e-text-event-processor-emacs-like.h, e-text/e-text-event-processor-types.h, e-text/e-text-event-processor.c, e-text/e-text-event-processor.h, e-text/e-text-model.c, e-text/e-text-model.h, e-text/e-text-test.c, e-text/e-text.c, e-text/e-text.h: Moved to gal. i.e., ... changed evolution to work with gal. svn path=/trunk/; revision=5490
* Don't use dir_sep as top-level directory, use "/".Jeffrey Stedfast2000-09-152-8/+5
| | | | | | | | | | | | 2000-09-14 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-store.c (get_folder): Don't use dir_sep as top-level directory, use "/". * providers/imap/camel-imap-folder.c (imap_expunge): Get rid of unused variable. svn path=/trunk/; revision=5437
* Don't look at the response of the command. camel_imap_command_extended()Dan Winship2000-09-151-80/+2
| | | | | | | | | * providers/imap/camel-imap-folder.c (imap_expunge): Don't look at the response of the command. camel_imap_command_extended() processes EXPUNGE responses itself, so if we do it here too we remove twice as many summary items as we should. svn path=/trunk/; revision=5432
* Rewrote to take a third argument (gboolean *selectable) so that we canJeffrey Stedfast2000-09-142-21/+95
| | | | | | | | | | | | | | | | | | | | | | | 2000-09-13 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-store.c (imap_folder_exists): Rewrote to take a third argument (gboolean *selectable) so that we can find out if the folder is selectable or not as we look to see if it exists. Also, don't use EXAMINE because that will not work on non-selectable folders, so use LIST instead. (get_folder): Check to see if the folder exists even vefore calling imap_create as this will save time. If the folder does exist, find out if it's selectable. Moved the call to refresh_info here. * providers/imap/camel-imap-folder.c (imap_get_uids): Check for a NULL summary. (camel_imap_folder_new): Don't call refresh_info here - call it in get_folder() because we don't know if this folder even exists on the server yet! And even if it does, we don't know if it can hold messages or not yet. svn path=/trunk/; revision=5412
* Cleanup of lots of exception handling ; bugfixesPeter Williams2000-09-063-7/+20
| | | | svn path=/trunk/; revision=5202
* Removed some unused functions.Christopher James Lahey2000-09-021-45/+0
| | | | | | | | | 2000-09-01 Christopher James Lahey <clahey@helixcode.com> * providers/imap/camel-imap-utils.c: Removed some unused functions. svn path=/trunk/; revision=5169
* Reimplemented. It should now work correctly for most possible VFolderJeffrey Stedfast2000-09-011-175/+327
| | | | | | | | | | 2000-08-31 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-utils.c (imap_translate_sexp): Reimplemented. It should now work correctly for most possible VFolder rules. svn path=/trunk/; revision=5151
* Don't save any exceptions caused by camel_imap_folder_changedJeffrey Stedfast2000-08-312-10/+40
| | | | | | | | | | | | | | | 2000-08-31 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-store.c (camel_imap_command_extended): Don't save any exceptions caused by camel_imap_folder_changed (camel_imap_fetch_command): Same. * providers/imap/camel-imap-folder.c (camel_imap_folder_changed): Using a new way of calculating the first recent message that seems more accurate. Also added code to make sure we don't accidently add a duplicate summary. svn path=/trunk/; revision=5135
* Rewrote to ignore strings that look like server responses until it is sureJeffrey Stedfast2000-08-312-12/+63
| | | | | | | | | | 2000-08-30 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-store.c (camel_imap_fetch_command): Rewrote to ignore strings that look like server responses until it is sure that it has finished reading the literal string response. svn path=/trunk/; revision=5124
* Don't wrap printed strings in quotes, makes things messyJeffrey Stedfast2000-08-314-133/+433
| | | | | | | | | | | | | | | | | | | | | | 2000-08-30 Jeffrey Stedfast <fejj@helixcode.com> * camel-remote-store.c (remote_send_string): Don't wrap printed strings in quotes, makes things messy * providers/imap/camel-imap-folder.c (imap_get_message): Updated to use the camel_imap_fetch_command * providers/imap/camel-imap-stream.c (stream_read): Updated to use camel_imap_fetch_command * providers/imap/camel-imap-store.c (camel_imap_command_extended): No longer handles FETCH requests so no longer needs to be concerned with checking to make sure that server responses are valid (they have to be). (camel_imap_fetch_command): New convenience function that handles all FETCH requests svn path=/trunk/; revision=5122
* Make CamelServices connect only when told to (old behavior). Make ↵Peter Williams2000-08-311-17/+20
| | | | | | CamelRemoteStore do its stuff in service::connect, not ::post_connect. svn path=/trunk/; revision=5116
* General cleanup / moving stuff around to make things easier to follow.Jeffrey Stedfast2000-08-311-41/+56
| | | | | | | | | 2000-08-30 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-store.c: General cleanup / moving stuff around to make things easier to follow. svn path=/trunk/; revision=5115
* Prevent exceptions from being overwrittenJeffrey Stedfast2000-08-303-123/+145
| | | | | | | | | | | | 2000-08-30 Jeffrey Stedfast <fejj@helixcode.com> * camel-remote-store.c: Prevent exceptions from being overwritten * providers/imap/camel-imap-folder.c (imap_expunge): Beautified (imap_get_subfolder_names_internal): Removed old code as the replacement code has now been tested and proven to work svn path=/trunk/; revision=5107
* Removed old code that will never be needed againJeffrey Stedfast2000-08-302-212/+90
| | | | | | | | | | | | | | 2000-08-29 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-utils.c: Removed old code that will never be needed again * providers/imap/camel-imap-store.c: Removed old code for try_connect - will never need this code (slurp_response): Update to make sure we aren't falsely detecting EXPUNGE flags svn path=/trunk/; revision=5106
* CamelRemoteStore: a new generic store for stores that connect to servers. ↵Peter Williams2000-08-304-838/+402
| | | | | | Prepare for the ability to cancel operations (much better exception handling). Clean up IMAP like nobody's business svn path=/trunk/; revision=5103
* Updated to check for EXPUNGE notificationsJeffrey Stedfast2000-08-303-19/+70
| | | | | | | | | | | | | | | | | | | | 2000-08-29 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-store.c (camel_imap_command_extended): Updated to check for EXPUNGE notifications * providers/imap/camel-imap-folder.c (camel_imap_folder_changed): Updated to account for messages which have been expunged (now takes a new arg, a GPtrArray of message id's that have been expunged) (imap_expunge): Updated (we may want to just use the code in folder_changed now instead of doing our own summary expunging...but that can be fixed later) (imap_append_message): Updated. (imap_copy_message_to): Updated. (imap_move_message_to): Updated. svn path=/trunk/; revision=5098
* Fixed the hack around quoted string responses - should now handle themJeffrey Stedfast2000-08-292-165/+158
| | | | | | | | | | | | | 2000-08-28 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (imap_get_message): Fixed the hack around quoted string responses - should now handle them according to the specifications in the RFC * providers/imap/camel-imap-stream.c (stream_read): Updated to match the code currently used in camel-imap-folder.c svn path=/trunk/; revision=5092
* Add support for specifying on which port to connect to a server; fix a ↵Peter Williams2000-08-261-0/+1
| | | | | | potential infinite loop in unicode. svn path=/trunk/; revision=5041
* If the url path is "/" and the folder path is "/", just LIST "" "*" (thisJeffrey Stedfast2000-08-261-2/+2
| | | | | | | | | | | | 2000-08-25 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (imap_get_subfolder_names_internal): If the url path is "/" and the folder path is "/", just LIST "" "*" (this should fix some cyrus imapd problems). Also, INBOX is case insensitive so use g_strcasecmp svn path=/trunk/; revision=5038
* If the url path is "/" and the folder path is "/", just LIST "" "*" (thisJeffrey Stedfast2000-08-261-7/+31
| | | | | | | | | | | 2000-08-25 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (imap_get_subfolder_names_internal): If the url path is "/" and the folder path is "/", just LIST "" "*" (this should fix some cyrus imapd problems) svn path=/trunk/; revision=5036
* use BODY.PEEK, not BODY, so we don't set the message \Seen.Dan Winship2000-08-231-1/+1
| | | | | | | | * providers/imap/camel-imap-folder.c (imap_protocol_get_summary_specifier): use BODY.PEEK, not BODY, so we don't set the message \Seen. svn path=/trunk/; revision=4970
* Automatically connect services when given a valid URL (should hopefully ↵Peter Williams2000-08-231-13/+31
| | | | | | disconnect, too); remove the old movemail folder correctly. svn path=/trunk/; revision=4965
* Whole buncha leak fixes thanks to PurifyMatthew Loper2000-08-171-2/+3
| | | | svn path=/trunk/; revision=4862
* Add support for copying messagesPeter Williams2000-08-161-1/+1
| | | | svn path=/trunk/; revision=4845
* do a strcasecmp rather than just a strcmp when checking if a folder isDan Winship2000-08-141-1/+1
| | | | | | | | | * providers/imap/camel-imap-folder.c (imap_get_subfolder_names_internal): do a strcasecmp rather than just a strcmp when checking if a folder is "INBOX", since it is a case-insensitive name. svn path=/trunk/; revision=4801
* (imap_get_subfolder_names_internal): Add "INBOX" to the list asDan Winship2000-08-131-1/+1
| | | | | | g_malloc'ed memory, not a static string. svn path=/trunk/; revision=4792
* Don't assume the FETCH results will come back in the order they wereDan Winship2000-08-131-2/+2
| | | | | | | | * providers/imap/camel-imap-folder.c (imap_get_summary_internal): Don't assume the FETCH results will come back in the order they were requested. svn path=/trunk/; revision=4791
* Now takes a char * parameter rather than a streamJeffrey Stedfast2000-08-133-8/+115
| | | | | | | | | | | | | | | 2000-08-12 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-store.c (camel_imap_command_continuation): Now takes a char * parameter rather than a stream (camel_imap_command_continuation_with_stream): Same function as above but takes a stream parameter instead * providers/imap/camel-imap-folder.c (imap_append_message): Use camel_imap_command_continuation_with_stream svn path=/trunk/; revision=4786
* No longer calls try_connect() to get authtypesJeffrey Stedfast2000-08-131-2/+4
| | | | | | | | | 2000-08-12 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-store.c (query_auth_types): No longer calls try_connect() to get authtypes svn path=/trunk/; revision=4782
* Changed param order a bit and fixed some logicJeffrey Stedfast2000-08-123-28/+53
| | | | | | | | | | | | | 2000-08-11 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-store.c (camel_imap_command_continuation): Changed param order a bit and fixed some logic * providers/imap/camel-imap-folder.c (imap_append_message): Use the new multi-transactional convenience functions svn path=/trunk/; revision=4766
* New convenience function for multi-transactional commands (openingJeffrey Stedfast2000-08-123-33/+209
| | | | | | | | | | | | 2000-08-11 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-store.c (camel_imap_command_preliminary): New convenience function for multi-transactional commands (opening request) (camel_imap_command_continuation): New convenience function for multi-transactional commands (followup data) svn path=/trunk/; revision=4762
* If we go over the max number of messages, don't keep requesting newJeffrey Stedfast2000-08-111-13/+17
| | | | | | | | | | 2000-08-10 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (camel_imap_folder_changed): If we go over the max number of messages, don't keep requesting new message summaries, just break. svn path=/trunk/; revision=4705
* Merge with camel-async.Peter Williams2000-08-116-127/+115
| | | | svn path=/trunk/; revision=4687
* A better way to compress leading whitespace. The code is probably invalidNot Zed2000-08-111-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-08-11 Not Zed <NotZed@HelixCode.com> * camel-mime-parser.c (folder_scan_header): A better way to compress leading whitespace. The code is probably invalid anyway, I dont think it will work across buffer boundaries. * providers/mbox/camel-mbox-folder.c (mbox_append_message): And write out proper format From lines here too. * providers/mbox/camel-mbox-summary.c (camel_mbox_summary_build_from): New function to build a more compatible mbox "From " line. (camel_mbox_summary_sync): Write From lines in the proper format. 2000-08-10 Not Zed <NotZed@HelixCode.com> * providers/mh/camel-mh-store.c (get_folder): Remove warnin g. * providers/mbox/camel-mbox-store.c (xrename): Kill some warnings with constification. * providers/imap/camel-imap-folder.c (imap_append_message): Fixed for append api change. Eek this routine seriously wastes memory. * providers/mh/camel-mh-folder.c (mh_search_free): Impelemnt. (mh_append_message): Fix for api change, and include user flags and tags in new message. * providers/vee/camel-vee-folder.c (vee_search_by_expression): Fix for search api change. * camel-folder.c (camel_folder_search_free): New function for freeing search results. (search_free): Changed my mind, implement a default that actually does something. Free as to the old interface. (camel_folder_append_message): Changed to accept a camelmessageinfo rather than flags, which just doesn't have enough info in it. (copy_message_to): Change for append_message api change. (move_message_to): Likewise. * providers/mbox/camel-mbox-folder.c (mbox_search_free): Implement. (mbox_append_message): Fix for api change, and also copy user flags/tags across to new summary. * camel-folder-search.c (search_user_tag): A search expression that returns the current use flag by name. (camel_folder_search_free_result): New function to free the result of a search. * camel-folder-summary.c: Bump summary version. (message_info_new): (message_info_load): (message_info_save): (camel_message_info_dup_to): (camel_message_info_free): Added support for arbitrary tag/value pairs (CamelTag's). (camel_tag_get): (camel_tag_set): (camel_tag_list_size): (camel_tag_list_free): Operations for working with CamelTags. svn path=/trunk/; revision=4683
* New code to keep an on-disk cache of what UIDs have been seen in a folder.Dan Winship2000-08-091-1/+1
| | | | | | | | | | | | | | | | | | * camel-uid-cache.c: New code to keep an on-disk cache of what UIDs have been seen in a folder. * camel-provider.h: Add new flags CAMEL_PROVIDER_IS_SOURCE (mail can arrive in it by non-Camel means) and CAMEL_PROVIDER_IS_STORAGE (you can work with mail directly without needing to copy it local). * providers/*/camel-*-provider.c: Add flags as needed: imap and mbox are SOURCE and STORAGE. mh and nntp are just STORAGE, pop3 is just SOURCE. * camel-mime-message.c (process_header): Add another subject g_strstrip that fejj's earlier commit missed. svn path=/trunk/; revision=4616
* If we are trying to get a subfolder listing of the root folder, alwaysJeffrey Stedfast2000-08-082-10/+23
| | | | | | | | | | | | | | 2000-08-07 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (imap_get_subfolder_names_internal): If we are trying to get a subfolder listing of the root folder, always make sure INBOX is there... * providers/imap/camel-imap-utils.c (imap_parse_list_response): Check for NIL as a directory separator. svn path=/trunk/; revision=4582
* Strip all \n's from the expressionJeffrey Stedfast2000-08-081-4/+7
| | | | | | | | | | | | 2000-08-07 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-utils.c (imap_translate_sexp): Strip all \n's from the expression * string-utils.c (strip): New convenience function to strip occurences of a single char from a string svn path=/trunk/; revision=4576
* If we fail to get a dir_sep, then supply the default of "/". (get_folder):Jeffrey Stedfast2000-08-051-28/+31
| | | | | | | | | | 2000-08-04 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-store.c (imap_connect): If we fail to get a dir_sep, then supply the default of "/". (get_folder): Undo changes by Peter svn path=/trunk/; revision=4537
* Coredump fix when IMAP get_folder with NULL dir_sepPeter Williams2000-08-051-1/+1
| | | | svn path=/trunk/; revision=4535
* Only call imap_get_summary_internal if the folder can hold messagesJeffrey Stedfast2000-08-042-7/+10
| | | | | | | | | | | | 2000-08-03 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (camel_imap_folder_new): Only call imap_get_summary_internal if the folder can hold messages * providers/nntp/camel-nntp-provider.c (camel_provider_module_init): Initialize the service_cache for the news/nntp providers svn path=/trunk/; revision=4519
* New and improved sexp parser. An honest try at using e-sexp is wrapped inJeffrey Stedfast2000-08-022-222/+314
| | | | | | | | | | | | | | 2000-08-01 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-utils.c (imap_translate_sexp): New and improved sexp parser. An honest try at using e-sexp is wrapped in a #ifdef at the bottom of the file but is currently not used * providers/imap/camel-imap-folder.c (imap_search_by_expression): We want to do a UID SEARCH so we get UIDs back instead of sequence numbers svn path=/trunk/; revision=4461
* Some IMAP servers don't wrap the UID in ()'s so don't depend on thatJeffrey Stedfast2000-08-012-208/+253
| | | | | | | | | | 2000-07-31 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (imap_get_message_info_internal): Some IMAP servers don't wrap the UID in ()'s so don't depend on that (imap_get_summary_internal): Same svn path=/trunk/; revision=4443
* Oops, forgot to free node->function - not good.Jeffrey Stedfast2000-08-011-0/+1
| | | | | | | | | 2000-07-31 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-utils.c (free_sexp_node): Oops, forgot to free node->function - not good. svn path=/trunk/; revision=4438
* New convenience function to translate a Camel sexp into the equivalentJeffrey Stedfast2000-08-014-46/+328
| | | | | | | | | | | | | | | | 2000-07-31 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-utils.c (imap_translate_sexp): New convenience function to translate a Camel sexp into the equivalent IMAP sexp. * providers/imap/camel-imap-store.c: More places now use imap_next_word * providers/imap/camel-imap-folder.c (imap_search_by_expression): Implemented initial version (this may or may not work quite right) svn path=/trunk/; revision=4428
* Make sure the third word/token (whatever) is "EXPUNGE" and not somethingJeffrey Stedfast2000-07-291-24/+35
| | | | | | | | | | | | | 2000-07-28 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (imap_expunge): Make sure the third word/token (whatever) is "EXPUNGE" and not something else like "EXISTS" or "RECENT". When removing the message from the summary also make sure to free that data to avoid leakage. Also make sure to subtract 1 from the 'id' since IMAP starts at 1 and our summary starts at 0 :-) svn path=/trunk/; revision=4411
* fixed a few logic errorsJeffrey Stedfast2000-07-292-8/+8
| | | | svn path=/trunk/; revision=4410
* Cleaned up a bit, now uses imap_next_word() (camel_imap_command_extended):Jeffrey Stedfast2000-07-292-35/+85
| | | | | | | | | | | | | | | | | | | 2000-07-28 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-store.c (camel_imap_status): Cleaned up a bit, now uses imap_next_word() (camel_imap_command_extended): Now uses imap_next_word(). When checking for RECENT, allow the first digit of the recent-count be between 0 and 9 inclusive instead of exclusive. * providers/imap/camel-imap-folder.c (imap_expunge): Optimized. No longer will it need to reload the summary as it now instead removes the appropriate message summaries from the cache. (camel_imap_folder_changed): If recent == 0 then return. If recent < 0 then just emit the folder_changed signal, don't reload summaries. svn path=/trunk/; revision=4409
* Get message count when STATUS is not available. (imap_init):Jeffrey Stedfast2000-07-293-55/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-07-28 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (imap_get_message_count_internal): Get message count when STATUS is not available. (imap_init): folder->has_search_capability is required for IMAP so should always be set to TRUE (is currently being set to FALSE as I've not yet implemented SEARCH support). (camel_imap_folder_changed): Seem to have fixed my optimization hack 2000-07-28 Jon K Hellan <hellan@acm.org> * providers/imap/camel-imap-store.h (CamelImapServerLevel): New enum. (CamelImapStore): Added server_level and has_status_capability members. * providers/imap/camel-imap-store.c (imap_connect): Detect IMAP4REV1, IMAP4 and STATUS in capability response. * providers/imap/camel-imap-folder.c (imap_get_message_count_internal): Use STATUS only if server supports it. TODO: Get message count when STATUS not supported. (imap_get_message, imap_get_summary_internal, imap_get_message_info_internal): Handle IMAP4 as well. (imap_protocol_get_summary_specifier): New function: Make a data item specifier for the header lines we need, appropriate to the server level. svn path=/trunk/; revision=4406
* Fixed my routine to only fetch new headers, my IDs were off by 1 on theJeffrey Stedfast2000-07-281-1/+1
| | | | | | | | | | | | 2000-07-27 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (camel_imap_folder_changed): Fixed my routine to only fetch new headers, my IDs were off by 1 on the high end, so when it would fetch the last newly arrived message it would fail and end up fetching all of the summaries because of the corruption. svn path=/trunk/; revision=4404
* Added camel-imap-utils.[c,h]Jeffrey Stedfast2000-07-285-106/+172
| | | | | | | | | | | | | | | | | | | | | | | | | 2000-07-27 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/Makefile.am: Added camel-imap-utils.[c,h] * providers/imap/camel-imap-utils.[c,h]: Utilities for parsing server responses for use in both camel-imap-store.c and camel-imap-folder.c * providers/imap/camel-imap-folder.c (imap_get_summary_internal): Free all the pointers in the headers array. (imap_get_subfolder_names_internal): Updated to use imap_parse_list_response (imap_parse_subfolder_list): Removed in favor of imap_parse_list_response * providers/imap/camel-imap-store.c (camel_imap_command_extended): Free all the pointers in the data array. (imap_connect): Updated to use imap_parse_list_response and fixed a leak (folder_is_selectable): Updated. svn path=/trunk/; revision=4400
* Now uses a hash table for looking up message info rather than a linearJeffrey Stedfast2000-07-282-18/+36
| | | | | | | | | 2000-07-27 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (imap_get_message_info): Now uses a hash table for looking up message info rather than a linear search :) svn path=/trunk/; revision=4398
* Fix Makefile.am booboo.Peter Williams2000-07-281-2/+0
| | | | svn path=/trunk/; revision=4394
* Fixed a few compiler warningsJeffrey Stedfast2000-07-261-2/+2
| | | | | | | | 2000-07-26 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c: Fixed a few compiler warnings svn path=/trunk/; revision=4345
* Fixed the real problem that Peter was running into.Jeffrey Stedfast2000-07-261-11/+11
| | | | | | | | | 2000-07-25 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (imap_summary_free): Fixed the real problem that Peter was running into. svn path=/trunk/; revision=4321
* IMAP expunge crash prevention... still not right...Peter Williams2000-07-261-0/+1
| | | | svn path=/trunk/; revision=4316
* Optimized to try and get the new message headers without reloading theJeffrey Stedfast2000-07-253-87/+73
| | | | | | | | | | | | 2000-07-25 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (camel_imap_folder_changed): Optimized to try and get the new message headers without reloading the entire summary from scratch. (imap_get_summary_internal): Will now sync() before attempting to reload the summary so that flags are set in the reloaded summary as well. svn path=/trunk/; revision=4309
* Updated to give special attention to the root folder.Jeffrey Stedfast2000-07-253-24/+39
| | | | | | | | | | | | | | | 2000-07-24 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-store.c (get_folder): Updated to give special attention to the root folder. * providers/imap/camel-imap-folder.c (imap_get_subfolder_names_internal): Updated to handle the root folder (imap_get_message_count_internal): return 0 if folder can't hold messages (camel_imap_folder_new): Change so that root folder gets special attention and always gets can_hold_messages set to FALSE svn path=/trunk/; revision=4308
* Remove exceptions from a number of methods that work on what ought to beDan Winship2000-07-251-69/+28
| | | | | | | | | | | | | | | * camel-folder.c: Remove exceptions from a number of methods that work on what ought to be static data: get_parent_folder, get_parent_store, get_message_count, get_unread_message_count, get_permanent_flags, get_message_flags, set_message_flags, get_message_user_flag, set_message_user_flag, get_uids, get_summary, get_subfolder_names. Turn camel_folder_delete_message into a macro. (Mostly a pull-up from the camel-async branch.) * providers/{imap,mbox,nntp,pop3,vee}: Update for CamelFolder changes svn path=/trunk/; revision=4303
* Updated to port easily to the new Camel API (imap_init): Don't SELECTJeffrey Stedfast2000-07-251-36/+28
| | | | | | | | | | 2000-07-24 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (imap_get_message_info): Updated to port easily to the new Camel API (imap_init): Don't SELECT INBOX, we don't need to do that svn path=/trunk/; revision=4302
* Initialize the summary and subfolder listing. (imap_summary_free): NowJeffrey Stedfast2000-07-254-103/+161
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-07-24 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (camel_imap_folder_new): Initialize the summary and subfolder listing. (imap_summary_free): Now takes a GPtrArray arg rather than a CamelImapFolder as it increases it's usefullness for free()'ing temporary summaries. (imap_get_message_count_internal): A new convenience function for getting the actual message count on a server to be used by imap_get_summary_internal) (imap_get_message_count): Since the Camel API is on the move again, the future version of this function will not be able to make a call to the store, it must only access previously fetched data (thus the creation of the _internal function) (imap_get_subfolder_names_internal): Again, because the future version of imap_get_subfolder_names will not take an exception, we must rename this function which will be called by camel_imap_folder_new() (imap_get_subfolder_names): We now return the previously collected subfolder listing that the _internal function fetched previously (imap_get_summary_internal): Again, same idea as the previous _internal functions... (imap_get_summary): Again... now returns a previously aquired summary * providers/imap/camel-imap-store.c (imap_noop): This will hopefully prevent the imap store from disconnecting. (imap_connect): Modified to add a gtk timeout event that will call imap_noop() every 10 minutes (we may want to change this time value) (imap_disconnect): Modified to remove the NOOP timeout event from the store. (camel_imap_command_extended): Commented out the code that would try and detect if the store was disconnected and then reconnect if it was needed. svn path=/trunk/; revision=4298
* Made it a little more forgiving. Also set current_folder to NULL as thereJeffrey Stedfast2000-07-243-54/+90
| | | | | | | | | | | | | 2000-07-23 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-store.c (imap_disconnect): Made it a little more forgiving. Also set current_folder to NULL as there is no selected folder after a disconnect. (stream_is_alive): Detects whether or not a socket is "alive" (camel_imap_command_extended): Use stream_is_alive() to aid in the detection of a disconnected state. svn path=/trunk/; revision=4288
* Clear CamelExceptions when appropriate (eg when folder is marked asJeffrey Stedfast2000-07-232-40/+47
| | | | | | | | | | | | | | 2000-07-22 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-store.c (get_folder): Clear CamelExceptions when appropriate (eg when folder is marked as \NoSelect). Still needs some cleanup and perhaps Dan will have a better way of doing this as this seems like a messy way of handling this. * providers/imap/camel-imap-folder.c (imap_get_uids): Took out some debug statements as they are no longer needed. svn path=/trunk/; revision=4275
* Updated to not strip out subfolders that are marked as \NoSelect becauseJeffrey Stedfast2000-07-222-7/+49
| | | | | | | | | | | | | | | | 2000-07-21 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (imap_get_subfolder_names): Updated to not strip out subfolders that are marked as \NoSelect because this will be correctly handled in store->get_folder from now on. * providers/imap/camel-imap-store.c (folder_is_selectable): New convenience function for use in get_folder(). (parse_list_response): Now takes a char **flags argument which is needed by folder_is_selectable(). (imap_connect): Updated to reflect changes to parse_list_response(). svn path=/trunk/; revision=4274
* Updated with some of the same fixes I've made to camel-imap-folder.c likeJeffrey Stedfast2000-07-221-3/+3
| | | | | | | | | | 2000-07-21 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-stream.c (stream_read): Updated with some of the same fixes I've made to camel-imap-folder.c like recalculating message part lengths. svn path=/trunk/; revision=4266
* Rewrote the code to check for "* %d RECENT". Still needs to be modified,Jeffrey Stedfast2000-07-221-7/+11
| | | | | | | | | | 2000-07-21 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-store.c (camel_imap_command_extended): Rewrote the code to check for "* %d RECENT". Still needs to be modified, but should no longer cause an infinite loop by detecting mis-detecting RECENT messages. svn path=/trunk/; revision=4265
* Oops. Fix UID parser to allow 0 and 9 to be in the range of valid UIDJeffrey Stedfast2000-07-201-2/+2
| | | | | | | | | | 2000-07-20 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (imap_get_summary): (imap_get_message_info): Oops. Fix UID parser to allow 0 and 9 to be in the range of valid UID chars. svn path=/trunk/; revision=4233
* General cleanup working towards getting Actions->Expunge workingJeffrey Stedfast2000-07-202-96/+51
| | | | | | | | | | | | | | 2000-07-19 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c: General cleanup working towards getting Actions->Expunge working correctly. * providers/imap/camel-imap-store.c (cammel_imap_command_extended): Added code to look for "* %d RECENT" and to emit the folder_changed signal if there are any recent messages. Note: this is a hack and needs to be rewritten badly. svn path=/trunk/; revision=4226
* If the folder's message count is not the same as the number of summaries,Jeffrey Stedfast2000-07-201-9/+20
| | | | | | | | | | 2000-07-19 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (imap_get_summary): If the folder's message count is not the same as the number of summaries, free the old summary and create a new summary. svn path=/trunk/; revision=4223
* Added in imap_[g,s]et_message_user_flag() methods (imap_get_message_info):Jeffrey Stedfast2000-07-191-50/+109
| | | | | | | | | | | | | | | | | | | | | | | 2000-07-18 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (camel_imap_folder_class_init): Added in imap_[g,s]et_message_user_flag() methods (imap_get_message_info): Rewrote to use the more efficient way of downloading summary information and also added a UID comparison so that if the UID requested doesn't match the UID received, it returns NULL. FIXME: When the mailer gets NULL when it requested message info, it seems that it displays a row for that message and when you try and select the blank row, it segfaults. * providers/imap/camel-imap-store.c (get_folder): Oops, this should not be checking against "/", it should be checking against dir_sep. * providers/imap/camel-imap-folder.c (imap_parse_subfolder_line): Updated to trim out the leading namespace. (imap_get_subfolder_names): Let the subfolder parser trim the namespace off the folder name. svn path=/trunk/; revision=4215
* Added in imap_[g,s]et_message_user_flag() methodsJeffrey Stedfast2000-07-192-28/+32
| | | | | | | | | | | | | | | | | 2000-07-18 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (camel_imap_folder_class_init): Added in imap_[g,s]et_message_user_flag() methods * providers/imap/camel-imap-store.c (get_folder): Oops, this should not be checking against "/", it should be checking against dir_sep. * providers/imap/camel-imap-folder.c (imap_parse_subfolder_line): Updated to trim out the leading namespace. (imap_get_subfolder_names): Let the subfolder parser trim the namespace off the folder name. svn path=/trunk/; revision=4214
* Send a "LOGOUT" command.Jeffrey Stedfast2000-07-182-4/+17
| | | | | | | | | | | | | | | | | | 2000-07-17 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-store.c (imap_disconnect): Send a "LOGOUT" command. * providers/imap/camel-imap-folder.c (imap_get_message): Hacks to get IMAP code to work with CommunigatePro and MS Exchange (and any other servers that send back a UID at the end of each FETCH inside of the main body of the message part). (imap_sync): Un-#if 0 the code that sets the flags on the IMAP server for messages that have changed. Oops, don't mask with DELETED to find out if the message has been answered ;-) (imap_expunge): sync before expunging. svn path=/trunk/; revision=4207
* Hacks to get IMAP code to work with CommunigatePro and MS Exchange (andJeffrey Stedfast2000-07-181-2/+2
| | | | | | | | | | | | | | 2000-07-17 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (imap_get_message): Hacks to get IMAP code to work with CommunigatePro and MS Exchange (and any other servers that send back a UID at the end of each FETCH inside of the main body of the message part). (imap_sync): Un-#if 0 the code that sets the flags on the IMAP server for messages that have changed. Oops, don't mask with DELETED to find out if the message has been answered ;-) svn path=/trunk/; revision=4202
* oops, s/status/s in imap_sync()Jeffrey Stedfast2000-07-181-2/+2
| | | | svn path=/trunk/; revision=4197
* Hacks to get IMAP code to work with CommunigatePro and MS Exchange (andJeffrey Stedfast2000-07-181-3/+1
| | | | | | | | | | | | | 2000-07-17 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (imap_get_message): Hacks to get IMAP code to work with CommunigatePro and MS Exchange (and any other servers that send back a UID at the end of each FETCH inside of the main body of the message part). (imap_sync): Un-#if 0 the code that sets the flags on the IMAP server for messages that have changed svn path=/trunk/; revision=4195
* Hacks to get IMAP code to work with CommunigatePro and MS Exchange (andJeffrey Stedfast2000-07-181-6/+6
| | | | | | | | | | | 2000-07-17 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (imap_get_message): Hacks to get IMAP code to work with CommunigatePro and MS Exchange (and any other servers that send back a UID at the end of each FETCH inside of the main body of the message part). svn path=/trunk/; revision=4194
* minor fixes that came up when building with gcc -ansi -pedanticJeffrey Stedfast2000-07-171-4/+4
| | | | svn path=/trunk/; revision=4184
* All SELECT calls now pass a NULL folder argument toJeffrey Stedfast2000-07-171-4/+4
| | | | | | | | | | | | | 2000-07-16 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c: All SELECT calls now pass a NULL folder argument to camel_imap_command_extended() since it's not needed. Also s/camel_imap_command/camel_imap_command_extended as I will probably be doing away with camel_imap_command() or at least only using it for LOGIN and similar commands where the server won't notify us of any recent messages. svn path=/trunk/; revision=4183
* All SELECT calls now pass a NULL folder argument toJeffrey Stedfast2000-07-172-24/+43
| | | | | | | | | | | | | | | | | | | | | 2000-07-16 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-store.c: All SELECT calls now pass a NULL folder argument to camel_imap_command_extended() since it's not needed. (imap_connect): Moved service_class->connect() to the point right after a connection is established with the server rather than waiting until the end of the function. (camel_imap_command): Updated the documentation comment (camel_imap_command_extended): Before sending a command, first check to make sure we are connected; if we aren't, then reconnect. Don't strncmp() command with "SELECT" as it's redundant. * providers/imap/camel-imap-folder.c: All SELECT calls now pass a NULL folder argument to camel_imap_command_extended() since it's not needed. svn path=/trunk/; revision=4182
* One last fix to get rid of hard-coded "/" directory separatorsJeffrey Stedfast2000-07-151-1/+4
| | | | | | | | | 2000-07-15 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (camel_imap_folder_new): One last fix to get rid of hard-coded "/" directory separators svn path=/trunk/; revision=4175
* Oops, minor fix to make any dir_sep work.Jeffrey Stedfast2000-07-151-2/+2
| | | | svn path=/trunk/; revision=4171
* New convenience function to unquote a string if it's encapsulated by "'sJeffrey Stedfast2000-07-153-27/+113
| | | | | | | | | | | | | 2000-07-14 Jeffrey Stedfast <fejj@helixcode.com> * string-utils.c (string_unquote): New convenience function to unquote a string if it's encapsulated by "'s * providers/imap/camel-imap-folder.c: * providers/imap/camel-imap-store.c: Made the necessary changes to stop using hard coded directory separators. svn path=/trunk/; revision=4170
* If a SELECT fails, set imap_store->current_folder to NULL so a SELECT isJeffrey Stedfast2000-07-142-48/+14
| | | | | | | | | | | | | | | | | 2000-07-13 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c: * providers/imap/camel-imap-store.c: If a SELECT fails, set imap_store->current_folder to NULL so a SELECT is forced before any message/folder operations are requested. Also, because some users don't use a namespace, make sure that if the url->path is "/" we don't use it when creating the folder_path. (camel_imap_command[_extended]): Since we allow the passing of a NULL folder which we can use to bypass a forced SELECT, no need to check for the individual commands that don't require a folder to be selected. svn path=/trunk/; revision=4161
* Updated to use CAMEL_IMAP_OK, CAMEL_IMAP_NO, CAMEL_IMAP_BAD, andJeffrey Stedfast2000-07-143-20/+19
| | | | | | | | | | | 2000-07-13 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c: * providers/imap/camel-imap-store.c: Updated to use CAMEL_IMAP_OK, CAMEL_IMAP_NO, CAMEL_IMAP_BAD, and CAMEL_IMAP_FAIL rather than the ones copied from the POP3 provider. svn path=/trunk/; revision=4155
* Oops. If the number of messages in the folder is 0, don't fetch summariesJeffrey Stedfast2000-07-142-15/+25
| | | | | | | | | | | | | | | 2000-07-13 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (imap_get_summary): Oops. If the number of messages in the folder is 0, don't fetch summaries 1 thru 0, just return an empty summary. (imap_copy_message_to): Fixed to use message UID and also send the source folder as an arg to camel_imap_command rather than NULL. (imap_move_message_to): Same. (imap_init): If SELECT is successful, we need to set the current folder to the one selected, this was causing problems with move/copy svn path=/trunk/; revision=4154
* Oops. If the number of messages in the folder is 0, don't fetch summariesJeffrey Stedfast2000-07-141-0/+6
| | | | | | | | | | 2000-07-13 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (imap_get_summary): Oops. If the number of messages in the folder is 0, don't fetch summaries 1 thru 0, just return an empty summary. svn path=/trunk/; revision=4150
* define a set of CAMEL_SERVICE_URL_ALLOW_* flags parallel to the _NEED_*Dan Winship2000-07-141-1/+3
| | | | | | | | | | | * camel-service.h: define a set of CAMEL_SERVICE_URL_ALLOW_* flags parallel to the _NEED_* flags, and make the _NEED_* flags imply the _ALLOW_* ones. * providers/imap/camel-imap-store.c (camel_imap_store_init): imap urls ALLOW_PATH svn path=/trunk/; revision=4147
* New and improved approach to fetching an entire folder summary that shouldJeffrey Stedfast2000-07-131-0/+2
| | | | | | | | | | | | | | | 2000-07-13 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (imap_get_summary): New and improved approach to fetching an entire folder summary that should be much much faster than the old way as it gets the entire folder summary in 1 shot rather than requesting message by message. As with the last update, this version also only fetches the minimum number of header fields. (imap_get_summary): Oops, forgot to free the temp GPtrArray *headers svn path=/trunk/; revision=4142
* New and improved approach to fetching an entire folder summary that shouldJeffrey Stedfast2000-07-131-166/+110
| | | | | | | | | | | | | 2000-07-13 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (imap_get_summary): New and improved approach to fetching an entire folder summary that should be much much faster than the old way as it gets the entire folder summary in 1 shot rather than requesting message by message. As with the last update, this version also only fetches the minimum number of header fields. svn path=/trunk/; revision=4141
* Don't fetch the entire RFC822 header, just fetch the fields we want.Jeffrey Stedfast2000-07-131-3/+6
| | | | | | | | | | 2000-07-13 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (imap_get_summary): Don't fetch the entire RFC822 header, just fetch the fields we want. (imap_get_message_info): Same. svn path=/trunk/; revision=4140
* Oops, missed a source file.Jeffrey Stedfast2000-07-131-1/+3
| | | | | | Added #include <e-util/e-util.h> and renamed strstrcase to e_strstrcase in providers/imap/camel-imap-folder.c svn path=/trunk/; revision=4134
* Chris forgot to add #include <e-util/e-util.h> to the source filesJeffrey Stedfast2000-07-131-4/+5
| | | | | | | | | | | 2000-07-12 Jeffrey Stedfast <fejj@helixcode.com> Chris forgot to add #include <e-util/e-util.h> to the source files * providers/imap/camel-imap-store.c (imap_connect): Fixed Peter's fix, we don't want to send a string to a %d. svn path=/trunk/; revision=4133
* Undid clahey's e_strstrcase because e_strstrcase DOES NOT EXIST inJeffrey Stedfast2000-07-131-6/+6
| | | | | | | | | | | | | 2000-07-12 Jeffrey Stedfast <fejj@helixcode.com> Undid clahey's e_strstrcase because e_strstrcase DOES NOT EXIST in e-utils/e-utils.c nor anywhere else in Evolution - besides, Camel should remain independant of Evolution. * providers/imap/camel-imap-store.c (imap_connect): Fixed Peter's fix, we don't want to send a string to a %d. svn path=/trunk/; revision=4132
* From addressbook/ChangeLog:Christopher James Lahey2000-07-131-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-07-12 Christopher James Lahey <clahey@helixcode.com> * backend/pas/pas-backend-file.c: Do case insensitive compares. * addressbook/gui/component/addressbook.c: Make quick search search both name and company name. From camel/ChangeLog: 2000-07-12 Christopher James Lahey <clahey@helixcode.com> * camel-folder-search.c, providers/imap/camel-imap-store.c: Changed from strstrcase to e_strstrcase. * string-utils.c, string-utils.h: Removed strstrcase (in favor of e_strstrcase in e-util/e-util.c.) From e-util/ChangeLog: 2000-07-12 Christopher James Lahey <clahey@helixcode.com> * e-util.c, e-util.h: Added e_strstrcase function. svn path=/trunk/; revision=4127