platform/upstream/evolution-data-server.git
23 years agoUses an SSL socket now although there's still a few things missing (like
Jeffrey Stedfast [Mon, 15 Jan 2001 06:25:23 +0000 (06:25 +0000)]
Uses an SSL socket now although there's still a few things missing (like

2001-01-15  Jeffrey Stedfast  <fejj@ximian.com>

* camel-tcp-stream-ssl.c (stream_connect): Uses an SSL socket now
although there's still a few things missing (like certificate
handling and such).

* camel.c (camel_ssl_init): A replacement function for
camel_init() that also initializes SSL.

23 years agoImplemented. (stream_setsockopt): Implemented.
Jeffrey Stedfast [Sun, 14 Jan 2001 22:48:09 +0000 (22:48 +0000)]
Implemented. (stream_setsockopt): Implemented.

2001-01-14  Jeffrey Stedfast  <fejj@ximian.com>

* camel-tcp-stream-ssl.c (stream_getsockopt): Implemented.
(stream_setsockopt): Implemented.

* camel-tcp-stream-raw.c (stream_getsockopt): Implemented.
(stream_setsockopt): Implemented.

* camel-tcp-stream.c (camel_tcp_stream_getsockopt): New method.
(camel_tcp_stream_setsockopt): Another new method. I think you get
the idea of what these are for so I won't explain them.

23 years agoNew CamelTcpStream class that implements nspr sockets and eventually will
Jeffrey Stedfast [Sun, 14 Jan 2001 08:21:00 +0000 (08:21 +0000)]
New CamelTcpStream class that implements nspr sockets and eventually will

2001-01-14  Jeffrey Stedfast  <fejj@helixcode.com>

* camel-tcp-stream-ssl.[c,h]: New CamelTcpStream class that
implements nspr sockets and eventually will use nss for
SSL/TLS. Currently doesn't do any SSL/TLS but it should still
work. It's functionally equivalent to CamelTcpStreamRaw at the
moment only it uses nspr i/o.

* camel-tcp-stream-raw.[c,h]: New CamelTcpStream class that
implements native sockets. Should be usable but may have some bugs
yet.

23 years agoNew abstract class for TCP streams. The next step is to write child
Jeffrey Stedfast [Sun, 14 Jan 2001 04:40:46 +0000 (04:40 +0000)]
New abstract class for TCP streams. The next step is to write child

2001-01-13  Jeffrey Stedfast  <fejj@ximian.com>

* camel-tcp-stream.[c,h]: New abstract class for TCP streams. The
next step is to write child classes (CamelTcpStreamBSD and
CamelTcpStreamSSL). The BSD stream will use normal BSD sockets
while SSL will use Mozilla's NSPR and NSS libraries to do Secure
Socket Layers which wille ventually replace CamelStreamSSL which I
just commit'd. Oh well.

23 years agoNew stream for handling SSL/TLS connections.
Jeffrey Stedfast [Sun, 14 Jan 2001 02:44:59 +0000 (02:44 +0000)]
New stream for handling SSL/TLS connections.

2001-01-13  Jeffrey Stedfast  <fejj@ximian.com>

* camel-stream-ssl.[c,h]: New stream for handling SSL/TLS
connections.

23 years ago (camel_folder_thread_messages_new): Added casts to rmeove some
Michael Zucci [Fri, 12 Jan 2001 03:43:53 +0000 (03:43 +0000)]
(camel_folder_thread_messages_new): Added casts to rmeove some
warnings for the analites out there.

23 years agoPerform a final pass, removing any pseudo nodes we added earlier. Quick
Not Zed [Fri, 12 Jan 2001 02:48:45 +0000 (02:48 +0000)]
Perform a final pass, removing any pseudo nodes we added earlier. Quick

2001-01-12  Not Zed  <NotZed@Ximian.com>

        * camel-folder-thread.c (camel_folder_thread_messages_new):
        Perform a final pass, removing any pseudo nodes we added earlier.
        Quick patch to test the idea.

23 years ago (imap_copy_message_to): Fix this up: sync flags to the server
Dan Winship [Thu, 11 Jan 2001 23:56:50 +0000 (23:56 +0000)]
(imap_copy_message_to): Fix this up: sync flags to the server
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).

23 years agoFix a bug in previous commit: don't check for deleted messages if there
Dan Winship [Thu, 11 Jan 2001 22:50:10 +0000 (22:50 +0000)]
Fix a bug in previous commit: don't check for deleted messages if there

* 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 ...").

23 years agoNew function to check for added/deleted messages when re-selecting a
Dan Winship [Thu, 11 Jan 2001 22:04:29 +0000 (22:04 +0000)]
New function to check for added/deleted messages when re-selecting a

* 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.

