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

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

24 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

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

24 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!

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

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

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

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

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

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

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

24 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 == ""

24 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

24 years agoAdd a new argument, clean, that says whether or not to try to disconnect
Dan Winship [Tue, 31 Oct 2000 23:44:46 +0000 (23:44 +0000)]
Add a new argument, clean, that says whether or not to try to disconnect

* camel-service.c (service_disconnect): Add a new argument, clean,
that says whether or not to try to disconnect cleanly.

* camel-remote-store.c (remote_send_string, remote_send_stream,
remote_recv_line): disconnect uncleanly on failure to prevent
infinite loops when providers would normally send commands from
disconnect(). Remove some unneeded CamelException goo.

* providers/smtp/camel-smtp-transport.c (smtp_disconnect):
* providers/pop3/camel-pop3-store.c (pop3_disconnect):
* providers/nntp/camel-nntp-store.c (nntp_store_disconnect):
* providers/imap/camel-imap-store.c (imap_disconnect): Don't send
QUIT/LOGOUT if !clean.

24 years agoCamel IMAP authentication includes (forgotten in last commit)
Dan Winship [Mon, 30 Oct 2000 17:39:08 +0000 (17:39 +0000)]
Camel IMAP authentication includes (forgotten in last commit)

24 years agoNew file with code for IMAP authentication mechanisms. (Currently just
Dan Winship [Mon, 30 Oct 2000 17:00:06 +0000 (17:00 +0000)]
New file with code for IMAP authentication mechanisms. (Currently just

* providers/imap/camel-imap-auth.c: New file with code for IMAP
authentication mechanisms. (Currently just krb4, and without
integrity/privacy protection).

* providers/imap/Makefile.am: Add camel-imap-auth.[ch] and krb4
CFLAGS/LDFLAGS

* providers/imap/camel-imap-store.c (connect_to_server): Split out
from imap_connect. Just does the basic connect and CAPABILITY
check. Redo the CAPABILITY code more robustly.
(query_auth_types_connected): Do this right rather than punting to
query_auth_types_generic. Check for KERBEROS_V4 if compiled with
krb4 support.
(query_auth_types_generic): Mention KERBEROS_V4 if compiled with
krb4 support.
(imap_connect): Use connect_to_server().

24 years agoTake an additional argument, "break_lines", saying whether or not to add
Dan Winship [Mon, 30 Oct 2000 16:58:53 +0000 (16:58 +0000)]
Take an additional argument, "break_lines", saying whether or not to add

* camel-mime-utils.c (base64_encode_step, base64_encode_close):
Take an additional argument, "break_lines", saying whether or not
to add '\n's to the output.

* camel-multipart.c (set_boundary):
* camel-mime-filter-basic.c (filter, complete): Update for base64
api change.

24 years ago Improved IMAP namespace handling: leave the namespace in the
Dan Winship [Mon, 30 Oct 2000 03:24:15 +0000 (03:24 +0000)]
Improved IMAP namespace handling: leave the namespace in the
folder names rather than constantly prepending it and stripping it
off. Also some subscription fixes.

* camel-store.c (camel_folder_info_build): Fix for the case where
@top isn't in @folders.

* providers/imap/camel-imap-folder.c (camel_imap_folder_new): Add
a "short_name" argument rather than figuring it out ourselves.
(imap_get_full_name): Implementation of CamelFolder::get_full_name
that strips off namespace so the user doesn't have to see it.
(imap_append_message, imap_copy_message_to, imap_move_message_to):
Use folder->full_name rather than calling
camel_imap_store_get_folder_path.

* providers/imap/camel-imap-utils.c (imap_parse_list_response):
Update this: make @flags a bitmask and @sep a char rather than a
string. Make all of the out arguments optional. Handle literals in
the server response.

* providers/imap/camel-imap-store.c (imap_connect): Do a better
job of getting the correct dir_sep for the namespace we're using.
Construct a base_url here that will be used by get_folder_info.
(camel_imap_store_folder_path): Removed
(imap_folder_exists): Add an argument to return the short name of
the folder (parsed out of the LIST response). Update for
imap_parse_list_response change.
(get_folder): Update for the various other changes.
(get_folder_info): Update for the various other changes. Be more
consistent about the returned layout: put everything underneath
the "namespace" directory, including INBOX, even if it doesn't
belong there. Don't destroy the list of subscribed folders until
we've actually gotten the new list.
(folder_subscribed, subscribe_folder, unsubscribe_folder): Use
folder_name directly rather than camel_imap_store_folder_Path.

* providers/imap/camel-imap-command.c (camel_imap_command): Update
for folder name changes.

24 years agoRemove md5-utils.h include since it's not part of Camel any more.
Dan Winship [Sun, 29 Oct 2000 20:06:29 +0000 (20:06 +0000)]
Remove md5-utils.h include since it's not part of Camel any more.

* camel.h: Remove md5-utils.h include since it's not part of Camel
any more.

* camel-charset-map.c: Kill some warnings.

* providers/nntp/camel-nntp-grouplist.c
(camel_nntp_get_grouplist_from_file, camel_nntp_grouplist_save):
Clean up warnings about time_t casts.

* providers/smtp/camel-smtp-transport.c: Remove unused md5-utils.h
include.

* providers/pop3/camel-pop3-store.c: Undefine the "_" macro
defined by krb4's des.h when compiling with krb support.
Fix md5-utils.h include.

24 years agoRemove previous comment about Outlook brokenness, since it turns out the
Dan Winship [Fri, 27 Oct 2000 22:05:45 +0000 (22:05 +0000)]
Remove previous comment about Outlook brokenness, since it turns out the
brokenness was actually somewhere else. (Still in Outlook, just not in
the part of Outlook I was told it was.)

24 years agoWork around Outlook brokenness in iMIP parsing by only quoting
Dan Winship [Fri, 27 Oct 2000 20:19:48 +0000 (20:19 +0000)]
Work around Outlook brokenness in iMIP parsing by only quoting

* camel-mime-utils.c (header_param_list_format_append): Work
around Outlook brokenness in iMIP parsing by only quoting
Content-type parameters when the quoting is mandatory.

24 years agobuild md5-utils
7 [Fri, 27 Oct 2000 18:28:20 +0000 (18:28 +0000)]
build md5-utils

2000-10-27    <jpr@helixcode.com>

* Makefile.am: build md5-utils

* md5-utils.c: Make part of util, get rid of camel stream util
function include string.h

* md5-utils.h: ditto

2000-10-27    <jpr@helixcode.com>

* providers/pop3/Makefile.am: Tidy up build

* providers/smtp/Makefile.am: ditto

* Makefile.am:  Move md5-utils.[hc] to e-util because the
addressbook is going to use md5 hashes for pilot syncing.
Maybe the calendar conduits as well because this is a good idea
Chris had.

24 years agoAdd newline to kill warnings.
Kjartan Maraas [Wed, 25 Oct 2000 22:38:15 +0000 (22:38 +0000)]
Add newline to kill warnings.

2000-10-26  Kjartan Maraas  <kmaraas@gnome.org>

* camel-exceptions-list.def: Add newline to kill warnings.

24 years agoFix folder listing code infinite loop.
Dan Winship [Wed, 25 Oct 2000 21:36:09 +0000 (21:36 +0000)]
Fix folder listing code infinite loop.

* providers/imap/camel-imap-store.c (get_folder_info): Fix folder
listing code infinite loop.

24 years agoAdd a "parent" field to CamelFolderInfo.
Dan Winship [Wed, 25 Oct 2000 15:27:17 +0000 (15:27 +0000)]
Add a "parent" field to CamelFolderInfo.

* camel-store.h: Add a "parent" field to CamelFolderInfo.

* camel-store.c (camel_folder_info_build): Deal with "parent"
(camel_store_folder_subscribed, camel_store_subscribe_folder,
camel_store_unsubscribe_folder): Add g_return_if_fails checking
that the folder supports subscriptions.

* providers/imap/camel-imap-store.c (folder_subscribed,
subscribe_folder, unsubscribe_folder): Remove "+ 1"s since the
mail subscribe UI won't prepend / to the folder names now.
(get_folder_info): Clear the "parent" field of the folderinfos
when removing an empty top level.

* providers/nntp/camel-nntp-store.c (nntp_store_folder_subscribed,
nntp_store_subscribe_folder, nntp_store_unsubscribe_folder):
Remove "+ 1"s since the mail subscribe UI won't prepend / to the
folder names now.

24 years agoadd subscribed_folders.
Chris Toshok [Wed, 25 Oct 2000 02:13:17 +0000 (02:13 +0000)]
add subscribed_folders.

2000-10-24  Chris Toshok  <toshok@helixcode.com>

* providers/imap/camel-imap-store.h: add subscribed_folders.

* providers/imap/camel-imap-store.c (camel_imap_store_class_init):
fill in vtable entries for subscription functions.
(camel_imap_store_finalize): new function, so we can free up our
subscribed_folders hashtable.
(camel_imap_store_init): set CAMEL_STORE_SUBSCRIPTIONS in the
CamelStore flags, and create our subscribed_folders hashtable.
(camel_imap_store_get_type): camel_imap_store_finalize is our
finalize function.
(get_folder_info): if we're looking at subscribed_only, clear out
the subscribed_folders hashtable, use LSUB instead of LIST, and
insert folder paths (prepended by their namespace if there is one)
into subscribed_folders.  INBOX subscription support needs work,
since we always show it, regardless of it's subscribed state.
(folder_subscribed): new function.  just look up the folder_path
in the hashtable.
(subscribe_folder): new function.  use the imap SUBSCRIBE command,
and if successful add it to the hashtable.
(unsubscribe_folder): new function.  use the imap UNSUBSCRIBE
command, and if successful remove it from the hashtable.

24 years agoadd a missing #include
Dan Winship [Tue, 24 Oct 2000 22:20:44 +0000 (22:20 +0000)]
add a missing #include

24 years agoFill in the message_count and unread_message_count flags (if !fast).
Dan Winship [Tue, 24 Oct 2000 18:49:30 +0000 (18:49 +0000)]
Fill in the message_count and unread_message_count flags (if !fast).

* providers/imap/camel-imap-store.c (get_folder_info): Fill in the
message_count and unread_message_count flags (if !fast).

24 years agolots of i18n fixes
Dan Winship [Tue, 24 Oct 2000 05:23:24 +0000 (05:23 +0000)]
lots of i18n fixes

24 years agoadd camel-nntp-types.h.
Chris Toshok [Mon, 23 Oct 2000 22:04:31 +0000 (22:04 +0000)]
add camel-nntp-types.h.

2000-10-23  Chris Toshok  <toshok@helixcode.com>

* providers/nntp/Makefile.am (libcamelnntpinclude_HEADERS): add
camel-nntp-types.h.

24 years agoFix a "how could this have been working before" memory overrun bug found
Dan Winship [Mon, 23 Oct 2000 20:28:32 +0000 (20:28 +0000)]
Fix a "how could this have been working before" memory overrun bug found

        * providers/imap/camel-imap-command.c (imap_read_untagged): Fix a
        "how could this have been working before" memory overrun bug
        found by Vlad.

24 years agoThese should have gone away a long time ago.
Dan Winship [Mon, 23 Oct 2000 18:04:22 +0000 (18:04 +0000)]
These should have gone away a long time ago.

* camel-op-queue.[ch], camel-thread-proxy.[ch]: These should have
gone away a long time ago.

24 years agore-enable the nntp provider.
Chris Toshok [Fri, 20 Oct 2000 21:57:50 +0000 (21:57 +0000)]
re-enable the nntp provider.

2000-10-20  Chris Toshok  <toshok@helixcode.com>

* providers/Makefile.am (SUBDIRS): re-enable the nntp provider.

24 years agoadd function to build a tree from the nntp group names (using '.' as a
Chris Toshok [Fri, 20 Oct 2000 21:46:14 +0000 (21:46 +0000)]
add function to build a tree from the nntp group names (using '.' as a

2000-10-20  Chris Toshok  <toshok@helixcode.com>

* providers/nntp/camel-nntp-store.c (build_folder_info): add
function to build a tree from the nntp group names (using '.' as a
heirarchy separator.)  #ifdefed INFO_AS_TREE only.
(build_folder_info_from_grouplist): if INFO_AS_TREE is selected,
call build_folder_info instead of appending a new CamelFolderInfo
to our list.
(ensure_news_dir_exists): use e_mkdir_hier instead of failing if a
parent directory (~/evolution/news generally) isn't there.

24 years ago#include <sys/types.h> before <regex.h>
Chris Toshok [Fri, 20 Oct 2000 05:19:04 +0000 (05:19 +0000)]
#include <sys/types.h> before <regex.h>

2000-10-19  Chris Toshok  <toshok@helixcode.com>

* camel-folder-search.c: #include <sys/types.h> before <regex.h>

24 years agoFix a bug with "INBOX" (or anything else with NIL hierarchy separator) as
Dan Winship [Fri, 20 Oct 2000 01:06:16 +0000 (01:06 +0000)]
Fix a bug with "INBOX" (or anything else with NIL hierarchy separator) as

* providers/imap/camel-imap-utils.c (imap_parse_list_response):
Fix a bug with "INBOX" (or anything else with NIL hierarchy
separator) as the namespace.

24 years agoEmit message_changed and folder_changed as appropriate.
Dan Winship [Fri, 20 Oct 2000 00:47:36 +0000 (00:47 +0000)]
Emit message_changed and folder_changed as appropriate.

* providers/imap/camel-imap-folder.c (imap_refresh_info): Emit
message_changed and folder_changed as appropriate.

24 years agoUpdate comment here so refresh_info isn't just for reconnects any more.
Dan Winship [Thu, 19 Oct 2000 20:30:43 +0000 (20:30 +0000)]
Update comment here so refresh_info isn't just for reconnects any more.

* camel-folder.c (camel_folder_refresh_info): Update comment here
so refresh_info isn't just for reconnects any more. Make the
default implementation a no-op rather than an error.

* providers/nntp/camel-nntp-folder.c: Move refresh_info impl into
camel_nntp_folder_new, since it would have leaked memory and not
done anything useful if it was called later.

* providers/mbox/camel-mbox-folder.c: Remove no-longer-necessary
refresh_info impl.

* providers/imap/camel-imap-folder.c (camel_imap_folder_changed):
Update imap_folder->exists, but don't actually load the new
messages. This is a temporary workaround to deal with the IMAP
provider stealing the message list focus at annoying times.
(imap_copy_message_to, imap_move_message_to): Emit a
folder_changed by hand, for now.

24 years agoBuild fixes from Jacob, same as the other branch.
Ettore Perazzoli [Thu, 19 Oct 2000 17:45:35 +0000 (17:45 +0000)]
Build fixes from Jacob, same as the other branch.

24 years agoThe correct fix this time - the description should be encoded here and not
Jeffrey Stedfast [Thu, 19 Oct 2000 00:13:50 +0000 (00:13 +0000)]
The correct fix this time - the description should be encoded here and not

2000-10-18  Jeffrey Stedfast  <fejj@helixcode.com>

* camel-mime-part.c (camel_mime_part_set_description): The correct
fix this time - the description should be encoded here and not in
the camel-medium layer.

24 years agoInitialize the outbuf to be empty before calling unicode_iconv on it.
Ettore Perazzoli [Wed, 18 Oct 2000 18:36:10 +0000 (18:36 +0000)]
Initialize the outbuf to be empty before calling unicode_iconv on it.
This fixes a problem with duplicate message bodies on my machine.

24 years agoNo, we must not encode the headers here. These interfaces ARE raw
Not Zed [Wed, 18 Oct 2000 06:11:54 +0000 (06:11 +0000)]
No, we must not encode the headers here. These interfaces ARE raw

2000-10-18  Not Zed  <NotZed@HelixCode.com>

* camel-mime-part.c (add_header): No, we must not encode the
headers here.  These interfaces ARE raw interfaces as they are
defined in camel_medium.  Also removed a bogus/meaningless FIXME.
(set_header): Likewise here, we must not.
(process_header): Removed another bogus comment.

* camel-object.c (shared_is_of_type): Comment out the spitting of
a big warning when we're trying to determine types from code.

* providers/mbox/camel-mbox-summary.c
(message_info_new_from_parser): Only call ibex funcitons if we
have an index.

* providers/mh/camel-mh-summary.c (camel_mh_summary_add): Only
call ibex functions if we have an index.
(remove_summary): Likewise.
(camel_mh_summary_check): Likewise.

* providers/nntp/camel-nntp-store.c (nntp_store_get_folder):
get_folder -> flags argument.

* providers/vee/camel-vee-store.c (vee_get_folder): create->flags.

* providers/pop3/camel-pop3-store.c (get_folder): Changed create
-> flags.

* providers/imap/camel-imap-store.c (get_folder): Added flags
argument.

* providers/mh/camel-mh-folder.c (camel_mh_folder_new): Added
flags argument, and fixed code appropriately.

* providers/mh/camel-mh-store.c (get_folder): Added flags argument.

* camel-folder-search.c (message_body_contains): Perform a regex
match on the contents of messages.  This wont quite work yet as
message contents are encoded when written to a stream.
(build_match_regex): Converts a number of strings into a regex
matching pattern, escaping special chars.
(match_message): match a single message from a folder, by uid.
Slow.
(search_body_contains): Changed to support matching where no index
is supplied.  Matches are performed by retrieving message
contents, etc.
() WTF?  camel should not be including any widget headers.

* providers/mbox/camel-mbox-folder.c (camel_mbox_folder_new):
Added flags argument.
(mbox_refresh_info): Changed into a NOP, the refresh info code
moved into the new function.
(camel_mbox_folder_new): If we have an index requested, build one,
otherwise, remove an old one, or just dont do anything.

* providers/mbox/camel-mbox-store.c (get_folder): Changed create
to flags, changed code to suit.

* camel-store.c (camel_store_get_folder): Changed create to flags.
(get_folder_internal): And here.
(get_folder): And here too.

* camel-store.h (camel_store_get_folder): Change the create
argument to be a flags argument.

24 years ago (camel_imap_folder_new): Move the summary creation to after the
Dan Winship [Wed, 18 Oct 2000 03:41:29 +0000 (03:41 +0000)]
(camel_imap_folder_new): Move the summary creation to after the
folder selection again, since it depends on the uidvalidity
having been set.

24 years agoRemove cached info at the end of the summary when the folder shrinks
Dan Winship [Wed, 18 Oct 2000 03:03:48 +0000 (03:03 +0000)]
Remove cached info at the end of the summary when the folder shrinks

* providers/imap/camel-imap-folder.c (imap_refresh_info): Remove
cached info at the end of the summary when the folder shrinks
between sessions. Also remove an untrue comment.

* providers/imap/camel-imap-store.c (get_folder): Fix up
summary_file to not include the namespace twice.

24 years agoEncode the header value. (add_header): Same.
Jeffrey Stedfast [Wed, 18 Oct 2000 01:06:55 +0000 (01:06 +0000)]
Encode the header value. (add_header): Same.

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

* camel-mime-part.c (set_header): Encode the header value.
(add_header): Same.

24 years agoAdded some malloc check debugging stuff.
Not Zed [Tue, 17 Oct 2000 09:45:38 +0000 (09:45 +0000)]
Added some malloc check debugging stuff.

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

* camel-mime-filter.c: Added some malloc check debugging stuff.

* camel-mime-parser.c
(struct _header_scan_state): Removed top_part, top_start, and
pending.  I can't even remember why they were there, and they're
not used anymore.

* camel-mime-filter-basic.c (filter): Forgot to up the space here
too.

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

* camel-mime-filter-basic.c (complete): Ok, so we hit a fixme, 3x
just wasn't enough for some sequences.

24 years agoDon't imap_next_word(respbuf + 2), instead use imap_next_word(respbuf) or
Jeffrey Stedfast [Tue, 17 Oct 2000 03:41:03 +0000 (03:41 +0000)]
Don't imap_next_word(respbuf + 2), instead use imap_next_word(respbuf) or

2000-10-16  Jeffrey Stedfast  <fejj@helixcode.com>

* providers/imap/camel-imap-command.c
(imap_read_response): Don't imap_next_word(respbuf + 2), instead
use imap_next_word(respbuf) or else we'll skip over the second
token.

24 years agoDon't free 'resp' as it doesn't point to the beginning of the allocated
Jeffrey Stedfast [Tue, 17 Oct 2000 02:37:24 +0000 (02:37 +0000)]
Don't free 'resp' as it doesn't point to the beginning of the allocated

2000-10-16  Jeffrey Stedfast  <fejj@helixcode.com>

* providers/imap/camel-imap-command.c
(camel_imap_response_extract): Don't free 'resp' as it doesn't
point to the beginning of the allocated data, instead free
response->untagged->pdata[i]. Also, if '*resp' is equal to a space
character, then set resp = imap_next_word (resp) rather than
expecting resp++ to work (there's a list broken IMAP daemons that
like to put extra spaces between tokens).
(imap_read_response): Don't expect 'respbuf+2' to be where the
untagged number response to start (see above fix for an
explanation).

24 years agowhen using the construct (flags & CAMEL_SERVICE_URL_NEED_*) make sure to
Chris Toshok [Mon, 16 Oct 2000 23:09:35 +0000 (23:09 +0000)]
when using the construct (flags & CAMEL_SERVICE_URL_NEED_*) make sure to

2000-10-16  Chris Toshok  <toshok@helixcode.com>

* camel-service.c (get_path): when using the construct (flags &
CAMEL_SERVICE_URL_NEED_*) make sure to do ((flags &
CAMEL_SERVICE_URL_NEED_*) == CAMEL_SERVICE_URL_NEED_*)
(check_url): same.

24 years agoOnly send the LOGOUT command if the store is connected. (imap_connect):
Jeffrey Stedfast [Mon, 16 Oct 2000 21:00:59 +0000 (21:00 +0000)]
Only send the LOGOUT command if the store is connected. (imap_connect):

2000-10-16  Jeffrey Stedfast  <fejj@helixcode.com>

* providers/imap/camel-imap-store.c (imap_disconnect): Only send
the LOGOUT command if the store is connected.
(imap_connect): Set the 'connected' state to TRUE when we
successfully connect.
(get_folder_info): if (!topfi), 'topfi' was allocated but then
'fi' was set. I think Dan meant to set topfi since fi is an
uninitialized value at this point.

* providers/imap/camel-imap-command.c (imap_read_response): Check
for the untagged BYE response and set the 'connected' state to
FALSE if we receive the BYE response. Return NULL if we get a BYE
response.

24 years agoDeal with the possibility of not getting a LIST response back for the top
Dan Winship [Mon, 16 Oct 2000 18:10:42 +0000 (18:10 +0000)]
Deal with the possibility of not getting a LIST response back for the top

* providers/imap/camel-imap-store.c (get_folder_info): Deal with
the possibility of not getting a LIST response back for the top
level.

24 years agoSimple subclass of CamelFolderSummary that also keeps a UIDVALIDITY value
Dan Winship [Thu, 12 Oct 2000 20:55:11 +0000 (20:55 +0000)]
Simple subclass of CamelFolderSummary that also keeps a UIDVALIDITY value

* providers/imap/camel-imap-summary.c: Simple subclass of
CamelFolderSummary that also keeps a UIDVALIDITY value (and
doesn't, for the moment, build content info).

* providers/imap/camel-imap-folder.c:
(various): Use a CamelImapSummary to store/fetch summary info.
(camel_imap_folder_new): Take a path to a file to use for the
summary. Set the folder's permanent_flags correctly according to
the server response. Read in the summary (checking the
UIDVALIDITY) and update it if it's out of date.
(imap_refresh_info): Just fetch UIDs and flags. If the UIDs all
match, update the flags as needed and be done with it. Otherwise,
delete messages that have been expunged from the server and fetch
full summary info for any new messages.
(imap_sync): Save the summary to disk.
(imap_update_summary): Renamed from imap_get_summary_internal. Can
now be told to get summary for only a subset of messages. Use
camel-mime-utils functions rather than rolling our own header
parsing.
(imap_get_message_info_internal): Merged into imap_update_summary.
(imap_set_message_flags): Don't marked the message FOLDER_FLAGGED
if we're not actually changing the value of any of the flags.
(camel_imap_folder_changed): Deal with EXISTS rather than RECENT.

* providers/imap/camel-imap-store.c (imap_connect): Call
camel_session_get_storage_path and save the value.
(get_folder): Create a local directory to store summary
information and pass a summary file name to camel_imap_folder_new.
Don't call camel_folder_refresh_info from here any more since
camel_imap_folder_new does it again.

* providers/imap/camel-imap-command.c (camel_imap_command): Add a
special case to this to make it possible to get the repsonses from
a SELECT and still have store->current_folder be updated
correctly.
(imap_read_response): parse EXISTS rather than RECENT

* camel-session.c (camel_session_get_storage_path): Use
e_mkdir_hier.

* camel-folder-summary.c (camel_folder_summary_remove_index): New
function.

* camel-mime-utils.c (header_raw_append_parse): fix this.
(camel-mime-parser.c doesn't use this code because of the MEMPOOL
optimization, so nothing was ever actually calling it before.)

24 years agoRemoved temp_message_buffer, and content_input_stream fields which seem to
Not Zed [Thu, 12 Oct 2000 13:38:51 +0000 (13:38 +0000)]
Removed temp_message_buffer, and content_input_stream fields which seem to

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

* camel-mime-part.h (struct _CamelMimePart): Removed
temp_message_buffer, and content_input_stream fields which seem to
have come from nowhere, and are unused.

* camel-mime-utils.c: Added a note about touching this file.
Nobody is to touch it without asking me first.  That goes for you
too Jeff.
(header_decode_text): In what way is this broken?

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

* providers/imap/camel-imap-folder.c (imap_get_summary_internal):
Fix camel_summary_* function rename
(imap_get_message_info_internal): Likewise.

* camel-mime-parser.c (camel_mime_parser_finalise): Fixed a spelling mistake.

* camel-folder-summary.c (camel_summary_format_address): Uh, why
do we encode and then decode here ... sigh.  This is not the way
to fix this.
(camel_folder_summary_format_address): Renamed to a proper name,
this was only supposed to be a private function.
(camel_folder_summary_format_string): Likewise.  Oh i see why it
was made public, code reuse by cut & paste.  Joy.

24 years agoremove the leading '/'. (nntp_store_subscribe_folder): same.
Chris Toshok [Wed, 11 Oct 2000 23:00:53 +0000 (23:00 +0000)]
remove the leading '/'. (nntp_store_subscribe_folder): same.

2000-10-11  Chris Toshok  <toshok@helixcode.com>

* providers/nntp/camel-nntp-store.c (nntp_store_unsubscribe_folder): remove the leading '/'.
(nntp_store_subscribe_folder): same.
(nntp_store_folder_subscribed): same.

24 years agoQuote the mailbox name as it may contain spaces. (imap_copy_message_to):
Jeffrey Stedfast [Wed, 11 Oct 2000 17:42:03 +0000 (17:42 +0000)]
Quote the mailbox name as it may contain spaces. (imap_copy_message_to):

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

* providers/imap/camel-imap-folder.c (imap_move_message_to): Quote
the mailbox name as it may contain spaces.
(imap_copy_message_to): Same.

24 years agofill in message_count and unread_message_count properly.
Chris Toshok [Wed, 11 Oct 2000 04:37:33 +0000 (04:37 +0000)]
fill in message_count and unread_message_count properly.

2000-10-10  Chris Toshok  <toshok@helixcode.com>

* providers/nntp/camel-nntp-store.c
(build_folder_info_from_grouplist): fill in message_count and
unread_message_count properly.

* providers/nntp/camel-nntp-newsrc.h: reformat.

* providers/nntp/camel-nntp-grouplist.c
(camel_nntp_get_grouplist_from_file): remove spew.

* providers/nntp/camel-nntp-newsrc.c
(camel_nntp_newsrc_group_get_num_articles_read): new function.
(camel_nntp_newsrc_group_get_highest_article_read): robustification.

24 years agoUn-rasterize my changelog entry
Joe Shaw [Tue, 10 Oct 2000 22:31:26 +0000 (22:31 +0000)]
Un-rasterize my changelog entry

No, I am not artifically inflating my commit numbers.

24 years agoCheck before deferencing the sep pointer.
Joe Shaw [Tue, 10 Oct 2000 21:31:49 +0000 (21:31 +0000)]
Check before deferencing the sep pointer.

2000-10-10  Joe Shaw  <joe@helixcode.com>

* providers/imap/camel-imap-store.c
(parse_list_response_as_folder_info): Check before deferencing the
sep pointer.

24 years agoteach camel about "its" vs. "it's"
Jacob "Ulysses" Berkman [Tue, 10 Oct 2000 16:57:29 +0000 (16:57 +0000)]
teach camel about "its" vs. "it's"

2000-10-10  Jacob "Ulysses" Berkman  <jacob@helixcode.com>

* camel-*.c: teach camel about "its" vs. "it's"

24 years agowrite out the newsrc. (nntp_store_get_name): if @brief, just return host.
Chris Toshok [Tue, 10 Oct 2000 00:50:46 +0000 (00:50 +0000)]
write out the newsrc. (nntp_store_get_name): if @brief, just return host.

2000-10-09  Chris Toshok  <toshok@helixcode.com>

* providers/nntp/camel-nntp-store.c (finalize): write out the
newsrc.
(nntp_store_get_name): if @brief, just return host.

* providers/nntp/camel-nntp-newsrc.c: robustification and bug
fixes.

24 years agoIssue a warning if h->value is NULL.
Miguel de Icaza [Sun, 8 Oct 2000 06:56:13 +0000 (06:56 +0000)]
Issue a warning if h->value is NULL.

2000-10-08  Miguel de Icaza  <miguel@helixcode.com>

* camel-mime-part.c (write_to_stream): Issue a warning if h->value
is NULL.

24 years agoDecode the resulting string.
Jeffrey Stedfast [Fri, 6 Oct 2000 21:38:36 +0000 (21:38 +0000)]
Decode the resulting string.

2000-10-06  Jeffrey Stedfast  <fejj@helixcode.com>

* camel-folder-summary.c (camel_summary_format_address): Decode
the resulting string.

24 years agoadd camel-nntp-grouplist.h (libcamelnntp_la_SOURCES): add
Chris Toshok [Fri, 6 Oct 2000 19:41:58 +0000 (19:41 +0000)]
add camel-nntp-grouplist.h (libcamelnntp_la_SOURCES): add

2000-10-06  Chris Toshok  <toshok@helixcode.com>

* providers/nntp/Makefile.am (libcamelnntpinclude_HEADERS): add
camel-nntp-grouplist.h
(libcamelnntp_la_SOURCES): add camel-nntp-grouplist.c

* providers/nntp/camel-nntp-provider.c: add our own hash functions
for nntp urls.

* providers/nntp/camel-nntp-newsrc.c
(camel_nntp_newsrc_group_is_subscribed): new function.
(camel_nntp_newsrc_subscribe_group): new function.
(camel_nntp_newsrc_unsubscribe_group): new function.

* providers/nntp/camel-nntp-newsrc.h: add prototypes for
_group_is_subscribed, _subscribe_group, and _unsubscribe_group.

* providers/nntp/camel-nntp-store.c
(build_folder_info_from_grouplist): new function.
(nntp_store_get_folder_info): add subscribed_only_parameter.  if
it's FALSE, load the grouplist and call
build_folder_info_from_grouplist.
(nntp_store_folder_subscribed): implement.
(nntp_store_subscribe_folder): implement.
(nntp_store_unsubscribe_folder): implement.
(camel_nntp_store_init): add CAMEL_STORE_SUBSCRIPTIONS to the
store's flags.

* providers/mh/camel-mh-store.c (get_folder_info): add
subscribed_only parameter.

* providers/mbox/camel-mbox-store.c (get_folder_info): add
subscribed_only parameter.

* providers/imap/camel-imap-store.c (get_folder_info): add
subscribed_only parameter.

* camel-store.c (camel_store_supports_subscriptions): new function.
(camel_store_folder_subscribed): new function.
(camel_store_subscribe_folder): new function.
(camel_store_unsubscribe_folder): new function.

* camel-store.h: add prototypes and virtual functions for the
subscribe implementation.  also, add a subscribed_only argument to
camel_store_get_folder_info.

24 years agonew file.
Chris Toshok [Fri, 6 Oct 2000 19:31:07 +0000 (19:31 +0000)]
new file.

2000-10-06  Chris Toshok  <toshok@helixcode.com>

* providers/nntp/camel-nntp-grouplist.c: new file.

* providers/nntp/camel-nntp-grouplist.h: new file.

* providers/nntp/camel-nntp-types.h: new file.

24 years agoFix so that we don't encode every single char in the word. Also, do we
Jeffrey Stedfast [Fri, 6 Oct 2000 19:05:22 +0000 (19:05 +0000)]
Fix so that we don't encode every single char in the word. Also, do we

2000-10-06  Jeffrey Stedfast  <fejj@helixcode.com>

* camel-mime-utils.c (quoted_encode): Fix so that we don't encode
every single char in the word. Also, do we need a safemask? I
don't see why we would.
(header_encode_string): Don't strip off the last char!!

24 years agoFix so that we don't encode every single char in the word. Also, do we
Jeffrey Stedfast [Fri, 6 Oct 2000 17:59:39 +0000 (17:59 +0000)]
Fix so that we don't encode every single char in the word. Also, do we

2000-10-06  Jeffrey Stedfast  <fejj@helixcode.com>

* camel-mime-utils.c (quoted_encode): Fix so that we don't encode
every single char in the word. Also, do we need a safemask? I
don't see why we would.

24 years agoDon't compile the NNTP provider as it currently doesn't build because
Ettore Perazzoli [Fri, 6 Oct 2000 16:31:06 +0000 (16:31 +0000)]
Don't compile the NNTP provider as it currently doesn't build because
of missing `camel-nntp-types.h'.

24 years agoadd camel-nntp-grouplist.h (libcamelnntp_la_SOURCES): add
Chris Toshok [Fri, 6 Oct 2000 08:25:36 +0000 (08:25 +0000)]
add camel-nntp-grouplist.h (libcamelnntp_la_SOURCES): add

2000-10-06  Chris Toshok  <toshok@helixcode.com>

* providers/nntp/Makefile.am (libcamelnntpinclude_HEADERS): add
camel-nntp-grouplist.h
(libcamelnntp_la_SOURCES): add camel-nntp-grouplist.c

* providers/nntp/camel-nntp-provider.c: add our own hash functions
for nntp urls.

* providers/nntp/camel-nntp-newsrc.c
(camel_nntp_newsrc_group_is_subscribed): new function.
(camel_nntp_newsrc_subscribe_group): new function.
(camel_nntp_newsrc_unsubscribe_group): new function.

* providers/nntp/camel-nntp-newsrc.h: add prototypes for
_group_is_subscribed, _subscribe_group, and _unsubscribe_group.

* providers/nntp/camel-nntp-store.c
(build_folder_info_from_grouplist): new function.
(nntp_store_get_folder_info): add subscribed_only_parameter.  if
it's FALSE, load the grouplist and call
build_folder_info_from_grouplist.
(nntp_store_folder_subscribed): implement.
(nntp_store_subscribe_folder): implement.
(nntp_store_unsubscribe_folder): implement.
(camel_nntp_store_init): add CAMEL_STORE_SUBSCRIPTIONS to the
store's flags.

* providers/mh/camel-mh-store.c (get_folder_info): add
subscribed_only parameter.

* providers/mbox/camel-mbox-store.c (get_folder_info): add
subscribed_only parameter.

* providers/imap/camel-imap-store.c (get_folder_info): add
subscribed_only parameter.

* camel-store.c (camel_store_supports_subscriptions): new function.
(camel_store_folder_subscribed): new function.
(camel_store_subscribe_folder): new function.
(camel_store_unsubscribe_folder): new function.

* camel-store.h: add prototypes and virtual functions for the
subscribe implementation.  also, add a subscribed_only argument to
camel_store_get_folder_info.

24 years agoEncode the name part of the address and don't quote the name.
Jeffrey Stedfast [Fri, 6 Oct 2000 00:59:34 +0000 (00:59 +0000)]
Encode the name part of the address and don't quote the name.

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

* camel-mime-utils.c (header_address_list_format_append): Encode
the name part of the address and don't quote the name.
(header_decode_text): Rewrote from scratch, the old code was badly
broken.

24 years agoUse the camel_address_encode function again.
Jeffrey Stedfast [Thu, 5 Oct 2000 23:20:52 +0000 (23:20 +0000)]
Use the camel_address_encode function again.

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

* camel-mime-message.c (camel_mime_message_set_reply_to): Use the
camel_address_encode function again.
(camel_mime_message_set_from): Same.

24 years agoModified to not encode space chars in the middle of a line. (isblank): New
Jeffrey Stedfast [Thu, 5 Oct 2000 21:26:28 +0000 (21:26 +0000)]
Modified to not encode space chars in the middle of a line. (isblank): New

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

* camel-mime-utils.c (quoted_encode_step): Modified to not encode
space chars in the middle of a line.
(isblank): New macro if we're not on a system with the GNU isblank
extension.

* camel-mime-message.c (camel_mime_message_set_from): Reversed my
changes, don't header_encode_phrase - it generates broken headers.
(camel_mime_message_set_reply_to): Same.

24 years agorevert to old method (only use XOVER if OVER is supported.)
Chris Toshok [Thu, 5 Oct 2000 00:51:58 +0000 (00:51 +0000)]
revert to old method (only use XOVER if OVER is supported.)

2000-10-04  Chris Toshok  <toshok@helixcode.com>

* providers/nntp/camel-nntp-utils.c (camel_nntp_get_headers):
revert to old method (only use XOVER if OVER is supported.)

* providers/nntp/camel-nntp-store.c
(camel_nntp_store_get_overview_fmt): handle the case where the
OVER extension isn't listed but LIST OVERVIEW.FMT works (again,
INN 2.2).  enable the OVER extension in this case.

24 years agoreturn a gboolean so we can tell if this command worked. we can't key off
Chris Toshok [Wed, 4 Oct 2000 21:59:06 +0000 (21:59 +0000)]
return a gboolean so we can tell if this command worked. we can't key off

2000-10-04  Chris Toshok  <toshok@helixcode.com>

* providers/nntp/camel-nntp-utils.c (get_XOVER_headers): return a
gboolean so we can tell if this command worked.  we can't key off
the OVER extension being present because at least one server (INN
2.2) doesn't report the OVER extension but implements the XOVER
command.  This could of course just be because I'm a loser for
thinking they were related in the first place.
(camel_nntp_get_headers): always try XOVER first, and if it fails
revert to the slow method.

24 years agoFix a case where a variable was free'd and then possibly used in an error
Dan Winship [Wed, 4 Oct 2000 21:55:53 +0000 (21:55 +0000)]
Fix a case where a variable was free'd and then possibly used in an error

* providers/mbox/camel-mbox-store.c (get_folder): Fix a case where
a variable was free'd and then possibly used in an error message.

24 years agonews: -> nntp:.
Chris Toshok [Wed, 4 Oct 2000 21:41:13 +0000 (21:41 +0000)]
news: -> nntp:.

2000-10-04  Chris Toshok  <toshok@helixcode.com>

* providers/nntp/camel-nntp-provider.c
(camel_provider_module_init): news: -> nntp:.

24 years agouse "nntp:" instead of "news:" since "news:" urls aren't supposed to have
Chris Toshok [Wed, 4 Oct 2000 21:32:32 +0000 (21:32 +0000)]
use "nntp:" instead of "news:" since "news:" urls aren't supposed to have

2000-10-04  Chris Toshok  <toshok@helixcode.com>

* providers/nntp/camel-nntp-store.c (nntp_store_get_folder_info):
use "nntp:" instead of "news:" since "news:" urls aren't supposed
to have host/user/port info in them.  also, if there's a user
defined in the url, put it in the urls for our folders.

24 years agoborrow some code from the imap provider to query the user for their
Chris Toshok [Wed, 4 Oct 2000 20:36:10 +0000 (20:36 +0000)]
borrow some code from the imap provider to query the user for their

2000-10-04  Chris Toshok  <toshok@helixcode.com>

* providers/nntp/camel-nntp-auth.c (camel_nntp_auth_authenticate):
borrow some code from the imap provider to query the user for
their password, and pass the user/passwd to nntp.  be extra
paranoid and zero out the password before freeing it.

* providers/nntp/camel-nntp-store.c (camel_nntp_store_init): add
ALLOW_USER/ALLOW_PASSWORD/ALLOW_AUTH to the url flags.
(nntp_store_query_auth_types_generic): return our list of
auth_types.
(nntp_store_query_auth_types_connected): broken, return same as in
query_auth_types_generic.