Commit Graph

747 Commits

Author SHA1 Message Date
0b5dd5d2ed Fix the NNTP provider's Makefile.am so that it does not use installed
Camel headers before the source ones.  Also, get rid of an unused
variable.

svn path=/trunk/; revision=4631
2000-08-09 05:21:12 +00:00
4b65801638 Reorder search result in summary order if we searched with a summary.
2000-08-09  Not Zed  <NotZed@HelixCode.com>

        * camel-folder-search.c (camel_folder_search_execute_expression):
        Reorder search result in summary order if we searched with a
        summary.

svn path=/trunk/; revision=4618
2000-08-09 00:40:03 +00:00
234e613bc3 New code to keep an on-disk cache of what UIDs have been seen in a folder.
* 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
2000-08-09 00:07:56 +00:00
9951ed2421 Add another subject g_strstrip that fejj's earlier commit missed.
* camel-mime-message.c (process_header): Add another subject
	g_strstrip that fejj's earlier commit missed.

svn path=/trunk/; revision=4596
2000-08-08 16:28:43 +00:00
a7943ce5a4 Only retry another uid if we had a name clash, otherwise fail.
2000-08-07  Not Zed  <NotZed@HelixCode.com>

        * providers/mh/camel-mh-folder.c (mh_append_message): Only retry
        another uid if we had a name clash, otherwise fail.

2000-08-04  Not Zed  <NotZed@HelixCode.com>

        * camel-url.c (camel_url_set_protocol):
        (camel_url_set_host):
        (camel_url_set_path):
        (camel_url_set_port): Url editing functions.

2000-08-02  Not Zed  <NotZed@HelixCode.com>

        * providers/mh/camel-mh-summary.c (camel_mh_summary_sync): Expunge
        from the end, so the index isn't messed up when you remove a
        message.

        * providers/mh/camel-mh-folder.c (mh_append_message): Fix a bug
        where it would never open an output file/uid.

        * providers/mbox/camel-mbox-store.c (rename_folder):
        Implementation for mbox as well.

        * camel-store.c (camel_store_rename_folder): New method to rename folders.
        (rename_folder): Default implementation.

        * providers/mh/camel-mh-store.c (delete_folder): Implement this.
        (rename_folder): Implement a rename operation.

svn path=/trunk/; revision=4590
2000-08-08 03:42:47 +00:00
35bb85fdf6 If we are trying to get a subfolder listing of the root folder, always
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
2000-08-07 20:32:27 +00:00
cdb87d2e0a Strip all \n's from the expression
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
2000-08-07 18:54:15 +00:00
c2b4339041 Do a g_strstrip on the subject so we can stop getting those annoying
2000-08-07  Jeffrey Stedfast  <fejj@helixcode.com>

	* camel-mime-message.c (camel_mime_message_set_subject): Do a
	g_strstrip on the subject so we can stop getting those annoying
	leading spaces

svn path=/trunk/; revision=4571
2000-08-07 18:18:17 +00:00
3179eb7162 Fix this to not require NULL-termination of the array.
* camel-folder.c (camel_folder_free_deep): Fix this to not require
	NULL-termination of the array.

svn path=/trunk/; revision=4560
2000-08-07 04:16:26 +00:00
9d08ab1e01 If we fail to get a dir_sep, then supply the default of "/". (get_folder):
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
2000-08-04 22:41:05 +00:00
5c3eeb9552 Coredump fix when IMAP get_folder with NULL dir_sep
svn path=/trunk/; revision=4535
2000-08-04 21:29:43 +00:00
34de93822b Indexes into the flags array are message_number minus 1, not just
* providers/pop3/camel-pop3-folder.c (pop3_set_message_flags):
	(pop3_sync): Indexes into the flags array are message_number minus
	1, not just message_number.

