Timo Sirainen [Thu, 8 May 2014 07:21:56 +0000 (10:21 +0300)]
run-test.sh: Valgrind version check was broken for v3.10+, removed it entirely.
RHEL 5.9 has valgrind v3.5 already, so there shouldn't really be any
important OSes using old valgrind that we need to support.
Timo Sirainen [Wed, 7 May 2014 16:47:12 +0000 (19:47 +0300)]
lib-imap: IMAP parser didn't parse atoms correctly that started with '~' character.
literal8 begins only after "~{", not immediately after "~" which is a valid
ATOM-CHAR.
Phil Carmody [Wed, 7 May 2014 15:39:23 +0000 (18:39 +0300)]
lib: fix md4/md5 buffer read overrun
uint_fast32_t may be 64 bits and read too many bytes at the end of the buffer.
This didn't actually break anything as long as there was 32 bits of readable
memory past the buffer.
Timo Sirainen [Wed, 7 May 2014 10:02:29 +0000 (13:02 +0300)]
liblib: Added unit test for hash methods to make sure they don't do read access beyond buffer.
This currently fails for MD4 and MD5, so they need to be fixed/replaced..
Timo Sirainen [Wed, 7 May 2014 09:26:38 +0000 (12:26 +0300)]
lib-compression: Fixed LZMA compression.
The code now looks more like the doc/examples/01_compress_easy.c distributed
with xz-utils. Most importantly this changes LZMA_OK to be allowed as a
result for lzma_code(zs, LZMA_FINISH).
Timo Sirainen [Mon, 5 May 2014 15:37:16 +0000 (18:37 +0300)]
mkdir_parents(): Handle mkdir() EEXIST errors that may happen during race conditions.
We don't care about EEXIST errors that happen when trying to mkdir() parent
directories, only if it happens when mkdir()ing the last directory.
Timo Sirainen [Mon, 5 May 2014 13:01:58 +0000 (16:01 +0300)]
lib-storage: mail_get_headers_utf8() now replaces NULs with spaces.
Perhaps there should also be another API function which actually allows
returning strings with NULs in them.
Timo Sirainen [Mon, 5 May 2014 12:05:20 +0000 (15:05 +0300)]
liblib: Added str_append_data(), which is simply a wrapper to buffer_append()
This is intended for appending data that may contain NUL characters that are
wanted to be added to the string.
Timo Sirainen [Mon, 5 May 2014 11:18:31 +0000 (14:18 +0300)]
imap: Brought back the original SEARCH PARTIAL code with the minor fix that it actually needed.
The new code in v2.2.11 was completely wrong. The code in previous commit
was broken with SORT. The original code was correct otherwise, except it
couldn't handle partial1 pointing past the valid range.
Timo Sirainen [Fri, 2 May 2014 10:36:00 +0000 (13:36 +0300)]
maildir: Returning mail's received/saved date or refcount was sometimes broken with zlib plugin.
If the value wasn't already cached and the same transaction also accessed
the message body, i_stream_stat() was used, which ended up to
i_stream_seekable_stat() due to caching the file, which didn't again fstat()
the actual maildir file but just used some internal values.
Timo Sirainen [Fri, 2 May 2014 08:40:05 +0000 (11:40 +0300)]
auth: Fixed userdb extra fields handling in passdb failure.
userdb prefetch -flag wasn't correctly set, causing the prefetch userdb in
some situations incorrectly either to be called or not be called.
This also fixes a crash when using userdb static and multiple passdbs. The
userdb_reply was set to NULL, which caused a crash later.
Timo Sirainen [Fri, 2 May 2014 08:12:58 +0000 (11:12 +0300)]
imap: Make sure we don't return empty "* n FETCH ()" reply, which violates RFC 3501 ABNF.
It happened only during error conditions, and it would be a bit too much
trouble to try to remove the reply entirely, so just append the message UID
there.
Timo Sirainen [Wed, 30 Apr 2014 14:37:43 +0000 (17:37 +0300)]
lib-storage: Partially reverted the mail.get_real_mail() API change for backwards compatibility.
I hadn't realized Pigeonhole was also using it. (I thought it was using only
the mail_get_real_mail() public API.) This fixes Pigeonhole v0.4.2 to work
again.
Timo Sirainen [Wed, 30 Apr 2014 03:08:46 +0000 (06:08 +0300)]
dsync: saved-date doesn't need to be looked up until mail body is being read.
This should improve the performance when the saved-date isn't already cached
or otherwise quickly accessible.
This change also makes dsync slightly incompatible with earlier versions.
When using dsync with an earlier version the saved-dates aren't synced. It
would be too much trouble to try to preserve full backwards compatibility,
especially because saved-date doesn't matter so much and isn't even visible
to IMAP clients.
Timo Sirainen [Tue, 29 Apr 2014 13:03:17 +0000 (16:03 +0300)]
lib-mail: istream-attachment-extractor handled mixed LFs vs CRLFs correctly.
Unless all the lines have the same newlines, the attachment can't be
recreated back exactly the same.
Timo Sirainen [Mon, 28 Apr 2014 17:14:03 +0000 (20:14 +0300)]
dsync: If incremental dsync finds that its state is stale, retry (later) with full sync.
This works only when the master itself notices such changes locally. Remote
changes aren't noticed, because the master doesn't send the state to remote
dsync and the master is also the one that decides which mailboxes are
synced. The fix to this probably means sending the state string to remote
dsync and have it check if the state is still valid (= protocol change).
Timo Sirainen [Mon, 28 Apr 2014 15:34:27 +0000 (18:34 +0300)]
doveadm replicator add <user mask> command added.
This allows quickly adding users from userdb that don't exist in replicator.
For example "doveadm replicator add '*'" adds all the new users from userdb.
This isn't really necessary though. Users will be automatically added as
soon as their mailboxes change in some way and replicator gets notified
about them.
Stephan Bosch [Sat, 26 Apr 2014 19:40:14 +0000 (22:40 +0300)]
lib-http: Fixed problem with connections idling indefinitely.
Forgot to check for idle connections when request finished after waiting
for payload to be read by application.
Timo Sirainen [Fri, 25 Apr 2014 13:15:20 +0000 (16:15 +0300)]
lib-lda: When non-RCPT/DATA command fails permanently, translate it internally to temporary failure.
We shouldn't be answering permanent failures to RCPT/DATA command when the
failure really had nothing to do with the recipient/content itself. Most
likely it's just some server misconfiguration, which should be treated as
temporary error.
Timo Sirainen [Wed, 23 Apr 2014 13:45:10 +0000 (16:45 +0300)]
virtual: Fixed assert-crash in IDLE caused by earlier changes.
This change negates all the improvements of the earlier changes when IDLE is
used. This could be fixed by using mailbox-list-notify.h API.