Timo Sirainen [Fri, 31 May 2013 23:25:54 +0000 (02:25 +0300)]
Make sure errno is preserved in non-delayed signal handlers.
The current code didn't have any signal handlers that modified errno, so
this doesn't fix any bugs.
Timo Sirainen [Fri, 31 May 2013 14:36:19 +0000 (17:36 +0300)]
imapc: Empty imapc_user expands to namespace's owner, or with public namespaces to user itself.
The main idea is that with shared namespaces it now expands to the shared
username, allowing shared mailbox access via imapc.
Stephan Bosch [Thu, 30 May 2013 15:04:52 +0000 (18:04 +0300)]
imap: Fixed segfault in URLFETCH command.
Command would be cleaned up while requests were still pending, causing a
segfault once a request finished. Added API determining whether the URLAUTH
fetch interface still has pending requests.
Timo Sirainen [Wed, 29 May 2013 13:40:50 +0000 (16:40 +0300)]
lib-imap: imap_append_string_for_humans() returned broken output for whitespace-only input.
This returned broken IMAP ENVELOPEs, especially for subjects that contained
only whitespace. Since the broken output returned a huge literal, it
basically caused the IMAP client to hang.
Timo Sirainen [Tue, 28 May 2013 14:30:42 +0000 (17:30 +0300)]
auth: Keep auth_request referenced during DNS lookup.
If the underlying auth connection gets closed, there's nothing else
referencing the auth_request.
Timo Sirainen [Mon, 27 May 2013 18:03:14 +0000 (21:03 +0300)]
dbox: Don't cache pop3.uidl|order unless index header indicates there are those.
They exist only when doing a migration, so it's pretty wasteful storing
"doesn't exist" for all other installations.
Timo Sirainen [Sun, 26 May 2013 18:57:36 +0000 (21:57 +0300)]
dsync: Added -x parameter to exclude mailboxes from sync.
Multiple -x parameters can be added. Giving \flag as parameter means that
the mailbox with the given SPECIAL-USE \flag is skipped. For example:
Timo Sirainen [Sun, 26 May 2013 16:04:00 +0000 (19:04 +0300)]
lib-index: mail_cache_lookup*() can now return fields recently added with mail_cache_add()
Previously it was returning them if they had already been written to
dovecot.index.cache, but not if they were still in the in-memory buffer.
This avoids caching/parsing the same field multiple times when messages
aren't accessed in ascending order (e.g. when sorting messages).
Stephan Bosch [Tue, 21 May 2013 19:55:23 +0000 (22:55 +0300)]
lib-imap-urlauth: Fixed deinitialization of the URLAUTH fetch handler.
Added reference counting to make sure callbacks will not deinitialize the
handler prematurely.
Stephan Bosch [Tue, 21 May 2013 19:55:17 +0000 (22:55 +0300)]
lib-imap-urlauth: Fixed resuming in URLAUTH fetch handler.
Fixed URLAUTH fetch handler to properly resume the URLAUTH connection, even
when it is deinitialized.
Timo Sirainen [Sun, 19 May 2013 23:01:02 +0000 (02:01 +0300)]
dsync: Don't try to sync with GUIDs if we can't set them on the needed side.
With two-way syncing both sides need to have writable GUIDs. With one-way
syncing only the writing side needs to have writable GUIDs.
Timo Sirainen [Sun, 19 May 2013 22:39:52 +0000 (01:39 +0300)]
maildir: Reverted most of changeset c92ebbedc6f9.
If dovecot-uidlist file is recreated, it gets a new inode number, and we
should recognize by that alone that it has changed. More importantly this
forced re-reading of dovecot-uidlist clears out the RACING flag, making it
impossible to handle reappearing maildir files.
Timo Sirainen [Sun, 19 May 2013 19:30:52 +0000 (22:30 +0300)]
http_url_escape_param(): Added more characters to be escaped.
Most importantly '+', which encodes a space normally. The others may not be
strictly necessary, but safer to escape them just in case.
Timo Sirainen [Wed, 15 May 2013 12:35:10 +0000 (15:35 +0300)]
imap: Return how long SELECT or EXAMINE command took to answer.
Could be useful to know sometimes if there's a large maildir where a lot
files need to be rename()d.
Timo Sirainen [Wed, 15 May 2013 12:06:24 +0000 (15:06 +0300)]
Added asserts to binary searches to make sure we don't go to infinite loop.
Using idx=left+(right-left)/2 would have worked also to allow 4GB sizes,
but since none of the places in the code are likely to reach 2GB we might as
well just add an assert. (Also if they do reach 2GB, it could be possible
that they could reach also above 4GB and cause problems. Better to see an
early error.)
Timo Sirainen [Wed, 15 May 2013 10:44:01 +0000 (13:44 +0300)]
lib-storage: Allow mail_*cache_fields settings to specify any hdr.* fields.
Also the fields were previously set only once globally, so if the process
served multiple users, it wouldn't have been possible to use per-user values
for these fields.
Timo Sirainen [Wed, 15 May 2013 10:34:59 +0000 (13:34 +0300)]
lib-index: Fixed mail_cache_register_fields() decision updates.
Normally this shouldn't matter, except when mail_*cache_fields settings have
been used.
Timo Sirainen [Tue, 14 May 2013 13:46:08 +0000 (16:46 +0300)]
example-config: Moved imap_* and pop3_* settings outside protocol section.
There's no need to keep them inside protocol {}, and in case of
pop3_uidl_format=%m setting it's actually harmful.
Timo Sirainen [Mon, 6 May 2013 20:59:41 +0000 (23:59 +0300)]
lib-index: Previous commit sometimes broke scanning transaction log view.
If min_file_seq+offset pointed to the end of the previous file that no
longer existed, we didn't just skip over it.