locking cleanups from Oswald Buddenhagen <ossi@kde.org>
* don't need to stat the lockfile since it will always be size 0
* only remove lockfile when we actually succeeded in locking
fixed segmentation fault caused by double free() when an error occurred
during the IMAP transmission.
fixed bug where isync could not handle a 0 value UIDVALIDITY
Added Tunnel directive to allow the user to specify a shell command to run
to set up an IMAP connection in place of a TCP socket (eg., to run over
an SSH session).
the uid for each message in the maildir is now stored in a dbm database
rather than the filename. this change was necessary because isync became
confused if you copied a message to another folder, in which case the uid
was invalid.
as a result of the above change, isync now acquires a mutex on the mailbox
to protect the dbm database from concurrent access.
main() was reworked to continue gracefully when an error is encountered, and
to always call maildir_close() so that the lock can be disabled, and the
database closed.
sync_mailbox() didn't consider MaxSize == 0 to mean "unlimited".
load_config() needs to print a newline in its error messages since
next_arg() kills the newline of the line that was read out of the config
file.
out if new mail arrives while in the process of downloading
noted in BUGS section of man page that if new mail arrives after the initial
message list has been retrieved from the IMAP server, that new mail will not
be fetched until the next invocation of isync.
1 giving a path to a nonexistant rc-file with the -c argument dumps core
The patch adds a check to ensure that the given rc-file is accessible
2 the error messages given from failed openssl calls are bogus
The handles the error from SSL_connect () correctly. The bug is
understndable since the error handling in openssl is quite obfuscated.
Good news is that the documentation manapges has been greatly updated in
the latest version (0.9.6). See in particular err(3), ERR_get_error(3)
and SSL_get_error(3).
Please note that possible SSL_ERROR_SSL type errors from SSL_read() and
SSL_write() is not handled. This should also be fixed.
3 connecting using the STARTTLS command with an imap server that is
configured only to accept the TLSv1 protocol gives an error because isync
sends an SSLv2 Hello message for backwards compability. (This is the case
with the uw-imap 2000 that ships with redhat-7.0)
I've read RFC2595 several times to see if it says something about
compability SSL2/SSL3 hello messages but can't find anything. IMHO the
correct thing to do is change the default to not use SSL2/3 compability
hello when using the STARTTLS command but use it if the imaps port is
used. The patch implements this change
4 repeated calls to SSL_CTX_set_options overwrites the old settings (the
values needs to be ORed together)
fixed in the patch
patch from me@mutt.org:
\Recent messages were put in the cur/ directory instead of new/
give error message when the LOGIN command fails