23 years agoFix a locking problem. (One branch of an if statement was returning with
Dan Winship [Thu, 11 Jan 2001 21:53:34 +0000 (21:53 +0000)]
Fix a locking problem. (One branch of an if statement was returning with

* camel-folder.c (camel_folder_copy_message_to): Fix a locking
problem. (One branch of an if statement was returning with the
lock still locked.) Also remove the deprecation comments, to match
move_message_to.

23 years agoChanged the descriptions for mh, mbox, and maildir to be more
Jeffrey Stedfast [Wed, 10 Jan 2001 21:28:28 +0000 (21:28 +0000)]
Changed the descriptions for mh, mbox, and maildir to be more

2001-01-10  Jeffrey Stedfast  <fejj@helixcode.com>

* providers/local/camel-local-provider.c: Changed the descriptions
for mh, mbox, and maildir to be more "user-friendly".

23 years agoNew header to prevent recursive #include problems
Dan Winship [Wed, 10 Jan 2001 20:20:02 +0000 (20:20 +0000)]
New header to prevent recursive #include problems

* providers/imap/camel-imap-types.h: New header to prevent
recursive #include problems

23 years agoNew header to prevent recursive #include problems
Dan Winship [Wed, 10 Jan 2001 20:19:45 +0000 (20:19 +0000)]
New header to prevent recursive #include problems

* 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

23 years agoNew class function, parallel to camel_folder_sync. (The default
Dan Winship [Wed, 10 Jan 2001 17:10:44 +0000 (17:10 +0000)]
New class function, parallel to camel_folder_sync. (The default

* 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.

23 years ago Mostly IMAP changes. Use the NAMESPACE extension (where
Dan Winship [Tue, 9 Jan 2001 22:25:50 +0000 (22:25 +0000)]
Mostly IMAP changes. Use the NAMESPACE extension (where
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.

23 years ago Kill off a long-hated Camel kludge: "empty" URLs and
Dan Winship [Tue, 9 Jan 2001 19:27:27 +0000 (19:27 +0000)]
Kill off a long-hated Camel kludge: "empty" URLs and
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.

23 years agoDont try and unref a messageinfo that wasn't there, and use the right free
Not Zed [Sat, 6 Jan 2001 02:25:04 +0000 (02:25 +0000)]
Dont try and unref a messageinfo that wasn't there, and use the right free

2001-01-06  Not Zed  <NotZed@HelixCode.com>

        * providers/vee/camel-vee-folder.c (vee_folder_build_folder): Dont
        try and unref a messageinfo that wasn't there, and use the right
        free function too.  Modified patch from Iain.
        (vee_move_message_to): New method, call the real folders'
        move_message_to method.

23 years agoRemove conflict thingie from a while back
JP Rosevear [Thu, 4 Jan 2001 21:48:22 +0000 (21:48 +0000)]
Remove conflict thingie from a while back

23 years agooops, forgot the changelog entry
JP Rosevear [Thu, 4 Jan 2001 21:47:21 +0000 (21:47 +0000)]
oops, forgot the changelog entry

23 years agofix includes for compilation
JP Rosevear [Thu, 4 Jan 2001 19:40:10 +0000 (19:40 +0000)]
fix includes for compilation

2001-01-04  JP Rosevear  <jpr@helixcode.com>

* tests/lib/Makefile.am: fix includes for compilation

* tests/message/Makefile.am: Build test3 again

* tests/message/test2.c: Kill warnings with header includes

* tests/message/test3.c: ditto

* tests/lib/streams.c: ditto

* tests/lib/camel-test.c: ditto

* tests/lib/messages.c: ditto

* tests/lib/folders.c: ditto

23 years agooops. commit-o
Dan Winship [Thu, 4 Jan 2001 18:53:41 +0000 (18:53 +0000)]
oops. commit-o

23 years agoFix two problems in figuring out server-expunged messages.
Dan Winship [Thu, 4 Jan 2001 18:40:57 +0000 (18:40 +0000)]
Fix two problems in figuring out server-expunged messages.

* providers/imap/camel-imap-folder.c (imap_rescan): Fix two
problems in figuring out server-expunged messages.

23 years agoFix two problems in figuring out server-expunged messages.
Dan Winship [Thu, 4 Jan 2001 16:57:39 +0000 (16:57 +0000)]
Fix two problems in figuring out server-expunged messages.

* providers/imap/camel-imap-folder.c (imap_rescan): Fix two
problems in figuring out server-expunged messages.

23 years agoIf we have a lot of messages changed, promote it to a folder changed
Not Zed [Thu, 4 Jan 2001 07:28:40 +0000 (07:28 +0000)]
If we have a lot of messages changed, promote it to a folder changed

2001-01-04  Not Zed  <NotZed@HelixCode.com>

        * camel-folder.c (thaw): If we have a lot of messages changed,
        promote it to a folder changed event.

23 years agoImplemented. (search_header_exists): Implemented.
Jeffrey Stedfast [Thu, 4 Jan 2001 06:40:33 +0000 (06:40 +0000)]
Implemented. (search_header_exists): Implemented.

2000-01-03  Jeffrey Stedfast  <fejj@helixcode.com>

* camel-folder-search.c (search_header_matches): Implemented.
(search_header_exists): Implemented.
(search_header_starts_with): Implemented.
(search_header_ends_with): Implemented.

23 years agoInitialize the exists variable so that we don't do random things if the
Christopher James Lahey [Wed, 3 Jan 2001 17:33:11 +0000 (17:33 +0000)]
Initialize the exists variable so that we don't do random things if the

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.

23 years agoREmove warning, this isn't really deprecated, sigh.
Not Zed [Wed, 3 Jan 2001 00:15:54 +0000 (00:15 +0000)]
REmove warning, this isn't really deprecated, sigh.

2000-12-29  Not Zed  <NotZed@HelixCode.com>

        * camel-folder.c (camel_folder_move_message_to): REmove warning,
        this isn't really deprecated, sigh.

        * camel-mime-utils.c (header_fold): Comment out some debug.

23 years agoFinishing the removal of these directories.
Chris Lahey [Tue, 2 Jan 2001 23:49:44 +0000 (23:49 +0000)]
Finishing the removal of these directories.

23 years agoRemoved these directories since they're unused.
Christopher James Lahey [Tue, 2 Jan 2001 23:48:27 +0000 (23:48 +0000)]
Removed these directories since they're unused.

2001-01-02  Christopher James Lahey  <clahey@helixcode.com>

* providers/maildir/, providers/mbox/, providers/mh/: Removed
these directories since they're unused.

23 years agofix off-by-one
Dan Winship [Tue, 2 Jan 2001 22:13:32 +0000 (22:13 +0000)]
fix off-by-one

23 years ago IMAP randomness.
Dan Winship [Tue, 2 Jan 2001 22:07:44 +0000 (22:07 +0000)]
IMAP randomness.

* 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.

23 years agoNew function to return just foo/bar with no parameters.
Dan Winship [Tue, 2 Jan 2001 19:33:34 +0000 (19:33 +0000)]
New function to return just foo/bar with no parameters.

* camel-mime-utils.c (header_content_type_simple): New function to
return just foo/bar with no parameters.

* camel-data-wrapper.c (get_mime_type): Use
header_content_type_simple rather than header_content_type_format.

23 years agoRemove this. It was only a thin wrapper around struct _header_content_type
Dan Winship [Thu, 28 Dec 2000 19:28:39 +0000 (19:28 +0000)]
Remove this. It was only a thin wrapper around struct _header_content_type

* gmime-content-field.[ch]: Remove this. It was only a thin
wrapper around struct _header_content_type anyway, and didn't
match the naming scheme of anything else.

* Makefile.am: Remove gmime-content-field.[ch]

* camel.h: Remove gmime-content-field.h

* camel-types.h: Add CamelContentType as a typedef for struct
_header_content_type (especially for use outside of camel).

* camel-multipart.c:
* camel-mime-part.c:
* camel-mime-message.c:
* camel-folder-summary.c:
* camel-folder-search.c:
* camel-data-wrapper.[ch]: Use CamelContentType and
header_content_type_* functions rather than the GMime stuff.

* camel-mime-part-utils.c:
* camel-medium.c: Remove unused gmime-content-field.h include.

23 years agoFix the APOP check to not crash on servers that don't return any
Dan Winship [Wed, 27 Dec 2000 19:10:06 +0000 (19:10 +0000)]
Fix the APOP check to not crash on servers that don't return any

* providers/pop3/camel-pop3-store.c (connect_to_server): Fix the
APOP check to not crash on servers that don't return any
information on the +OK greeting line.

23 years ago (camel_imap_folder_changed): Make sure we unref the summary lookup.
Michael Zucci [Sun, 24 Dec 2000 01:42:27 +0000 (01:42 +0000)]
(camel_imap_folder_changed): Make sure we unref the summary lookup.

23 years ago clean up a stubborn and hard to remove imap_folder->summary.
Michael Zucci [Sun, 24 Dec 2000 01:41:17 +0000 (01:41 +0000)]
clean up a stubborn and hard to remove imap_folder->summary.

23 years ago Minor compilation fixes.
Michael Zucci [Sun, 24 Dec 2000 00:51:54 +0000 (00:51 +0000)]
Minor compilation fixes.

23 years agoLock the command channel while searching. (imap_body_contains): If
Not Zed [Sun, 24 Dec 2000 00:46:20 +0000 (00:46 +0000)]
Lock the command channel while searching. (imap_body_contains): If

2000-12-24  Not Zed  <NotZed@HelixCode.com>

        * providers/imap/camel-imap-search.c (imap_body_contains): Lock
        the command channel while searching.
        (imap_body_contains): If performing a whole uid search, then add
        references to our own summary items, dont look it up in the
        folder.  This way they can't vanish unexpectedly.

        * providers/imap/camel-imap-folder.h (CamelImapFolder): Added a
        private field.

        * providers/imap/camel-imap-private.h: Added lock for imap
        searches.

        * Merge from camel-mt-branch.

        * providers/imap/camel-imap-folder.c (imap_update_summary): Merge
        fix, use the folder->summary.
        (imap_get_message_flags, imap_set_message_flags,
        imap_get_message_user_flag, imap_set_message_user_flag): Removed
        again.
        (camel_imap_folder_init): Setup private data/lock.
        (imap_finalize): Free private data/search lock.
        (imap_search_free): Lock the search_lock.
        (imap_search_by_expression): Lock the search lock when using the
        search object.  Also copy/ref hte summary, rather than getting it
        directly.
        (imap_refresh_info): Free any info lookups.  Use folder->summary
        not imap_folder->summary.  And lock around commands.

23 years agoWhen getting the top-level folder list, include INBOX even if it's not
Dan Winship [Fri, 22 Dec 2000 20:33:00 +0000 (20:33 +0000)]
When getting the top-level folder list, include INBOX even if it's not

* 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.

23 years agoNew CamelFolderSearch subclass that just reimplements body_contains (using
Dan Winship [Thu, 21 Dec 2000 19:50:09 +0000 (19:50 +0000)]
New CamelFolderSearch subclass that just reimplements body_contains (using

* 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

23 years agoUpdate the doc comment: since it always NUL-terminates the buffer, it
Dan Winship [Thu, 21 Dec 2000 17:14:07 +0000 (17:14 +0000)]
Update the doc comment: since it always NUL-terminates the buffer, it

* camel-stream-buffer.c (camel_stream_buffer_gets): Update the
doc comment: since it always NUL-terminates the buffer, it reads
at most @max-1 bytes, not @max.

* camel-remote-store.c (remote_recv_line): Fix the "did
camel_stream_buffer_gets fill the whole buffer" check. Fixes a bug
when reading lines longer than 1024 characters (eg, IMAP SEARCH
responses in very large folders).

23 years agoOops. Don't do "FETCH 1:0" when the folder is empty.
Dan Winship [Tue, 19 Dec 2000 20:40:12 +0000 (20:40 +0000)]
Oops. Don't do "FETCH 1:0" when the folder is empty.

* 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.

23 years agoAdd "guint32 server_flags" to CamelImapMessageInfo to keep track of the
Dan Winship [Tue, 19 Dec 2000 19:42:15 +0000 (19:42 +0000)]
Add "guint32 server_flags" to CamelImapMessageInfo to keep track of the

        * 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.

23 years agoChange the semantics of fmt: Now %S (capital S) means an IMAP "string",
Dan Winship [Mon, 18 Dec 2000 19:17:17 +0000 (19:17 +0000)]
Change the semantics of fmt: Now %S (capital S) means an IMAP "string",

* 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.

23 years agoWhen checking to see if we need to fold the header, when we come accross a
Jeffrey Stedfast [Fri, 15 Dec 2000 21:33:21 +0000 (21:33 +0000)]
When checking to see if we need to fold the header, when we come accross a

2000-12-15  Jeffrey Stedfast  <fejj@helixcode.com>

* camel-mime-utils.c (header_fold): When checking to see if we
need to fold the header, when we come accross a \n, make sure to
start at p + 1 the next time through the loop or else we get into
an infinite loop.

23 years agochange a bunch of IS_CAMEL_* macros to CAMEL_IS_*
Dan Winship [Wed, 13 Dec 2000 19:56:34 +0000 (19:56 +0000)]
change a bunch of IS_CAMEL_* macros to CAMEL_IS_*

* Namespace cleanup: change a bunch of IS_CAMEL_* macros to
CAMEL_IS_*

23 years agoadd #include <sys/types.h> for freebsd.
Chris Toshok [Wed, 13 Dec 2000 19:40:53 +0000 (19:40 +0000)]
add #include <sys/types.h> for freebsd.

2000-12-13  Chris Toshok  <toshok@helixcode.com>

* providers/imap/camel-imap-auth.c: add #include <sys/types.h> for
freebsd.

23 years agoAdded #ifndef NO_WARNINGS around a #warning. Added (void) to the prototype
Christopher James Lahey [Tue, 12 Dec 2000 23:31:40 +0000 (23:31 +0000)]
Added #ifndef NO_WARNINGS around a #warning. Added (void) to the prototype

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.

23 years agoAdd missing .h file. (From campd.)
Dan Winship [Tue, 12 Dec 2000 23:10:39 +0000 (23:10 +0000)]
Add missing .h file. (From campd.)

* tests/lib/Makefile.am: Add missing .h file. (From campd.)

23 years agoRemove use of linewrap filter. Headers are now wrapped. encode_8bit
Michael Zucci [Mon, 11 Dec 2000 11:40:15 +0000 (11:40 +0000)]
Remove use of linewrap filter. Headers are now wrapped. encode_8bit

* providers/smtp/camel-smtp-transport.c (smtp_data): Remove use of
linewrap filter.  Headers are now wrapped.  encode_8bit already
enforces a 998 octet line limit.
(smtp_data): Also fixed a memleak, we always have to unref our own
copy of the filters.  We also dont need to remove them manually,
so dont bother.  The type's an int too ...

* camel-internet-address.c (internet_unformat): When scanning past
quotes, remove them also.
(camel_internet_address_format_address): If the name contains "'s,
or ','s then strip and quotes and wrap the whole lot in one set of
quotes.

* Makefile.am (noinst_HEADERS): We dont want to install
camel-charset-map-private.h, ever.  There are probably other
similar files ..?

* camel-mime-part.c (write_to_stream): Fold header lines
appropriately as we're writing them out.

* camel-mime-utils.c (header_fold): Add a new argument, headerlen,
tells it how long the associated header token is.
(header_fold): Also,k check to see if we need to fold first, using
a better algorithm, and also accept already-folded lines, and
re-process accordingly.
(rfc2047_decode_word): Add a little buffer space to iconv output
for shifting overheads?
(rfc2047_decode_word): finish the iconv with a null call, to flush
shift state, etc.
(rfc2047_encode_word): Attempt to break up long words into
appropriately sized, independent, chunks.  See rfc2047, section 2.
(header_decode_mailbox): Dont add in extra spaces into the output
if we are decoding adjacent encoded words.  We can only guess this
case, as some broken mailers put encoded words inside quoted
words.
(header_encode_phrase): Dont merge words if they are going to end
up too long.  Also change back ot only merge consecutive words of
the same type.  e.g. 'foo. blah fum.' -> "foo." blah "fum."  or
'iam an. idiot' -> iam "an." idiot

23 years agoHrm, we actually want to call set_header, not add_header here, probably
Not Zed [Mon, 11 Dec 2000 04:09:03 +0000 (04:09 +0000)]
Hrm, we actually want to call set_header, not add_header here, probably

2000-12-11  Not Zed  <NotZed@HelixCode.com>

        * camel-medium.c (camel_medium_set_header): Hrm, we actually want
        to call set_header, not add_header here, probably explains some
        duplicate X-Evolution headers i was trying to track down.  Also
        changed the api to handle a NULL value == remove the header.

        * providers/local/camel-maildir-summary.c
        (maildir_summary_decode_x_evolution): Always return error, we dont
        use x-evolution for maildir.
        (maildir_summary_encode_x_evolution): Always return a NULL string,
        likewise.
        (maildir_summary_add): Hook in here, since the _new function
        doesn't have access to any flags from the caller.  If we have
        flags, then update the filename again.  Not ideal, but should
        work.

23 years ago oops
Michael Zucci [Fri, 8 Dec 2000 18:06:19 +0000 (18:06 +0000)]
oops

23 years agoShush
JP Rosevear [Fri, 8 Dec 2000 17:55:41 +0000 (17:55 +0000)]
Shush

23 years agoRemove test3 from build until the files show up
JP Rosevear [Fri, 8 Dec 2000 17:52:27 +0000 (17:52 +0000)]
Remove test3 from build until the files show up

2000-12-08  JP Rosevear  <jpr@helixcode.com>

* tests/message/Makefile.am: Remove test3 from build until the files
show up

2000-12-08  JP Rosevear  <jpr@helixcode.com>

* Makefile.am: Remove files from extra_dist since they are already
listed

23 years agoChange the sign of the default date offset when none is supplied.
Not Zed [Fri, 8 Dec 2000 14:22:36 +0000 (14:22 +0000)]
Change the sign of the default date offset when none is supplied.

2000-12-09  Not Zed  <NotZed@HelixCode.com>

* camel-mime-message.c (camel_mime_message_set_date): Change the
sign of the default date offset when none is supplied.
(camel_mime_message_set_date): Also do dst if its dst (forward 1
hour).  Fixes #928 + some.

23 years agoChange line no format so that emacs can detect it.
Not Zed [Thu, 7 Dec 2000 22:28:59 +0000 (22:28 +0000)]
Change line no format so that emacs can detect it.

2000-12-06  Not Zed  <NotZed@HelixCode.com>

        * tests/lib/camel-test.h (check): Change line no format so that
        emacs can detect it.

23 years agoWe want to bitwise-or the server and cached flags here so that we keep the
Jeffrey Stedfast [Thu, 7 Dec 2000 02:02:43 +0000 (02:02 +0000)]
We want to bitwise-or the server and cached flags here so that we keep the

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.

23 years agoIf the data wrapper fails to be written to the stream, unref it and the
Jeffrey Stedfast [Tue, 5 Dec 2000 23:47:50 +0000 (23:47 +0000)]
If the data wrapper fails to be written to the stream, unref it and the

2000-12-05  Jeffrey Stedfast  <fejj@helixcode.com>

* providers/smtp/camel-smtp-transport.c (smtp_data): If the data
wrapper fails to be written to the stream, unref it and the
filters before returning.

23 years ago (imap_refresh_info): Fix a really really really dumb bug.
Dan Winship [Tue, 5 Dec 2000 22:58:41 +0000 (22:58 +0000)]
(imap_refresh_info): Fix a really really really dumb bug.

23 years agouse BODY.PEEK[] rather than RFC822, so the message doesn't get marked as
Dan Winship [Tue, 5 Dec 2000 22:20:10 +0000 (22:20 +0000)]
use BODY.PEEK[] rather than RFC822, so the message doesn't get marked as

* providers/imap/camel-imap-folder.c (imap_get_message): use
BODY.PEEK[] rather than RFC822, so the message doesn't get marked
as \Seen.

23 years agoFix the check for "flags aren't actually changing".
Dan Winship [Tue, 5 Dec 2000 16:46:15 +0000 (16:46 +0000)]
Fix the check for "flags aren't actually changing".

* 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.

23 years ago Stream testing stuff.
Michael Zucci [Tue, 5 Dec 2000 12:07:01 +0000 (12:07 +0000)]
Stream testing stuff.

23 years agostream_flush does make sense for a substream afterall (if you have a
Not Zed [Tue, 5 Dec 2000 11:50:32 +0000 (11:50 +0000)]
stream_flush does make sense for a substream afterall (if you have a

2000-12-05  Not Zed  <NotZed@HelixCode.com>

        * camel-seekable-substream.c (stream_flush): stream_flush does
        make sense for a substream afterall (if you have a stream_write).
        (stream_write): Implement this.
        (stream_seek): Change the STREAM_END behaviour to be more sane.
        if bounded go from the end of the bound, if unbounded, go from the
        end of the parent stream.

        * camel-stream-mem.c (stream_read): Dont return error if reading
        past the end of data, just return 0.

        * camel-stream-fs.c (camel_stream_fs_init): Initialise the stream
        to be unbound.
        (stream_seek): Fix the logic when seeking from the end of an
        unbounded stream.
        (camel_stream_fs_new_with_fd): If the fd is invalid (-1), then
        return NULL immediately.
        (stream_seek): Range check a SEEK_END so it fits within
        bound_start.

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

        * tests/lib/folders.c (test_folder_basic): New test to perform
        basic store operations on folders (taken from folders/test1).
        (test_folder_message_ops): Tkane the guts out of folders/test2.

23 years agoi18n-ize exception strings. (get_name): And here. (_send_to): Here too.
Jeffrey Stedfast [Mon, 4 Dec 2000 22:37:45 +0000 (22:37 +0000)]
i18n-ize exception strings. (get_name): And here. (_send_to): Here too.

2000-12-04  Jeffrey Stedfast  <fejj@helixcode.com>

* providers/smtp/camel-smtp-transport.c (smtp_connect): i18n-ize
exception strings.
(get_name): And here.
(_send_to): Here too.
(smtp_helo): And here and there...
(smtp_mail): And around the square...
(smtp_rcpt): Saying catch me if you can...
(smtp_data): And here three.
(smtp_rset): And here.
(smtp_quit): And finally here.

23 years ago added some imap tests, tho they dont get far yet and dont
Michael Zucci [Mon, 4 Dec 2000 12:59:01 +0000 (12:59 +0000)]
added some imap tests, tho they dont get far yet and dont
recover automatically.

23 years agoAdded system_flag to CamelFolderSearchClass
Jeffrey Stedfast [Sat, 2 Dec 2000 03:55:18 +0000 (03:55 +0000)]
Added system_flag to CamelFolderSearchClass

2000-12-01  Jeffrey Stedfast  <fejj@helixcode.com>

* camel-folder-search.h: Added system_flag to CamelFolderSearchClass

* camel-folder-summary.c (camel_system_flag_get): Convenience
function to return whether or not a flag is set using a string as
the flag name.
(camel_system_flag): Return the integer value of the flag string.

* camel-folder-search.c (search_system_flag): New ESExp callback
for allowing vfoldering on CamelMessageInfo flags.

23 years agoDon't g_return_if_fail if the service is already disconnected. Just
Dan Winship [Fri, 1 Dec 2000 17:32:42 +0000 (17:32 +0000)]
Don't g_return_if_fail if the service is already disconnected. Just

* camel-service.c (camel_service_disconnect): Don't
g_return_if_fail if the service is already disconnected. Just
return.

* providers/pop3/camel-pop3-store.c (pop3_try_authenticate):
Return FALSE (don't try again) if we get CAMEL_POP3_FAIL.
(pop3_connect): If we don't succeed, disconnect.

23 years agoFix a possible bug where 'name' could be uninitialized.
Jeffrey Stedfast [Fri, 1 Dec 2000 04:25:43 +0000 (04:25 +0000)]
Fix a possible bug where 'name' could be uninitialized.

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.

23 years agoNew convenience function, doesn't do much but it sure makes code cleaner
Jeffrey Stedfast [Fri, 1 Dec 2000 00:34:33 +0000 (00:34 +0000)]
New convenience function, doesn't do much but it sure makes code cleaner

2000-11-30  Jeffrey Stedfast  <fejj@helixcode.com>

* 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.

23 years agoHandle the case where the summary failed to load - clear the summary and
Jeffrey Stedfast [Thu, 30 Nov 2000 21:15:09 +0000 (21:15 +0000)]
Handle the case where the summary failed to load - clear the summary and

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?

23 years agoRemove unused variable.
Dan Winship [Thu, 30 Nov 2000 20:53:55 +0000 (20:53 +0000)]
Remove unused variable.

* camel-exception.c (camel_exception_setv): Remove unused
variable.

23 years agoRemove assertion that content is there, when it no longer can be.
Not Zed [Thu, 30 Nov 2000 11:05:36 +0000 (11:05 +0000)]
Remove assertion that content is there, when it no longer can be.

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.

23 years agoUpdated the gtk-doc comment.
Jeffrey Stedfast [Wed, 29 Nov 2000 21:35:14 +0000 (21:35 +0000)]
Updated the gtk-doc comment.

2000-11-29  Jeffrey Stedfast  <fejj@helixcode.com>

* camel-store.c (camel_store_get_folder): Updated the gtk-doc
comment.

23 years agoUse iconv instead of unicode_iconv.
Dan Winship [Wed, 29 Nov 2000 20:41:08 +0000 (20:41 +0000)]
Use iconv instead of unicode_iconv.

* camel-mime-utils.c:
* camel-mime-filter-charset.c: Use iconv instead of unicode_iconv.

23 years agoFix some off-by-one-ness.
Dan Winship [Wed, 29 Nov 2000 20:04:16 +0000 (20:04 +0000)]
Fix some off-by-one-ness.

* 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.

23 years agoBuilddir != srcdir loving.
Ettore Perazzoli [Wed, 29 Nov 2000 12:33:21 +0000 (12:33 +0000)]
Builddir != srcdir loving.

23 years agoAdd a missed unref.
Not Zed [Wed, 29 Nov 2000 10:49:05 +0000 (10:49 +0000)]
Add a missed unref.

2000-11-29  Not Zed  <NotZed@HelixCode.com>

* tests/message/test2.c (main): Add a missed unref.

* camel-stream-mem.c (camel_stream_mem_set_buffer): We must set
ourselves as the owner of the byte-array.
Weird, someone has modified this file (its been reindented), but i
can't see any changelogs ...

* tests/lib/messages.c (content_finalise): Fix memleak in tester,
free byte array when our content object is deleted.

* camel-folder-search.c (camel_folder_search_finalize): Yeah
great, so the sexp is a gtk object, not a camel object.  Isn't
that going to be fun to fix?

* camel-session.c (camel_session_finalise): Free the storage path.

* providers/local/camel-local-store.c (camel_local_store_init): If
store->folders is setup, free it first, then overwrite.  Hmm,
this seems a bit crappy to me.

* camel-store.c (camel_store_init): Dont setup store->folders if
its already setup.

* camel-exception.c (camel_exception_setv): Removed a memleak.  no
need to strdup after a strdup_printf!!!

* camel-address.c (camel_address_finalize): Free the address
ptrarray, once finished.

* providers/local/camel-local-folder.c (local_finalize): Make sure
we dont leave the folder locked on close.
(local_finalize): Free summary/search.

* providers/local/camel-mh-summary.c (mh_summary_next_uid_string):
Small memleak, always free name after using it.

* camel-mime-part.c (set_content_object): Free txt after setting
the header.

* providers/local/camel-maildir-summary.c (maildir_summary_check):
Fix a memleak, close the dir after scanning new.
(message_info_free): Added so we can free the filename cached in
the messageinfo.
(camel_maildir_summary_finalise): Free the hostname.

* tests/folder/test[12].c (main): Clear out camel-test before
starting.

* providers/local/camel-mbox-summary.c (mbox_summary_sync_quick):
Because encode_x_evolution folds the line (sigh, because
encode_param does, unlike every other function in
camel-mime-utils), unfold the encoded result before comparing.
(mbox_summary_sync_quick): Another small memleak, free xevnew once
finished with it.

* camel-mime-utils.c (header_decode_quoted_string): Removed a
redundant check for c=0.
(header_unfold): New function to un-fold headers.

* providers/local/camel-local-summary.c
(local_summary_encode_x_evolution): some problems with encoding
tags, using the wrong output strings.
(local_summary_encode_x_evolution): We dont need to append a ;
either, param_list_format_append() will do it for us.
`

23 years agoShush
JP Rosevear [Wed, 29 Nov 2000 03:54:09 +0000 (03:54 +0000)]
Shush

23 years agoAdd USE_FLOCK, USE_FCNTL, USE_FLOCK
JP Rosevear [Tue, 28 Nov 2000 22:58:58 +0000 (22:58 +0000)]
Add USE_FLOCK, USE_FCNTL, USE_FLOCK

2000-11-28  JP Rosevear  <jpr@helixcode.com>

* acconfig.h: Add USE_FLOCK, USE_FCNTL, USE_FLOCK

* configure.in: Auto* magic for various camel locking types

2000-11-28  JP Rosevear  <jpr@helixcode.com>

* camel-lock.c: No longer hard code the enabled lock types

23 years agoDon't set exception to g_strerror (errno) when nread == 0, because it
Dan Winship [Tue, 28 Nov 2000 21:27:16 +0000 (21:27 +0000)]
Don't set exception to g_strerror (errno) when nread == 0, because it

* camel-remote-store.c (remote_recv_line): Don't set exception to
g_strerror (errno) when nread == 0, because it won't have been
set.

23 years agoDon't try to free things if they haven't been set yet.
Dan Winship [Tue, 28 Nov 2000 20:36:46 +0000 (20:36 +0000)]
Don't try to free things if they haven't been set yet.

* providers/pop3/camel-pop3-folder.c (pop3_finalize): Don't try to
free things if they haven't been set yet.

23 years agosend NULL so we don't have to clear the exception
Jeffrey Stedfast [Tue, 28 Nov 2000 17:29:40 +0000 (17:29 +0000)]
send NULL so we don't have to clear the exception

23 years agoClear the exception if EHLO fails before trying HELO in the cases where
Jeffrey Stedfast [Tue, 28 Nov 2000 17:25:19 +0000 (17:25 +0000)]
Clear the exception if EHLO fails before trying HELO in the cases where

2000-11-28  Jeffrey Stedfast  <fejj@helixcode.com>

* providers/smtp/camel-smtp-transport.c (smtp_connect): Clear the
exception if EHLO fails before trying HELO in the cases where the
SMTP provider doesn't announce its ESMTPness.

23 years agoSet the info size's properly, oops!
Not Zed [Tue, 28 Nov 2000 13:13:23 +0000 (13:13 +0000)]
Set the info size's properly, oops!

2000-11-28  Not Zed  <NotZed@HelixCode.com>

* providers/local/camel-maildir-summary.c
(camel_maildir_summary_init): Set the info size's properly, oops!

* tests/lib/folders.[ch]: Folder testing helpers.

* tests/folder/test2.c: Test basic message ops on folders.

* tests/folder/test1.c (main): Test basic folder ops on (local)
stores.

* providers/local/camel-local-provider.c
(camel_provider_module_init): Removed some debug.

* providers/local/camel-maildir-folder.c
(camel_maildir_folder_class_init): fix parent class.

* providers/local/camel-mh-folder.c (camel_mh_folder_class_init):
Fix parent class (damn cut & paste).

* providers/local/camel-maildir-store.c (get_folder): Call parent
impl.
(camel_maildir_store_class_init): Fix parent class setup.
(delete_folder): Check the folder exists before trying to delete
it.
(delete_folder): Try and make the delete operation atomic/rollback
failures.  e.g. if one directory isn't empty, then create the
other empty ones back.  Also clear the tmp directory fully first.

* providers/local/camel-mbox-store.c (get_folder): Call parent
impl.
(camel_mbox_store_class_init): parent class is camel_local_store,
not camel_folder, oops.
(delete_folder): Return an error if it doesn't exist, rather than
covering it up.

* providers/local/camel-mh-store.c (get_folder): Call parent impl.
(camel_mh_store_class_init): fix parent class setup.
(delete_folder): Error if it doesn't exist now.

* camel-folder.c (camel_folder_move_message_to):
(camel_folder_copy_message_to): Added warnings as these functions
are going to be removed later.

* camel-store.c (camel_store_get_root_folder): Fix for an early
api change.  We want CAMEL_STORE_FOLDER_CREATE, not TRUE, since
its a flag.
(camel_store_get_default_folder): And here too.

* providers/local/camel-local-store.c (xrename): Handle renaming
folders differently to renaming files.
(get_default_folder_name): local stores dont have a default
folder, so make it so.  Or at least, it doesn't seem to make sense
to have one.
(get_root_folder_name): Same for root.
(get_folder): Added parent implementation, that makes sure the
service path exists, if we are creating a new folder (but doesn't
create the folder).

2000-11-27  Not Zed  <NotZed@HelixCode.com>

* providers/local/camel-local-store.c (xrename): Fixed races.  Use
link/unlink, rather than rename, to properly detect overwriting
another file.  And allow some files to be missing.

* providers/Makefile.am: Removed mh, mbox, added local, to the default.

23 years agoadd scan = scan->next; to avoid infinite loop
Radek Doulik [Tue, 28 Nov 2000 12:54:31 +0000 (12:54 +0000)]
add scan = scan->next; to avoid infinite loop

2000-11-28  Radek Doulik  <rodo@helixcode.com>

* providers/local/camel-local-summary.c
(local_summary_decode_x_evolution): add scan = scan->next; to
avoid infinite loop

23 years agoMake this gratuitously more complicated. No wait, I mean, fix bugs. Now
Dan Winship [Tue, 28 Nov 2000 03:26:51 +0000 (03:26 +0000)]
Make this gratuitously more complicated. No wait, I mean, fix bugs. Now

* 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.

23 years agoRemove "complete" field
JP Rosevear [Mon, 27 Nov 2000 20:30:51 +0000 (20:30 +0000)]
Remove "complete" field

2000-11-27  JP Rosevear  <jpr@helixcode.com>

* conduit/address-conduit.h: Remove "complete" field

* conduit/address-conduit.c (print_local): Make it print useful debug
info
(print_remote): ditto
(local_record_from_ecard): Make sure phone numbers get out to the pilot
(ecard_from_remote_record): Set phone strings to "" if they are null
(sequence_complete): unref the book view
(view_cb): ref the book view
(free_prepare): do nothing

* backend/pas/pas-backend-file.c (pas_backend_file_book_view_free):
Destroy the card lists with the rest of the view.
(pas_backend_file_changes): Don't destroy the card lists here
(pas_backend_file_book_view_free): Free the card/id lists in the
change context here, the correct place.
(pas_backend_file_changes): instead of here...

2000-11-27  JP Rosevear  <jpr@helixcode.com>

* conduits/todo/todo-conduit.c (free_prepare): Ditto

* conduits/calendar/calendar-conduit.c (free_prepare): Adjust
free_prepare to the correct signal parameters.  Don't actually
do anything - there is a semantic discrepancy that needs to be
resolved.

2000-11-27  JP Rosevear  <jpr@helixcode.com>

* providers/local/.cvsignore: shush

23 years agoRemoved mh, mbox, added local, to the default.
Not Zed [Mon, 27 Nov 2000 02:18:00 +0000 (02:18 +0000)]
Removed mh, mbox, added local, to the default.

2000-11-27  Not Zed  <NotZed@HelixCode.com>

        * providers/Makefile.am: Removed mh, mbox, added local, to the default.

23 years agolittle util to scan mailboxes for any and every address they contain.
Michael Zucci [Fri, 24 Nov 2000 07:06:45 +0000 (07:06 +0000)]
little util to scan mailboxes for any and every address they contain.

* tests/data/getaddr.pl: little util to scan mailboxes for any and
every address they contain.

* tests/message/test2.c (main): Added a bunch of stuff to test
decoding/reencoding/etc of internationalised addresses.

* tests/message/lib/address-data.h: Copy of some unicode/other
testing data.  **Beware** of editing this file in emacs, it'll
probably try and convert all the characters to something
unusable.

* tests/lib/camel-test.c (camel_test_break): Add a debugger hook
point.

* camel-mime-utils.c (quoted_encode): Check for space and convert
to _ separately.
(header_decode_mailbox): Fixed the 'check comments for realname'
code, problem was the domain getting code was skipping all
whitespace/comments before we could get a look-in.  This is
approximate but fairly robust.
(header_decode_text): Dont use the c-type isspace func here, we
want a specific whitespace only.
(header_decode_text): If we have decoded words next to each other,
do not insert whitespaces between them, which is what rfc2047 requires.
(header_decode_text): Make c unsigned too.

23 years agoAdded at least some explanation of all this stuff.
Not Zed [Fri, 24 Nov 2000 03:54:55 +0000 (03:54 +0000)]
Added at least some explanation of all this stuff.

2000-11-24  Not Zed  <NotZed@HelixCode.com>

* tests/README: Added at least some explanation of all this stuff.

* tests/lib/camel-test.h (check_msg): Added a non-gcc version of
the fail command, we dont get the expression that failed, but no
matter.  Should be (more) portable now.
(check, check_msg): Put the file/lineno in the default message.

23 years agoAdd tests.
Not Zed [Fri, 24 Nov 2000 03:18:20 +0000 (03:18 +0000)]
Add tests.

2000-11-24  Not Zed  <NotZed@HelixCode.com>

* Makefile.am (SUBDIRS): Add tests.

* camel-mime-filter-basic.c (filter): Well, I'll add the extra
bytes here too, lathough not strictly needed, might save a
re-malloc when we get to complete().

* camel-mime-filter-charset.c (filter): Make sure we have room if
we only convert very short data.
(complete): and here too.

* tests/Makefile.am: Initial test harness & tests.  Requires gcc
for this.

* camel-internet-address.c (d): Turn off debug.

* camel-charset-map.c (camel_charset_step): Oops, & masks for set
intersection, not | them.  Dunno how this got even close to
working.

2000-11-23  Not Zed  <NotZed@HelixCode.com>

* camel-mime-filter-basic.c (filter): For base64 encoding, the
output size for 0, 1, or 2 bytes of input can exceed input*2, so
make sure we account for that as well.
(complete): And here.
(complete): Similarly for qp encoding, if we have a trailing
space, we need some extra bytes (not needed for 'filter()', as any
such bytes are stored in state/save).

* camel-mime-utils.c (quoted_decode_step): Removed fixme not required.
(quoted_encode_close): Dont append a trailing afterall.  Otherwise
a pass through the encode/decode will grow the message each time.

23 years agocheck for return values
Radek Doulik [Wed, 22 Nov 2000 15:50:10 +0000 (15:50 +0000)]
check for return values

2000-11-22  Radek Doulik  <rodo@helixcode.com>

* camel-mime-utils.c (header_msgid_generate): check for return
values

23 years agoadd #ifdef HAVE_ALLOCA_H
Dan Winship [Tue, 21 Nov 2000 22:04:40 +0000 (22:04 +0000)]
add #ifdef HAVE_ALLOCA_H

* camel-lock.c:
* camel-movemail.c: add #ifdef HAVE_ALLOCA_H

23 years agoShite, -1 on error, >=0 on success. So i've just been truncating all the
Not Zed [Tue, 21 Nov 2000 13:38:53 +0000 (13:38 +0000)]
Shite, -1 on error, >=0 on success. So i've just been truncating all the

2000-11-21  Not Zed  <NotZed@HelixCode.com>

* providers/local/camel-mh-summary.c (mh_summary_sync_message):
Shite, -1 on error, >=0 on success.  So i've just been truncating
all the messages I touched, good one zed.
(mh_summary_sync_message): Sigh, and write to the right damn fd as
well.
(mh_summary_sync_message): Argh, and we need to compare the length
of the old xev -1 to the new xev, to check if we can optimise it.

* camel-folder.c (camel_folder_change_info_new): Init the pool.
(camel_folder_change_info_add_source): Allocate string in the
pool.
(camel_folder_change_info_add_source_list):
(camel_folder_change_info_add_update): No longer free the key, as
it cannot be yet.
(change_info_add_uid): Add a new arg, copy, telling it whether to
copy the uid argument or not, and copy using mempool_strdup.
(change_info_cat): Tell add_uid to copy the string.
(camel_folder_change_info_add_update): Call add_uid directly.
(change_info_remove): Call add_uid directly, with no copy, and
dont free the key.
(change_info_free_update): No longer required since we dont malloc
the keys.
(camel_folder_change_info_add_uid): Fix for add_uid change.
(camel_folder_change_info_remove_uid):
(camel_folder_change_info_change_uid):
(change_info_clear): No longer needed, just set the size to 0 on
the array directly.
(camel_folder_change_info_clear): Empty the arrays directly, and
flush the mempool too, and also clear uid_source, incase anyone
was silly enough to call us in the wrong order.
(camel_folder_change_info_free): Dont bother clearing the array's
contents, just free the pool and throw away all the indexes.

* camel-folder.h: Added a mempool to CamelFolderChangeInfo to
store the uid's we get.

* camel-folder-search.c (search_match_all): If we are only
matching a single info, just use that/do the search.
(camel_folder_search_match_expression): New function.  Matches a
single message info against an expression.
(camel_folder_search_init): Init a hash table used to map the
returned gptrarrays' to mempools.
(camel_folder_search_execute_expression): Store all of the string
data in a mempool, slightly faster, less wasted space (usually),.
(camel_folder_search_free_result): Check for the mempool that
stores the data for the list, and free that if we have it,
otherwise assume we need to use g_free() (which should only happen
if the list is empty at the moment).
: commented out the debugging prints.  Got sick of 'executing
header search' crap.

* providers/vee/camel-vee-folder.c (camel_vee_folder_init): Init
changes.
(camel_vee_folder_finalise): Free changes.
(vfolder_add_match): Simple helper to add a new matching info
record.
(camel_vee_folder_add_folder): Only trigger a changed event if we
have changes.
(vfolder_change_match): New function, changes our local vfolder
info to match the source.
(vfolder_add_match): Add a new info to the vfolder list.
(vfolder_remove_match): Remove a no-longer matching info from the
vfolder summary.
(message_changed): check if the message still matches, and
remove/etc as required.
(camel_vee_folder_finalise, init): init/free search object.
(vee_folder_build_folder): Build the changes to the folder into
the changes data, as we go.
(folder_changed): If the folder gave us an explicit list of
changes, then process each one separately (unless there's a lot
added/changed).

* providers/vee/camel-vee-folder.h: Added a changes field to the
folder.

23 years agoAdded camel-folder-thread.[ch].
Not Zed [Tue, 21 Nov 2000 03:51:33 +0000 (03:51 +0000)]
Added camel-folder-thread.[ch].

2000-11-21  Not Zed  <NotZed@HelixCode.com>

        * Makefile.am (libcamel_la_SOURCES): Added
        camel-folder-thread.[ch].

        * camel-folder-thread.c: message-threading algorithm, taken from
        evolutions' mail component, as it is generally more useful than
        just for evolution itself.  Changed to use e-memchunks as well to
        speed it up a little and use less mem.

23 years agofix changelog merge conflicts
Jeffrey Stedfast [Tue, 21 Nov 2000 02:21:40 +0000 (02:21 +0000)]
fix changelog merge conflicts

23 years agoFixed to return the correct bytecount in all cases which is the real fix
Jeffrey Stedfast [Tue, 21 Nov 2000 02:21:03 +0000 (02:21 +0000)]
Fixed to return the correct bytecount in all cases which is the real fix

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.

23 years agoFixes for the summary messageid changes. Hash the messageid and store it.
Not Zed [Mon, 20 Nov 2000 23:54:48 +0000 (23:54 +0000)]
Fixes for the summary messageid changes. Hash the messageid and store it.

2000-11-20  Not Zed  <NotZed@HelixCode.com>

* providers/nntp/camel-nntp-utils.c (get_XOVER_headers): Fixes for
the summary messageid changes.  Hash the messageid and store it.
(get_XOVER_headers): Use camel_folder_summary_info_new() to create
the summary item before adding it.

* camel-folder-summary.h (CamelMessageInfo): Changed the
messgae-id to be an 8 byte md5 hash, and the references list to be
an array of these.

* providers/local/camel-mh-summary.c (mh_summary_sync_message):
New function, sync out the message info stuff.  Only updates the
X-Ev header if it can get away with it, otherwise writes out a
whole new message.
(mh_summary_sync): Added more functionality.  All summary info is
now written to the X-Ev header, etc, and new messages re-written
if required during the sync process.

* providers/local/camel-local-folder.c
(local_set_message_user_flag): Set the XEVCHANGE flag.
(local_set_message_user_tag): And here too.

* providers/local/camel-local-summary.h: New flag
CAMEL_MESSAGE_FOLDER_XEVCHANGE to indicate the XEV header has
probably changed size and needs to be rewritten in whole.

* camel-folder-summary.c (next_uid_string): Want this static, not
const.
(message_info_new): Store the references and message-id values as
64 bit, binary hashes.
(message_info_load): fix for message-id/references changes.
(message_info_save): Likewise.
(camel_message_info_dup_to): And here.
(camel_message_info_free): And here too.  No longer free
message_id, and simple free for references array.
(CAMEL_FOLDER_SUMMARY_VERSION): Bumped file revision.
(camel_folder_summary_init): Init memchunk allocators to empty.
(camel_folder_summary_finalize): Free memchunk allocators if
there.
(message_info_new): Use the chunk allocator to allocate message
info's.
(camel_folder_summary_info_new): New helper to allocate the
message info, and setup the memchunk if required.
(content_info_alloc): Likewise for content info's.
(message_info_load): Use summary_info_new_empty.
(content_info_new): Use content_info_alloc.
(content_info_load): "
(content_info_free): Free the content info as a memchunk.
(message_info_free): Free everything directly and the base as a
memchunk, rather than calling camel_message_info_free(), which
assumes a malloc'd array.

* providers/local/camel-local-summary.c: Include ctype.h, kill a
warning.
(local_summary_decode_x_evolution): If we get a NULL message info,
then dont try and set anything, just check for validity.
(camel_local_summary_write_headers): New function to write a set
of headers to an fd.
(camel_local_summary_check): Added some statistic generation
stuff for memory profiling.

* providers/local/camel-mbox-summary.c (header_write): Changed to
use stdoi functions to write out the header to a buffered stream,
instead of using writev, which is apparently slow (and writing
each line separately is slow anyway).
(mbox_summary_sync_full): New implementation.  Does things
differently, doesn't use or require the content info stuff.
(summary_rebuild): Dont return an error if we start scanning at
the end of file.
(mbox_summary_sync_full): If we are not writing out new headers,
make sure we copy the From line as we go, and update frompos
appropriately.
(mbox_summary_sync_full): Always copy the From line from the
existing one, rather than trying to make one up ourselves.
(mbox_summary_sync): If we can get by with a quick-sync, then try
it, if that fails, then try a full sync anyway.
(mbox_summary_sync_quick): Quick sync.  Only update system flags,
etc.
(mbox_summary_sync_full): Use the proper local summary encode_xev
function.
(header_evolution_decode): Removed, no longer needed.
(header_evolution_encode): Same.
(copy_block): No longer needed, removed.
(header_write): Removed, replaced with
camel_local_summary_write_headers.
(mbox_summary_sync_full): Fixed for header_write change.

* camel-mime-parser.c (folder_scan_step): Implement the new
optional parser state HSCAN_PRE_FROM, that returns the (currently
unfiltered) input data.
(folder_scan_drop_step): Do the right thing for the PRE_FROM
state.
(camel_mime_parser_scan_from): Update the doco.
(camel_mime_parser_scan_pre_from): Ok, make this behaviour
optional, it simplifies a lot of loops that dont otherwise need to
know about it.
(folder_scan_step): Made the PRE_FROM state optional.
(struct _header_scan_state): Made the bool vars 1 bit.
(folder_pull_part): Free the from_line buffer if it is there.
(folder_scan_skip_line): Added a new arg, can save the skpped data
to a byte_array, as we go.
(folder_scan_step): Fixed calls to skip_line approrpiately.  Now
we save the from line as we parse it.
(camel_mime_parser_read): New function to read from the mime
parser buffer directly.  Useful if you use the parser to read the
first/some headers, then need to scan the rest of the data,
without needing to use a seek(), or allocate your own buffers.

* camel-mime-parser.h (struct _header_state): Added a new parser state,
pre-from which returns any data found before a from line during
parsing (all other data can be retrieved by the caller except
this).

23 years agolso make sure not to go past the end of the buffer ;-)
Jeffrey Stedfast [Fri, 17 Nov 2000 08:12:43 +0000 (08:12 +0000)]
lso make sure not to go past the end of the buffer ;-)