svn path=/trunk/; revision=4533
2000-08-04 18:40:38 +00:00
6165277ab5 add a debugging macro for doing protocol tracing.
* providers/pop3/camel-pop3-store.c: add a debugging macro for
        doing protocol tracing.

svn path=/trunk/; revision=4526
2000-08-04 04:36:19 +00:00
c263dfffeb Only call imap_get_summary_internal if the folder can hold messages
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
2000-08-03 23:07:18 +00:00
64dcaa003c Initialize the service_cache for the news/nntp providers
2000-08-03  Jeffrey Stedfast  <fejj@helixcode.com>

	* providers/nntp/camel-nntp-provider.c (camel_provider_module_init):
	Initialize the service_cache for the news/nntp providers

svn path=/trunk/; revision=4514
2000-08-03 20:40:19 +00:00
bc9ac7db4c srcdir != builddir fix
svn path=/trunk/; revision=4506
2000-08-03 15:45:22 +00:00
319e78b7f2 Kill this. It doesn't have any code to do anything the new mh provider
* providers/MH: Kill this. It doesn't have any code to do anything
	the new mh provider doesn't do better.

	* providers/Makefile.am: Remove reference to MH subdir, and
	promote nntp to fully-supported status, since it does compile and
	all.

svn path=/trunk/; revision=4496
2000-08-03 00:47:50 +00:00
5a2a24af92 Trim trailing space from the subject. I've now seen replies from two
* camel-mime-message.c (camel_mime_message_set_subject): Trim
	trailing space from the subject. I've now seen replies from two
	different people that tricked the threading code by (a) not having
	References/In-Reply-To, and (b) adding an extra space to the end
	of the subject line so the subject-based threading fails too. Who
	writes these broken mailers anyway?

svn path=/trunk/; revision=4495
2000-08-03 00:35:45 +00:00
ea8003dcd6 When forced to use the IP, place it in square brackets.
2000-08-01  Jeffrey Stedfast  <fejj@helixcode.com>

	* providers/smtp/camel-smtp-transport.c (smtp_helo): When forced
	to use the IP, place it in square brackets.

svn path=/trunk/; revision=4462
2000-08-02 00:29:53 +00:00
2c23afbef1 New and improved sexp parser. An honest try at using e-sexp is wrapped in
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
2000-08-01 23:05:34 +00:00
799fedf1c9 cvsignore file
svn path=/trunk/; revision=4446
2000-08-01 14:30:59 +00:00
a930984494 Initial cut at mh provider. Well, it already does everything
mbox does.

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

        * providers/mh: New mh provider implementation.

        * providers/Makefile.am (SUBDIRS): Added mh provider.

svn path=/trunk/; revision=4444
2000-08-01 12:46:05 +00:00
60e6d0367f Some IMAP servers don't wrap the UID in ()'s so don't depend on that
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
2000-08-01 00:31:28 +00:00
4b87fc9067 Oops, forgot to free node->function - not good.
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
2000-07-31 22:15:31 +00:00
959fe7be1e Buffer overrun fix in g_strfreev -- two more that I forgot
svn path=/trunk/; revision=4432
2000-07-31 20:46:47 +00:00
5ed94f2baf Buffer overrun fix in g_strfreev
svn path=/trunk/; revision=4431
2000-07-31 20:33:27 +00:00
3ef60c2537 New convenience function to translate a Camel sexp into the equivalent
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
2000-07-31 20:00:20 +00:00
f67eb8f791 A few string overrun checks for the mime parser
svn path=/trunk/; revision=4427
2000-07-31 19:57:49 +00:00
da2fff47da Make sure the third word/token (whatever) is "EXPUNGE" and not something
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
2000-07-29 01:49:06 +00:00
dca8b620c8 fixed a few logic errors
svn path=/trunk/; revision=4410
2000-07-29 00:18:09 +00:00
0ba155afa8 Cleaned up a bit, now uses imap_next_word() (camel_imap_command_extended):
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
2000-07-28 23:13:46 +00:00
42ea927055 Get message count when STATUS is not available. (imap_init):
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
2000-07-28 17:41:15 +00:00
a28ef9db3c Fixed my routine to only fetch new headers, my IDs were off by 1 on the
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
2000-07-28 02:02:51 +00:00
8a7e082b56 If the path doesn't begin with a / and there is a host, prepend a / to the
2000-07-27  Jeffrey Stedfast  <fejj@helixcode.com>

	* camel-url.c (camel_url_to_string): If the path doesn't begin
	with a / and there is a host, prepend a / to the path.

