aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/imap/camel-imap-utils.c
Commit message (Collapse)AuthorAgeFilesLines
* Check for LOGIN xxxx as well if debug is on, so we dont print passwords toNot Zed2002-05-071-6/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2002-05-07 Not Zed <NotZed@Ximian.com> * camel-remote-store.c (remote_send_string): Check for LOGIN xxxx as well if debug is on, so we dont print passwords to evolution logs. * providers/imap/camel-imap-utils.c (imap_is_atom_char): This was really broken. 1. isprint() is locale dependent, and 2. it looked up an 8 bit value in a 7 bit table without truncating it. I've removed the isprint() stuff and just put it directly into the special table, which i've expanded to the right size too. * providers/imap/*: Applied patch from Preston Elder <prez@magick.tm> to make camel only use literals if it needs to for simple strings. Changed slightly to use imap_is_atom() and more consistent formatting. providers/imap/camel-imap-utils.c (imap_is_atom): Chagned from imap_needs_quoting(). ** Merged in camel-object2 branch. Simpler camelobject implementation + object args interface. * camel.c (camel_init): Call camel_object_get_type() to make sure camel_object_type is initialised. * camel-object.h (CAMEL_OBJECT_TYPE): Changed to return global camel_object_type pointer, not call camel_object_get_type. svn path=/trunk/; revision=16701
* As a temporary solution, just printf ("\a"); to make a beep :-)Jeffrey Stedfast2002-01-221-33/+46
| | | | | | | | | | | | | | | | | 2002-01-21 Jeffrey Stedfast <fejj@ximian.com> * camel-filter-driver.c (do_beep): As a temporary solution, just printf ("\a"); to make a beep :-) * providers/imap/camel-imap-command.c (imap_command_strdup_vprintf): Encode the mailbox to UTF-7 here. * providers/imap/camel-imap-utils.c (imap_parse_list_response): Decode the mailbox name as we parse the list response. (imap_mailbox_decode): It's only an illegal mailbox name if it didn't switch back to US-ASCII mode. svn path=/trunk/; revision=15421
* New function to decode an IMAP mailbox name from modified UTF-7 encodingJeffrey Stedfast2002-01-191-1/+263
| | | | | | | | | | | | 2002-01-18 Jeffrey Stedfast <fejj@ximian.com> * providers/imap/camel-imap-utils.c (imap_mailbox_decode): New function to decode an IMAP mailbox name from modified UTF-7 encoding to UTF-8. (imap_mailbox_encode): New function to convert a mailbox name from UTF-8 to IMAP's modified UTF-7 encoding. svn path=/trunk/; revision=15361
* Updated to use the new imap_uid_array_to_set() interface.Jeffrey Stedfast2002-01-151-11/+23
| | | | | | | | | | | | | | | | | | | | | 2002-01-14 Jeffrey Stedfast <fejj@ximian.com> * providers/imap/camel-imap-folder.c (imap_expunge_uids_online): Updated to use the new imap_uid_array_to_set() interface. (imap_expunge_uids_resyncing): Same. (do_copy): Here too. (imap_update_summary): Added a FIXME comment to rewrite allowing for a uid-set limitation. (get_matching): Copy some of the logic over from imap_uid_adday_to_set() to limit the length of the uid-set string. (imap_sync_online): Added a comment to explain what is going on with get_matching() since the behavior has changed slightly. * providers/imap/camel-imap-utils.c (imap_uid_array_to_set): Modify the interface so that we can limit the size of the uid set string returned. svn path=/trunk/; revision=15318
* Abort if body == NULL.Jeffrey Stedfast2001-11-171-1/+1
| | | | | | | | | 2001-11-16 Jeffrey Stedfast <fejj@ximian.com> * providers/imap/camel-imap-utils.c (imap_parse_body): Abort if body == NULL. svn path=/trunk/; revision=14738
* More fixing of the license texts.Ettore Perazzoli2001-10-281-11/+11
| | | | svn path=/trunk/; revision=14216
* Get the entire directory structure for the folder we just created, meaningJeffrey Stedfast2001-08-201-0/+50
| | | | | | | | | | | | | 2001-08-20 Jeffrey Stedfast <fejj@ximian.com> * providers/imap/camel-imap-store.c (create_folder): Get the entire directory structure for the folder we just created, meaning if we created a folder named "test.mailbox" where test didn't previously exist, get the listing for "test" and "test.mailbox". * providers/imap/camel-imap-utils.c (imap_parse_folder_name): New function. svn path=/trunk/; revision=12258
* If we are online and message flags have changed in the current folder,Jeffrey Stedfast2001-08-171-11/+0
| | | | | | | | | | | | | | | | | | 2001-08-16 Jeffrey Stedfast <fejj@ximian.com> * providers/imap/camel-imap-store.c (imap_keepalive): If we are online and message flags have changed in the current folder, sync the flags else do a NOOP. This fixes bug #4666. Also lock around the NOOP command. * providers/imap/camel-imap-folder.c (imap_sync_online): Don't ever send "STORE FLAGS.SILENT ()" since Cyrus imapd doesn't like this (and maybe others too?) so what we'll do instead is to send "STORE -FLAGS.SILENT (\Seen \Answered \Deleted \Marked)" to clear all the flags (since this is in essence what we want to do anyway). svn path=/trunk/; revision=12136
* Fix a leak.Peter Williams2001-08-141-3/+12
| | | | | | | | | | | | | | 2001-08-13 Peter Williams <peterw@ximian.com> * providers/imap/camel-imap-store.c (delete_folder): Fix a leak. * providers/imap/camel-imap-utils.c (imap_namespace_concat): Bleah, handle when namespace = NULL (can happen upon initial open of mailbox.) * providers/imap/camel-imap-command.c (imap_command_strdup_vprintf): Don't crash when %F'ing with an empty folder name and NULL namespace. svn path=/trunk/; revision=11971
* Added an assert - at this point a backtrace would be more useful than aJeffrey Stedfast2001-08-111-6/+18
| | | | | | | | | | 2001-08-10 Jeffrey Stedfast <fejj@ximian.com> * providers/imap/camel-imap-utils.c (imap_quote_string): Added an assert - at this point a backtrace would be more useful than a transaction log for debugging. svn path=/trunk/; revision=11902
* A quoted string cannot contain \n's so check for those as well.Jeffrey Stedfast2001-08-101-73/+72
| | | | | | | | | | 2001-08-09 Jeffrey Stedfast <fejj@ximian.com> * providers/imap/camel-imap-utils.c (imap_parse_string_generic): A quoted string cannot contain \n's so check for those as well. (imap_atom_specials): Update this to fix bug #6553. svn path=/trunk/; revision=11845
* Completely hide the namespace from everything external to the IMAP code,Peter Williams2001-08-071-2/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-08-06 Peter Williams <peterw@ximian.com> Completely hide the namespace from everything external to the IMAP code, which Dan W says is the way it should be. * providers/imap/camel-imap-command.c (imap_command_strdup_vprintf): Add a new %F argument, which is like %S but will add the namespace (for folder names). (camel_imap_command): Use %F here. * providers/imap/camel-imap-utils.c (imap_parse_list_response): Changed to strip out the namespec when returning *folder. In order to do this we need to be passed the CamelImapStore. (imap_concat): Move to here from camel-imap-store.c, un-static (imap_namespace_concat): New function, adds the namespace to the folder name, unless it's INBOX. * providers/imap/camel-imap-utils.h: Prototypes. * providers/imap/camel-imap-store.c (imap_connect_online): Extra arg to imap_parse_list_response. (imap_connect_offline): Here too. (get_folder_status): Use %F. (get_folder_online): Here too. (delete_folder): Here too. (create_folder): Here too, and arg to imap_parse_list_response. (parse_list_response_as_folder_info): Arg to i_p_l_r. (get_subscribed_folders_by_hand): Use %F. (get_folders_online): Here too. (get_folder_info_online): Instead of checking for NULL @name, check for name = NULL or "", and set to "" instead of namespace. Pass "" instead of namespace to camel_folder_info_build. (subscribe_folder): Use %F. (unsubscribe_folder): Here too. * providers/imap/camel-imap-folder.c (imap_get_full_name): This now just returns folder->full_name. (do_append): Use %F (do_copy): Here too. svn path=/trunk/; revision=11705
* new method to get an application-initialized filter driver.Dan Winship2001-07-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * camel-session.c (camel_session_get_filter_driver): new method to get an application-initialized filter driver. * camel-filter-driver.c (camel_filter_driver_new): Remove the get_folder function and data args from here... (camel_filter_driver_set_folder_func): ...and add this function to set/change them. * providers/imap/camel-imap-folder.c (camel_imap_folder_new): If this folder is INBOX and we're filtering INBOX, set a flag on the folder for later. (imap_update_summary): Add another argument (GPtrArray *recents), and if it's non-NULL, add the uids of any \Recent new messages to it. (camel_imap_folder_changed): If doing filtering in this folder, create a recents array and pass it to imap_update_summary. Then get a filter driver and use it to filter the recent messages. * providers/imap/camel-imap-summary.h: * providers/imap/camel-imap-utils.c (imap_parse_flag_list): Add support for the \Recent flag. * providers/imap/camel-imap-provider.c (imap_conf_entries): enable the "filter" option. * camel-types.h: add CamelFilterDriver typedef here svn path=/trunk/; revision=10681
* Update the copyrights, replacing Helix Code with Ximian andEttore Perazzoli2001-06-231-2/+2
| | | | | | helixcode.com with ximian.com all over the place. svn path=/trunk/; revision=10440
* Create a CamelDiscoDiary. (imap_disconnect_offline): And free it.Dan Winship2001-05-301-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * providers/imap/camel-imap-store.c (imap_connect_online, imap_connect_offline): Create a CamelDiscoDiary. (imap_disconnect_offline): And free it. * providers/imap/camel-imap-folder.c (camel_imap_folder_selected): If RESYNCING, don't do any sort of checking that the remote folder matches the summary, beyond making sure that the UIDVALIDITY is correct. (imap_rescan): Add a missing camel_folder_summary_info_free when removing a UID from the summary. (imap_expunge_uids_offline): Implement. Fairly simple. (imap_expunge_uids_resyncing): Implement. If the store supports UIDPLUS, we can just use imap_expunge_uids_online. If not, we need to temporarily undelete any messages marked deleted on the server that aren't supposed to get expunged. (imap_append_offline): Implement, using cache and summary operations, and triggering the folder_changed event by hand. (imap_append_resyncing): Implement. Redo imap_append_online a bit in the process to make them able to share more code. (imap_copy_offline): Implement. (imap_copy_online): Move parts of this out into a helper. (imap_copy_resyncing): Implement. In most cases this is just like imap_copy_online, but if you are copying a message that was itself copied or appended into the folder, and the server doesn't do UIDPLUS, it will be necessary to replace at least part of the copy operation with one or more appends. * providers/imap/camel-imap-command.c (imap_read_response): Don't record the current folder in the response when in RESYNCING mode. (This means that EXISTS and EXPUNGE responses won't be processed, which is needed because the summary may not match the folder at this point.) (imap_read_response): On error, call camel_imap_response_free_without_processing, not camel_imap_response_free. * providers/imap/camel-imap-utils.c (imap_uid_array_to_set): Make this work better when operating on UIDs that aren't in the summary. * providers/imap/camel-imap-summary.c (camel_imap_summary_add_offline): New routine used by imap_append_offline and imap_copy_offline to create new summary entries. svn path=/trunk/; revision=10041
* 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
* Support the IMAP UIDPLUS extension (RFC 2359), which lets youDan Winship2001-05-011-2/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-011-0/+74
| | | | | | | | | | | | | | * 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
* 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
* 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
* First batch of disconnected IMAP-related stuff. This adds localDan Winship2001-03-161-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Delayed loading of IMAP message parts.Dan Winship2001-01-171-4/+246
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* IMAP randomness.Dan Winship2001-01-031-49/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* New CamelFolderSearch subclass that just reimplements body_contains (usingDan Winship2000-12-221-393/+0
| | | | | | | | | | | | | | | | | | * 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
* Change the semantics of fmt: Now %S (capital S) means an IMAP "string",Dan Winship2000-12-191-0/+35
| | | | | | | | | | | | | | | | | | | | | * 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
* Fixed to return the correct bytecount in all cases which is the real fixJeffrey Stedfast2000-11-211-3/+0
| | | | | | | | | | | | | | | | 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
* Improved IMAP namespace handling: leave the namespace in theDan Winship2000-10-301-42/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 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
* New file containing camel_imap_command and friends. MajorDan Winship2000-10-041-0/+74
| | | | | | | | | | | | | | | | | | | | | | | | * 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 camel_folder_{get,free}_subfolder_info, as we want to be able toDan Winship2000-10-031-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* 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-231-3/+4
| | | | | | | | | | | | | | | | | | | | 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
* New function to convert Camel flags to an IMAP flag_list.Dan Winship2000-09-221-0/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* 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
* Removed old code that will never be needed againJeffrey Stedfast2000-08-301-97/+2
| | | | | | | | | | | | | | 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
* If we are trying to get a subfolder listing of the root folder, alwaysJeffrey Stedfast2000-08-081-3/+7
| | | | | | | | | | | | | | 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
* Only call imap_get_summary_internal if the folder can hold messagesJeffrey Stedfast2000-08-041-5/+6
| | | | | | | | | | | | 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-021-221/+313
| | | | | | | | | | | | | | 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-011-190/+235
| | | | | | | | | | 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-011-0/+243
| | | | | | | | | | | | | | | | 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
* Added camel-imap-utils.[c,h]Jeffrey Stedfast2000-07-281-0/+97
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