platform/upstream/evolution-data-server.git
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 ;-)

23 years agoWhen extracting a literal string, capture up until the end of the last
Jeffrey Stedfast [Fri, 17 Nov 2000 08:11:29 +0000 (08:11 +0000)]
When extracting a literal string, capture up until the end of the last

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.

23 years agoUse the byte-read count to decrement the number of bytes left to read
Jeffrey Stedfast [Fri, 17 Nov 2000 07:18:56 +0000 (07:18 +0000)]
Use the byte-read count to decrement the number of bytes left to read

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

* providers/imap/camel-imap-command.c (imap_read_untagged): Use
the byte-read count to decrement the number of bytes left to read
rather than using strlen. Not only does this protect against a DoS
(embedded NUL chars in the literal string would make strlen
inaccurate) but it also improves performace a little.

* camel-remote-store.c (remote_recv_line): *Sigh* Return the
number of bytes read on success rather than 0. Also don't use
camel_stream_buffer_read_line since we can't get an accurate octet
count.

23 years agoWe should always terminate the string. No need to check outptr is in
Not Zed [Fri, 17 Nov 2000 06:04:23 +0000 (06:04 +0000)]
We should always terminate the string. No need to check outptr is in

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

        * camel-stream-buffer.c (camel_stream_buffer_gets): We should
        always terminate the string.  No need to check outptr is in range,
        its already been checked.

        * providers/local/camel-mbox-summary.c (mbox_summary_sync): When
        we update the summary, do it from mbox_summary->folder_size, not
        the content info endpos (which isn't any good anymore anyway).

        * providers/local/camel-mbox-folder.c (mbox_append_message): Set
        the frompos from the current folder size, since summary_add wont
        have initialised it to anything useful.

23 years agoCheck the uid string is all digits before trying to write a 'standard'
Not Zed [Thu, 16 Nov 2000 13:27:21 +0000 (13:27 +0000)]
Check the uid string is all digits before trying to write a 'standard'

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

        * providers/local/camel-local-summary.c
        (local_summary_encode_x_evolution): Check the uid string is all
        digits before trying to write a 'standard' x-ev header.

        * providers/local/camel-maildir-summary.c
        (camel_maildir_summary_info_to_name): Convert an info into a
        maildir name:info filename.
        (camel_maildir_summary_name_to_info): Convert a name:info filename
        into an info, and tell us if it didn't match it.
        (message_info_new): When creating a new filename, gets its info
        from the flags field.  Likewise if creating from an existing file,
        extract the flags.
        (maildir_summary_sync): Remove a small memleak.  Also, if our
        flags and that requires a filename change, perform that here.
        (message_info_new): Get the received date from the filename.
        Also, dont overwirte the uid if we have one.
        (maildir_summary_check): Sort the summary in received order before
        completion.
        (maildir_summary_next_uid_string): Test the name for collusions
        before we give it out.  Retry, and if that fails, well, I guess we
        collide :(

        * providers/local/camel-mbox-folder.c (mbox_lock): Implement mbox
        locking.
        (mbox_unlock): And unlocking.
        (mbox_append_message): Lock the folder for write before doing
        anything.
        (mbox_get_message): Lock the folder for read before doing
        anything.

        * providers/local/camel-local-folder.c (camel_local_folder_lock):
        Implement something here.  We handle the recursive ability but
        pass the locking to the folder itself.
        (camel_local_folder_unlock): Likewise for unlocking.
        (local_lock): Default - do nothing, return success.
        (local_unlock): Same.
        (local_sync): Changed slightly for locking api changes, and also,
        only lock around the sync process itself.

        * camel-lock.c: New file - utility functions for locking using
        different strategies and/or for locking folders safely.

        * Makefile.am (libcamel_la_SOURCES): Adde camel-lock.[ch]

23 years agoNew file - utility functions for locking using different strategies and/or
Not Zed [Thu, 16 Nov 2000 08:36:39 +0000 (08:36 +0000)]
New file - utility functions for locking using different strategies and/or

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

        * camel-lock.c: New file - utility functions for locking using
        different strategies and/or for locking folders safely.

        * Makefile.am (libcamel_la_SOURCES): Adde camel-lock.[ch]

23 years ago Locking interfaces.
Michael Zucci [Thu, 16 Nov 2000 06:13:22 +0000 (06:13 +0000)]
Locking interfaces.

23 years agoremoved #include <libgnomevfs/gnome-vfs.h>
Radek Doulik [Wed, 15 Nov 2000 18:45:53 +0000 (18:45 +0000)]
removed #include <libgnomevfs/gnome-vfs.h>

23 years agomime_guess_type_from_file_name moved back to composer as it introduced
Radek Doulik [Wed, 15 Nov 2000 08:44:57 +0000 (08:44 +0000)]
mime_guess_type_from_file_name moved back to composer as it introduced

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

* camel-mime-utils.c: mime_guess_type_from_file_name moved back to
composer as it introduced unwanted VFS dependency

23 years agoRemoved local again, not quite ready.
Not Zed [Wed, 15 Nov 2000 06:33:49 +0000 (06:33 +0000)]
Removed local again, not quite ready.

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

* providers/Makefile.am: Removed local again, not quite ready.

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

* camel-folder-summary.c (message_info_new_from_message): Use
message_info_new to create the summary from headers, instead of
getting directly from the message.
(format_recipients): No longer required.

* providers/Makefile.am (SUBDIRS): Added local.

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

* camel-mime-parser.c (folder_push_part): Make sure 'atleast' is
at least 1, always.  This is possibly a temporary fix for a
bad failure mode on bad multipart messages.
(folder_scan_content): Go until inend, not inend+1.  Changed the
continuation and retry logic to be simpler and more robust.  If we
can't find a marker within
the atleast we need, just set it to 1, and try again, rather than
just going to the next smaller limit (boundary check checks the
length anyway).
(header_append): streamline the empty line case.  And strip
trailing \r's if there are any (\n's already stripped).
(folder_scan_header): Reordered and cleaned up a lot.  Check for
continuation only once, and compress lwsp then. Assume the header
buffer already has end of line's stripped, and simplify some things:
Only check for end of headers once and easier.
Dont check to remove end of line character
Dont bother testing inptr-start if we get a boundary match - it is
always zero.
(folder_scan_header): Removed the unused part variable, and a few
pointless assignments.
(folder_scan_header): Change the end limit to be 1 higher, to make
sure we get all content.
(folder_scan_content): And here too.
(folder_scan_header): Killed a warning.
(folder_push_part): Removed a bad comment.  Actually
boundarylenfinal can be zero for a new message not in a
multipart.  So we fix that here.

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

* camel-mime-utils.c (header_decode_param_list): Renamed from
header_param_list_decode.
(header_param_list_decode): New external function to decode a
parameter list.
(header_param_list_format_append): Made public.
(header_param_list_format): Another new public helper function for
formatting just a param list.

* camel-folder-summary.c (next_uid_string): Default implementation
is the same as before.
(camel_folder_summary_class_init): And set it up.

* camel-folder-summary.h: Make next_uid_string a virtual function.

* camel-folder.c (camel_folder_change_info_changed): New function
to return true if the changeset contains any changes.

23 years ago Maildir lives.
Michael Zucci [Wed, 15 Nov 2000 05:44:25 +0000 (05:44 +0000)]
Maildir lives.

23 years ago Initial cut for local provider, to handle mh/mailbox/maildir at
Michael Zucci [Wed, 15 Nov 2000 03:04:12 +0000 (03:04 +0000)]
Initial cut for local provider, to handle mh/mailbox/maildir at
least.
Checking in to make a backup.

23 years agoDon't cast an int to a ssize_t.
Jeffrey Stedfast [Tue, 14 Nov 2000 21:29:21 +0000 (21:29 +0000)]
Don't cast an int to a ssize_t.

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

* camel-stream.c (camel_stream_printf): Don't cast an int to a
ssize_t.

23 years agoGo until inend, not inend+1. Changed the continuation and retry logic to
Not Zed [Sat, 11 Nov 2000 13:01:31 +0000 (13:01 +0000)]
Go until inend, not inend+1. Changed the continuation and retry logic to

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

* camel-mime-parser.c:
(folder_scan_content): Go until inend, not inend+1.  Changed the
continuation and retry logic to be simpler and more robust.  If we
can't find a marker within
the atleast we need, just set it to 1, and try again, rather than
just going to the next smaller limit (boundary check checks the
length anyway).
(header_append): streamline the empty line case.  And strip
trailing \r's if there are any (\n's already stripped).
(folder_scan_header): Reordered and cleaned up a lot.  Check for
continuation only once, and compress lwsp then. Assume the header
buffer already has end of line's stripped, and simplify some things:
Only check for end of headers once and easier.
Dont check to remove end of line character
Dont bother testing inptr-start if we get a boundary match - it is
always zero.
(folder_scan_header): Removed the unused part variable, and a few
pointless assignments.
(folder_scan_header): Change the end limit to be 1 higher, to make
sure we get all content.
(folder_scan_content): And here too.
(folder_scan_header): Killed a warning.
(folder_push_part): Removed a bad comment.  Actually
boundarylenfinal can be zero for a new message not in a
multipart.  So we fix that here.

