Mime-parser rework: parse the mime headers of the current container so we can guess the size of the content to jump accross; binary/ascii is used to switch the search algorithm for the next boundary.
- the old mime parser version skipped empty containers; we do this by hand
- for some reason the numbers addressing the mimeparts grow different, maybe mixed use of old/new may cause confusion...
to be able to test the mimeparser in an insulated binary, here we have a test, that reads a given file into memory, and parses it using the mime parser.
More hickups found due to the mimetester; pre push.
- the_mime_parser (): we need to know where parse_MimeHeaders() finds the end of the headers.
- the_mime_parser (): don't move the pointer around just to count up to the end-pointer. this can be done by pointer substraction.
- parse_MimeHeaders (): move the parameter so our caller gets to know what we read
- parse_MimeHeaders (): if (ptr >= content_end) after reading is probably a bug (also there in stable..), that makes us fail to read the last line, if. move it to the end of the pointer.
- don't call strchr twice; remember & evaluate the first result
- stripping the disposition-header can be done right where we found it.
- move the cluster of buffers into a struct compatible to the CKEY macro
- add the interesting other evaluated flags & numbers to that struct
- move finding & parsing of the 'interesting headers' into its own function.
by all this we hope to get informations about the mimepart before we have to search for its end
- remove strlen from the for loop abort condition
- move string around _once_
- return the length of the string we operated on, since we know it after the operation anyways.
avoid decoding mime-parts unless we realy need to.
- suff... doesn't need to decode all attachments; we just need the mime headers here.
- when searching for the attachment we want to output, we also don't need the content.
- when outputing an attachment, just decode the attachment were actualy interested in.
- looping forward while moving a pointer and doing memcmp isn't fast. replace it by strstr
- \r\n can be done in a pointer dereferencing comparison.
Note: maybe we need to fallback to the memcmp way if there is binary content?
In that case we should do a little smarter and try to use contentlength-headers etc.
avoid calling GETR for the number of total/read messages
so far webcit used a call of GETR to retrieve the number of messages available in the current room for displaying the room banner.
However, GOTO already gave us this information, and GETR is only available for aides, so we got Important messages with that error when logged in as joe average.
This went under the radar for quiet a while, since the error message wasn't printed but silently ignored.
- default is 30 seconds
- Server greeting 90 seconds (DNS lookups for RBLs might be slow
- Server sending the response to the EOM sequence; here we might have background processing like virus or spam scanning that wants to finish before finaly accepting the message.
Don't send identity header if we want to do gzip compression
Propfind replies send 'Content-encoding: identity' right now, which is superseeded by the frameworks 'Content-encoding: gzip' in case of the client indicates this.
sending that headers twice has uncertain results depending on the client; while the RFC demands to evaluate the later, some fail to read our reply then.
- move defines from imap_tools.h into serv_imap.h
- switch includes in sequence
- we now have IMAP->Reply, which we write into, until IUnbuffer sends it to the client
- IReply & IReplyPrintf do now send 'Params[0].Key BAD xxxxxx\r\n' to the client; this makes the code more compact.
- IA* append stuff to the outbuffer that we want to send.
- replace rumpelstilskin handler lookup by hashlist and central register calls.
- replace if's in the sequence separating the handlers by their required pre-conditions by flags on the register call.
this should
- (hopefully) fix some troubles with evolutions imap, which wouldn't like to read enough chunks until the line ends
- speed up stuff like header fetching in huge lists, since we reduce the number of context switches here.
have flexible timouts while reading lines in our client mode connections
since some mailserver take a little longer to finish reading mails we need to wait after we send our '.\r\n'; its 90 seconds now, all other parts will wait 5s, quit will wait 1 second.
we changed the SMTP outbound connections to be nonblocking so we could abort on not reacting SMTP-Servers.
thus we need to select before writing, else the connection will fail.
don't fetch a RSS before the network frequency is elapsed
currently the RSS-Thread is run over and over; we shouldn't stress our partrers to much, so we let the network poll frequency elaps before we try to poll the rss feed again.
move old tokenizer over to the managesieve server; its only used there.
- remove old_imap_tokenizer from imap_tools.h
- move old_imap_tokenizer to modules/managesieve/serv_managesieve.c
- move imap_tools.h to modules/imap; since its not needed globaly anymore.
* need to set & check errno that tells us whether our tempfile was fresh created or already there
* remove tmpfile on error
* don't use fopen() because we can't specify the flags we need for that
* ftruncate() the tempfile at the right place
Prevent writing empty network configs Part II
* writenfree_spoolcontrol_file ()
- serialise into a StrBuf
- write that to a tempfile in the netconfig directory
- if we fail, abort & log error
- if we succed use rename () to replace the original config file.
* cmd_snet: make shure the target FS has enough space for the new config
- Create our own filename insteaf of using mk*tmp*; CC->cs_pid should be uniq.; we use O_CREAT|O_EXCL so we're shure its ours or fails.
- Create that filename in the same directory as the filal config filename; by that we can be shure its in the same filesystem, and if thats full, we will fail
- Stat the original file for sise (if not there assume 80) and write twice as much into that file so we're next to shure the content from the client will fit in
- the citadel protocol is a little st00pit here, we don't know the size in advance, and we can't return an error _after_ accepting the file
- instead of moving the content of the tempfile into the final file, we use rename() which is supposed to be atomic.
* sock_getln (): CtdlSockGetLine() gives us lines without \r\n, no need to look for them again
* sock_getln_err (): add integer pointer returning the actual return state in case of error
* ml_sock_gets (): use sock_getln_err () so we can abort on impropper replies
* smtp_try (): make socket nonblocking, so we can abort on error
-> we will wait 5 seconds for the remote site to send us the SMTP-State else we will abort the connection on failure.
Art Cancro [Tue, 26 Oct 2010 04:17:37 +0000 (00:17 -0400)]
Numerous style changes to the 'edit message' dialog. The save,
cancel, and address book buttons now occupy the navbar instead of
a bunch of controls that shouldn't have been there anyway. I
also fixed a javascript bug that was making the addressbook popup
silently fail in the background if we were in a room that didn't
require message recipients.
The attachment dialog now sits above the message body pane, but
this will soon get migrated into the navbar as well (maybe another
popup).
Finally, the background of the message entry div now more or less
occupies the entire space available to it; this still needs more
tuning in order to make the editor occupy the correct amount of
space in the pane.