Stephan Bosch [Mon, 15 Sep 2014 08:19:50 +0000 (11:19 +0300)]
lib-http: server: Fixed connection reference counting.
Connection often still got destroyed too early. Particularly submitting
responses would potentially destroy the connection, which is often
unexpected. Sending responses is now postponed until handled by the stream
output handler, which is explicitly triggered when necessary.
Timo Sirainen [Sat, 13 Sep 2014 19:15:35 +0000 (22:15 +0300)]
fs-metawrap: Add FS_PROPERTY_COPY_METADATA property for wrapped fs backends.
This is because if we simply use the parent copy the metadata gets copied
as well.
Timo Sirainen [Thu, 11 Sep 2014 15:15:04 +0000 (18:15 +0300)]
virtual: Recent optimizations had broken fast mailbox syncing.
We wrongly assumed that all_mails array could have been accessed using vseqs.
Broken by 8abf7eea2966
Phil Carmody [Wed, 10 Sep 2014 11:08:58 +0000 (14:08 +0300)]
lib-index: test suite memory leak cleanup
So that memory leak checkers can be active while running the test
suites, ensure that the suite itself doesn't leak.
Stephan Bosch [Wed, 10 Sep 2014 10:39:37 +0000 (13:39 +0300)]
lib-http: client: Tunnel connection failure would cause segfault.
That happened because it tried to retry waiting requests, which makes no sense for a CONNECT tunnel.
Stephan Bosch [Wed, 10 Sep 2014 10:39:37 +0000 (13:39 +0300)]
lib-http: server: Added assert to connect callback which makes sure request is either responded to or referenced.
Earlier change added this only to callback for normal requests, but CONNECT should be handled the same in this respect.
Stephan Bosch [Wed, 10 Sep 2014 10:39:37 +0000 (13:39 +0300)]
lib-http: server: Fixed delayed request destruction.
Destruction was actually delayed indefinitely, because the delay flag was not reset.
Obviously, this caused a memory leak.
Stephan Bosch [Wed, 10 Sep 2014 10:39:37 +0000 (13:39 +0300)]
lib-http: server: Fixed segfault occurring in connection input handler.
Request handlers could close and destroy the connection early.
Fixed by holding a reference in the input handler.
Timo Sirainen [Tue, 9 Sep 2014 14:09:30 +0000 (17:09 +0300)]
lib-master: Fixed -c & -i command line parameters when config socket was readable.
The config socket was always being read, even if another config file was
attempted to be used.
Timo Sirainen [Mon, 8 Sep 2014 10:39:25 +0000 (13:39 +0300)]
COPYING.LGPL: Updated FSF mailing address.
Also some whitespace and line wrapping changes. Used the same file as
http://www.gnu.org/licenses/lgpl-2.1.txt
Timo Sirainen [Wed, 3 Sep 2014 13:29:52 +0000 (06:29 -0700)]
lib-storage: Fixed off-by-one memory allocation in dynamic settings allocation code.
This didn't actually affect normal Dovecot builds, because there were always
some storages with get_setting_parser_info=NULL that added the necessary
padding.
Timo Sirainen [Thu, 28 Aug 2014 13:44:18 +0000 (22:44 +0900)]
lib-fs: Fixed metawrap_fs.copy() to work with FS_PROPERTY_COPY_METADATA backends.
This is done by simply copying the entire file with the metadata included
instead of rewriting it.
Timo Sirainen [Thu, 28 Aug 2014 12:56:41 +0000 (21:56 +0900)]
lib-dict: Changed dict.init() API to take struct dict_settings and added dict_init_full().
This allows giving more settings to dict in future as needed. Unfortunately
it also breaks the internal dict API, but there aren't really any plugins
widely using it, so it's not a big problem.
Timo Sirainen [Tue, 26 Aug 2014 05:50:15 +0000 (14:50 +0900)]
auth: Allow passdb credentials lookup also with auth_bind=yes
Although we probably can't lookup the password itself, we're also doing
passdb lokups for proxying and other purposes. These lookups will still work
as long as pass_attrs & pass_filter is specified.
Timo Sirainen [Thu, 21 Aug 2014 12:49:34 +0000 (14:49 +0200)]
fts-lucene: When deleting corrupted lucene-indexes/ directory, don't rmdir it.
This at least avoids errors with NFS when some of the files are still open
inside it by other processes.
Timo Sirainen [Wed, 20 Aug 2014 13:32:15 +0000 (15:32 +0200)]
lmtp: Put back the deduplication code.
Too dangerous after all to change it in the middle of v2.2.x. It's also not
causing that much trouble even when it breaks..
Timo Sirainen [Wed, 20 Aug 2014 12:35:27 +0000 (14:35 +0200)]
auth: protocol-specific username settings weren't used for userdb lookups.
The username was set before the service-specific settings were looked up, so
global settings were always used. This affected auth_default_realm,
auth_username_translation and auth_username_format settings.
Timo Sirainen [Wed, 20 Aug 2014 11:22:28 +0000 (14:22 +0300)]
fts-lucene: If whitespace_chars was set, we may have ended up indexing some garbage words.
The final \0 was replaced with space, so everything beyond that was also
being indexed.
Timo Sirainen [Tue, 19 Aug 2014 21:51:14 +0000 (23:51 +0200)]
lib: wildcard_match() should have matched "*" wildcard against an empty "" string also.
This fixes global ACL "*" matching the root namespace when creating new
mailboxes.
Timo Sirainen [Fri, 15 Aug 2014 12:22:46 +0000 (15:22 +0300)]
istream-chain: Support using io_add_istream() for the chain stream.
The callback is notified whenever new streams are added to the chain.
It's currently not possible to have nonblocking istreams added to the chain
and the callback being called when they have new data, but it would be
possible to implement as well if needed at some point.
Phil Carmody [Fri, 15 Aug 2014 12:02:59 +0000 (15:02 +0300)]
pop3: satisfy some strict parsing rules in RFC 1939
"Commands in the POP3 consist of a case-insensitive keyword, possibly
followed by one or more arguments. All commands are terminated by a
CRLF pair. Keywords and arguments consist of printable ASCII
characters. Keywords and arguments are each separated by a single
SPACE character."
"A server MUST respond to an unrecognized, unimplemented, or
syntactically invalid command by responding with a negative status
indicator."
Therefore the following commands must be rejected:
LIST 2600Hz
LIST 99 red balloons
TOP 1 2 buckle-my-shoe
Phil Carmody [Fri, 15 Aug 2014 12:02:59 +0000 (15:02 +0300)]
pop3: fix msgnum/size parsers
The outer if()s are completely unnecessary, and permit `num'
to remain uninitialised. Spotted by clang's static analysis.
Note that the lack of a parameter from a broken client is no longer
treated as "0". Before the bug was introduced:
DELE
-ERR There's no message 0.
After this patch:
DELE
-ERR Invalid message number:
Timo Sirainen [Fri, 15 Aug 2014 11:41:03 +0000 (14:41 +0300)]
Handle "out of disk space" and "out of user quota" as separate cases.
"Out of disk space" is a temporary error that should be logged as error and
the failure should be sent to user as "Internal server error".
Obsolete the use of MAIL_ERROR_NOSPACE and MAIL_ERRSTR_NO_SPACE. Use the
clearer MAIL_ERROR_NOQUOTA and MAIL_ERRSTR_NO_QUOTA instead.
Phil Carmody [Wed, 13 Aug 2014 10:34:22 +0000 (13:34 +0300)]
lib-http: server_request/connection - improve encapsulation
It just feels a bit dirty having the request mess around with the
connection's internals, have the connection manage its linked lists
itself. No functional changes.
Timo Sirainen [Tue, 12 Aug 2014 15:48:03 +0000 (18:48 +0300)]
virtual plugin: Optimized syncing a large number of physical mailboxes.
Especially when the number of mails was large the old code took a lot of CPU
time. Based on patch by Teemu Huovila.
Timo Sirainen [Tue, 12 Aug 2014 10:12:01 +0000 (13:12 +0300)]
lib-http server: Delay calling the request's destroy callback until handle_request() callback is finished.
This simplifies the code in the handle_request() so it doesn't need to keep
track of whether the response is already submitted or not.
Timo Sirainen [Tue, 12 Aug 2014 09:39:46 +0000 (12:39 +0300)]
fts-lucene: If lucene-indexes dir is unexpectedly lost, rescan when expunge log update fails.
This mainly fixes a repeating error about failing to open the expunge log.
It should happen only if dovecot.index thinks that the mailbox is indexed
while in reality the entire lucene-indexes directory doesn't exist.
Timo Sirainen [Mon, 11 Aug 2014 16:30:15 +0000 (19:30 +0300)]
ostream-buffer: Allow modifying the buffer outside ostream, unless o_stream_seek() is used.
Now we'll just append to the end of the buffer instead of forcibly trying to
write at the offset where the last ostream write ended.