23 years agoMake sure 'atleast' is at least 1, always. This is possibly a temporary
Not Zed [Sat, 11 Nov 2000 04:01:14 +0000 (04:01 +0000)]
Make sure 'atleast' is at least 1, always. This is possibly a temporary

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

* camel-mime-parser.c (folder_push_part): Make sure 'atleast' is
at least 1, always.  This is possibly a temporary fix for a
bad failure mode on bad multipart messages.

23 years agoput a space before a single-digit day of the month since it seems some
Dan Winship [Fri, 10 Nov 2000 21:32:24 +0000 (21:32 +0000)]
put a space before a single-digit day of the month since it seems some

* providers/mbox/camel-mbox-summary.c
(camel_mbox_summary_build_from): put a space before a single-digit
day of the month since it seems some mailers are fantastically
picky about this. (bugs.gnome.org #27232)

23 years agofix ids ending with '.'
Radek Doulik [Fri, 10 Nov 2000 20:46:59 +0000 (20:46 +0000)]
fix ids ending with '.'

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

* camel-mime-utils.c (header_msgid_generate): fix ids ending with '.'

23 years agoFix error handling. (Only send a "*" to bail out of authentication if the
Dan Winship [Thu, 9 Nov 2000 18:52:06 +0000 (18:52 +0000)]
Fix error handling. (Only send a "*" to bail out of authentication if the

* providers/imap/camel-imap-auth.c (imap_try_kerberos_v4_auth):
Fix error handling. (Only send a "*" to bail out of authentication
if the server hasn't already bailed on us.)

23 years agonew function, moved from composer
Radek Doulik [Wed, 8 Nov 2000 13:04:59 +0000 (13:04 +0000)]
new function, moved from composer

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

* camel-mime-utils.c (mime_guess_type_from_file_name): new
function, moved from composer

23 years agoKeep track of the caller bestenc flags that make sense.
Not Zed [Wed, 8 Nov 2000 09:13:52 +0000 (09:13 +0000)]
Keep track of the caller bestenc flags that make sense.

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

* camel-mime-message.c (find_best_encoding): Keep track of the
caller bestenc flags that make sense.

* camel-mime-filter-bestenc.c (filter): Added code to detect when
we have "^From " lines in the sequence of text.
(camel_mime_filter_bestenc_get_best_encoding): Added a new flag
CAMEL_BESTENC_NO_FROM: if set, it will not allow any lines
matching "^From " to appear in the output - currently forcing
base64 encoding to achieve this.

* camel-mime-parser.c (folder_scan_step): Call
camel_mime-filter_complete() once we're done, rather than
filter_filter().
(folder_scan_content): Some fixes for state changing; so that when
we do find another boundary it is properly flagged.  Since we
strip the last \n off all data, we must take that into account
too.  Sigh.  Fixes a rather nasty set of bugs where multipart
messages could start including following messages as parts, etc.
(struct _header_scan_stack): Added new parameter,
boundarylenfinal, which holds the length of the final boundary, if
it is different (e.g. for From lines, whihc aren't)
(folder_scan_step): Setup teh boundarylenfinal value when creating
a new boundary.
(folder_scan_content): Hmm, if we hit the end-of-buffer sentinal,
reset the scanner back to leave 'atleast' chars in the buffer
still, dump that content, and retry again.  Stops us losing a
check for a boundary on some data we haven't really looked at yet!
(folder_scan_content): Use boundarylenfinal to calculate
'atleast'.
(folder_scan_header): And here too.
(folder_boundary_check): Use the atleast value directly, dont
truncate it.  Use the boundarylen/boundarylenfinal values directly
too.
(struct _header_scan_stack): Add an atleast parameter to cache the
atleast info.
(folder_push_part): Determine/set 'atleast', every time we add a
new part.
(folder_scan_header): Get the cached atleast info from the current
part.
(folder_scan_content): And here too.
(folder_scan_header): Fix a problem where a part starting with
" text" would be interpreted as a followon header wrongly.

* camel-mime-filter-charset.c (complete): Add some assertions to
find a bug.

23 years agoFix the default implementation for CamelService::get_name() so that it
Ettore Perazzoli [Tue, 7 Nov 2000 18:37:30 +0000 (18:37 +0000)]
Fix the default implementation for CamelService::get_name() so that it
returns a malloced string instead of a static one.  (A static one
breaks the semantics of the method.)

23 years agoKill debugging, as it causes lots of evolution-mail spewage.
Dan Winship [Tue, 7 Nov 2000 18:29:45 +0000 (18:29 +0000)]
Kill debugging, as it causes lots of evolution-mail spewage.

* camel-stream-filter.c (d): Kill debugging, as it causes lots of
evolution-mail spewage.

23 years ago Oops, forgot to commit. New stream/filter for doing
Michael Zucci [Tue, 7 Nov 2000 12:48:36 +0000 (12:48 +0000)]
Oops, forgot to commit.  New stream/filter for doing
cool stuff.

23 years agoImplement a complete() function, now we need one. (filter): Upgraded to
Not Zed [Tue, 7 Nov 2000 12:31:10 +0000 (12:31 +0000)]
Implement a complete() function, now we need one. (filter): Upgraded to

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

* camel-mime-filter-bestenc.c (complete): Implement a complete()
function, now we need one.
(filter): Upgraded to match rfrc2045 properly.  Checks also for
length of line and valid CRLF sequences.
(camel_mime_filter_bestenc_get_best_encoding): Do the work of
working out what is the best encoding given what we found about
the stream.

* camel-mime-part.c (camel_mime_part_encoding_to_string): Use a
lookup table to get the encoding naem, and add the binary type.
(camel_mime_part_encoding_from_string): Likewise for the reverse.

* camel-mime-part.h: Added the binary encoding type, see rfc2045.

* camel-mime-utils.c (header_param_list_format_append): Dont put a
space before ;'s in parameter lists, makes them more
readable/consistent.

* camel-mime-message.c (multipart_has_8bit_parts): Cleaned up the
old stuff, well removed it.
(camel_mime_message_set_best_encoding): Added another argument
that lets you select what you want to set the best of.  i.e. for
smtp transport we only need 7 bit, and dont need to optimise the
charset (although of course, we should always).
(find_best_encoding): Implement this feature, if we are not
getting the best charset, use the one we have.
(best_encoding): Set the charset on the part appropriately.  Sigh,
the interfaces for this are nonexistant.
(find_best_encoding): Tell the bestenc filter that lf should be
treated as crlf for the purposes of determining encodings.

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

* camel-charset-map.c (camel_charset_init): Init function for an
iterative charset determinator.
(camel_charset_step): Iterate another buffer.
(camel_charset_mask): Removed, since it couldn't have worked.
(camel_charset_best): Use the iterative interface to do the work.
(camel_charset_best_name): Get the best name for a charset so far.

* camel-mime-filter-bestenc.c: New class, a stream
filter that can be used to memory-efficiently determine the best
encoding and/or charset to use for a given stream of bytes.

* Makefile.am (libcamelinclude_HEADERS): Added stream-null*.
(libcamel_la_SOURCES): Added bestenc*

* camel-stream-null.c: New class, a null-stream, that always
succeeds, and never has any contents.

* camel-stream.c: Minor pointless changes.  Was going to do
something else but changed my mind.  Added trivial default
implementations for all callbacks.

* camel-mime-message.h: Cleaned up some old cruft.

* camel-folder-summary.c (camel_folder_summary_format_address):
address_list_format() no longer encodes, so we dont need to decode
it.

* camel-address.c (camel_address_unformat): New function, attempts
to reverse the formatting process on display addresses.
(camel_address_length): New function to get the number of
addresses, without having to peek the structure.

* camel-mime-message.c (camel_mime_message_set_from): Fix a typo.
(camel_mime_message_finalize): Only unref from/reply_to if we have
it.
(camel_mime_message_set_recipients): New function - set the
recipients as a CamelInternetAddress.  This function effectively
deprecates the older recipient setting functions.
(camel_mime_message_add_recipient): What the hell, i'll bite the
bullet.  Terminate this function.  The old api was ambiguious and
inefficient and didn't work right anyway.
(camel_mime_message_remove_recipient_address): And this one.
(camel_mime_message_remove_recipient_name): And this one too.
(camel_mime_message_set_recipients): If we set an empty header,
then remove it from the header list.  Allow a null receipient
object to clear a header.
(camel_mime_message_set_from): Likewise, if setting an empty from
address.
(camel_mime_message_encode_8bit_parts): Eeek!!
camel_stream_mem_new_with_byte_array owns the byte_array we give
it, so make sure we dont free any of it!
(camel_mime_message_encode_8bit_parts):  Infact, i'll just rewrite
the whole lot, its a bit of a mess.  Should really rename it and
make it a little more useful too, lets see ...
(best_encoding): This has a string interface?  Oh boy.
(camel_mime_message_foreach_part): New experimental function to
iterate over all message parts.  Might not remain.
(camel_mime_message_has_8bit_parts): New implementation using
foreach_part.  Fixed a couple of problems.
(find_best_encoding): New function, that finds the best encoding
for a given part (will probably be moved to camel-mime-part), and
also the best charset to use if it is a text part.  Since one
affects the other it is a two pass process, but uses streams and
not memory to achieve this.
(camel_mime_message_set_best_encoding): Uses the function above to
configure an entire message for the best encoding possible given
transport constraints.
(camel_mime_message_encode_8bit_parts): Reimplemented to use the
function above to perform the work.

* camel-internet-address.c
(camel_internet_address_format_address): Dont put <> around a lone
address with no real name.
(camel_internet_address_encode_address): Similarly.
(internet_decode): Actually return the count of decoded addresses.
(internet_unformat): Implement the unformatting routine.

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

* providers/smtp/camel-smtp-transport.c (_send_to): Changed to get
the internetaddress directly, rather than having to parse it
itself.

* camel-address.c (camel_address_format): Added a new function
which will format address, suitable for display.
(camel_address_cat): Concatentate 1 camel address onto another.
It is upto the caller to ensure the addresses are of compatible
types.
(camel_address_new_clone): New function to create a new address by
copying an existing one of the same type.
(camel_address_copy): New helper function to copy an address.

* camel-mime-message.h (struct _CamelMimeMessage): Removed cached
copy of date string.
(struct _CamelMimeMessage): Added date_received info.

* camel-mime-message.c (camel_mime_message_get_date_string):
Removed.  Nothing uses it anyway, and it is redundant.
(camel_mime_message_finalize): No more date_str.
(camel_mime_message_init): No more date_str, initialise
date_received*
(write_to_stream): Change the check for a date header.
(process_header): No longer track the date_str.
(camel_mime_message_get_received_date): Removed.  totally invalid
anyway.
(camel_mime_message_get_sent_date): Removed.  Redundant.  The only
'date' is the sent date, the received date is just made up.
(camel_mime_message_get_date): Args changed to be more consistent
with utility functions.
(camel_mime_message_get_date): Dont set the date when we're asked
for it (if its not set by the time its written, it'll be set
then).
(camel_mime_message_get_date_received): Actually do 'the right
thing' here, if we have a received header, use that to determine
the received date.  And return the data in the same format as
get_date.
(camel_mime_message_set_from): Changed the api to better match
what we should be doing.  Pass a camelinternetaddress, etc.
(camel_mime_message_set_reply_to): Cahnged similarly to take an
internetaddress.
(camel_mime_message_get_reply_to): Likewise.
(camel_mime_message_finalize): Unref the from/reply_to objects.
(format_address): Removed, no longer needed.
(process_header): Changed to store the from/reply_to as
internetaddress's.
(write_to_stream): Set the from header directly to empty, if we
dont have one.  Maybe we should just abort, and/or create one
based on the current user.

* camel-mime-utils.c (header_address_list_format): Renamed to
header_address_list_encode, which is what it is actually doing.
(header_address_list_format_append): Similarly.
(encoding_map[]): Removed, no longer used.
(header_address_list_encode_append): Take another arg, do we
encode the address (for internet), or not (for display - utf8
only).
(header_address_list_format): Re-added this function, but now it
generates a display version only.  Surprise surprise, that is all
anythign needs to generate anyway.  Sigh.

* camel-internet-address.c (camel_internet_address_get): Return
false if we get an invalid index only.
(camel_internet_address_encode_address): Helper function to encode
a single address for mailing.
(internet_encode): Use the above function to format it.
(camel_internet_address_format_address): Format a single address
for display.
(internet_format): Implement the display version.
(camel_internet_address_class_init): Init the internet_format
virtual function.
(internet_cat): Implement virtual function to concatenate
addresses.

* camel-folder-summary.c
(camel_folder_summary_info_new_from_header): new function, only
build the summary info, dont add it.
(camel_folder_summary_info_new_from_parser): Likewise, for new
info from parser.
(camel_folder_summary_add_from_parser): Cahnged to call function
above to build info.
(camel_folder_summary_add_from_header): Changed to call function
above, to build info.
(camel_folder_summary_info_free): New function to free the summary
message info.
(camel_folder_summary_clear): Changed to clal above to free info.
(camel_folder_summary_remove): Likewise.
(camel_folder_summary_add): Cleaned up the clashing uid
re-assignment logic a little bit.
(camel_folder_summary_decode_uint32): Fixed a typo, 01 != -1.
(camel_folder_summary_decode_time_t): Return -1 on error.
(camel_folder_summary_encode_off_t): New function to encode an
off_t type.
(camel_folder_summary_decode_off_t): And likewise for the reverse.
(CAMEL_FOLDER_SUMMARY_VERSION): Bumped the summary version, since
we're now encoding time/off_t's right.
(summary_header_save): Use time_t encoder to save the timestamp.
(summary_header_load): Likewise for decoding the timestamp.
(content_info_load): Decode off_t types directly, now we can.
(content_info_save): And likewise for encoding.
(camel_folder_summary_add_from_message): New function, create a
summary item from an existing message and add it.
(camel_folder_summary_info_new_from_message): New function, create
a summary item from an existing message.
(summary_build_content_info_message): New function to do the dirty
work of building the conent info/indexing, from a message source.
(format_recipients): Format an internetaddress suitable for the
summary.
(message_info_new_from_message): Build a new summary item from a
mime message.
(content_info_new_from_message): Build a new conent info from a
mime part.
(camel_folder_summary_class_init): Init the new class functions.
(message_info_new_from_message): Fixed for message api change.

Added documentation to the functions.

23 years agoTwo segfault fixes
Peter Williams [Tue, 7 Nov 2000 01:19:26 +0000 (01:19 +0000)]
Two segfault fixes

23 years agonew function, generates simple message/content id
Radek Doulik [Sat, 4 Nov 2000 10:07:37 +0000 (10:07 +0000)]
new function, generates simple message/content id

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

* camel-mime-utils.c (header_msgid_generate): new function,
generates simple message/content id

23 years agoSet the preface/postface from the parser into the multipart object.
Not Zed [Sat, 4 Nov 2000 02:34:46 +0000 (02:34 +0000)]
Set the preface/postface from the parser into the multipart object.

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

        * camel-mime-part-utils.c
        (camel_mime_part_construct_content_from_parser): Set the
        preface/postface from the parser into the multipart object.

        * camel-multipart.c (camel_multipart_set_postface): Function to
        set the postface text on a multipart.
        (camel_multipart_set_preface): Similarly for preface text.

        * camel-mime-parser.c (folder_scan_content): If we scan until a
        boundary, then we do not include the \n that starts the boundary
        line in the content.
        (struct _header_scan_stack): Added a ByteArray to store the
        multipart pre/post-text as we're scanning.
        (folder_pull_part): Free pre/posttext if they are allocated.
        (folder_scan_step): Build into the pre/posttext arrays as we
        encounter data.
        (camel_mime_parser_preface): REturn the multipart preface text, if
        there is any scanned.
        (camel_mime_parser_postface): Likewise for postface text.
        (byte_array_to_string): helper function for above.

        * providers/mbox/camel-mbox-folder.c (mbox_append_message): Change
        the from line to be "\nFrom ..." always, so no need to
        check/append a \n to messages.
        (mbox_append_message): Open the output stream with append mode
        [assuming this is more efficient than seeking to the end]
        And dont prepend \n  on the From line if its the first in the
        mbox.
        (mbox_append_message): Pass the offset of the real start of the
        "From " line when we perform the update (which may != 'seek')

        * camel-mime-filter-charset.c (complete): Removed the terminating
        NUL 'fix'.

        * camel-stream-filter.c (do_read): Added some debug.
        (do_flush): And here.
        (do_write): And here too.
        (do_write): ARGH!!! ARGH!  Ok, so the filter stream was writing a
        different number of bytes than the requester was asking it to
        write (because of filtering, of course!).  So instead of returning
        the true number of written bytes, we'll return what they asked us
        to write - unless there is an error in which case we return -1.

        * camel-mime-utils.c (base64_encode_close): Sigh, forgot to make
        it unsigned.  I think this is actually a gcc bug as (48 >> 2)
        somehow ended up negative, when it obviously should not, even if
        the data load was signed.

23 years agoUndo my incorrect fix - I misunderstood danw - sorry!
Jeffrey Stedfast [Fri, 3 Nov 2000 23:07:47 +0000 (23:07 +0000)]
Undo my incorrect fix - I misunderstood danw - sorry!

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

* camel-url.c: Undo my incorrect fix - I misunderstood danw -
sorry!

23 years agoUnbreak this.
Dan Winship [Fri, 3 Nov 2000 22:33:23 +0000 (22:33 +0000)]
Unbreak this.

* providers/pop3/camel-pop3-store.c (camel_pop3_store_expunge):
Unbreak this.

23 years agoIf show_pass, then base64 the password before writing it to the output
Jeffrey Stedfast [Fri, 3 Nov 2000 20:55:02 +0000 (20:55 +0000)]
If show_pass, then base64 the password before writing it to the output

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

* camel-url.c (camel_url_to_string): If show_pass, then base64 the
password before writing it to the output string.
(camel_url_new): Assume password has been base64 encoded and
decode accordingly.

23 years agofix bug in previous
Dan Winship [Fri, 3 Nov 2000 19:19:53 +0000 (19:19 +0000)]
fix bug in previous

23 years agoAdd an "url_flags" field to CamelProvider. Move the CAMEL_SERVICE_URL_*
Dan Winship [Fri, 3 Nov 2000 18:22:34 +0000 (18:22 +0000)]
Add an "url_flags" field to CamelProvider. Move the CAMEL_SERVICE_URL_*

* camel-provider.h: Add an "url_flags" field to CamelProvider.
Move the CAMEL_SERVICE_URL_* defines here and remove the SERVICE_
part of the name.

* camel-service.h: Remove CAMEL_SERVICE_URL_* flags and
service->url_flags field.

* camel-service.c (check_url, get_path): Get URL flags from
service->provider, update for changed flag names.

* providers/*/camel-*-provider.c: Add URL flags to provider
structures.

* providers/*/camel-*-{store,transport}.c, camel-remote-store.c:
Remove service->url_flags initialization.

23 years agoQuote foldernames when sending to the IMAP server because the folder name
Jeffrey Stedfast [Thu, 2 Nov 2000 05:00:28 +0000 (05:00 +0000)]
Quote foldernames when sending to the IMAP server because the folder name

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

* providers/imap/camel-imap-store.c (get_folder_info): Quote
foldernames when sending to the IMAP server because the folder
name might contain spaces.

23 years agoMerged in camel-incremental-branch.
Not Zed [Thu, 2 Nov 2000 03:35:04 +0000 (03:35 +0000)]
Merged in camel-incremental-branch.

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

        * Merged in camel-incremental-branch.

23 years agoRemove old subbed folders from hash table after freeing them.
Dan Winship [Thu, 2 Nov 2000 02:52:21 +0000 (02:52 +0000)]
Remove old subbed folders from hash table after freeing them.

        * providers/imap/camel-imap-store.c (get_folder_info): Remove old
        subbed folders from hash table after freeing them.

23 years agoDeal correctly with namespace == ""
Dan Winship [Wed, 1 Nov 2000 21:34:06 +0000 (21:34 +0000)]
Deal correctly with namespace == ""

* providers/imap/camel-imap-folder.c (imap_get_full_name): Deal
correctly with namespace == ""

23 years agocalendar: made all gui show localized
Gediminas Paulauskas [Wed, 1 Nov 2000 04:11:29 +0000 (04:11 +0000)]
calendar: made all gui show localized
camel: updated charset info from newest libunicode
po: updated Lithuanian translation