- 15 Oct, 2001 2 commits
-
-
hacks. Something to remember for the mailbox2 is to do some smart caching, the current buffered stream is not good enough. * configure.in: VERSION is set to 0.0.9a for the alpha. * frm/frm.c: Protype for usage(). get_personal() should use const char *. * mail/mail.c (main): Use mailbox_scan() instead of mailbox_messages_count () it is faster for IMAP. * mailbox/mbx_imap.c(imap_get_message0): Remove the stream_setbufsiz() it is no longer used. (imap_message_readline imap_body_readline): Bug fix, readline will only consume up to '\n' even though the buffer is bigger. So we have to adjust the offset/lines/size to reflect what we consume. This is not very good for example doing: { off_t offset = 14; char buffer[512]; stream_readline (stream, buffer, sizeof buffer, offset, NULL); ... } Will send to the impap server. C: g445 FETCH 4 BODY.PEEK[2]<0.2048> S: * 4 FETCH (BODY[2]<0> {739} S: g445 OK FETCH completed This is waste since the first line is only 37 bytes. We will have to come up on the second API with some smart caching. * mailbox/memory_stream.c (_memory_write): Nasty bug was not updating the stream size. * mailbox/stream.c(stream_readline): Take care of known case where the buflen is 0 or 1.
Alain Magloire authored -
it is the same approach as in mail/util.c(environment) settings. The old code was simply overkill, property_t was seldomly use if at all and no need for heavy hash table and all that jazz. * mailbox/property.c: New code, the same as mail/util.c environment. * mailbox/mbx_mbox.c (_mbx_init): Remove property_add_defaults() etc .. no longer in use in the initialisation code. * mailbox/mbx_imap.c: Likewised * mailbox/mbx_pop.c: Likewised * mailbox/mbx_mh.c: Likewised * mailbox/header.c: Remove property code. * mailbox/body.c: Remove property code. * mailbox/message.c: Remove property code. * mailbox/filter.c: Change the code according to the new property_t. * mailbox/filter_rfc822.c: Change the code according to the new property_t. * include/mailutils/header.h: Remove property. * include/mailutils/body.h: Remove property. * include/mailutils/message.h: Remove property. * include/mailutils/property.h: Remove property_add_defaults() property_set_valued () takes one more argument for overwrite. * mailbox/include/header0.hy: Remove property field. * mailbox/include/body0.hy: Remove property field. * mailbox/include/message0.hy: Remove property field. * mailbox/mailbox.c(mailbox_get_property mailbox_set_property): Changed Property code. * mailbox/mailer.c(mailer_set_property mailer_get_property): Changed Property code. * mailbox/folder_imap.c (imap_search imap_expunge imap_status): Stubs Search is not implemented yet, STATUS neither and EXPUNGE is not used. * mailbox/list.c: Rename variable index to indx to shutup gcc whos confusing with index() when warning level was high. * mailbox/md5-rsa.c: Likewised. * mailbox/mailbox.c (mailbox_get_debug mailbox_set_debug): The debug object was being set on the folder not the mailbox. * mailbox/mbx_imap.c (imap_messages_count): Attempt to reconnect if the connection timeout. Is this wise ? (imap_scan0): Move gut of imap_scan() code tho here. (imap_scan): Stub calling imap_scan0() with notification enable. (imap_expunge): After CLOSE, call imap_scan0() wiht notification disable. Memory leak in parse822, this was a real pain to trace, because of the recursive nature of the algorithm. Sam should buy me a beer for this. * mailbox/parse822.c: Use more assert to catch errors. (parse822_group): phrase was not free() in case of failure. (parse822_mail_box): Dead if branch remove and free phrase. (parse822_route): accumulator was not being freed. (parse822_local_part): Move down st_free(more). (parse822_domain): Move down st_free(more).
Alain Magloire authored
-
- 14 Oct, 2001 12 commits
-
-
-
-
-
-
-
-
-
-
-
It should probably be a runtime option via set debug=1 or something for now it is disable between if (0) {...}. More cleanup in the IMAP code. A memory stream buffer is use to save the string literal sended by the IMAP server. The allocation is handle by the memory_stream which simplifies the code. * folder_imap.c (folder_imap.c): Create a memory stream to hold the literal or quoted string send by the IMAP server. (folder_imap_list folder_imap_lsub): There is no callback field the struct folder_list is in struct _f_imap now. (imap_literal_string imap_quoted_string imap_string): Use the memory string stream to save the result. (imap_body): Still need to be clean, but creates the cache header when doing the scan. (imap_parse): Do not use alloca().
Alain Magloire authored
- 13 Oct, 2001 2 commits
-
-
- 12 Oct, 2001 3 commits
-
-
-
-
* mailbox/folder_imap.c (imap_body): Destry the cache header if it was previously set on a SCAN. * mailbox/mbx_imap.c (delete_to_string): New function, to generate a string of IMAP message numbers. (imap_expunge): use delete_to_string; (attribute_string): Removed. (flags_string): Removed. (flags_to_string): Replace attribute_string() and flags_string(). (message_operation): Rename to fetch_operation. * mailbox/include/imap0.h(struct _f_imap): field func and id removed, never used.
Alain Magloire authored
-
- 11 Oct, 2001 3 commits
-
-
(imap_string): Free the buffer. (imap_body): Check if we already have the fheader header. (imap_scan): Forgot the break in the switch. I think, I broke something in the IMAP code too .. sigh ... it is getting to late here to figure this out.
Alain Magloire authored -
the approach of downloading part of the header of the total set of messages. The it was done before is that the headers were ask one by one per message. This was causing performance delay because we were doing a lot of small transaction on the TCP/IP stack. By bundling the entire thing in one request there was much less transcation and the speed was increase by a factor of 10++. The Imap code folder_imap.c and mbx_imap.c is now messy. The rewrite in mailbox2 should clean this up though. * mailbox/folder_imap.c (imap_quoted_string): Allocated the memory instead. (imap_body): If we were doing the scan free the memory and create the cache header. (imap_fetch): Create the message if was not done, important for the scan. * mailbox/mbx_imap.c (imap_scan): Bundle one big request to fetch as much information as possible. (message_operation): Free the buffer when done. * mailbox/include/imap0.h: Add IMAP_SCAN states. * mailbox/file_stream.c (_file_readline): It seems that fgets() can not handle binary data. Try to do our best.
Alain Magloire authored -
of byte written to 0. (header_get_value): Likewised. * mailbox/mbx_imap.c (imap_envelope_sender): Go through header_get_value() to fetch the "Sender" field, it may be cache. (imap_header_get_fvalue): Put parenthesies around the FETCH, the WU-IMAPD likes it that way.
Alain Magloire authored
-
- 10 Oct, 2001 2 commits
-
-
-
For pop this a little hackish, since there is no proper folder. As a hack we set for the pop folder the actual mailbox as data pointer. (pop_user): the owner of the authority is the folder.
Alain Magloire authored
-
- 09 Oct, 2001 2 commits
-
-
is not set fallback on body_lines and header_lines. * mail/print.c: Lines number are not always known for example for POP or IMAP, it is not known until the mail is dowloaded so take a guess base on the size.
Alain Magloire authored -
Move all the previous mbox_expunge() to mbox_expunge0() with a new argument deciding whether or not to remove messages set deleted. (mbox_save_attributes): Stub calling mbox_expunge0(). (mbox_expunge): Stub calling mbox_expunge0() * mailbox/mbx_mh.c: Provide a prototype for mh_message_number() there is no provision for it in the current Mailbox API.
Alain Magloire authored
-
- 08 Oct, 2001 4 commits
-
-
- 06 Oct, 2001 2 commits
-
-
-
LPAREN. * mailbox/header.c (header_get_fvalue): Return 0 in the number of byte return argument even when no header is found. (header_get_value): Likewised. * mailbox/mbx_imap.c (imap_header_get_fvalue): Also cache the message size and the FLAGS. (imap_message_size): If we already have the size do not request it again.
Alain Magloire authored
-
- 05 Oct, 2001 4 commits
-
-
-
-
parse822_quoted_string() sometimes returns EOK and does not fill qstr (e.g. when parsing empty string: "")
Sergey Poznyakoff authored -
There is no parenthesis when we send the UIDVALIDITY/UNSEEN. * mailbox/header.c (header_free_cache): New function. (fill_blurb): Call header_free_cache to release memory. (header_destroy): Move the code to header_free_cache(). (header_set_fvalue): Accept a NULL value, it will permanent failure i.e. the header does not exist. (header_get_value): Check the cache provided by the header object then the cache from _get_fvalue() and fall back to downloading the entire header. * mailbox/mbx_imap.c (imap_hader_get_fvalue): Implement a cache in IMAP for the most use headers like "FROM, SUBJECT ....". * mailbox/include/imap0.h: New field in _m_imap to hold the header cache. * mailbox/mapfile_stream.c: signed and unsigned cast.
Alain Magloire authored
-
- 04 Oct, 2001 2 commits
-
-
-
the \\Delete flag and just keep it locally. The expunge will take care of resending it. (imap_attr_get_flags): Likewised.
Alain Magloire authored
-
- 03 Oct, 2001 2 commits
-
-