svn path=/trunk/; revision=4403
2000-07-27 23:49:47 +00:00
2c5a9bc227 Added camel-imap-utils.[c,h]
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
2000-07-27 23:11:11 +00:00
4a4c22b8e1 Now uses a hash table for looking up message info rather than a linear
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
2000-07-27 18:32:23 +00:00
268f0e60b2 Fix Makefile.am booboo.
svn path=/trunk/; revision=4394
2000-07-27 17:01:05 +00:00
ed21f552bb Make the mime parser a bit less reckless. More reckful?
svn path=/trunk/; revision=4365
2000-07-26 21:02:08 +00:00
c9e2825702 routine to call an external movemail program. (camel_movemail): Nuke
* camel-movemail.c (movemail_external): routine to call an
	external movemail program.
	(camel_movemail): Nuke return value, use movemail_external when
	available and useful, and don't delete "dest" on errors, since
	it might have started non-empty.

svn path=/trunk/; revision=4355
2000-07-26 18:32:10 +00:00
222e4d4b62 Should now always prepend a '/' before the path if it doesn't already
2000-07-26  Jeffrey Stedfast  <fejj@helixcode.com>

	* camel-url.c (camel_url_to_string): Should now always prepend a '/'
	before the path if it doesn't already exist.

	* providers/imap/camel-imap-folder.c: Fixed a few compiler warnings

svn path=/trunk/; revision=4346
2000-07-26 15:13:50 +00:00
53f0a7f9e4 Fixed a few compiler warnings
2000-07-26  Jeffrey Stedfast  <fejj@helixcode.com>

	* providers/imap/camel-imap-folder.c: Fixed a few compiler warnings

svn path=/trunk/; revision=4345
2000-07-26 15:08:56 +00:00
28288cc95b Fixed the real problem that Peter was running into.
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
2000-07-25 19:35:08 +00:00
dffee37274 Don't add a Mime-Version header to a message that already has one.
* camel-mime-message.c (write_to_stream): Don't add a Mime-Version
	header to a message that already has one.

	* camel-internet-address.c (internet_encode): Don't put <>s around
	addresses with no name part.

svn path=/trunk/; revision=4318
2000-07-25 17:59:07 +00:00
e12a083de7 IMAP expunge crash prevention... still not right...
svn path=/trunk/; revision=4316
2000-07-25 16:02:20 +00:00
e89713fcd5 Optimized to try and get the new message headers without reloading the
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
2000-07-25 05:32:55 +00:00
6a601c210b Updated to give special attention to the root folder.
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
2000-07-25 03:45:55 +00:00
72183d80ec Remove exceptions from a number of methods that work on what ought to be
* 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
2000-07-25 02:42:11 +00:00
58eab08d84 Updated to port easily to the new Camel API (imap_init): Don't SELECT
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
2000-07-25 02:02:14 +00:00
b4fa8e15a8 Initialize the summary and subfolder listing. (imap_summary_free): Now
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
2000-07-24 23:10:21 +00:00
8c4533cc2d Remove camel_folder_get_message_uid, which was not used, and not
* camel-folder.[ch]: Remove camel_folder_get_message_uid, which
	was not used, and not implemented by any provider.

	* providers/nntp/camel-nntp-folder.c: Remove get_message_uid
	non-implementation.

svn path=/trunk/; revision=4292
2000-07-24 15:16:09 +00:00