2024-08-02 08:03  Oswald Buddenhagen <ossi@users.sf.net>

	* src/mbsync.1.in:

	generalize AUTHORS section of man page

2024-08-02 08:14  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac, src/.gitignore, src/Makefile.am,
	  src/mbsync.1.in, src/mdconvert.1.in:

	substitute version and date in man pages

	this shortens the release checklist and reduces commit churn.

	for the date we use configure's timestamp. this should reflect the
	package's creation time and be consistent with the version.

2024-08-02 07:56  Oswald Buddenhagen <ossi@users.sf.net>

	* .gitignore, Makefile.am, configure.ac, version.sh:

	automate setting package version

	this avoids the need for bumping the version, which is particularly
	helpful if one doesn't know yet whether the next release will be a
	patch, minor, or major.

	we cache the version extracted from git, which also provides a fallback
	for the case of somebody rebuilding configure from a tar-ball.

	note that it's impossible to determine the version at configure time, so
	after git-tagging you need to remember to run version.sh (or autoconf)
	prior to rolling a tar-ball.

2022-06-26 10:59  Oswald Buddenhagen <ossi@users.sf.net>

	* LICENSES/LicenseRef-isync-GPL-exception.txt:

	generalize GPL exception

	we have explicit approval from:
	- Anton Khirnov <anton@khirnov.net>
	- Jeremy Katz <katzj@fedoraproject.org>
	- Jesse Weaver <pianohacker@gmail.com>
	- Marc Hoersken <info@marc-hoersken.de>
	- Michael J Gruber <michael@grubix.eu>
	- Noa Resare <noa@resare.com> (formerly Daniel)
	- Oliver Runge <oliver.runge@gmail.com>
	- Patrick Steinhardt <ps@pks.im>
	- Theodore Ts'o <tytso@mit.edu>

	notably missing approval from:
	- Michael Elkins <me@sigpipe.org>

	further missing approval from:
	- Eivind Eklund <eivind@FreeBSD.org>
	- Georgy Kibardin <georgy@kibardin.name>
	- Jack Stone <jwjstone@fastmail.fm>
	- Jan Synacek <jsynacek@redhat.com>

	still, because
	- isync already contains an exception for OpenSSL,
	- every contributor implicitly agreed to that exception, and
	- that exception exists specifically because of the advertising clause
	  in OpenSSL < v3's license,
	i'm assuming that the MIA contributors are actually fine with the
	proposed change.

2022-09-03 20:46  Oswald Buddenhagen <ossi@users.sf.net>

	* AUTHORS:

	update some email addresses

	noa's and jeremy's new address are confirmed.
	michael e.'s address is kinda confirmed, except that it's silent.

2023-01-14 01:06  Husain Alshehhi <husain@alshehhi.io>

	* .gitignore, AUTHORS:

	add tag files to .gitignore

	The auto-generated makefile targets CTAGS, GTAGS and TAGS generate files
	locally that should not be checked-in into the source code. This change
	adds these files to the .gitignore file. The list of files match those
	in distclean-tags target.

2023-07-24 10:04  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: .gitignore, Makefile.am, bit_enum_gen.pl, common.h,
	  config.c, driver.h, drv_imap.c, drv_proxy.c, sync.c, sync.h,
	  sync_p.h, sync_state.c:

	revamp automatic enumeration of power-of-two enumerators

	i found a neat trick to do it with the C pre-processor after all.
	this makes the enum definitions themselves arguably somewhat less
	legible, but on the upside the build system becomes simpler, and IDEs
	can build/update their code models without having to (re-)build the
	project first.

	somewhat as a side effect, this gives bit enums proper names, so we
	don't need to refer to them by cryptic prefixes anymore.

	amends 6a78e2c5f.

2023-07-24 09:34  Oswald Buddenhagen <ossi@users.sf.net>

	* src/common.h:

	remove redundant argument from BIT_FORMATTER_PROTO()

	it doesn't need to know the enum prefix.

	amends 17db5de0c & 950ebe833.

2024-07-30 06:25  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, drv_imap.c, drv_maildir.c, drv_proxy.c,
	  drv_proxy_gen.pl, sync.c:

	eliminate commit_cmds driver callback

	no driver implements it, and this isn't likely to change any time soon.

2024-07-30 05:50  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	Revert "actually implement imap_commit_cmds()"

	the CHECK command doesn't do what i thought; the formulation in the
	specs was ambiguous - it really checks for new mail, rather than
	committing, and each operation is supposed to be atomic. inefficient,
	but safe. IMAP4rev2 eliminates the command altogether, subsuming its
	function under NOOP.

	consequently, the commit callback doesn't make sense for imap.
	in principle, we could use it to coalesce multiple STOREs to counter the
	inefficiency, but that won't happen any time soon, and the
	implementation would look rather differently anyway.

	as a "side effect", this fixes an assertion failure in imap_close_box()
	when all flag sets failed (e.g., b/c the box was read-only), as their
	callbacks would be short-cut in front of the completion of the CHECK
	command, which was not sequenced before the close_box() call.

	This reverts commit cfaa4848dd7c72e628fcc81a4c4532c9be226144.

2023-01-10 10:37  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	don't try to create already existing boxes

	if the SELECT command fails even though the box was LISTed, then the
	error cause is obviously not that box is absent, and so we should not
	attempt to CREATE it.

2024-07-04 07:09  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main_sync.c:

	don't try to qsort() NULL array

	while this actually works due to the array size being zero, it's
	undefined behavior which makes gcc eliminate a subsequent null check in
	the calling function.

2024-07-29 10:05  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.c:

	cap readsz at buffer size

	otherwise we may get negative comparison sizes, which the unsigned
	arithmetic we use cannot represent. this would prevent buffer content
	downshifting, resulting in prepare_read() erroring out.

	amends 859b7dd.

	REFMAIL: 87h740x2xe.fsf@wavexx.thregr.org
	REFMAIL: ec0f6f2a-0151-46ad-865a-a6f77ad8e204@app.fastmail.com
	REFMAIL: 87edk45p9o.fsf@b3l.xyz
	REFMAIL: CYAWIDDGRHT7.2CH3R3D6Z3F97@ferdinandy.com

2024-02-07 10:19  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	permit leading whitespace in INTERNALDATE strings

	the BNF specifies "(SP DIGIT) / 2DIGIT" for the date-day-fixed symbol,
	but "*SP 1*DIGIT" matches that closely enough for parsing purposes.

	REFMAIL: CYYDEEVZ8CCT.2M1T7XKT45HH8@jonas.vautherin.ch

2022-07-09 06:26  Oswald Buddenhagen <ossi@users.sf.net>

	* src/mbsync.1:

	document defaults of referenced XDG env vars

	so users don't have to google the spec.

2022-07-05 09:40  Oswald Buddenhagen <ossi@users.sf.net>

	* AUTHORS:

	remove duplicate contributor entry

	anton khirnov is already in the main section, no need to have him in the
	honorary section as well.

	on a completely unrelated note, for posterity: andreas grapentin's
	mention is due to commit cf13630a, where i forgot to credit him for the
	initial version of the patch.

2022-07-04 10:50  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: socket.c, socket.h:

	make DNS lookup asynchronous

	true asynchronicity is actually fairly useless, as it's unlikely that
	both Stores in a Channel use IMAP, and both host resolutions take
	particularly long - the main objective is imposing the Timeout setting.
	however, we can't just use setjmp()+alarm(), as longjmp()ing out of
	getaddrinfo() is undefined, as it may for example free() just at the
	wrong time. so we go for the real thing.

	this implementation just fork()s out a process which uses getaddrinfo()
	(or gethostbyname()) per lookup. this isn't particularly scalable, but
	as we don't expect a lot of lookups, it seems adequate.

2022-07-03 09:52  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: main.c, main_list.c, main_p.h, main_sync.c, util.c:

	fix Tunnel leaving behind zombies

	this generally went unnoticed, as the tunnel usually terminates right
	before we exit anyway. however, if multiple Channels are synced, it may
	become visible.

	this is a "shotgun" implementation, where the main loop just reaps all
	unclaimed children.
	arguably, it would be cleaner if each socket actually tracked its own
	process, but getting synchronous kills+waits right is tricky, so we
	continue to pretend that there is no process as far as the socket layer
	is concerned.

	poll()/select() are not restartable, so they need EINTR handling now
	that SIGCHLD is actually delivered.

2022-07-03 09:40  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main.c:

	fix broken Tunnel potentially causing SIGPIPE

	we need to ignore the signal, so the regular error handling can kick in.

2022-07-04 16:03  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main_sync.c:

	don't refresh progress counters pointlessly

	the mainloop-based refresh timer keeps spinning even if there is no
	update. overload stats_steps to signal whether a refresh is needed.

	amends 8fbc4323.

2022-07-01 12:54  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main_sync.c:

	abort channel sync when a store is fubar

	this got lost in d5a5da947.

	this also simplifies a nested condition, where the logic has previously
	been, but isn't applicable any more.

	REFMAIL: 87fsjloz05.fsf@wavexx.thregr.org

2022-07-01 11:00  Oswald Buddenhagen <ossi@users.sf.net>

	* src/mbsync.1:

	improve wording of --ext-exit docu

2022-07-01 10:14  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main.c:

	fix lineup of --ext-exit in help output

2022-06-26 10:21  Oswald Buddenhagen <ossi@users.sf.net>

	* AUTHORS:

	try to make AUTHORS reflect reality

	make a complete list of contributors who hold copyright (and those who
	don't).

	the case of ted is particularly interesting - he recently disclaimed
	significant contributions, but it turns out that this isn't true:
	the rewrite in 130664b6 incorporated significant portions of his async
	IMAP patch for debian.

	speaking of debian, i deleted ted's and nicolas' mention as debian
	maintainers, as debian/ is basically just a (poorly maintained) mirror,
	and has an own copyright file.

2022-06-20 15:33  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: add missing `next` in cmptrash()

	this doesn't really matter, as the branches are mutually exclusive
	anyway, but still.

	amends 01329bdf.

2022-06-02 10:10  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac:

	bump version

2022-06-06 10:37  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, drv_maildir.c, main.c, sync.c:

	whitespace fixes

	consistently surround '|' with spaces.

2022-06-07 10:08  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	drop unused 'flags' parameter of maildir_list_{recurse,inbox,path}()

	amends 416ced25.

2022-06-03 18:58  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_maildir.c, mbsyncrc.sample:

	add support for Maildir Paths with suffixes

	that is, Path not ending with a slash.

	pedantically, this is a bugfix, as the manual already suggested that
	this is possible (and at least one user got the hint, though he was
	disappointed).

	the IMAP driver already supports this.

2022-06-03 16:06  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	forbid nesting maildir Path under Inbox again

	it was never documented, and i can't really think of a case where
	someone would actually want it, as the MUA side of things would be just
	weird. additionally, the case of Path being Inbox+'/' did not work
	anyway. will reconsider and fix the latter case if someone complains.

	reverts 98bd2b11.

2022-06-03 13:38  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	simplify/fix recursive maildir listing

	there is no need to call maildir_list_{path,inbox}() from
	maildir_list_recurse(), as maildir_list_store() will do that anyway -
	if it's actually requested, that is. this means that this removes the
	implicit listing when Inbox is nested into Path, or vice versa. this is
	actually correct, as the Patterns matching would throw away the non-
	requested boxes anyway.

2022-06-03 10:14  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	simplify maildir recursion limitation

	the isDir argument is effectively already a depth counter, so we don't
	need a separate one for that.

	amends 79797826.

2022-05-23 08:12  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: .gitignore, Makefile.am, drv_imap.c, imap_p.h,
	  imap_utf7.c, tst_imap_utf7.c:

	add support for UTF-7 mailbox names

	this finally makes us compliant with IMAP4rev1. how fitting that the
	meanwhile released IMAP4rev2 demoted UTF-7 to legacy status ...

	based on a patch by Georgy Kibardin <georgy@kibardin.name>.

2022-05-23 10:04  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	enable UTF-8 on servers with RFC6855 support

	note that this is a somewhat sloppy implementation, as it simply
	assumes that the local system uses UTF-8 - that seems reasonable
	nowadays.

2022-05-18 15:11  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	assume Tunnel to be secure more consistently

	follows up on 27458133.

2022-05-17 11:22  Oswald Buddenhagen <ossi@users.sf.net>

	* src/tst_msg_cvt.c:

	autotest conversion of even more malformed messages

	this follows up on 87065c12.

2022-05-17 11:16  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync_msg_cvt.c:

	default to CRLF output in copy_msg_convert()

	if we have nothing to go on, assume canonical line endings.

2022-05-16 14:51  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, drv_maildir.c:

	recognize options even if the build does not support them

	there were several cases of confused users who failed to notice that
	they built without OpenSSL and wondered what is wrong with their
	config.

2022-05-16 13:58  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, mbsync.1:

	rename SSLType => TLSType

	for consistency with TLSVersions.
	the variable names are unchanged to avoid churn.

2022-05-16 14:26  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, mbsync.1:

	disable TLS 1.0 & 1.1 by default

	these were not reasonable defaults any more.

2022-05-16 13:57  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, mbsync.1, mbsyncrc.sample:

	supersede SSLVersions option with TLSVersions

	the new one isn't an exhaustive set anymore, but a delta to the default
	(or previous setting). this has the advantage that new versions aren't
	automatically disabled anymore as soon as mbsync learns about them if
	the user has a setting they fail to adjust.

2022-05-16 10:56  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	prune legacy SSL options

	they have been deprecated since v1.2.

2022-05-16 10:01  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	handle copying/trashing failures more carefully

	report them as errors (not warnings), let them cause a non-zero exit
	code, and in the case of trashing, prevent the subsequent expunge. the
	exception are messages that just disappeared below our feet.

2022-05-13 11:02  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	postpone check for cancellation in some driver callbacks

	the purpose of these checks is preventing triggering more driver calls,
	while immediate followups to already completed calls should be still
	made.

	note that some of the checks are strictly speaking redundant, as
	chaining into a next phase will return immediately anyway when the
	other side isn't ready yet. but we keep them for clarity.

2022-05-13 10:14  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	dissolve SVARS_CHECK_CANCEL_RET

	it was small and used only twice, so didn't really pull its weight.

2022-05-13 09:44  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: sync.c, sync.h:

	stop abusing SYNC_* for what really should be COPY_*

2022-05-11 10:56  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	prefer DECL_INIT_SVARS over DECL_SVARS+INIT_SVARS

	... as a result of relying on C99+.

2022-05-11 10:37  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	make more use of SVARS_CHECK_RET{,_VARS} macro

2022-05-10 12:11  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, main.c, main_sync.c, mbsync.1, sync.c:

	add --ext-exit option

	this is only a partial solution for reporting changes, but it's
	adequate if the goal is merely triggering a bulk action, like
	re-indexing the local store.

	inspired by patches posted by Yuri D'Elia <wavexx@thregr.org>.

2022-05-10 11:30  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: main_sync.c, mbsync.1, sync.c, sync.h:

	include expunges in progress counters

2022-05-19 19:24  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main_sync.c:

	rate-limit progress counters

	for simple local operations, they could easily dominate the cpu load.
	also, over a slow remote tty, they could slow down things noticeably.

2022-05-10 08:58  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, drv_imap.c, drv_maildir.c, main.c,
	  tst_timers.c, util.c:

	increase timer resolution to milliseconds

	seconds are too coarse for what we intend. technically, centisecs would
	be sufficient (and more honest, given that we prefer coarse timers,
	which have only tick precision), but that's a somewhat untypical unit.

2022-05-05 18:31  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, mbsync.1, run-tests.pl, sync.c, sync.h,
	  sync_p.h, sync_state.c:

	make expiration target side configurable

	REFMAIL: 87k0fauw7q.fsf@wavexx.thregr.org

2022-05-05 16:33  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, drv_proxy.c, drv_proxy_gen.pl, main.c,
	  main_sync.c, mbsync.1, sync_state.c:

	add --dry-run mode

	REFMAIL: 20211130142121.xon5oygrpdfj5s2t@fastmail.com

2022-05-03 18:01  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: sync_msg_cvt.c, tst_msg_cvt.c:

	add support for incomplete headers to copy_msg_convert()

	in the spirit of being liberal about what we accept.

	this completely re-structures the header processing loop, with the nice
	side effect of eliminating the gotos.

	REFMAIL: 87bkyzhoov.fsf@curie.anarc.at

2022-05-03 17:22  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: sync_msg_cvt.c, tst_msg_cvt.c:

	preserve stray CRs in copy_msg_convert()

	strip only CRs followed by LFs. this has mostly theoretical value (but
	will make a subsequent change simpler).

2022-06-18 14:43  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: .gitignore, Makefile.am, tst_msg_cvt.c, util.c:

	add test for copy_msg_convert()

2022-05-03 11:38  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync_msg_cvt.c:

	factor out ADD_NL() inside copy_msg_convert()

2022-05-01 12:16  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: Makefile.am, sync.c, sync_msg_cvt.c, sync_p.h:

	factor copy_msg_convert() out to own source file

2022-05-01 09:55  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	return error strings from copy_msg_convert()

	... instead of reporting conversion errors directly in copy_msg_convert().
	this makes it easier to autotest properly.

	this reverts bc15e571 in spirit, sidestepping the problem it tried to
	solve instead.

2022-05-05 09:33  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	make IMAP error messages less confusing

	don't print the status, as the user doesn't really care whether it's
	NO or BAD. more importantly, "NO LOGIN failed" is a rather misleading
	thing to report.

2022-06-10 16:29  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	rework IMAP list parsing

	replace the "DOM-like" model with a "streaming" model, i.e., the tokens
	are now immediately processed by stateful callbacks as they are found.
	this avoids plenty of allocations and copies (though not of the message
	contents, yet).

2021-12-23 19:06  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	tweak debug output for IMAP literals

	- short literals are now printed even with only -Dn.
	  this ensures that we see all parts of, for example, LIST responses.
	  we use xprintf() for that, so we don't mess up the -Dn output in case
	  the literal contains something unexpected (we don't care with -DN).
	- omitted bytes are now indicated.
	- missing trailing newlines are now "pretty-printed".
	- long literals are now printed in chunks as we receive them. this
	  makes the output messier, but it's necessary for an upcoming change,
	  and, on the upside, we'll get better indication when the transfer
	  gets stuck in the middle of a message.

2022-06-09 12:25  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac, src/common.h, src/util.c:

	add xprintf()

	this introduces a "commit" callback to the xprintf kernel, to avoid
	pointlessly assembling a temporary output string prior to printing it.

	one could lift the buffer limitations by introducing a "segment"
	callback instead, but that would slow down xvasprintf() due to the
	higher callback rate, for no good reason.

2022-05-03 17:28  Oswald Buddenhagen <ossi@users.sf.net>

	* src/util.c:

	add escaping of non-printable & non-ASCII characters to xvasprintf()

2022-05-03 13:57  Oswald Buddenhagen <ossi@users.sf.net>

	* src/util.c:

	restructure xvasprintf() for uniformity

	%\\s now supports length limitations, and \\ on other format specifiers
	is now ignored (like .* already was on non-strings).

2022-05-01 17:20  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, drv_imap.c, util.c:

	move imap_vprintf() to util.c and rename it to xvasprintf()

	it's currently used only by IMAP, but it's logically low-level.

2022-06-09 11:32  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: socket.c, socket.h:

	try to avoid extra syscalls when reading sockets

	so far we shifted down the buffered data only when we ran out of space.
	however, that may cause chopping up the actual socket read, which is a
	bad trade-off with avoiding a moderate-sized memmove. so try to keep
	enough space for the anticipated read size.

	note that this ignores the zlib path, as that always does full-size
	socket reads into z_buf, and saving inflate() calls seems pointless.

2022-06-09 11:27  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, socket.c, socket.h:

	don't notify about socket reads that fall short of expectations

	this will prospectively make the debug output less messy.

2021-11-26 10:39  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, socket.c, socket.h:

	make socket_read()'s interface more like socket_read_line()'s

	return a pointer into the internal buffer rather than copying into a
	user-supplied one. this permits zero-copy in future use cases.

2022-06-09 09:18  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.c:

	socket_read_line(): reset buffer offset when no bytes are left

	socket_read() already did that.

2022-06-09 09:00  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.c:

	beautify socket_read_line() somewhat

	- use more appropriate name for socket object
	- localize some variable declarations
	- denoise the code by using more local variables
	- don't pointlessly do stuff when we're failing anyway

2021-11-26 21:58  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, drv_imap.c, main_sync.c, sync.c, util.c:

	add input length argument to map_name()

	... and use it when parsing IMAP LIST responses.

2021-11-24 22:05  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	require IMAP4rev1 capability

	technically, we should have been doing that since the beginning, but as
	there is IMAP4rev2 now, it might actually matter (in about a decade,
	when servers start dropping backwards compat ...).

2021-11-26 11:24  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	optimize IMAP flag parsing

	uppercase the reference strings and utilize already known string
	lengths.

2021-11-25 12:40  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, drv_imap.c, util.c:

	make IMAP parsing case insensitive

	it's easy to overlook, but the spec demands this. we got away with it so
	far, as everyone just uses UPPERCASE ... for the things we use so far.

2021-11-25 13:02  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, drv_imap.c, util.c:

	optimize string operations in IMAP parser

	the string length is knowable in advance everywhere, so we can use that
	for strdups and short-circuiting comparisons.

2021-11-24 15:55  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	add support for LITERAL- extension

	it's the same as LITERAL+, only with a strongly limited payload size.

2021-11-24 21:33  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	make sure that all IMAP lists are parsed

	... even if we ignore their contents, as they may (hypothetically)
	contain literals, which are relevant for the stream syntax.

	amends 6fd4e8de2.

2021-11-24 21:25  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	improve error reporting from IMAP list parsing

	so far, we'd print only a generic message - except in two cases, where
	the generic error would be preceded by a specific one. now we always
	print a single reasonably specific message.

2021-11-24 21:22  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	simplify parsing responses with multiple IMAP lists

	the callbacks took the current parsing position only to pass it on to
	the next list parse. so instead, store it in the state, and have a
	separate function for continuation.

2022-06-19 11:13  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	revamp sending of IMAP commands with literals

	include the literal's length into the command itself, so error messages
	become clearer. the commands are initially built for LITERAL+, and are
	"edited down" right before sending if necessary.

2022-06-19 10:36  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	simplify assembly of IMAP APPEND commands

	treat the date string the same as the flag string.

	amends eb1f1076.

2021-12-26 19:05  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	handle tagged BAD [TOOBIG] server responses

	some servers consider attempts to APPEND too big messages to be BAD
	commands, rather than just NO-worthy ones. so just pretend that we did
	in fact get a NO, and carry on.

	this was tested with gmail. if we run into servers that don't send the
	expected response code, we will need to relax the condition.

2022-06-19 09:19  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	free IMAP command's payload prior to invoking its completion callback

	otherwise the synching may livelock due to failing to schedule follow-up
	commands, thinking the buffers are still full. of course, this is
	relevant only for commands that failed early and thus didn't free the
	payload right after submission already - which will be possible only
	after the next commit.

2022-04-20 10:19  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, driver.h, drv_imap.c, drv_maildir.c, main.c,
	  main_sync.c, mbsync.1, run-tests.pl, sync.c, sync.h:

	add ExpungeSolo option

	REFMAIL: CAOgBZNonT0s0b_yPs2vx81Ru3cQp5M93xpZ3syWBW-2CNoX_ow@mail.gmail.com

2021-12-29 13:42  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	don't UID EXPUNGE too many messages

	we didn't check that the UIDs are adjacent, so we might have caught
	not fetched deleted messages between two fetched messages below the
	bulk load range.

	checking adjacency of UIDs would make expunges in the bulk range (which
	is likely to be full of holes) rather inefficient. so we use sequence
	numbers instead.

	this is admittedly a rather academical fix ...

	amends 18225344.

2022-04-23 12:45  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, drv_imap.c, drv_maildir.c, sync.c, sync_p.h:

	revamp handling of expunged messages

	try to purge sync entries based on which messages are *actually*
	expunged, rather than those that are *expected* to be expunged.

	to save network bandwidth, the IMAP driver doesn't report all expunges,
	so some entry purges would be delayed - potentially indefinitely, e.g.,
	when only --pull-new --push is used, or Trash isn't used (nor
	ExpungeSolo, prospectively). so keep a fallback path to avoid this.

2022-04-26 11:45  Oswald Buddenhagen <ossi@users.sf.net>

	* .gitignore, src/.gitignore, src/Makefile.am, src/drv_imap.c,
	  src/imap_msgs.c, src/imap_p.h, src/tst_imap_msgs.c:

	track IMAP message sequence numbers (and therefore expunges)

2022-05-30 19:31  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.c, driver.h, drv_imap.c:

	track number of messages in IMAP stores

	... rather than calculating it on the fly. for efficiency.

2022-04-21 14:14  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, sync.c:

	moan about trashing in non-UIDPLUS boxes

	... as that's inherently racy, as the manual says.

2021-12-29 13:20  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, drv_imap.c, drv_maildir.c, sync.c:

	use UID EXPUNGE also when trashing remotely

	amends 2f0fbcd3.

2022-04-20 09:15  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, driver.h, drv_maildir.c, main.c,
	  run-tests.pl:

	add autotest for syncing non-UIDPLUS stores

2022-06-18 10:52  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, driver.h, drv_imap.c, drv_maildir.c, main.c,
	  main_sync.c, mbsync.1, run-tests.pl, sync.c, sync.h:

	add new sync operation 'Old'

	this is essentially the same as 'New', but for previously seen messages,
	such as those that would have been instantly expunged (because they were
	marked as deleted), those that we failed to store for some reason, and
	already expired ones that are now flagged.

	REFMAIL: CAOgBZNonT0s0b_yPs2vx81Ru3cQp5M93xpZ3syWBW-2CNoX_ow@mail.gmail.com

2022-06-01 17:55  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, drv_imap.c, drv_maildir.c, sync.c:

	split OPEN_PAIRED from OPEN_OLD, and rename OPEN_OLD_IDS accordingly

	this emphasizes the non-complementarity to OPEN_NEW.
	the "real" OPEN_OLD is currently used only for trashing.

2022-06-01 17:32  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	concentrate calculation of minimal loaded UID in load_box()

	so it's in one place with the maximal one, sans the one-sided
	preparation of the bulk range + exception list.

2022-01-12 12:56  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, main.c, mbsync.1:

	silently reinterpret --full

	change it from --{push,pull} to --{new,gone,flags,upgrade}.
	that alone doesn't change anything; combining it with any other option
	would cause a complaint anyway.

	this enables us to introduce --{push,pull}-full, which will matter when
	--full doesn't actually include all type flags any more, as we'll then
	be able to combine it with the extra type flag(s). in the same vein, we
	now advertize "Sync Full" instead of "Sync All" (both continue to be
	recognized).

2022-05-18 17:03  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, config.h, main.c, mbsync.1, run-tests.pl,
	  sync.c, sync.h:

	rename Delete to Gone

	this is more symmetrical with New, and results in some less dodgy
	grammar. it also avoids confusion with the \Deleted flag.

	fwiw, the pedantically correct name would be Expunges, but that's
	confusingly close to the target-side expunge options. also, it's longer.

2022-01-12 11:49  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, config.h, main.c, mbsync.1, sync.c, sync.h:

	rename ReNew to Upgrade

	that's what it really has been for a while now.

2022-02-22 15:42  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: run-tests.pl, sync.c:

	fix mixing MaxMessages with MaxSize

	this is actually a useful combination for resource-constrained devices.

2022-02-24 13:32  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: run-tests.pl, sync.c:

	fix handling of 'seen' flag wrt placeholders

	while we don't want to propagate seeing _from_ the placeholder, we do
	want to propagate it _to_ it, and consequently also un-seeing from it.

2022-06-17 14:49  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: mbsync.1, run-tests.pl, sync.c:

	make MaxSize ignore source-side message flagging

	when propagation of too big messages was entirely suppressed, the only
	way to force it was flagging the source message. however, now that we
	have placeholders that can be flagged to trigger full propagation, it's
	rather pointless to keep the old method working, and still doing it
	does in fact confuse users, see for example
	REFMAIL: CAOgBZNq_a9yKcq8Jw5y9VS6p2Se8mD7gkf6vPr_KU0taAWuGZQ@mail.gmail.com

	to avoid this, we now almost completely shadow the regular meaning of
	flagging - it basically becomes a non-synchronizable flag until the
	placeholder is upgraded.

2022-02-20 11:39  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: run-tests.pl, sync.c:

	make sure we fetch source flags when expiring while pulling new

	otherwise important messages may be incorrectly aborted.

2022-02-21 09:07  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: run-tests.pl, sync.c:

	fix off-by-one when loading messages outside the bulk range

	this would lead to a bogus deletion being propagated to the near side.

2022-04-23 12:20  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: run-tests.pl, sync.c:

	fix expiration when syncing only new messages

	this was broken by commit de6dc699 - we now iterated only over far-side
	messages, which we don't necessarily load, unlike the near-side ones
	(which we need to do to know their current importance).

	fix by iterating over sync entries instead of messages, which basically
	restores the pre-19128f15 state in that regard. the minor catch here is
	that we now need an auxiliary array to sort the sync entries by UIDs. on
	the upside, we can also use it to avoid repeated calculation of the
	flags.

2021-12-10 17:37  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: run-tests.pl, sync.c, sync_p.h:

	fix expiration completion during --noop run

	make sure that an expiration calculation run is performed if ongoing
	expiration transactions have been loaded from the journal. this has the
	nice side effect of centralizing the regular trigger condition as well.

	flags_set_p2() is also adjusted to query S_NEXPIRE only if an expiration
	is actually ongoing, like the flag propagation submission loop already
	did.

	this went unnoticed, because expiration upon arrival of new messages
	wasn't autotested at all - despite being the common case.

2022-02-18 17:48  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	don't pointlessly load near-side new messages when expiring

	we don't count them towards the total anyway (as they are unpaired).

2022-01-07 17:25  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	fix expiration completion after external expunge

	when the expiration is interrupted, but an external expunge removes the
	near-side message before we resume, we would just drop the transaction,
	resulting in an "unmarked" orphan.

	a corner case is an expiration that finishes, but initially isn't
	expunged (probably due to an interruption), followed by an unexpiration
	that gets interrupted, and the message being expunged externally
	(because it's still marked as deleted). we obviously can't complete
	that transaction without re-propagating the message, so effectively
	cancel it instead.

2022-02-26 17:24  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: sync.c, sync_state.c:

	simplify journaling of expiring unborn messages

	don't use a separate journal command anymore, but handle them like
	regular expirations, and let the entry purge loop at the end cleanup
	them.

2022-06-01 12:04  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: run-tests.pl, sync.c, sync_p.h:

	orphan/prune sync entries also if messages were expunged externally

	deletions we propagated ourselves are implicitly covered by that as
	well, so we don't need to record them separately anymore.

2022-01-26 21:03  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: run-tests.pl, sync.c:

	fix bogus orphaning due to expunging

	we cannot orphan all messages whose opposite we expunge, as that would
	prevent subsequent propagation of the deletion. we can do that only if
	the message is already known to be marked as deleted.

2022-02-10 19:27  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: run-tests.pl, sync.c:

	don't propagate about-to-be-expunged messages

	while we already refrained from propagating messages that would be
	expunged from the target, we still propagated ones that would be
	expunged from the source. this would lead to the weird situation of
	creating orphans, and would pose journal replay idempotence problems.

	such messages will now never have a sync record, so it becomes
	pointless to test for S_PENDING in the trashing loop. note that the
	behavior was previously bogus: these messages would have been paired by
	the end of the run, so we shouldn't have treated them as solo for the
	purposes of TrashOnlyNew/TrashRemoteNew.

2022-03-17 11:58  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, main.c, run-tests.pl, sync.c:

	autotest skipping doomed messages more thoroughly

	ensure that the messages are actually skipped, not subsequently
	expunged.

2022-04-14 12:30  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync_state.c:

	make sure that entries with deleted placeholders are pruned

	we need to copy the S_DEL status bits when upgrading sync entries, so
	that when a placeholder is flagged at the same time for both deletion
	and upgrade, the entry pruning loop sees that the dummy message got
	expunged.

	note that we don't mask any bits, so the post-split entries may end up
	with S_DEL for a zero UID - which doesn't matter.

2022-06-17 13:57  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: run-tests.pl, sync.c, sync_state.c:

	rework flag propagation during placeholder upgrade

	don't implicitly propagate flags with upgrades. the user asked for
	replacing the body, so do just that. if they also asked for flag
	propagation, handle it like the case without upgrade as far as possible.
	this makes async parallel flag propagation in the opposite direction
	robust, while still being reasonably simple.

2022-02-07 19:01  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: run-tests.pl, sync.c, sync_state.c:

	fix resuming propagation of flags on new messages

	log the flags as soon as we know them, and commit them when the uid is
	assigned (including during tuid matching).

	amends 25b1c2b9.

2019-12-29 11:31  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	de-noise msg_fetched() somewhat (prospectively)

	assign temporary srec object instead of always spelling out the
	indirection.

2021-12-10 20:45  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: run-tests.pl, sync.c, sync_p.h, sync_state.c:

	rework maxuid tracking yet again

	re-introduce newmaxuid, but now it's not used at all until the state
	is committed. this simplifies the new-message loop, esp. in view of a
	soon significantly increased number of branches in it.

2022-02-18 16:45  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	knock out ReNew if there are no dummies

	the operation requires loading the target side, which makes it somewhat
	expensive in otherwise unidirectional syncs.

	one could also knock out Flags and Delete if there are no living pairs,
	but that wouldn't actually save much.

2022-03-19 16:35  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	revamp post-journal-replay OPEN_* flags computation

	instead of doing it instantly for every message, make a tally and
	process it along with the OP_* flags. this allows us to print the
	counts, and makes the handling more uniform.

2022-06-01 18:30  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	fix dropping of pending message propagations when resuming

	started message propagations will now complete upon resumption even if
	the run was requested to be a no-op - whether that's a good thing can
	be argued, but it's the least effort way to avoid that committing
	discards transaction state.

2022-04-12 08:32  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	make sure we fetch source flags when resuming --renew

	... and the target is expunged.

2022-02-09 13:01  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	fix updating cached message flags in imap_set_msg_flags()

	while this (currently) doesn't really matter (as all flag changes are
	calculated before any are actually submitted), msg's flags should not
	be updated before set_msg_flags() has actually succeeded.

	as a side effect, this does away with the redundancy elimination and
	pulling uid from msg (which were both unused since 19128f158).

2021-12-11 14:43  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, main.c, run-tests.pl, sync.c, sync_p.h:

	don't log right before saving state unless requested

	only the journal replay autotest really needs it. in other cases it's
	just wasting time and ssd life.

2022-03-01 14:16  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, drv_proxy.c, drv_proxy_gen.pl, main.c,
	  run-tests.pl, sync.c, sync_state.c, util.c:

	rework interrupt-resume autotesting

	instead of doing two runs for each journal entry, do one run for each
	"write" operation, be it a journal entry or a writing driver call. this
	saves runs between which no visible change occurred, which yields a 33%
	improvement in runtime.

	we now also exclude the final entry purge from the test, as it's really
	kinda pointless, and we'd have to jump through additional hoops
	(simulate an atomic commit of the state) to make it reliable in all
	cases.

	note that this also adds a few steps, which actually uncovered a bug in
	the expunge sequencing.

	amends efd72b85.

2022-03-01 13:58  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: main.c, run-tests.pl:

	split off -Ts from -Tj

	there is actually no use case overlap between between the two (though
	limiting the step count does imply keeping the journal, as we exit
	before we could commit anyway).

2022-02-06 13:56  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	don't expunge until all flag propagation is complete

	so far, we ensured that propagation _into_ a store completes before
	expunging it, but not that propagation _from_ it completes. this way we
	could end up expunging the source messages before the changes reached
	the target, which could mess up resuming after an interruption.

2022-01-03 15:53  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_proxy.c, sync.c:

	heed M_DEAD more thoroughly

	this doesn't really fix anything under current conditions, as so far
	only Maildir driver functions that modify known messages can cause
	concurrent expunges to be detected, and we don't call any of these
	before the so far unchecked loops.

2022-01-07 21:58  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, drv_imap.c, drv_maildir.c, drv_proxy.c,
	  main_list.c, main_sync.c, sync.c:

	fix possible attempts to set flags of M_DEAD messages

	so far, we checked for M_DEAD only in loops over messages. but we should
	have checked srec->msg uses as well. this would make the code a mess, so
	instead call back from the drivers when messages are expunged, so we can
	reset the pointers.

	the only case where this really matters so far is the flag setting loop,
	which may cause the concurrent expunge of not yet handled messages to be
	detected by the maildir driver.

2021-12-23 22:51  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_proxy.c, drv_proxy_gen.pl:

	fix invalid data accesses in proxy driver callbacks

	all printing of auxiliary callback arguments must be conditional on the
	command having actually succeeded. this affected fetch_msg() most, which
	outright crashed due to a null pointer deref.

	to fix this for good, we automate the generation of the status printing
	and checking. as a side effect, this fixes the fetch_msg() callback not
	printing the status at all.

	amends 4cc5ad5a.

2022-06-01 11:54  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, driver.h, drv_proxy.c, main.c, main_list.c,
	  main_sync.c, run-tests.pl:

	test also one-sided async operation

	this tests only the common case of the far side being async - adding
	100% instead of 50% to the runtime of the test to cover a corner case
	didn't seem worth it.

2022-02-07 11:53  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, drv_proxy.c, drv_proxy_gen.pl:

	fake async drivers more convincingly

	instead of delaying the callback, delay the actual driver call. this is
	in line with how the IMAP driver would behave, as since commit 6c08f568
	it queues the socket writes (the network upstream latency goes on top,
	but that doesn't alter the result).

	amends 4423a932.

2021-12-23 12:48  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync_state.c:

	print some more debug info during state reading and journal replay

2022-02-10 16:58  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: sync.c, sync_p.h, sync_state.c:

	improve some debug messages

	- print on which side we're upgrading a placeholder. as a side effect,
	  this moves some magic out of upgrade_srec().
	- don't use past tense for something that is only about to happen
	- don't print status of every sync entry affected by journal replay -
	  the entry load already prints it, and relevant operations print the
	  new status. also, it was inconsistent with not printing the entry's
	  old flags.

2022-02-10 20:07  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, config.c, main_sync.c, sync.h:

	add debug messages about effective requested operations

2022-06-05 08:49  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_proxy.c, drv_proxy_gen.pl:

	add debug pretty-printing for OPEN_* flags as well

2021-12-23 16:43  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: bit_enum_gen.pl, common.h, sync_state.c, util.c:

	add debug pretty-printing for sync record status flags as well

2021-12-12 13:51  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.c, driver.h, sync.c, sync_state.c:

	format message flags in the sync debug output

	now that we can do it cheaply, make copious use of it.

2022-06-15 15:17  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, driver.c, driver.h, drv_proxy.c, sync.c,
	  sync_state.c:

	streamline pretty-printing of message flags

	wrap make_flags() into fmt_flags() which returns a (struct-wrapped)
	string, so the calls can be inlined into the printf statements, without
	reserving buffers.

	we locally force optimization, so copy elision is always done, as debug
	builds would otherwise suffer a somewhat unreasonable performance hit.

2022-01-07 23:15  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	denoise usages of INIT_IMAP_CMD()

	move the variable declarations into the macro, taking advantage of the
	fact that mixing them with code is ok since C99.

2021-12-26 18:11  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	fold superfluous INIT_IMAP_CMD_X() macro

	it's been identical to INIT_IMAP_CMD() since c3d91ae1.

2022-05-04 19:29  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_proxy_gen.pl:

	simplify an initialization in proxy driver code generator

	the 'checked' hash entry doesn't exist yet at that point, so it's always
	undefined.

	amends 4423a932.

2022-01-07 19:21  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_proxy_gen.pl:

	support C99 comments in proxy driver code generator

2021-11-26 19:39  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: sync.c, sync_p.h:

	cache drivers' ability to handle crlf in mails

	it's a cheap call, but it clutters up log files.

2021-11-25 14:57  Oswald Buddenhagen <ossi@users.sf.net>

	* src/util.c:

	remove questionable optimization from case-insensitive string comparison

	we optimized the case where the string would be equal even without
	upper-casing, but for the much more common case where the strings differ
	even after upper-casing, this was just an additional conditional.

2021-12-10 19:56  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: sync.c, sync_p.h, sync_state.c:

	improve tracking of maxxfuid

	do it when the corresponding expiration events are logged/replayed.
	that makes it unnecessary to log it separately just to make the
	autotest happy.

2022-02-04 18:28  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync_state.c:

	fix tracking of sync record count through placeholder upgrades

	for now, this is just pedantry, as it merely affects the size of the
	already oversized { uid => srec } flathash after journal replay.

	amends 70bad661.

2022-01-06 11:44  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	optimize { uid => srec } flathash

	the sync records contain the uid, so storing it explicitly doubles the
	hash's size for no good reason.

2021-12-29 21:38  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	make use of finduid[] after journal replay

	we used to pass all initially loaded messages to match_tuids(), which
	could be quite some when syncing old messages. as lost TUIDs result in
	O(n^2) behavior, this could have a serious performance impact.

2022-05-18 21:03  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: main_sync.c, mbsync.1, util.c:

	print human-readable summary at exit

	this is meant primarily for use with a redirected output, where no
	progress counters are shown. but it would be weird not to have it with
	tty output as well, so it replaces the counters after completion.

	REFMAIL: 87bl2cgt6u.fsf@curie.anarc.at

2022-06-05 17:28  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, drv_imap.c:

	fix bogus complaints about missing Store/Account references

	... when the reference is simply invalid (we already get a complaint
	about that).

2022-06-05 17:27  Oswald Buddenhagen <ossi@users.sf.net>

	* src/config.c:

	don't stop validating Channel config after first error

2022-06-05 17:18  Oswald Buddenhagen <ossi@users.sf.net>

	* src/config.c:

	append even broken Channel configs to list

	otherwise perfectly fine Group defs will complain about invalid refs.

	we already do that with Store configs.

2021-12-28 17:53  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main_sync.c:

	abort if any invalid Channels/Groups have been specified

	this is more in line with expectations, and avoids a silly "No channel
	specified." error message.

2022-01-13 13:05  Oswald Buddenhagen <ossi@users.sf.net>

	* src/config.c:

	handle mixing simple and compound sync options more explicitly

2021-12-28 11:55  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, main.c, mbsync.1, sync.h:

	complain about --noop/--no-* conflicts

	REFMAIL: 20211130124527.t3u7s4fyy57gmfzc@fastmail.com

2021-12-28 11:55  Oswald Buddenhagen <ossi@users.sf.net>

	* src/config.c:

	tone down complaints in merge_ops()

	speak more accurately of redundancy, not conflict. these are fatal
	errors at all only because the user likely meant something else than
	they typed, so we force them to think again.

2022-01-11 15:16  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, config.h, main.c:

	report location of overlapping operations

2022-05-18 17:08  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, driver.c, drv_imap.c:

	stop parsing config lines after invalid keyword

	otherwise we may pointlessly complain about excess tokens.

2022-05-18 20:40  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: Makefile.am, config.c, driver.c, driver.h, main.c,
	  main_list.c, main_p.h, mbsync.1:

	add --list-stores mode

	this is useful for verifying the store configuration, and finding the
	right mailbox names.

	REFMAIL: YaZC3XUTWjyfjgn+@ugly

2022-05-04 11:52  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: Makefile.am, driver.c, driver.h, main.c, main_p.h,
	  main_sync.c:

	factor out main_sync.c & main_p.h from main.c

	this moves the channel iteration & synchronization code from main(),
	with all its dependencies.

	then it is "re-threaded" to be more directly driven by the driver
	callbacks (like sync_boxes() is), rather than being a weird state
	machine.

	while the code is moved, localize many variables, and use an enum
	instead of #defines for the states.

2022-04-04 19:41  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: run-tests.pl, sync.c, sync_p.h, sync_state.c:

	exclude placeholders from trashing

	it makes no sense to trash the placeholders, and in fact the common
	case is that they are deleted due to being replaced by the full
	message.

	a separate S_PURGED state needed to be added, as S_PURGE needs to be
	reset after setting F_DELETED (so the operation doesn't count as still
	pending after journal replay), yet trashing needs an indicator. logging
	is now done via a separate command, as piggy-backing it on flag updates
	just makes things less legible for no benefit.

	this is mostly academical, as trashing being done on the side where
	placeholders reside is rather unlikely.

2022-04-04 16:55  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	add autotest for message trashing

2022-04-12 10:18  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	do not exclude oversized messages from remote trashing

	... as otherwise these messages would be just lost.

	the assumption is that opposite-side trashing is used only for locally
	generated messages whose size we control. it's also more consistent with
	same-side trashing, where even oversized messages would be trashed.

	the exclusion was broken anyway, as we failed to query the size of old
	messages, particularly after 70bad661.

2021-12-08 12:58  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	treat not-really-propagated messages as trashable

	messages for which only a placeholder was propagated should be treated
	as not propagated, as otherwise the actual contents will be lost when
	only not propagated messages are trashed.

	amends 70bad661.

2022-02-20 14:27  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	re-nest conditions for trashing messages

	this makes the logic easier to follow and document in place.

	also add some debug statements.

2022-02-08 14:19  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync_state.c:

	make journal entry argument processing saner

	the mega-if was unreadable and caused lots of churn.

2022-06-16 08:38  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, driver.h, sync_p.h:

	assert sizes of smaller-than-int bit fields in structures

2022-06-16 08:40  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: sync.c, sync_p.h, sync_state.c:

	merge wstate back into status

	this optimizes space usage, prospectively (we'd have to extend wstate
	soon otherwise).

	this partially reverts 4ffe1496.

2022-05-31 12:05  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: .gitignore, Makefile.am, bit_enum_gen.pl, common.h,
	  driver.h, drv_maildir.c, sync.c, sync.h, sync_p.h,
	  sync_state.c:

	automate enumeration of power-of-two #defines

	this is a lot more legible, and makes it possible to insert values in
	the middle without churn.

	i didn't find a way to do this with the pre-processor, so we now have
	another code generator.

	we now use the $< make variable, which requires gmake on netbsd < 9.0,
	and possibly other systems with an ancient make.

2021-11-26 16:31  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main.c:

	print version and command line args in debug mode

	that makes it unnecessary to ask help-seeking users for it separately.

2022-06-06 10:29  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, driver.h, main.c, sync.c, util.c:

	split Verbosity off from DFlags

	this clearly documents the permitted states.

2022-05-30 21:04  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, config.h, drv_imap.c, drv_maildir.c,
	  mbsync.1, run-tests.pl, sync.h:

	re-interpret relative local paths in config file

	this makes config+data file "sets" relocatable, which is useful for
	testing.

	this is technically a gratuitous backwards incompatible behavior
	change, but to the degree that anyone uses relative paths at all, they
	almost certainly rely on PWD being set up such that they won't see a
	difference.

2022-05-30 21:04  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, mbsync.1:

	make default config & state locations follow the XDG basedir spec

	there are fallbacks to the old locations for compatibility.

	the new locations use "isync" instead of "mbsync", which is preparation
	for renaming the executable back in v1.6.

2022-05-05 17:00  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, drv_maildir.c, sync_state.c, util.c:

	create sync state parent directories recursively

	this may matter with SyncState being for example ~/.local/state/isync/.

2022-05-31 07:58  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: Makefile.am, sync.c, sync_p.h, sync_state.c:

	factor out sync_state.c & sync_p.h from sync.c

	while moving the code, localize some variables, and use C99 comments.

2022-05-04 11:52  Oswald Buddenhagen <ossi@users.sf.net>

	* src/Makefile.am:

	rearrange Makefile somewhat for consistency

2021-12-26 11:42  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.c, driver.h, drv_imap.c, drv_maildir.c,
	  drv_proxy.c, sync.c:

	centralize message flag pretty-printing somewhat

	the flag values themselves are central, so we can centralize their most
	common representation (Maildir's) just as well.

2021-12-23 22:12  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_proxy.c:

	make some string buffers non-static

	this was clearly bogus; these are short-lived local variables.

	amends 4cc5ad5a.

2022-04-12 11:06  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	replace 1-t => t^1

	this is consistent with what we already did for in-place operations.
	arguably, it's also a bit more intuitive.

2022-04-12 11:00  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, config.c, drv_imap.c, drv_maildir.c,
	  drv_proxy.c, main.c, socket.c, sync.c, util.c:

	rename nfcalloc() => nfzalloc()

	the signature is like that of zalloc() (as found in the linux kernel;
	not to be confused with zone allocators, etc.), not like that of
	calloc().

2022-02-08 14:02  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, config.c, config.h, util.c:

	move expand_strdup() to config.c

	it's not really a generic function.

2022-02-08 13:57  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, sync.c, util.c:

	move checked FILE functions to util.c

	while they are used only in sync.c, they are conceptually low-level.

2021-12-21 17:44  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, drv_maildir.c, drv_proxy.c, main.c, sync.c,
	  util.c:

	turn debug() functions into macros

	this makes calling them with more expensive arguments efficient without
	wrapping them into additional conditionals.

2022-04-27 14:42  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, config.c, driver.c, drv_imap.c,
	  drv_maildir.c, drv_proxy.c, main.c, socket.c, sync.c,
	  tst_timers.c, util.c:

	centralize some #includes

	these are used (almost) everywhere, so put them in common.h.

2022-04-24 12:30  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, config.c, config.h, main.c, sync.c, sync.h,
	  tst_timers.c, util.c:

	shuffle around global variables

	the new organization clarifies the ownership, making things more
	self-contained. this will potentially help with unit testing.

2022-01-08 13:12  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, drv_imap.c, drv_maildir.c, main.c,
	  mdconvert.c, sync.c, util.c:

	coding style: add "superfluous" braces

	- wrap flow-controlled statements that contain blocks into blocks
	  themselves
	- wrap bodies of do-while()s into blocks
	- use braces on 'else' symmetrically (this obviously has a cascading
	  effect, so this patch touches lots of lines)
	- attach braces

	unavoidably, the rules are sometimes broken around #ifdef-ery.

2021-12-08 12:55  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, driver.h, drv_imap.c, sync.c, sync.h:

	comment updates

2022-02-20 12:00  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: use more legible format for test data

	instead of specifying the mailboxes and sync state verbatim, use a
	format which deals only with "subjects" (but no UIDs), and specifies the
	whole state for each subject on a single line (exceptions prove the
	rule).

	the dumpers don't try to re-create the abstraction, as that's deemed
	to be an unreasonable effort.

	while rewriting most of the test data anyway, move it to the bottom of
	the file, which is a more natural location for it.

2022-02-20 12:01  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: remove show()

	this somewhat crude way of generating test data will be obsolete soon.

2022-01-27 13:22  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: make state comparison more elaborate

	don't abort the comparison if continuing makes sense, and try to be more
	specific about the problems.

	we give up if messages are excessive/missing or the subject is wrong,
	as that touches upon the rather complex problem of diff optimization.

2022-01-26 20:56  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: support tests that don't modify the state file

	a test run may (legitimately or not) modify only the mailboxes, or even
	nothing at all. do something sensible in this case.

2022-02-06 14:43  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: transform ck*() => cmp*()

	this avoids the ugly and error-prone repeated reading of the state
	after a failure.

	cmpbox() had to be made non-destructive on the box state.

	readchan() had to be created.

2022-01-24 20:49  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: use ints where we mean ints

	... instead of using strings. perl allows being sloppy, but it doesn't
	really help understanding the code.

2022-01-23 23:33  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: use more appropriate data formats

	parse the test data into hierarchical structures instead of using it in
	its raw form. this is semantically cleaner and allows us to change the
	input format more easily.

2022-01-24 00:12  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: factor out readstate() from showstate() and ckstate()

2022-02-07 14:44  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: make more use of readfile()

2022-02-20 19:34  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: factor out mkstate()

	for clarity and structural consistency.

2022-01-23 22:19  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: let mkchan() take an atomic channel state

	this is consistent with ckchan() and printchan().

2022-04-04 19:51  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: add support for strace-ing

	works just like valgrind-ing.

2022-01-26 17:46  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: add support for starting at a specific test

	... which is often useful for continuation after test data fixes.

2022-01-26 17:45  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: use sub-string matching for test selection

	typing the full names is rather tedious when they get long.
	also, using sub-strings, we can match multiple tests with one argument.

2022-01-25 20:45  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: be more verbose about internal errors & warnings

2022-01-14 15:57  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: don't die on failure to read state file

	this can happen as part of a "regular" test failure.

2022-01-24 00:04  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: remove excessive close()s from showstate()'s error path

2022-02-02 12:06  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	remove pointless "lost track of ... messages" warnings

	it doesn't really add any value when resuming after an interruption, as
	incomplete propagations are perfectly expected, and are recovered from.
	but it does make sense in the non-UIDPLUS path, where not finding just
	stored messages indicates a problem.
	so move the reporting from match_tuids() to msgs_found_new(), and remove
	a redundant warning from the latter.

	amends 6577bf3e.

2022-01-08 11:53  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	delay TUID assignment less

	we can't delay TUID assignment until after starting propagation if we
	want to provide both safety and performance.

	amends a0961d65.

2022-05-10 10:11  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	make some maildir (error) messages more helpful

	include the affected path.

2022-04-04 19:39  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	slightly improve maildir rescan debugging

2022-06-02 16:42  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.c, drv_maildir.c:

	make free_*_messages() loops less obfuscated

	notably, free_maildir_messages() had a dead assignment.

2022-05-20 10:42  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	don't put IMAP stores in SST_BAD state into the unowned list

	nothing would ever recycle them, so they'd just waste space. so cancel
	them right away.

	amends 9d22641.

2022-05-20 10:33  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	clarify / micro-optimize cancel_sync()

2022-05-20 10:33  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, drv_maildir.c:

	get rid of some redundant casts

	amends c3d91ae1, 1b67c499, 9c86ec34, and 83ebe902+1039ee25.

2022-06-18 16:35  Oswald Buddenhagen <ossi@users.sf.net>

	* src/mdconvert.1:

	fix roff abuse in mdconvert man page

	this one was missed in a33e4475.

2022-06-16 10:44  Oswald Buddenhagen <ossi@users.sf.net>

	* COPYING, LICENSES/GPL-2.0-or-later.txt,
	  LICENSES/LicenseRef-isync-GPL-exception.txt, Makefile.am,
	  configure.ac, mbsync-get-cert, src/Makefile.am, src/common.h,
	  src/config.c, src/config.h, src/driver.c, src/driver.h,
	  src/drv_imap.c, src/drv_maildir.c, src/drv_proxy.c,
	  src/drv_proxy_gen.pl, src/main.c, src/mbsync.1,
	  src/mdconvert.1, src/mdconvert.c, src/run-tests.pl,
	  src/socket.c, src/socket.h, src/sync.c, src/sync.h,
	  src/tst_timers.c, src/util.c:

	convert licensing to SPDX

	while at it, add/fix some licenses/copyrights/comments:
	- it makes no sense to have a GPL exception in scripts
	- ted did not contribute to the man page
	- tst_timers is not part of the mbsync executable
	- explicitly put the build system under GPL and add copyrights

2022-05-25 14:14  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, config.c, config.h, driver.c, driver.h,
	  drv_imap.c, drv_maildir.c, drv_proxy.c, drv_proxy_gen.pl,
	  main.c, mbsync.1, mdconvert.1, mdconvert.c, run-tests.pl,
	  socket.c, socket.h, sync.c, sync.h, tst_timers.c, util.c:

	bump copyrights

	it's legally irrelevant, but whatever.

2021-12-09 18:05  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: mbsync.1, mbsyncrc.sample:

	documentation tweaks

	manual:
	- explain what "rename on move" really means
	- reword "remote" to "opposite" to make it less confusing
	  (possibly renaming TrashRemoteNew left as an exercise for later)
	- mention example mbsyncrc
	- consistently capitalize Store/Channel/Group where they refer to the
	  respective configuration entities
	- emphasize that SyncState may need a trailing slash (as we do for Path)
	- fix missing mention of global usage/default for some options
	example mbsyncrc:
	- add big fat note that empty lines matter
	- stop demoing deprecated options
	- point out that CertificateFile is optional

	REFMAIL: 877dd11jb3.fsf@angela.anarc.at

2022-05-03 21:11  Oswald Buddenhagen <ossi@users.sf.net>

	* .gitignore, src/.gitignore:

	fix .gitignores

	- src/tmp/ is actually a symlink (and thus not a dir)
	- autoconf now generates configure~
	- the coverity result archive was missed so far

2021-12-22 19:13  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	sort lists of trashed messages after journal replay

	the messages are trashed in mailbox (and thus UID) order, and in
	practice we expect the operations to complete in order. however, if
	older messages need to be trashed after a journal replay, and we get
	interrupted again, the next replay would produce an unsorted array,
	and thus break the binary search.

	amends 2bba9b9.

2022-04-04 19:53  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	don't clobber message status when upgrading placeholders

	we'd reset the possibly set M_RECENT flag, which would lead to
	pointless maildir rescans.

	amends 70bad661.

2022-04-20 09:10  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	fix severing of msg -> srec links upon maildir rescan

	amends 9c86ec34 (the relevant line was arguably misplaced there, and
	should have been in 2277ecef or whereabouts already).

2022-06-01 09:57  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, main.c:

	fix --debug-crash suppressing the progress display

	there isn't really a reason for that; DEBUG_CRASH is quite unlike the
	other DEBUG_ flags.

	note that the DEBUG_*_ALL flags are not checked, because they always
	come with their corresponding less verbose flag anyway.

2022-01-13 11:23  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	fix maildir driver's debug flag

	copy-pasto; it certainly wasn't meant to respond to --debug-sync.
	the problem was barely noticeable, as the maildir driver's only debugs
	are in the rarely triggered rescan path, apart from the flags usually
	being used en bloc anyway.

	amends 0e1f8f9a.

2022-01-06 14:08  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	plug memory leaks when OPEN_OLD_IDS is used with Maildir

	amends 77acc268.

2021-12-26 18:14  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	plug memory leaks in imap_{store,trash}_msg() error paths

2021-12-24 01:20  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	fix storing messages on non-UIDPLUS servers

	the fetch mode needs to be set for messages.

	amends 42f165ec.

2022-05-20 07:54  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	workaround iCloud IMAP bug

	thanks to Sabahattin Gucukoglu <listsebby@me.com> for the thorough
	investigation.

	REFMAIL: 29C5E84D-5FE7-47BB-9A14-2EC34D3921C5@me.com

2021-12-09 10:42  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	re-issue IMAP CAPABILITY after authentication

	... if the server didn't include a corresponding response code by
	itself. required for the sorry excuse of an imap server that ms
	exchange is.

2022-06-06 09:55  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, socket.c, socket.h:

	work around "unexpected EOF" error messages at end of SSL connections

	gmail apparently doesn't send a close notification (SSL_shutdown())
	before closing the TCP socket.

2021-12-29 20:55  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	overflow-check ranges[] in imap_set_range()

	amends 3d64f167.

2021-12-29 20:50  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	reserve enough UID ranges in imap_load_box()

	in certain configurations, under very unlikely conditions (which are
	practically impossible to control remotely), we'd overflow ranges[].
	in a typical gcc build, the values (which are also practically
	impossible to control remotely) would be written at the end of buf[],
	which would be rather harmless, as only a tiny part of buf is used
	subsequently. so i'm not classifying this as a security issue.

	amends 77acc268.

2021-11-25 16:04  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac:

	bump version

2021-11-26 10:53  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac:

	modernize configure.ac

2021-12-01 10:25  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	don't complain about concurrent flagging as deleted

	the result of propagating a deletion is flagging as deleted, so shut up
	if the only remote change is exactly that.

2021-11-26 22:05  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	fix read beyond end of input in copy_msg_convert()

	the input isn't necessarily null-terminated (it currently is for imap,
	but not for maildir), so if the message ended somewhere within the
	header field name, we'd read beyond its end, which theoretically could
	cause a crash. no other adverse effects could result, as we'd stop
	processing such a broken message right afterwards.

	amends 70bad661.

2021-11-24 17:24  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	reject unreasonably long mailbox names from IMAP LIST

	this wasn't really a security problem, as the name mapping we actually
	do does not change the string length, and the iteration was already
	safe after the literal length fix, but it's still better to catch weird
	input.

2021-11-24 16:51  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	reject messages that grow too large due to conversion

	that shouldn't really be a problem, as we have 2GB of headroom, and most
	growth would happen when sending an all-newlines message from maildir to
	imap (due to CR additions), which is mostly non-critical. but better
	safe than sorry.

2021-11-24 16:46  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	report conversion errors directly in copy_msg_convert()

	that makes it easier to report various conditions without introducing
	separate error codes.

2021-11-24 16:22  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	deal with oversized messages in maildirs

	don't try to read messages > 2G, as that will only lead to trouble down
	the line.

	this wouldn't have worked on linux anyway (we read in one chunk, and
	that is limited to (2^31 - 2^12) on all architectures), but on
	platforms were big reads work, this was a security problem if one
	synchronized other users' maildirs.

	as a minor fix on the side, we now also clip the reported message size,
	so MaxSize works for excessively big messages.

2021-11-24 18:21  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	CVE-2021-3657: reject excessively large IMAP literals

	we didn't limit the 32-bit size of literals so far, which, given that we
	use int-sized lengths & offsets, permitted all kinds of buffer
	overflows. malicious/compromised servers may have been able to exploit
	this. actual email senders would be constrained by size limits for
	delivered mails, and to cause more than a crash they'd have to predict
	the exact size of the final message.

	we now limit to 2GB, which, given that we use unsigned ints since
	e2d3b4d55 (v1.4.0), gives the handlers downstream plenty of headroom.

	an alternative would have been using 64-bit offsets, but this seems like
	major overkill, even if IMAP4rev2 recently mandated it (we talk only
	IMAP4rev1, so we can ignore it).

2021-11-22 19:57  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	CVE-2021-44143: don't overflow heap on messages without headers

	when a broken/compromised/malicious server gives us a message that
	starts with an empty line, we'd enter the path for inserting a pristine
	placeholder subject, for which we unfortunately didn't actually allocate
	space (unless MaxSize is in use and the message exceeds it).

	note that this cannot be triggered by merely receiving a crafted mail
	with no headers (yes, it's actually possible to send such a thing), as
	the delivery of mails adds plenty of headers.

	amends 70bad661.

2021-07-29 11:14  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac:

	bump version

2021-06-21 09:35  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	limit maildir nesting depth

	this is a cheap way to catch symlink loops. 10 seems like a reasonable
	limit, as it's unlikely that anyone would be able to actually work with
	such a deeply nested mailbox tree.

	fixes debian bug #990117.

2021-06-11 15:56  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	enable embedding arbitrarily long strings into IMAP commands

	the AUTHENTICATE command may get insanely long for GSSAPI when SASL-IR
	is available. instead of growing the buffers each time someone hits the
	limit (as done in f7cec306), remove the limitation altogether.

	imap_vprintf() still contains a fixed-size buffer which could overflow
	when really long strings (e.g., mailbox names) need to be quoted. this
	seems very unlikely, so we'll deal with it if someone actually hits it.

	REFMAIL: 87sg1qxdye.fsf@cern.ch

2021-06-03 09:07  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac:

	bump version

2021-06-03 09:02  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac:

	bump version

2021-04-14 14:58  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	CVE-2021-3578: fix handling of unexpected APPENDUID response code

	if the code was sent in response to anything but a STORE, we'd overwrite
	a data pointer in one of our imap_cmd subclasses, an allocator data
	structure, or the start of the next allocation, with an int that was
	completely under the server's control. it's plausible that this could be
	exploited for remote code execution.

	to avoid this, we could ensure that the object is of the right type
	prior to casting, by using a new flag in the parameter block. but it's
	easier to just dispose of the out_uid field altogether and reuse the uid
	field that is present in the parameter block anyway, but was used only
	for FETCH commands so far.

	this problem was found by Lukas Braun <koomi@moshbit.net> using a
	fuzzer.

2021-04-14 14:52  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	don't crash on malformed CAPABILITY responses

	amends 95a83c822.

	this problem was found by Lukas Braun <koomi@moshbit.net> using a
	fuzzer.

2021-03-19 17:21  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, drv_imap.c, drv_maildir.c:

	tolerate INBOX mis-casing in Path

	while it's technically reasonable to expect the user to match the
	server's casing of INBOX if they set Path, this might come as a
	surprise to those who know that the IMAP INBOX is case-insensitive.
	so tolerate any casing instead. as a minor side effect, we'd now even be
	able to deal with a server using different casing in NAMESPACE and LIST.

2021-02-21 20:24  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac:

	bump version

2021-02-20 21:52  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	make UIDVALIDITY recovery more strict about vanished messages

	in particular, this covers the case of a mailbox being replaced with an
	empty new one, which would subsequently lead to the opposite end being
	emptied as well, which would typically be undesired.

	also add plenty of comments.

2021-02-20 21:52  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	improve error messages about irrecoverably changed UIDVALIDITY

	don't print the actual values, which are meaningless technicalities
	to the average user, and can be obtained separately for debugging if
	really necessary.
	also, fix the omission of the affected mailboxes from one of the
	messages.

2021-02-14 19:42  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	CVE-2021-20247: reject funny mailbox names from IMAP LIST/LSUB

	in particular, '..' in the name could be used to escape the Path/Inbox
	of a Maildir Store, which could be exploited for stealing or deleting
	data, or staging a (mild) DoS attack.

2021-02-14 22:37  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	be more tolerant of formally malformed response codes

	fastmail sends flags containing ']' in PERMANENTFLAGS, which is formally
	illegal. however, if we parse the embedded list before looking for the
	response code's closing ']', things work out fine.

	as a side effect we won't complain about similarly or completely
	malformed response codes we don't recognize at all, which may or may not
	be considered an improvement ...

2021-02-14 22:06  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	fix bogus continuation of IMAP list parsing

	on error, parse_imap_list() needs to reset the nesting level in the
	state, as imap_socket_read() uses that as an indicator whether list
	parsing is ongoing.

2021-02-14 20:25  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	accept unsolicited FETCH responses (without payload) after all

	while the spec says that the server SHOULD not send FETCH responses
	about STORE FLAGS when .SILENT is used, at least gmail and fastmail seem
	to do it nonetheless. also, in case of concurrent flag updates on the
	affected messages such responses can be legitimately sent.

	in earlier versions of mbsync this would lead to duplicate messages
	piling up in the store, though that would pose no problem at that point.

2021-02-14 22:46  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac:

	bump version

2021-02-07 19:26  Nihal Jere <nihal@nihaljere.xyz>

	* configure.ac, src/common.h, src/util.c:

	use correct <poll.h> header

	In POSIX, poll() should be accessible using <poll.h>, although most
	implementations keep <sys/poll.h> to avoid breakage. This fixes some
	warnings when building on musl.

2021-02-03 13:44  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac:

	bump version

2021-02-03 13:25  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	unbreak handling of 'INBOX.' NAMESPACE again

	INBOX matching must not prevent prefix (namespace) stripping, as INBOX
	may be the namespace.

	amends 04fc586e7.

	REFMAIL: 186391612191752@vla1-ea7e194e8506.qloud-c.yandex.net

2021-01-03 18:39  Anton Khirnov <anton@khirnov.net>

	* src/drv_imap.c:

	Set authentication id for the SASL EXTERNAL mechanism

	The SASL library will refuse to use the EXTERNAL module when no auth id
	is set a priori.

	Tested to work with Dovecot, using TLS client certificates for
	authentication.

2021-01-05 18:45  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	improve SASL error messages

	provide context, and remove the redundant numeric codes.

2021-01-05 18:44  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	tune SASL-related comments

	- add explanations to the callbacks
	- remove bogus comment - EXTERNAL can be in fact missing (when no
	  authentication id is set)

2021-01-01 13:46  Oswald Buddenhagen <ossi@users.sf.net>

	* src/util.c:

	save errno in sys_error()

	the print functions prior to perror() might otherwise clobber it.

2020-12-18 13:33  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: remove unused boxname parameter from printbox()

2020-12-18 13:31  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: pass containers by reference

	this makes function prototypes a lot more useful for parameter checking.

2020-12-14 22:16  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, driver.h, drv_imap.c, drv_proxy.c,
	  drv_proxy_gen.pl, main.c, run-tests.pl:

	add forced async mode to proxy driver

	to test async operation of the syncing core while using the synchronous
	maildir driver, we add a mode to the proxy driver where it queues
	callback invocations to the next main loop iteration.

2020-12-14 13:08  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_proxy.c:

	localize a variable more appropriately

2020-12-16 12:49  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: main.c, run-tests.pl:

	consolidate testing options behind common switch

	don't pollute the namespace with random uppercase switches. instead,
	have a new -T switch with suboptions, just like -D.

2020-12-17 14:53  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac, src/common.h, src/driver.h, src/drv_imap.c,
	  src/drv_maildir.c, src/drv_proxy.c:

	introduce new inheritance model based on C11 anonymous structs

	the struct declarations got uglier, but their usage requires a lot fewer
	explicit references to the parent struct (though some are added where
	using the derived struct is more practical now).

	we also use something i'd term "covariant members": derivatives of
	store_t also reference derivatives of store_conf_t, etc., which
	drastically cuts down the number of casts.
	fwiw, to achieve this with "proper" inheritance in C++, we'd use
	covariant getter functions which hide the still existing casts.

	C11 is almost a decade old now, and compilers supported that feature
	even longer than that, so i don't expect this to be a problem.

2020-12-17 21:03  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_proxy.c, drv_proxy_gen.pl:

	add some error checking to proxy template processor

	debugging is a lot easier when the unconsumed (and therefore likely
	mistyped) replacements are complained about.

2020-12-17 19:14  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_proxy_gen.pl:

	handle indentation in proxy driver template code more flexibly

	use the indentation of the placeholder, not the replacement.
	this doesn't matter right now, as all placeholders are indented by one
	step, but that will change soon.

	the indent function cannot be inlined into the substitution, as for some
	reason ^ then matches the end of the string, not the embedded line
	starts (with perl v5.32). also, $1 needs to go into a temporary anyway.

2020-12-14 22:24  Oswald Buddenhagen <ossi@users.sf.net>

	* src/common.h:

	make FALLTHROUGH work with qtcreator's code model

	the code model inspector claims that __GNUC__ is 10, but the #if works
	only with >= 4, which is plain wrong. so just handle clang explicitly.

2020-12-12 13:56  Oswald Buddenhagen <ossi@users.sf.net>

	* src/mbsync.1:

	improve docu for {Pass,User}Cmd

2020-11-29 12:47  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac:

	fix build with macOS keychain support

	we use symbols from CoreFoundation directly, so we need to link it
	explicitly.

	amends 198ca65b.

2020-10-05 11:16  Oswald Buddenhagen <ossi@users.sf.net>

	* src/mbsync.1:

	improve wording in man page

2020-10-05 11:15  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	streamline init of type & name in imap_parse_store()

2020-10-05 11:05  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, driver.c, driver.h, drv_imap.c,
	  drv_maildir.c:

	make complaints about unrecognized keywords more verbose

	tell the user in what section the keyword appeared, as that may help
	spotting mistakes like stray empty lines.

2020-10-05 10:35  Oswald Buddenhagen <ossi@users.sf.net>

	* src/config.c:

	complain about global options following sections

	while harmless for most options, such usage is counter to the
	documentation, and actually breaks CopyArrivalDate, MaxMessages, and
	ExpireUnread.

2020-10-05 10:31  Oswald Buddenhagen <ossi@users.sf.net>

	* src/config.c:

	make exit from parsing Group sections less convoluted

	this is a de-optimization, but it makes the code consistent with the
	other sections (which do not use the shortcut due to having to
	post-process the data or being encapsulated by a function call).

2020-10-05 09:56  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, config.h, main.c:

	remove the -cT option

	it was another vestige from the compat wrapper.

	amends cbac8aa75.

2020-08-05 18:58  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	improve error handling in post-STORE UIDNEXT fallback

	that's mostly hypothetical, but let's not make assumptions.

	this also adds EXPUNGE response handling to make total_msgs reliable. in
	principle, this affects the post-SELECT UIDNEXT fallback as well, but
	there the racing window is so short that this barely improves anything.

	amends 94022a67.

2020-08-05 17:48  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	fix UIDNEXT query vs. concurrent imap_fetch_msg()

	the uidnext query following message stores can be interleaved with
	message fetches. that means that we cannot rely on the 1st command in
	flight being that query. but instead of iterating over all commands in
	flight, move the uidnext query flag to imap_store (and make sure to
	check for the presence of a message body before testing it) - this
	avoids the loop and an extra byte in every command.

	this also makes it clear that the query is mutually exclusive with
	loading messages (the untagged responses are not distinguishable).

2020-08-05 16:06  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, drv_imap.c:

	make item tracking in parse_fetch_rsp() more uniform

	amends 67ea5bea7 & a5a8783ea.

2020-08-05 15:43  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	delay allocation of msgdata.msgid field

	this allows us to simplify the exit path of parse_fetch_rsp().

2020-08-05 15:36  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	fix invalid free() in error path

	the tuid isn't actually allocated - it's a pointer into the raw data.

	amends a5a8783e.

2020-08-05 15:29  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	remove redundant zero initializations

	we already use calloc().

	amends 130664b6.

2020-08-04 07:08  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	de-duplicate exit paths of imap_alloc_store()

2020-08-04 07:06  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	don't unnecessarily re-initialize some members of imap_store

	... when recycling server connections.

2020-08-03 22:23  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_maildir.c, sync.c:

	use more appropriate return value in driver_t::select_box()

	don't say DRV_CANCELED when it's really DRV_STORE_BAD, as apart from
	being just wrong, it lead to the confusing effect of canceling a store
	as the result of a supposed cancellation of the same store.

2020-07-29 18:23  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, socket.c, socket.h, util.c:

	handle CertificateFile more cleanly

	properly distribute the certificates between the SSL context's trust
	store and our host cert list.

	as a drive-by, clean up some nasty type casts at the cost of including
	a second OpenSSL header into socket.h.

2020-07-28 14:14  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, drv_proxy.c:

	actually implement imap_commit_cmds()

	delay reporting success of STORE FLAGS until a subsequent CHECK
	succeeds.

	this fixes (inverse flag change propagation) and (deletes not being
	propagated) after an interruption due to prematurely logged flag
	updates.

2019-12-29 13:37  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, drv_imap.c, drv_maildir.c, mbsync.1,
	  run-tests.pl, sync.c:

	create placeholders for messages over MaxSize

	this is vastly more useful than just omitting the messages with no
	indication at all.

2019-11-25 19:55  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: run-tests.pl, sync.c:

	don't rewrite state gratuitously

	delay the creation of the new state and journal until there is actually
	something interesting to write. this saves some cpu cycles and prolongs
	ssd life a whee bit.

2019-11-17 18:45  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, drv_imap.c, run-tests.pl, sync.c, sync.h:

	add/fix/de-duplicate comments

2019-12-29 13:41  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	de-duplicate updating of uid in sync records

2020-07-20 18:53  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: run-tests.pl, sync.c:

	do away with newmaxuid

	now that expiration order is determined by a single loop ordered by
	far-side UIDs, it is no longer necessary to accurately track the highest
	seen UID.

	as a side effect, this fixes a problem reported (way too long ago) by
	Yuri D'Elia: we failed to up newmaxuid for messages we produced
	ourselves, so we would keep enumerating the same messages until we also
	propagated externally generated messages from that mailbox - which might
	have been never for the server side of archive/trash mailboxes.

2020-07-16 12:47  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	make expiration loops solely far-side-driven

	we can do that, as unpaired near-side messages are ignored anyway.

	this mildly changes expiration order, as near-side messages that
	existed for a long time but were propagated much later will be expired
	later. however, that has no practical relevance.

2020-07-16 11:08  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	don't forget to skip dead messages on far side during expiration

	this is mostly theoretical, as at this point no updates to the message
	list can have actually happened. but it's future-proof and consistent
	with the near-side loop.

2020-07-12 15:21  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	streamline counting of currently pushed messages wrt. expiration

	don't count them as alive just to ignore them in the next step.

2020-07-08 12:37  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	re-nest conditions for syncing new messages

	this makes the logic easier to follow and document in place.
	also, make the comments actually match reality.

2020-07-21 14:10  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	handle messages which are newly doomed after an interruption

	we already didn't propagate messages which would be instantly expunged
	from the target, but failed to cancel propagations that were already
	scheduled before we got interrupted. this matters a bit when the
	resumption happens significantly later than the initial attempt, giving
	the user time to mark messages on the source as deleted.

2020-07-11 14:21  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	remove redundant condition

	the 'pending' and 'skipped' sync record states are mutually exclusive
	with having a complementary message, so there is no point in testing it
	explicitly.

	amends bd5fb6ff.

2019-12-29 10:52  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, drv_imap.c, drv_maildir.c, drv_proxy.c,
	  sync.c:

	fix loading of some messages' sizes in some partial sync scenarios

	we need to pass a different "boundary" UID to driver_t::load_box() for
	every OPEN_* flag that queries a partial range:
	- OPEN_FIND refers to messages newer than all we know about
	- OPEN_OLD_IDS refers to messages which are paired
	- OPEN_{OLD,NEW}_SIZE refers to messages (not) above the committed
	  boundary of already propagated messages

	we treated the 3rd like the 2nd, which was just wrong - the actual
	boundary may be lower or higher, so we'd produce wrong results when
	MaxSize was set and only one of New and ReNew was requested.

2020-07-22 17:44  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, config.h, main.c, mbsync.1, mbsyncrc.sample,
	  run-tests.pl, sync.c, sync.h:

	deprecate master/slave terminology

	the underlying metaphor refers to an inhumane practice, so using it
	casually is rightfully offensive to many people. it isn't even a
	particularly apt metaphor, as it suggests a strict hierarchy that is
	counter to mbsync's highly symmetrical mode of operation.

	the far/near terminology has been chosen as the replacement, as it is a
	natural fit for the push/pull terminology. on the downside, due to these
	not being nouns, a few uses are a bit awkward, and several others had to
	be amended to include 'side'. also, it's conceptually quite close to
	remote/local, which matches the typical use case, but is maybe a bit too
	suggestive of actually non-existing limitations.

	the new f/n suffixes of the -C/-R/-X options clash with pre-existing
	options, so direct concatenation of short options is even less practical
	than before (some suffixes of -D already clashed), but doing that leads
	to unreadable command lines anyway.

	as with previous deprecations, all pre-existing command line and config
	options keep working, but yield a warning. the state files are silently
	upgraded.

2020-07-04 14:13  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	purge handling of pending sync entries from state file

	these cannot actually end up in the committed state.

	amends bd5fb6ff.

2020-07-08 20:16  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, sync.c:

	wrap jFprintf()+debug() into a macro

	this ensures that everything that is logged to the journal also appears
	in the debug output, and it makes the code less noisy.

2019-11-27 16:13  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac, src/Makefile.am, src/drv_imap.c, src/mbsync.1,
	  src/mbsyncrc.sample:

	add option to get password from macOS Keychain

	this is better than using PassCmd, as it allows the keychain manager to
	identify the calling process and therefore use a selective whitelist.

	unlike in the now removed example, we use an "internet password" for the
	imap protocol, rather than a "generic password" - this seems more
	appropriate.

	based on a patch by Oliver Runge <oliver.runge@gmail.com>

2019-11-26 11:17  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, mbsync.1:

	add ability to script IMAP user query

	It was already possible to retrieve passwords from arbitrary commands.
	But this goes only half the way to allowing automated derivation of
	login credentials, as some environments may also have different user
	names based on the system. Therefore, add the UserCmd option to
	complement PassCmd.

	Based on a patch series by Patrick Steinhardt <ps@pks.im>

2019-11-22 16:50  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	de-duplicate FETCH response data item traversal somewhat

2019-11-22 16:49  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	complain about malformed item names in FETCH responses

2019-11-22 15:54  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	re-nest parse_fetch_rsp()

	prefer early exits over else branches, which is easier to follow.

2019-11-11 15:32  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	extract parse_fetched_flags() from parse_fetch_rsp()

2019-11-11 15:18  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	extract parse_fetched_header() from parse_fetch_rsp()

2019-11-11 16:24  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	handle bogus IMAP FETCH responses more robustly

	don't use assert()s when the error condition can stem not only from
	errors in mbsync's logic, but also from the IMAP stream being corrupted.

	amends 72be55b0e.

	REFMAIL: 20191021233411.55ctuvslkfqf2pna@koblih.localdomain

2019-11-11 13:29  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	sanitize error handling in IMAP FETCH response processing

	abort on actual error conditions (protocol errors) and downgrade the
	rest to warnings.

	REFMAIL: 20191102164509.dxayakg3hrmozjnm@carbon

2019-11-11 12:51  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	centralize disposal of parsed IMAP lists

	makes the code less cluttered, and it's harder to introduce leaks.

	this has the hypothetical disadvantage that due to freeing being
	delayed, the peak memory usage would rise significantly if we chained to
	another parse_list() call which produces a big list while already
	holding a big list, but that isn't the case anywhere.

2019-11-11 12:41  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	fully decompose NAMESPACE response early on

	that way the code becomes clearer, and we don't keep useless nodes in
	memory.

2019-11-10 16:13  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	don't store 'shared' and 'other' namespaces

	they are never used anyway, and aren't going to be (because configuring
	that would be more annoying than just specifying Path manually).

2019-11-16 15:00  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, socket.c, socket.h, util.c:

	drop redundant conn->writing member

	this information is already encoded in the socket notifier's config.

2019-11-15 19:20  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, util.c:

	rewrite nonsensical struct packing magic

	this couldn't have possibly worked - the alignment also determines the
	sizeof, thus defeating the intent of the packing.

2019-11-15 19:21  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac:

	modernize list of gcc warning flags somewhat

2019-07-28 18:50  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, config.c, drv_imap.c, drv_maildir.c,
	  drv_proxy_gen.pl, main.c, mdconvert.c, socket.c, socket.h,
	  sync.c, util.c:

	consistently use NULL for null pointers

	makes the code noisier, but also somewhat more expressive.

2020-07-08 15:27  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, config.c, config.h, driver.c, driver.h,
	  drv_imap.c, drv_maildir.c, drv_proxy.c, main.c, socket.c,
	  socket.h, sync.c, sync.h, util.c:

	fix lots of sign conversion warnings

	... by making a lot of objects unsigned, and some signed.
	casts which lose precision and change the sign in one go (ssize_t and
	time_t to uint on LP64) are made explicit as well.

2019-07-28 20:10  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, drv_maildir.c, sync.c, util.c:

	make some narrowing of integers explicit

	this does specifically *not* cover about a bazillion warnings about
	size_t being shrunk to uint - these make no sense given the expected
	data set size.

2019-07-28 19:24  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, config.c, config.h, sync.c, util.c:

	shrink some data at the source to avoid subsequent narrowing

2019-07-28 19:13  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_maildir.c, main.c, socket.c, sync.c, sync.h,
	  util.c:

	constness fixes

	add missing const qualifications, and add "const cast" suppressions
	where unavoidable.

2019-07-28 18:54  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, drv_imap.c, main.c, sync.c:

	make more objects static

2019-07-28 17:52  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, drv_imap.c, main.c, sync.c, util.c:

	add some ATTR_* (mostly)

	mostly ATTR_PRINTFLIKE(*, 0) for functions with a va_list argument.

	also, one ATTR_NORETURN and one ATTR_UNUSED, both on functions.

	also, an explicit suppression for a format string stored in a variable.

2020-08-04 14:54  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, drv_maildir.c, util.c:

	turn maildir_again() into a proper varargs function

	this is mostly to work around the fact that both gcc and clang won't
	accept the format string declaration (i.e., will complain with
	-Wformat-nonliteral) if the *called* function does not actually take a
	va_list.

	on the upside, it makes one caller cleaner. yay ...

2019-11-26 15:18  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, socket.c, socket.h:

	remove support for SSLv3

	it's insecure and default builds of openssl don't include it any more.

2019-11-26 15:05  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, mbsync.1, socket.c, socket.h:

	add support for (disabling) TLS v1.3

	this is actually potentially counterproductive, as people who have set
	SSLVersions and fail to adjust it will _lose_ tls 1.3 support. however,
	without the option being there, people (incorrectly) believe that tls
	1.3 is not supported.

2019-11-26 14:49  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, mbsync.1:

	Add option to use IMAP LSUB instead of LIST

	Based on patch by Cedric Ware <cedric.ware__bml@normalesup.org>

2011-06-02 17:41  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	IMAP: reject unqualified non-uppercased INBOX spellings

	otherwise the server would interpret it as INBOX contrary to our
	expectations, which might lead to moderately surprising effects.

	if you really want to sync your ~/maildir/inbox to the IMAP INBOX,
	specify it as the Maildir Store's Inbox.

2019-11-09 18:47  Jaroslav Suchanek <jaroslav.suchanek@gmail.com>

	* src/: drv_imap.c, mbsync.1, socket.c, socket.h:

	Add support for specifying cipher string used for ssl connection

	Some distributions (e.g. Fedora) added support for system wide crypto
	policies. This is supported in most common crypto libraries including
	OpenSSL. Applications can override this policy using their own cipher
	string. This commit adds support for specifying the cipher string in
	the mbsync configuration.

	For example, to exclude Diffie-Hellman, the user can specify
	  CipherString "DEFAULT:!DH"
	in the IMAP Account's configuration.

2019-12-29 11:34  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	set sync record's flags only after propagating new message

	this is semantically cleaner, and fixes storing the flags in the rare
	case that flags are not being synced and the target is not being
	expunged, as in this case flags are queried only during the actual
	propagation.

2020-07-07 19:14  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	atomize & document conditions in load() exception list construction

2019-12-29 11:31  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	de-noise msg_copied() and flags_set() somewhat

	assign temporary srec object instead of always spelling out the
	indirection.

2019-12-03 12:06  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	de-noise initialization of sync records

	use calloc() instead of malloc().

2019-11-16 16:14  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, socket.c, socket.h:

	rename socket_expect_read() => socket_expect_activity()

	... to better reflect its (mostly new) function.

2019-11-16 13:17  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.c:

	re-nest conditions in socket_fd_cb()

	conn->state == SCK_STARTTLS implies conn->ssl != NULL.

2019-07-28 11:36  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.c:

	move state assignment to a more natural place

	... so it's right next to the related callback assignment.

2019-11-22 19:10  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_proxy.c:

	de-noise -Dd output somewhat

	drop commas and left-align fields in message lists.

2020-07-08 11:45  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, drv_imap.c, drv_maildir.c, drv_proxy.c,
	  sync.c:

	fix signedness issues surrounding UIDs

	amends bb632d1c.

2019-11-22 20:02  Oswald Buddenhagen <ossi@users.sf.net>

	* src/util.c:

	make find_uint_array() never create negative indices

2019-11-15 19:04  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	centralize "const cast" in make_key()

2019-07-28 18:42  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, drv_imap.c:

	fix strftime() format string warning properly

	the workaround for -Wformat triggered -Wformat-nonliteral in turn.
	so instead go back to using pragmas and add a proper gcc version check.

	this also works with clang - mostly for qt-creator's code model, which
	is clang-based.

	amends/reverts 55e65147.

2019-07-28 20:31  Oswald Buddenhagen <ossi@users.sf.net>

	* src/common.h:

	don't use reserved identifier pattern in stringify()

2019-11-11 21:42  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main.c:

	don't leak the channel list after all

	unlike the actual configuration data, it's not kept in global variables,
	so it shows up in memcheck.

	amends 1de3ecd88.

2019-11-11 21:32  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main.c:

	don't leak box list from the command line

	we also free the box list obtained from IMAP, so there isn't a real
	reason not to do that for one from the command line.

	amends 1de3ecd88.

2020-07-22 12:18  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	actually implement maildir_get_uidnext()

	the assumption was that this wouldn't be needed, as maildir_store_msg()
	reliably delivers a UID. however, if we crash right before the callback
	can record that UID, we'd still use OPEN_FIND in the next run, which
	requires the saved next UID.

2020-07-21 15:16  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	get rid of maildir_find_new_msgs() stub

	a failed assertion isn't any better than a clean segfault with an
	obvious backtrace.

2020-06-14 11:16  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	Maildir: fix setting flags on messages without ":2," part

	this is mostly hypothetical, as all messages i've encountered actually
	have it even if no flags are set on them.

2019-11-24 09:54  Oswald Buddenhagen <ossi@users.sf.net>

	* Makefile.am:

	give the coverity build result archive a more descriptive name

2020-04-02 18:39  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: use symbolic message subjects

	... instead of numbers. otherwise there is too much confusion with UIDs.

2020-04-03 08:43  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: re-order mailbox contents according to UIDs

	... instead of subjects, because that's way more natural and thus less
	confusing.

2020-04-03 10:18  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: re-organize mailbox storage by UID

	an effect of 7ce658d is that we can index messages by UID rather than
	content (or more specifically, subject). apart from being cleaner, it
	allows duplicated subjects.

2020-04-03 09:21  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: assume that each message has a UID

	followup to 7ce658d14.

2019-12-29 11:06  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: show the right state file after idempotence test failure

	amends efd72b85.

2019-12-29 10:59  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: fix prototype of ckbox()

2019-12-29 10:59  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: create the temp dir in $TEMP

	on modern systems, this makes it likely to end up on tmpfs, which is a
	lot faster and ssd-friendlier.

	the symlink is not deleted at the end, to minimize fs churn. that means
	it will be dangling after a reboot, which gets fixed in the next run.

2020-08-04 12:44  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac:

	bump version

2020-08-04 09:17  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.c:

	fix version comparison in LibreSSL conditional

	the operator was exactly inverted. that means that it actually wouldn't
	compile with both older versions (that needed the aliases) and
	potentially new versions (that will hide the data members - still not
	the case as of 3.2).

	amends 8a40554f0.

2020-08-04 08:10  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	fix re-using server connections for new stores

	we failed to reset the box list pointer after freeing it, which would
	lead to a crash.
	we also failed to reset the listing status, which would lead to
	malfunction if we hadn't already crashed.

	this inlines imap_cleanup_store(), as there isn't much value in keeping
	it. the message list is already freed when disowning the store anyway.

2020-08-03 10:39  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_proxy.c:

	don't crash in proxy_invoke_bad_callback()

	we need to hold a ref to the proxy store, as after the bad_callback()
	it's otherwise likely gone.

2020-07-27 20:48  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: socket.c, socket.h:

	fix simultaneously connecting to multiple hosts in non-IPv6 builds

	we need to deep-copy the struct hostent data, as otherwise the
	concurrent connects will overwrite each other's lookup results.

	this is a rather hypothetical fix, as the bug currently affects only
	channels connecting two IMAP accounts, and only if the first host's
	first address asynchronously fails to connect.

2020-07-27 22:28  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	increase PassCmd output buffer even more

	apparently, some XOAUTH2 tokens are at 2.4K already, so make it 8K to be
	*really* safe for a while.

	REFMAIL: <20200716000515.GA2111668@lysator.liu.se>

2020-08-02 18:05  Oswald Buddenhagen <ossi@users.sf.net>

	* src/mbsync.1:

	unbreak CertificateFile documentation

	the file may in fact contain CA certs.

	amends 7d9d3e15.

2020-07-08 09:42  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac:

	bump version

2019-12-29 11:59  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	fix propagation of flagged oversized messages

	... when not syncing flags and the target is not being expunged, as in
	that case flags were not queried in time.

2019-11-24 09:54  Oswald Buddenhagen <ossi@users.sf.net>

	* src/compat/: config.c, main.c:

	fix printf length arguments on lp64

	found by coverity.

2019-09-09 16:47  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, drv_maildir.c:

	handle case-insensitivity of IMAP's INBOX

	this is relevant only when listing an IMAP Store's contents, as that's
	the only place where we aren't imposing the spelling ourselves.

	we need to be careful not to treat our own canonical (prefix-stripped
	and always slash-delimited) box names like that; codify that in
	comments.

	this reveals that commit 6f2160f1 may be deemed to have been incorrect -
	the TODO item was ambiguous, and could quite possibly have meant this
	fix. unsurprisingly, 380ccdd4 re-introduced it with more explicit
	wording.

2019-11-23 12:51  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	catch server's failure to FETCH *

	the query is untypical enough to have caused problems with davmail (when
	we still used *:*) and mailo.com (until it got fixed), so better check
	that the result (not) returned by the server makes sense.

2019-11-16 16:14  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.c:

	don't timeout while uploading big messages

	we did already set up the timeout when starting to send commands, but so
	far we did not reset it when succeeding to send out data. rectify that.

	REFFAIL: 87sgy92we3.fsf@jnanam.net

2019-12-03 12:00  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main.c:

	make -DC work with yama ptrace protection

2019-11-22 20:00  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_maildir.c, util.c:

	fix overflows in uint comparisons

2019-11-27 16:55  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: compat/isync.1, mbsync.1:

	fix roff abuse in man pages

	".." is not valid. use "." instead, as recommended by groff_man(7).
	this also necessitated adjusting the markup of the license blurbs.

2019-11-18 17:57  Oswald Buddenhagen <ossi@users.sf.net>

	* src/mbsync.1:

	improve documentation of the server certificate related options

2020-02-28 11:10  Oswald Buddenhagen <ossi@users.sf.net>

	* Makefile.am:

	re-generate ChangeLog only if it's newer than the git index

	otherwise, we'd re-generate it during 'install' as well.

	note that this does not work with new-style git worktrees, where .git is
	only a file - but there the log generation itself already doesn't work
	anyway.

2019-11-18 15:30  Oswald Buddenhagen <ossi@users.sf.net>

	* README:

	update build requirements

	in particular, mention perl-related things, which might not be
	immediately obvious.

2020-07-01 16:25  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main.c:

	mention --remove in --help output

	amends d9a983a.

2019-11-23 12:30  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	fix UIDNEXT error message

2020-01-08 17:22  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, drv_imap.c, drv_maildir.c, sync.c:

	don't try to propagate flags the target store does not support

	$Forwarded is not standard, so it will most likely fail with mailboxes
	that do not support keywords.

	amends c4d7f018.

2019-12-28 16:45  Oswald Buddenhagen <ossi@users.sf.net>

	* src/driver.h:

	rename F_PASSED => F_FORWARDED

	the flag names are supposed to reflect the IMAP names (that's why
	their #defines are followed by comments with the Maildir names).

	amends c4d7f018.

2019-07-28 11:33  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.c:

	fix error handling of SSL_set_tlsext_host_name()

	it is not one of the functions to be checked with SSL_get_error().

	amends 17babc169.

2019-07-28 10:11  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.c:

	error-check more openssl function calls

2019-07-28 09:35  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, socket.c:

	attempt to improve ssl error handling (again)

	the error queue may contain multiple errors, so make sure to drain it
	completely. also, don't try to fall back to errno in case of
	SSL_ERROR_SSL.

2019-07-28 10:02  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.c:

	modernize ssl context init

	with openssl 1.1+, use TLS_client_method() instead of the deprecated
	SSLv23_client_method().

2019-07-28 09:46  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.c:

	fix leak of openssl X509 objects

	SSL_get_peer_certificate() increments the refcount of the object.

2019-09-10 11:14  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac:

	fix libcrypto detection in openssl 1.1+ without pkg-config

	CRYPTO_lock() was removed. test for X509_cmp() instead, which we
	actually use.

	inspired by report from FX <coudert@users.sourceforge.net>.

2019-09-10 11:00  Oswald Buddenhagen <ossi@users.sf.net>

	* src/mbsync.1:

	wording fixes in mbsync.1

	inspired by Ulrich Ölmann <u.oelmann@pengutronix.de>.

2019-08-30 11:13  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac, isync.spec.in:

	purge vestiges of the compat wrapper

	amends cbac8aa75.

2019-08-18 08:38  Caspar Schutijser <caspar@schutijser.com>

	* src/socket.c:

	Do not crash when using Tunnel in an IPv6-enabled build

	socket_connected() is also called on the tunnel pipe.

	amends 3ceb55310.

2019-07-09 18:51  Dmitry Torokhov <dtor@chromium.org>

	* src/drv_imap.c:

	Bump up PassCmd buffer size to 2KiB

	While ordinary passwords are rarely longer than 80 bytes, XOAUTH2 tokens
	easily exceed this limit. Let's bump it up to 2K to be really safe.

2019-05-28 15:27  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	fix parsing of NIL hierarchy delimiters in IMAP LIST responses

	a server which does not support hierarchical mailboxes (e.g., seznam.cz
	as of oct 2018) can legitimately send NIL (rather than an empty string).

2019-05-28 13:44  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac:

	make output of perl check more tidy

	amends c75001aa.

2019-03-10 10:30  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	fix spacing in "SASL mechanism(s) not available" error message

	amends fdb03b91.

2019-02-20 18:19  Klemens Nanni <kn@openbsd.org>

	* src/drv_imap.c:

	Fix CopyArrivalDate on platforms without glibc

	strptime(3)'s "%d" day of the month conversion specifier does not accept
	leading blanks in case of single digit numbers.  "%e" does that.

	While implementation details and differences between the two
	day-of-month conversion specifiers vary, none of the major libcs
	(incl. OpenBSD, FreeBSD, Illumos, musl) consume a leading blank for "%d"
	except glibc, which consumes any number of spaces like in the "%e" case.

	Using "%e" ensures that date strings like " 4-Mar-2018 16:49:25 -0500"
	are successfully parsed by all major implementations in compliance to
	X/Open Portability Guide Issue 4, Version 2 ("XPG4.2").  musl is now the
	only one that still treats "%d" and "%e" without stripping any space.

	Issue analysed and reported by Evan Silberman <evan@jklol.net> who found
	mbsync 1.3.0 on OpenBSD 6.4 to fail with `CopyArrivalDate' set when
	syncing mails with the above mentioned timestamp.

	See https://marc.info/?l=openbsd-tech&m=155044284526535 for details.

2019-02-05 10:23  Gergely Risko <gergely@risko.hu>

	* src/drv_imap.c:

	Work around useless SASL warnings

	Ater sasl_client_step() is called and the Cyrus SASL library forwards
	it to the client plugin, if the result value is OK (authentication
	succeeded), the clientout is filled out to be an empty string, even if
	the client plugin wanted to return NULL.

	To avoid that mbsync complains at this point, check the returned length
	instead of the pointer.

2019-01-04 23:00  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_proxy_gen.pl:

	fix formatting of uint in callback debug stubs

	amends bb632d1c.

2018-11-24 13:15  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.c, driver.h, drv_imap.c:

	sort messages from UID FETCH request

	turns out that some IMAP servers (e.g., poczta.o2.pl) do not return
	messages in ascending UID order in response to a UID FETCH request,
	which makes the driver violate the API contract.

	counter this by sorting the messages. this also addresses the
	long-standing (but hypothetical) issue that parallel UID FETCH requests
	could be handled out-of-order and thus also lead to mixed up results.

	based on patch by Marcin Niestroj <macius1990w@gmail.com>.

2018-09-09 11:35  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	bump IMAP command buffer size to 4KiB

	while only 1KiB is required by the IMAP spec, AUTHENTICATE GSSAPI with
	Kerberos requires about 1700 bytes.
	accomodate that, plus some reserve.

	fix suggested by Tollef Fog Heen <tfheen@err.no> via Debian BTS.

2018-09-08 16:36  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.c:

	use SNI when connecting with SSL

	based on patch by Vincent Bernat <vincent@bernat.ch>.

2018-07-01 11:22  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, socket.h:

	fix type of 'port' and check its range in config reader

2018-05-18 13:24  Klemens Nanni <kn@openbsd.org>

	* src/: drv_maildir.c, drv_proxy.c:

	Fix time_t format strings

	For time_t, long long handles dates after Y2038 and should be safe on
	32-bit architectures.

	From Jeremie Courreges-Anglas <jca@openbsd.org>.

2018-05-18 13:11  Klemens Nanni <kn@openbsd.org>

	* src/socket.c:

	User functions provided by recent LibreSSL versions

	At least on OpenBSD, this enables new APIs out of the box provided by
	LibreSSL 2.7.1 and higher.

	From Jeremie Courreges-Anglas <jca@openbsd.org>.

2018-06-21 14:52  Michael J Gruber <github@grubix.eu>

	* src/: driver.h, drv_imap.c, drv_maildir.c, drv_proxy.c,
	  sync.c:

	implement Forwarded flag

	maildir supports a 'P' flag which denotes the fact that a message has
	been 'passed' on (forwarded, bounced). notmuch syncs this to the
	'passed' tag.

	Per https://tools.ietf.org/html/rfc5788, IMAP has a user-defined flag
	(keyword) '$Forwarded' that is supported by many servers and clients
	these days. (Technically, one should check for '$Forwarded' in the
	server response.)

	Restructure mbsync's flag parser to accept keywords (flags starting with
	'$') but still bail out on unknown system flags (flags starting with '\').
	Support '$Forwarded' as a first keyword since it maps to maildir's 'P'
	and needs to be sorted in between the system flags.

	Signed-off-by: Michael J Gruber <github@grubix.eu>

2018-06-21 14:52  Michael J Gruber <github@grubix.eu>

	* src/: driver.h, drv_imap.c, drv_maildir.c, drv_proxy.c,
	  sync.c:

	mark MAILBOX_DRIVER_FLAG locations in code

	Mailbox driver flags are defined in several places. It is essential that
	they are kept in sync, so mark them with the same string for easy
	grepping with an alerting boiler plate.

	Signed-off-by: Michael J Gruber <github@grubix.eu>

2018-07-01 09:05  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	fix IMAP UID sequence also in imap_find_new_msgs()

	use just * instead of the rather nonsensical *:* (which davmail happens
	to actually barf at).

	amends 72be55b0 (and 0a5a8479).

2018-04-08 16:10  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	fix uidvalidity recovery with really long message-id headers

	re-using the file name buffer for the headers wasn't such a great idea,
	as _POSIX_PATH_MAX is only 256, while RFC2822 permits lines up to 1000
	chars. and sure enough, i have a message with a whopping 470-char
	message-id header ...

2017-11-18 08:57  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	fix IMAP UID sequence in UIDNEXT determination fallback

	use just * instead of the rather nonsensical *:* (which davmail happens
	to actually barf at).

	amends 72be55b0.

2017-10-15 14:52  Oswald Buddenhagen <ossi@users.sf.net>

	* src/util.c:

	make more use of equals()

2017-10-15 14:14  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, main.c, sync.c, util.c:

	make map_name() interpret empty strings as "no separator"

	empty strings were previously meaningless, and starting with 72c2d695a,
	failure to handle them lead to bogus results when the IMAP hierarchy
	separator is legitimately empty (when the server genuinely supports none
	and none is manually configured). non-null can be asserted more cleanly
	than null-or-non-empty, so change the api like that.
	incidentally, this also removes the need to work around gcc's bogus
	warning in -Os mode.

	problem found by "Casper Ti. Vector" <caspervector@gmail.com>

2017-10-15 14:46  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	remove pointless conditional in assignment of ctx->delimiter

	amends 72c2d695a.

2017-10-15 09:34  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac:

	add check for perl and its version

2017-10-07 12:30  Oswald Buddenhagen <ossi@users.sf.net>

	* src/util.c:

	limit -Wmaybe-uninitialized suppression to gcc >= 4.3

	apple gcc 4.2 complains about the use of the pragma inside a function.
	clang also complains, but because the pragma is entirely unknown to it.

	as neither compiler emits the bogus warning in the first place, there is
	no point in suppressing it anyway.

2017-10-07 12:09  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.h:

	don't forward-declare SSL types any more

	our current project structure precludes the clash between some indirect
	include of ssl.h and our definition of 'S' (or 'M', i don't remember)
	that happened on some system, so there is no need to avoid including it
	any more.

	this avoids complaints from some more picky compilers, as re-defining
	typedefs (even to the same thing) is illegal before C11.

2017-10-07 12:46  Oswald Buddenhagen <ossi@users.sf.net>

	* .gitignore:

	git-ignore tar ball signatures

2017-10-07 12:17  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac:

	bump version

2017-10-01 13:21  Oswald Buddenhagen <ossi@users.sf.net>

	* README, configure.ac, src/Makefile.am, src/compat/.gitignore,
	  src/compat/Makefile.am, src/compat/config.c,
	  src/compat/convert.c, src/compat/isync.1, src/compat/isync.h,
	  src/compat/isyncrc.sample, src/compat/main.c,
	  src/compat/util.c, src/mbsync.1:

	delete the compat wrapper

	it was deprecated in 1.2. until 1.4 gets released, enough time will have
	passed for sure.

2017-10-01 13:06  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac:

	bump version

2017-10-01 12:59  Oswald Buddenhagen <ossi@users.sf.net>

	* Makefile.am:

	adjust dist-hook to syntax change in .gitignore

	don't try to delete files in / ...

	amends 46e792c3d.

2017-10-01 08:44  Oswald Buddenhagen <ossi@users.sf.net>

	* Makefile.am, mbsync-get-cert:

	rename get-cert => mbsync-get-cert

	to avoid undue namespace pollution. inspired by debian.

2017-04-09 08:40  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	make sync records with stray TUID non-fatal

	while the situation indicates an internal error, it is harmless in
	itself. also, printing some more information may help identify the
	problem.

2017-08-11 07:20  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: compat/config.c, compat/isync.h, compat/main.c,
	  drv_imap.c, mbsync.1, socket.c, socket.h:

	prune SSL 2 support

	OpenSSL actually did that a while ago already, so this was dead code.

2017-10-01 08:40  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	another fix for -Wimplicit-fallthrough (new on master)

2017-09-23 10:52  Oswald Buddenhagen <ossi@users.sf.net>

	* Makefile.am:

	update debian packaging

2017-09-23 10:32  Alessandro Ghedini <ghedo@debian.org>

	* src/drv_imap.c:

	Fix spelling of error messages

2017-10-01 08:04  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, compat/isync.h, compat/main.c, main.c,
	  socket.c:

	fixes for -Wimplicit-fallthrough

2017-10-01 06:15  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac:

	bump version

2017-08-19 11:22  Helmut Grohne <helmut@subdivi.de>

	* configure.ac:

	use autoconf's built-in pkg-config support for OpenSSL

	the hand-crafted suppport did not work with cross-builds.

2017-08-11 06:50  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: compat/config.c, compat/isync.1, drv_imap.c, mbsync.1:

	enable TLS 1.1 and 1.2 by default

	there is no reason not to, and debian even disabled 1.0 globally,
	because it's (theoretically) too insecure in some contexts (BEAST
	attack).

	in the compat wrapper, the UseTLSv1 option has been re-interpreted as
	v1.x, to avoid adding new options.

2017-08-05 18:28  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac:

	bump version

2017-08-05 18:24  Oswald Buddenhagen <ossi@users.sf.net>

	* src/mbsync.1:

	mention the need for renaming Maildir files upon move

	mu4e config line offered by Ben Maughan <benmaughan@gmail.com>.

2017-07-30 16:37  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.c:

	fix spurious decompression errors

	while that's just bad api, inflate() can return Z_BUF_ERROR during
	normal operation.

	contrary to the zpipe example and what the documentation implies,
	deflate() actually isn't that braindead. add respective comments.

	REFMAIL: CALA3aExMjtRL0tAmgUANpDTnn-_HJ0sYkOEXWzoO6DVaiNFUHQ@mail.gmail.com

2017-07-30 11:47  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.c:

	improve zlib error reporting

	zlib is not exactly thorough about always populating z_stream->msg, so
	fall back to the error code if necessary.

2017-06-21 07:33  Patrick Steinhardt <ps@pks.im>

	* src/socket.c:

	socket: use next addrinfo if opening socket fails

	The `socket_connect_one` function previously did an `exit(1)` when
	encountering any errors with opening the socket. This would break
	connecting to a host where multiple possible addrinfos are returned,
	where the leading addrinfos are in fact impossible to connect to. E.g.
	with a kernel configured without support for IPv6, the `getaddrinfo`
	call may still return a hint containing an IPv6 address alongside
	another hint with an IPv4 address. Creating the socket with the IPv6
	address, which will cause an error, lead us to exiting early without
	even trying remaining hints.

	While one can argue that the user should have compiled without HAVE_IPV6
	or used an appropriate DNS configuration, we can do better by simply
	skipping over the current addrinfo causing an error. To do so, we split
	out a new function `socket_connect_next`, which selects the next
	available address info and subsequently calls `socket_connect_one`
	again. When no hints remain, `sock_connect_one` will error out at that
	point.

2017-05-14 07:42  Oswald Buddenhagen <ossi@users.sf.net>

	* Makefile.am:

	fix 'make log' with non-default git config format.pretty

	suggested by Aaron Jensen <aaronjensen@gmail.com>.

	REFMAIL: CAHyO48z0DcoFPC8rCNAL38oxVQtZNKifVd-NEF3sp1EfR-GgxQ@mail.gmail.com

2017-05-14 07:37  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	fix build without BDB

	amends 83ebe902.

	REFMAIL: CAHyO48z0DcoFPC8rCNAL38oxVQtZNKifVd-NEF3sp1EfR-GgxQ@mail.gmail.com

2017-03-21 19:05  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, driver.h, drv_imap.c, drv_maildir.c,
	  drv_proxy.c, sync.c, util.c:

	make UIDs unsigned

	complies with the IMAP spec, thus removing the (not really) arbitrary
	limitation to INT_MAX for UIDs.

2017-04-02 15:21  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	delay assignment of TUID when propagating messages

	go back to assigning TUIDs only right before actually propagating them.
	this avoids spurious "TUID lost" warnings.

2017-03-11 12:20  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, drv_imap.c, run-tests.pl, sync.c:

	move away from magic UIDs in the sync state

	the only legitimate "deviant" UID is zero, meaning "no message". this
	can be futher qualified by additional flags in the sync record, rather
	than using magic values for the UID. in fact, the zero UID (so far
	meaning only "expunged") was already optionally qualifed with "expired".

	as a side effect, driver->store_msg() now returns 0 instead of -2 for
	unknown UIDs. this was a hack to avoid translating the value later
	on, but it made the api horrible, and now it's superflous in the first
	place.

2017-04-01 15:02  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	split off ephemeral sync record state to a separate member

	this allows us to simplify logging of expiration, as we now can just log
	the entire persistent state instead of fiddling with bits.

2017-03-19 10:53  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, main.c, run-tests.pl, sync.c:

	autotest: implement much more thorough resumption verification

	the test will now make a test run for every journaled step, both right
	before and right after the logging.

2017-03-29 11:43  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: pre-assign all UIDs of the test messages

	this ensures stable results when the boxes are used with different
	OPEN_FLAGS (which will happen in a subsequent commit), at the negligible
	cost of removing the implicit test of the maildir driver's ability to
	enumerate new messages.

2017-04-02 12:57  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: .gitignore, Makefile.am, common.h, driver.h,
	  drv_imap.c, drv_maildir.c, drv_proxy.c, drv_proxy_gen.pl,
	  main.c, mbsync.1, sync.c:

	introduce driver call debugging

	do that by wrapping the actual stores into proxies.

	the proxy driver's code is auto-generated from function templates, some
	parameters, and the declarations of the driver functions themselves.
	attempts to do it with CPP macros turned out to be a nightmare.

2017-03-24 18:24  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, drv_imap.c, drv_maildir.c, sync.c:

	let driver_t::openbox_box() return the UID validity

	... and make 'uidvalidity' private to the drivers.

2017-01-29 14:39  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, sync.c:

	use a #define for invalid UIDVALIDITY

2017-03-24 17:43  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, drv_imap.c, drv_maildir.c, sync.c:

	introduce get_uidnext() driver callback

	... and make 'uidnext' private to the imap driver.

2017-03-26 16:44  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, drv_imap.c, drv_maildir.c, sync.c:

	let driver_t::find_new_msgs() return the list of messages

	consistently with driver_t::load_box().

2017-03-24 17:09  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, drv_imap.c, drv_maildir.c, sync.c:

	let driver_t::load_box() return the list of messages

	... and make 'msgs', 'count', and 'recent' private to the drivers.

2017-03-24 16:44  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, drv_imap.c, drv_maildir.c, main.c:

	let driver_t::list_store() return the list of boxes

	... and make 'boxes' and 'listed' private to the drivers.

2017-03-24 16:00  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	factor out transform_refcounted_msg_response()

	the missing cross of transform_refcounted_box_response() and
	transform_msg_response().

2017-03-24 15:56  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	make struct imap_cmd_refcounted_state "abstract"

	take the callback out of it, so it can be individualized.
	so far, this only increases code size ...

2017-03-24 14:29  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main.c:

	don't mess with the driver's mailbox list from outside

	the api specifies that the list remains owned by the driver, so poking
	around in it is ugly and risky.

2017-03-24 13:18  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, drv_imap.c, drv_maildir.c, sync.c:

	make driver_t::prepare_load_box() return the final options

	... and make 'opts' private to the drivers.

2017-03-24 13:06  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, drv_imap.c, drv_maildir.c, sync.c:

	introduce get_box_path() driver callback

	... and make 'path' private to the maildir driver.

2017-03-21 18:27  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, drv_imap.c, drv_maildir.c, main.c, sync.c:

	make set_bad_callback() a proper driver_t entry

	... and make the pointers private to the drivers.

2017-03-19 12:50  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, drv_imap.c, drv_maildir.c, drv_proxy.c,
	  main.c, sync.c:

	provide a proper getter callback for driver capabilities

	that way driver_t contains only callbacks.

2017-03-19 12:46  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, drv_imap.c, drv_maildir.c, main.c, sync.c:

	prepend "get_" to getters in driver_t

	this makes it callbacks consistently start with a verb.

2017-04-02 12:04  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: run-tests.pl, sync.c:

	rewrite tracking of highest expired UID

	so far, we tracked the slave side, and calculated the master side on the
	fly. that complicated things unnecessarily.

2017-03-10 16:40  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	streamline syncing of old entries

	the order of the conditionals was purely historical (pre 4ec56f8cf, anno
	2005) and hard to follow, as were the comments.

2017-01-29 14:00  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	sort uid exception list in a smarter place

	do it closer to where it is populated. that way the debug output is
	sorted, and we don't sort the list if it's known to be empty.

2017-01-28 18:19  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	add fallbacks for determining UIDNEXT

	if the server sends no UIDNEXT, do an initial FETCH to query the UID of
	the last message.

	same if the server sends no APPENDUID.

	this allows us to remove the arbitrary limitation of the UID range to
	INT_MAX, at the cost of additional round-trips.

2017-03-21 17:46  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, drv_maildir.c, main.c:

	fix repeated listing of same Store with different flags

	multiple Channels can call driver_t::list_store() with different LIST_*
	flags. assuming the flags are actually taken into consideration, using a
	single boolean 'listed' flag to track whether the Store still needs to
	be listed obviously wouldn't cut it - if INBOX does not live right under
	Path and the Channels used entirely disjoint Patterns (say, * and
	INBOX*), the second Channel in a single run (probably a Group) would
	fail to match anything.

	to fix this, make store_t::listed more granular. this also requires
	moving its handling back into the drivers (thus reverting c66afdc0),
	because the actually performed queries and their possible implicit
	results are driver-specific.

	note that this slightly pessimizes some cases - e.g., an IMAP Store with
	Path "" will now list the entire namespace even if there is only one
	Channel with Pattern "INBOX*" (because a hypothetical Pattern "*" would
	also include INBOX*, and the queries are kept disjoint to avoid the need
	for de-duplication). this isn't expected to be a problem, as listing
	mailboxes is generally cheap.

2017-03-21 14:12  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	factor out listing Maildir++ Stores

	Maildir++ is sufficiently different from the other SubFolder styles to
	justify a separate function; the resulting code duplication is minimal,
	but the separated functions are a lot clearer.

2017-03-21 13:39  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	fix exclusion of bogus "INBOX.*" folders in Maildir++

	this also adds code which avoids that the message about excluding the
	mailbox is printed multiple times - this could happen with Maildir++, as
	the hierarchy is flattened.

	amends 0f24ca31b.

2017-03-19 19:21  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	make "Patterns *" match INBOX* in Maildir++ Stores

	this also has the side effect that we won't fail to include INBOX itself
	when Inbox is nested under Path when using other SubFolder styles
	(regression introduced with Maildir++ support in 0f24ca31b).

	REFMAIL: 1489492069.2148187.910409864.7727F9FC@webmail.messagingengine.com

2017-03-19 17:08  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main.c:

	make help screen print some more compile time options

2017-03-04 11:47  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	de-obfuscate cmd_sendable()

	split the monster conditional and add comments.

2017-03-30 17:39  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, run-tests.pl:

	add comments

2017-03-30 18:04  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	fix sync resumption with aborted entries

	we need a separate log entry type which does proper mmaxxuid tracking.

	while moving code around, this also removes a redundant debug statement.

	amends b1842617.

2017-03-30 17:57  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	remove nonsensical statement from journal replay of aborted entries

	at this stage, entries cannot possibly have messages assigned to them,
	so trying to unlink them makes no sense.

	amends b1842617.

2017-03-30 17:48  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	fix sync resumption with re-newed messages

	the UID of the entries needs to be bumped from -1 to -2, as otherwise
	the resumed run would see a TUID in a sync entry which may not have one.

2017-03-30 17:44  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	don't emit redundant flag updates for re-newed messages

2017-03-19 10:35  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	fix maxuid tracking

	newmaxuid represents the highest UID for which a sync entry was created,
	while maxuid represents the end of the range which is guaranteed to have
	been propagated. that means that the former needs to be instantly
	incremented (and logged), while the latter must not be touched until the
	entire new message sync completes. this matters particularly in the case
	of resuming an interrupted run, where sync entry creation must resume
	exactly where it left off, while loading the box must use the old limit
	to ensure that all messages are available for actual propagation.

2017-03-31 10:39  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	de-duplicate journal replay somewhat

	we've been using indices to separate master/slave state for a long time,
	so there is no point in using pairs of matching brackets to signify the
	side in the journal. instead, use somewhat descriptive letters (S[een],
	F[ind], T[rashed]) and the index itself.

2017-04-02 13:42  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, config.h, drv_imap.c, drv_maildir.c,
	  socket.h, tst_timers.c:

	use typedefs for structs more

	makes the code more compact (and consistent, as typedefs were already
	used in some places).

2017-04-02 13:24  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	factor out jFprintf()

2017-03-29 13:14  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	fix signedness of 'nex' variables

	they are derived from srec->status, which is unsigned. for not
	understood reasons, the compiler complains only after extending status
	to a full unsigned int.

	on the way, localize the declarations.

2017-04-02 10:03  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, drv_maildir.c:

	don't use strncpy() to copy TUIDs

	latest since 77acc268, the code prior to these statements ensures that
	the full length is available, so just use memcpy(). the code for
	comparing TUIDs uses memcmp() anyway.

2017-03-26 19:06  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: improve valgrind integration

	introduce recognition of $USE_VALGRIND to run all mbsync invocations
	through valgrind.

	this also removes the seemingly purposeless --log-fd=3 indirection.

2017-03-29 14:31  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: write logs to files

	they can get long, and having actual files also helps with diffing.

2017-03-29 14:24  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: factor out readfile() function

2017-03-14 13:52  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: de-duplicate error reporting paths

2017-03-14 13:44  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: print consistent information for journal replay failures

2017-03-14 13:20  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: don't print expected result if the mbsync run itself fails

	there isn't an actual result to compare with anyway.

2017-03-31 11:16  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: de-duplicate: use print*() in show*()

	this actually adds some (minimal) transformation overhead, but it makes
	the relationship clearer.

2017-03-14 14:01  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: determine path of mbsync prior to chdir()

	that allows tmp/ to be a symlink to a ramdisk.

2017-03-14 10:10  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: use warnings

2017-03-14 10:09  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	autotest: remove stray close() call from printstate()

2017-03-11 12:27  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	don't populate sync record map with invalid UIDs

	this would obviously just bloat the hash with nonsense, slowing down the
	actual lookup later.

2017-02-15 10:45  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	fix mislabeling of test

2017-01-28 17:26  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	make -DN print also the sent data

2017-02-15 16:25  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	don't arbitrarily limit UIDs to a billion, part 2

	imap_find_new_msgs() had the same fixed limit as imap_load_box().

	amends 815822d8.

2016-12-18 19:50  Oswald Buddenhagen <ossi@users.sf.net>

	* README, src/driver.c, src/driver.h, src/drv_imap.c,
	  src/drv_maildir.c, src/mbsync.1, src/sync.c:

	implement Message-Id based UIDVALIDITY recovery

2016-12-18 20:22  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, drv_imap.c, drv_maildir.c, sync.c:

	don't fetch message size unless necessary

	when syncing flags but not re-newing non-fetched messages, there is no
	need to query the message size for all messages, as the old ones are
	queried only for their flags.

2016-11-06 16:26  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	some reshuffling in maildir_scan() for clarity

2016-12-18 20:24  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	make fetching of partial UID ranges more flexible

	instead of a single hard-coded branch, use a generic method to split
	ranges as needed.

	this is of course entirely over-engineered as of now, but subsequent
	commits will make good use of it.

2016-11-05 17:33  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	factor out app_cr

2016-11-05 17:33  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	factor out copy_msg_convert()

2016-11-05 17:32  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	factor out copy_msg_bytes()

2016-12-29 13:34  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, drv_imap.c:

	make more use of strnlen()

	includes adding the so far superfluous prototype for the replacemnt to
	common.h.

2016-12-29 14:08  Oswald Buddenhagen <ossi@users.sf.net>

	* src/util.c:

	make use of memchr() in strnlen() replacement after all

	turns out the comment advising against it was bogus - unlike for
	memcmp(), the standard does indeed prescribe that the memchr()
	implementation may not read past the first occurrence of the searched
	char.

2016-12-29 14:06  Oswald Buddenhagen <ossi@users.sf.net>

	* src/util.c:

	adjust return type of strnlen() replacement

	it doesn't really matter, but it's nicer to stay consistent with the
	official prototype.

2016-12-29 13:10  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, sync.c:

	standardize on 'int' for message sizes

	that's what the sources already assumed anyway. size_t is total
	overkill, as No Email Ever (TM) will exceed 2GiB.

	this also fixes a harmless format string warning in 32 bit builds.

2016-11-13 21:20  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	print actually read TUID in debug message

2016-11-13 21:19  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	null-terminate lines read from state file & journal

	makes the subsequent code less convoluted.

2016-11-06 16:23  Oswald Buddenhagen <ossi@users.sf.net>

	* src/common.h:

	mark string_list_t as packed

	otherwise we'll regularly over-allocate due to the struct's stride.

2016-12-18 20:52  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, sync.c, util.c:

	make more use of shifted_bit()

	technically, this introduces a redundant AND, but the compiler is smart
	enough to prove that (((A & M) ^ B) & M) == ((A ^ B) & M).

2016-11-06 16:22  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, drv_maildir.c:

	make more use of nfstrndup()

2016-11-12 13:15  Oswald Buddenhagen <ossi@users.sf.net>

	* src/mbsync.1:

	document some additional uses for PipelineDepth

2016-12-11 11:09  Oswald Buddenhagen <ossi@users.sf.net>

	* src/util.c:

	silence bogus [-Wmaybe-uninitialized] with -O0/-O1/-Os

2016-12-04 10:23  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	accept NAMESPACE responses without hierarchy delimiter

	RFC2342 states that the delimiter may be NIL, which some servers
	apparently actually make use of.

	REFMAIL: CAM0xXk_FQ83CPrd37iQCMKtc1B2P8=u-r5jX0n2WE5Y+3483nQ@mail.gmail.com

2016-12-04 10:14  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	validate NAMESPACE response earlier

	... and don't silently fail later on.

2016-12-03 18:18  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	inform user if LOGIN was skipped because of missing SSL

	'AuthMechs *' technically includes LOGIN, so it is a bit unintuitive
	when it's still not used.

2016-12-03 19:00  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	make * not match LOGIN even in non-SSL builds

	this is consistent with the plain text transmission warning below.

2016-12-03 19:58  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	be more helpful when no SASL mechanisms are available

2016-12-03 19:58  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	fix LOGIN in SASL builds

	if AuthMechs includes more than just LOGIN and the server announces any
	AUTH= mechanism, we try SASL. but that can still fail to find any
	suitable authentication mechanism, and we must not error out in that
	case if we are supposed to fall back to LOGIN.

2016-12-03 13:32  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	fix LOGIN in non-SASL builds

	specifically, if AuthMechs included more than just LOGIN (which would be
	the case for '*') and the server announced any AUTH= mechanism, we'd
	immediately error out upon seeing it, thus failing to actually try
	LOGIN.

2016-11-20 10:47  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	don't arbitrarily limit UIDs to a billion

	the number was chosen to make queries more comprehensible when the
	server sends no UIDNEXT, but it appears that such insanely large UIDs
	actually show up in the wild. so send 32-bit INT_MAX instead.

	note that this is again making an assumption: that no server uses
	unsigned ints for UIDs. but we can't sent UINT_MAX, as that would break
	with servers which use signed ints. also, *we* use signed ints (which is
	actually a clear violation of the spec).

	it would be possible to special-case the range [1,inf] to 1:*, thus
	entirely removing arbitrary limits. however, when the range doesn't
	start at 1, we may actually get a single message instead of none due to
	the imap uid range limits being unordered. this gets really nasty when
	we need to issue multiple queries, as we may list the same message
	twice.

	a reliable way around this would be issuing a separate query to find the
	actual value of UID '*', to make up for the server not sending UIDNEXT
	in the first place. this would obviously imply an additional round-trip
	per mailbox ...

2016-11-04 20:23  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	wrap message trashing into simple transactions

	trashing many messages at once inevitably overtaxes m$ exchange, and the
	connection breaks. without any progress tracking, it would restart from
	scratch each time, which would lead to a) it never finishing and b) many
	copies of the messages in the trash.

	full transactions as we do for "proper" syncing would be over the top,
	as it's not *that* bad if some messages get duplicated in the trash. so
	we record only the messages for which trashing completed, thus allowing
	some overlap between the attempts.

2016-11-05 17:16  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	use a temporary for sanity

2016-11-04 20:09  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, drv_imap.c, drv_maildir.c, sync.c, util.c:

	pre-sort exception list passed to driver->load_box()

	... and use that to optimize the maildir driver somewhat.

2016-11-04 20:48  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac, src/common.h, src/driver.h, src/drv_imap.c,
	  src/drv_maildir.c, src/sync.c, src/util.c:

	abstract growable arrays somewhat

	... and sneak in a C99 requirement on the way. just because.

2016-11-04 15:21  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_maildir.c, mbsync.1:

	fix SubFolders style Maildir++

	turns out i misread the spec in a subtle way: while all other folders
	are physically nested under INBOX, the IMAP view puts them at the same
	(root) level. to get them shown as subfolders of INBOX, they need to
	have _two_ leading dots.

	this also implies that the Maildir++ mode has no use for a Path, so
	reject attempts to specify one.

2016-07-24 09:58  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.c:

	fix build with openssl 1.1

	they finally made their structs opaque, and provided proper getters.

2016-07-24 09:58  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.c:

	prune obsolete #include

	hmac.h was needed only for the cram-md5 implementation.

2016-05-21 11:08  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.c:

	fix server certificate validation error reporting

	use the right function to decode the error code.

	found by Andrés Ramírez <sunshavi@fastmail.fm>.

2015-11-08 11:19  Oswald Buddenhagen <ossi@users.sf.net>

	* .gitignore, src/.gitignore, src/compat/.gitignore:

	improve .gitignore files

	- add missing entries
	- remove redundant entries which are inherited from parent dirs
	- mark dirctories as such
	- anchor specific files

2015-11-06 07:29  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: compat/isync.1, compat/isyncrc.sample, mbsyncrc.sample:

	fix CertificateFile docs & samples

	the mbsync manual says explicitly that the system's default certificate
	store should *not* be specified.
	however, the isync manual talked about CA certificates, which is (and
	always was) exactly wrong.
	also adjust both .sample rc files.

2015-09-27 10:13  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.c:

	don't crash when dns lookup fails (ipv6 path)

	we call socket_connect_bail() when getaddrinfo() failed, so it must deal
	with no addrinfo being there yet.

2015-09-27 09:47  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	remove legacy (bsd-style) locking

	flock() may be implemented via fcntl(), which may cause the process to
	deadlock itself when trying to apply both types of locks. this is the
	case even on linux when the file lives on NFS.

	it's unlikely that anything except mbsync would try to access the
	.uidvalidity files anyway, so there is no point in trying to be
	compatible with anything else ...

	REFMAIL: uddy4g589ym.fsf@eismej-u14.spgear.lab.emc.com

2015-09-06 20:56  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	don't attempt to issue LOGOUT on bad stores

	amends 9d22641b.

2015-09-06 19:02  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.c:

	de-duplicate cleanup of name-related data in error paths

	"name" being both the ipv6 dns info and our own socket label.

	sort-of amends 9d22641b.

2015-09-07 10:23  Oswald Buddenhagen <ossi@users.sf.net>

	* README, src/mbsync.1:

	mention safety of concurrent access; wording improvements

2015-09-01 12:21  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, drv_imap.c, sync.c, util.c:

	tolerate case changes in X-TUID header name

	it is legal for an email system to simply change the case of rfc2822
	headers, and at least one imap server apparently does just that.
	this would lead to us not finding our own header, which is obviously not
	helpful.

	REFMAIL: CA+fD2U3hJEszmvwBsXEpTsaWgJ2Dh373mCESM3M0kg3ZwAYjaw@mail.gmail.com

2015-08-08 17:45  Anton Khirnov <anton@khirnov.net>

	* src/: drv_imap.c, mbsync.1, socket.c, socket.h:

	add support for sending a TLS client certificate

2015-07-18 16:17  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac:

	fix configure for static libdb, libnsl, and libsocket

	the right variable to put libraries into is LIBS, not LDFLAGS.

	REFMAIL: CAABPU68s3uy0Gv-vfAGzeNn0s5Ow--+p+y8W7xE7US_7iXpdjw@mail.gmail.com

2015-05-24 16:20  Oswald Buddenhagen <ossi@users.sf.net>

	* README:

	mention m$ exchange MOVE workaround in compat section

2015-05-24 16:20  Oswald Buddenhagen <ossi@users.sf.net>

	* README:

	list more deps (sasl and zlib)

2015-05-24 16:20  Oswald Buddenhagen <ossi@users.sf.net>

	* README:

	less technical info

	no point in listing IMAP extensions in the README

2015-05-23 09:06  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, drv_imap.c, drv_maildir.c, main.c:

	make it possible to specifiy Pattern INBOX* with no Path defined

	that pattern may very well expand to INBOXNOT, which would naturally
	live under Path, so we need to look into the Path. of course, this
	actually makes sense only if there *is* a Path, and complaining about
	it being absent is backwards.

2015-05-23 08:47  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	remove support for multi-char imap path delimiters again

	the idea that this is even possible was based on an incomplete reading
	of the imap spec.

	however, the infrastructure for supporting multi-char delimiters as such
	is retained, as the Flatten option can be used with them.

2015-05-24 09:37  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, drv_imap.c, drv_maildir.c, main.c, socket.c:

	make server connection a cancellable operation

	this entails splitting drv->open_store() into alloc_store() and
	connect_store().

2015-05-17 14:28  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	validate Path earlier

	we cannot know whether it will be needed later, but we can validate it
	if it's set.

2015-05-17 10:06  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: main.c, sync.h:

	prune dead SYNC_FAIL_ALL define

2015-05-17 15:07  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	don't make bogus attempts at enabling compression

	recycling server connections skips everything up to setting up the
	prefix (Path/NAMESPACE). "everything" should obviously include enabling
	compression, as that must be done at most once per connection.

2015-05-09 16:00  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac:

	bump version

2015-05-09 15:44  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	rename misnamed functions concerning sending imap commands

	cmd_submittable() => cmd_sendable()
	cancel_submitted_imap_cmds() => cancel_sent_imap_cmds()

	the sequence is exec -> submit -> send.

2015-05-09 17:18  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, socket.c, socket.h:

	ensure direct exit after calling back

	any structures may be invalid after callback invocation.

	this has the side effect that the socket write callback now returns
	void, like all other callbacks do.

2015-05-09 17:17  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, socket.c, socket.h:

	fix socket_write() recursion

	the synchronous writing to the socket would have typically invoked the
	write callback, which would flush further commands, thus recursing.

	we take the easy way out and make it fully asynchronous, i.e., no data
	is sent before (re-)entering the event loop.

	this also has the effect that socket_write() cannot fail any more, and
	any errors will be reported asynchronously. this is consistent with
	socket_read(), and produces cleaner code.

	this introduces a marginal performance regression: the maildir driver is
	synchronous, so all messages (which fit into memory) will be read before
	any data is sent. this is not considered relevant.

2015-05-09 15:12  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	fix #ifdefs around AuthMech & RequireCRAM

	these options don't depend on HAVE_LIBSSL.

2015-05-09 15:06  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	mask AUTHENTICATE PLAIN commands in error output as well

	amends bd0f3af5.

2015-05-02 16:59  Felix Janda <felix.janda@posteo.de>

	* configure.ac:

	Add configure option for zlib

2015-05-08 08:20  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, mbsync.1:

	add DisableExtension option to work around (server) bugs

2015-05-01 17:16  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_maildir.c, mbsync.1, mbsyncrc.sample, sync.c:

	support verbatim and real Maildir++ subfolder naming styles

	the legacy style is a poorly executed attempt at Maildir++, so introduce
	the latter for the sake of completeness. but most users will probably
	just want to use subfolders without any additional dots.

2015-05-01 15:29  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	make maildir_list_recurse() recursion less convoluted

	move the unconditional addition of INBOX out ouf the function.
	this makes it possible to move the folder check and addition to the
	listing before the recursion, which seems clearer.

2015-05-01 11:19  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	pass a maildir_store_conf_t to maildir_validate_path()

	casting early on makes the code clearer.

2015-05-01 18:19  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main.c:

	make flags in pattern debugging non-cumulative

2015-05-01 16:39  Oswald Buddenhagen <ossi@users.sf.net>

	* src/mbsync.1:

	use \fB and \fI consistently, take 2

	\fB means literal, while \fI means placeholder, value for placeholder,
	or emphasis.

2015-05-01 09:55  Oswald Buddenhagen <ossi@users.sf.net>

	* README, configure.ac:

	fix consistent misspelling of Berkeley

2015-05-01 09:48  Oswald Buddenhagen <ossi@users.sf.net>

	* README, configure.ac:

	the minimum required bdb version is in fact 4.1

	this is the one that introduced the transaction argument to db->open().

2015-05-01 09:45  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac:

	make the bdb check actually check for a linkable library

	it only checked whether the header is compilable.

	amends e1d0ea8a1.

2015-04-26 18:54  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, drv_imap.c, drv_maildir.c, main.c:

	make skipping of failed stores more thorough

	in the case of imap stores, the failure is bound to the server config,
	not just the store config.

	that means that the storage of the failure state needs to be private to
	the driver, accessible only through a function.

2015-04-06 14:49  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, mbsync.1, socket.c, socket.h:

	add socket timeout handling

2015-04-26 16:15  Oswald Buddenhagen <ossi@users.sf.net>

	* src/util.c:

	remove caching of current time

	it's too hard to reliably predict when invalidation will be necessary.

2015-04-26 16:34  Oswald Buddenhagen <ossi@users.sf.net>

	* src/util.c:

	don't get system time when dealing with null timers

	they fire immediately regardless of wall time, so we can save some
	pointless syscalls.

2015-04-26 10:07  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main.c:

	fix -DN not implying -Dn

2015-04-18 09:46  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	make it possible to nest maildir Path under Inbox

	simply make the code symmetrical to the inverse case.

	note that the result will be sort of awkward, as the folders under Path
	(and thus the subfolders of Inbox) don't start with a dot, while the
	subfolders of these folders do. this needs to be addressed separately.

2015-04-18 09:42  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	make handling of Inbox-in-Path nesting less obfuscated

	when we run into Inbox while listing Path, check whether Inbox is being
	listed anyway, and just skip it if so, instead of listing it right away
	and resetting LIST_INBOX (and thus having a calling order dependency).

2015-04-18 08:54  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	don't list IMAP Path under INBOX twice

	if NAMESPACE is "INBOX.", listing INBOX recursively will already include
	it.

	REFMAIL: 1890363108.1020695.1428757117731.JavaMail.yahoo@mail.yahoo.com

2015-04-13 07:17  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	fix uninitialized variable warning

	the returned UID is not used when trashing messages, but we still
	shouldn't just return an undefined value.

2015-04-11 18:06  Reimar Döffinger <Reimar.Doeffinger@gmx.de>

	* README, configure.ac, src/Makefile.am,
	  src/compat/Makefile.am, src/drv_maildir.c:

	Make Berkley DB an optional dependency.

	It doesn't seem necessary for any of the basic functionality.

	Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>

2015-04-09 08:05  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	fix SASL, take 2

	USER (the authorization identity) specifies whom to act for.
	AUTHNAME (the authentication identity) specifies who is acting (and
	thus whose PASS is being used).
	USER is derived from AUTHNAME if omitted, but apparently the
	GSS-API module automatically adds the REALM, which is not helpful.

	it appears to be common to set both USER and AUTHNAME to the same value,
	so let's just do it as well.

	REFMAIL: 20150407194807.GA1714@leeloo.kyriasis.com

2015-04-03 20:38  Dmitrij D. Czarkoff <czarkoff@gmail.com>

	* src/drv_maildir.c:

	fix crash in maildir_set_msg_flags()

	memcpy(3)'s behavior is undefined when source and destination addresses
	overlap, and it actually crashed on OpenBSD. use memmove() instead.

2015-04-03 12:03  Oswald Buddenhagen <ossi@users.sf.net>

	* Makefile.am:

	add cov-scan target

2015-04-03 11:24  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac:

	bump version

2015-03-30 12:52  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, mbsync.1:

	don't insert unnecessary linebreaks upon PassCmd invocation

	the PassCmd will be typically non-interactive (or it will use a gui
	password agent), so starting a new line just makes the progress counter
	uglier. so make it configurable and default to no line break.

2015-03-30 12:27  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main.c:

	fix crash when no mailboxes match Patterns

	filter_boxes() just returns a null pointer in this case.

	REFMAIL: 20150330121211.GA10315@venus.fritz.box

2015-03-30 10:59  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	fix SASL PLAIN for User != $USER

	REFMAIL: 87d29mysnx.fsf@ericabrahamsen.net

2015-03-26 17:09  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, main.c, mbsync.1:

	add debugging for main()

	so far, that's mostly mailbox listing

2015-03-23 07:42  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, drv_imap.c, drv_maildir.c, main.c, mbsync.1,
	  sync.c, util.c:

	revamp console output options

	- the old meaning of -V[V] was moved to -D{n|N}, as these are really
	  debugging options.
	- don't print the info messages by default; this can be re-enabled with
	  the -V switch, and is implied by most debug options (it was really
	  kind of stupid that verbose/debug operation disabled these).
	- the sync algo/state debugging can be separately enabled with -Ds now.

2015-03-28 16:26  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, drv_imap.c, main.c, mbsync.1, sync.c:

	make progress counters global

	which means they are now cumulative, and include channels and boxes.

2015-03-28 16:51  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main.c:

	pre-calculate channel and box lists (as far as possible)

	... instead of determining them on the fly, because
	- it enables early display of totals (to be used soon)
	- it enables re-use of the data (to be used at some point)
	- the code is less cryptic

	note that we leak the data created in main(), consistently with other
	configuration-related data.

2015-03-26 16:28  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main.c:

	don't claim that INBOX is absent even if it was not listed

	IMAP defines that INBOX is always present.

2015-03-26 16:27  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main.c:

	rework Pattern application

	instead of creating three lists of mailboxes (common, master, slave)
	and deriving the mailbox presence from the list being processed, create
	a single joined list which contains the presence information.
	additionally, the list is sorted alphabetically (with INBOX first),
	which is neater.

2015-03-26 16:16  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, util.c:

	static my_strndup() => extern nfstrndup()

2015-03-26 13:28  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	make sure that INBOX always exists

	makes the Maildir driver consistent with IMAP.

2015-03-23 19:16  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	don't refuse to strip Path just because it's INBOX/

	no ambiguity can result from this, so there is no reason to treat
	sub-folders of INBOX differently from any other namespace.

2015-03-23 17:05  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	mask AUTHENTICATE PLAIN commands in debug output

	they are almost as bad as LOGIN.

2015-03-22 12:30  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	remove double "Logging in ..." when using legacy LOGIN

2015-03-23 18:00  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main.c:

	fix out-of-Path INBOX never being matched by Patterns

	"(null)I" really doesn't cut it.

	amends cf0f32f8.

2015-03-22 10:44  Oswald Buddenhagen <ossi@users.sf.net>

	* src/mbsyncrc.sample:

	escape backslashes in PassCmd examples

	the config parser strips one level of backslash escapes.

2015-03-21 11:18  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	fix bogus "unexpected command continuation request"

	it helps if the code actually does what the comment above it claims.
	clarify it a bit, so i don't get stupid ideas again.

	This reverts commit cf6a7b4d182d2fe82f7371af9e5a857818f3d02d.

2015-03-07 16:46  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	fix chaining of COMPRESS invocation

	it was bound to the use of NAMESPACE, which made no sense at all.

2015-02-15 17:13  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, config.c, driver.h, drv_imap.c,
	  drv_maildir.c, main.c, mbsync.1, socket.c, socket.h, sync.c:

	soft-limit peak memory usage

	propagating many messages from a fast store (typically maildir or a
	local IMAP server) to a slow asynchronous store could cause gigabytes of
	data being buffered. avoid this by throttling fetches if the target
	context reports memory usage above a configurable limit.

	REFMAIL: 9737edb14457c71af4ed156c1be0ae59@mpcjanssen.nl

2015-02-15 11:48  Oswald Buddenhagen <ossi@users.sf.net>

	* src/config.c:

	complain about excess values supplied to options

2015-02-15 11:19  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.c:

	handle clean SSL connection shutdowns

	some servers actually bother to close down the SSL connection before
	closing the socket.

	this fixes the spurious "unhandled SSL error 6" messages.

	REFMAIL: 20150120114805.GA17586@leeloo.kyriasis.com

2015-02-15 11:15  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, socket.c, socket.h:

	refactor socket EOF handling

	handling EOF already at the socket level isn't a very good idea - it
	breaks the abstraction, and makes implementing sane semantics hard.

2015-02-14 13:03  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.c:

	fix crash on shutdown of compressed connection

	the callback may destroy the socket, so it is very unwise to use it for
	buffering the return value. use a temporary instead.

2015-02-14 12:30  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.c:

	handle clean shutdown of zlib stream

	the server can actually close the zlib stream before closing the socket,
	so we need to accept it.

	we don't do anything beyond that - the actual EOF will be signaled by
	the socket, and if the server (erroneously) sends more data, zlib will
	tell us about it.

	REFMAIL: 1423048708-975-1-git-send-email-alex.bennee@linaro.org

2015-02-15 10:39  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.c:

	don't try to flush if there is nothing to flush

	zlib reports Z_BUF_ERROR when a flush is attempted without any activity
	since the previous flush (if any). while this is harmless as such,
	discerning the condition from genuine errors would be much harder than
	avoiding the pointless flush in the first place.

	REFMAIL: eb5681612f17be777bc8d138d31dd6d6@mpcjanssen.nl

2015-02-15 10:38  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, drv_maildir.c:

	introduce and use pending_wakeup()

	so we don't need to peek into internal data structures.

2015-01-03 23:39  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, drv_imap.c, drv_maildir.c, main.c:

	deal sensibly with permanent errors

	don't retry dead Stores for every Channel.

	this also introduces a state for transient errors (specifically, connect
	failures), but this is currently unused.

2015-01-01 18:25  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	unify .isyncuidmap.db handling with that of .uidvalidity

	that is, open the database on demand when locking and close it again
	when unlocking.

2015-01-01 18:18  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	refactor maildir_set_uid() and maildir_store_uidval()

	the latter now handles both the db and the plaintext file, so the former
	can make use of it.

2015-01-01 17:00  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	rename some *uid*() => *uidval*() to better reflect their function

2015-01-01 15:49  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	lock .uidvalidity on demand

	a maildir re-scan doesn't need to lock it if it doesn't need to allocate
	any new uids.

2015-01-01 12:24  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	delay unlocking of .uidvalidity

	it's wasteful to re-lock all the time. instead, unlock in the background
	after 1-2 seconds of inactivity.

2014-12-29 01:08  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, driver.h, drv_imap.c, drv_maildir.c, main.c,
	  mbsync.1, sync.c, sync.h:

	add support for propagating folder deletions

2015-01-17 14:27  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	don't make intermediate directories proper maildirs

	"phantom" mailboxes waste time on syncing. furthermore, mutt's mailbox
	navigator provides no means to enter subfolders of maildirs.

2014-12-29 01:01  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	deal sensibly with incomplete maildir directories

	a directory is no mailbox unless it contains a cur/ subdir.
	but if that one is present, create new/ and tmp/ if they are missing.

	this makes it possible to resume interrupted maildir creations.

2014-12-29 01:00  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	factor out maildir_clear_tmp()

2014-12-30 14:16  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: main.c, sync.c, sync.h:

	supplement open_box() with box existence information from list_store()

	there is no point in trying to open a non-existing box before trying to
	create it.

2014-12-29 00:42  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, drv_imap.c, drv_maildir.c, sync.c:

	split create_box() off from open_box()

	this allows us to do something else than creating missing boxes
	depending on circumstances. hypothetically, that is.

2015-01-03 22:16  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	open the mailboxes after loading the sync state

	this allows us to react differently to a box'es absence depending on the
	state. hypothetically, so far.

2014-12-27 22:50  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	lock sync state lazily

	don't try to lock it until we actually read or write it.
	the idea is to not fail with SyncState * if we tried to load the state
	before selecting a non-existing mailbox. this is ok, because if the
	mailbox is missing, we obviously have no sync state pertaining to it,
	either.
	as a side effect, this allows simplifying an error path.

2014-12-27 22:39  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, drv_imap.c, drv_maildir.c, main.c, sync.c:

	split off open_box() from select_box()

	aka prepare_paths() reloaded. we'll need it in a moment.

2014-12-27 22:13  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	factor out {prepare,lock,save,load}_state()

2014-12-14 16:03  Oswald Buddenhagen <ossi@users.sf.net>

	* src/config.c:

	de-duplicate handling of box operation (create & expunge) options

	loops work just fine ...

2014-12-27 21:13  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, drv_imap.c, drv_maildir.c, main.c, sync.c:

	make some driver function names more descriptive

2014-12-14 11:36  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, drv_imap.c, drv_maildir.c, sync.c:

	rename driver::prepare_opts() => prepare_load()

	... and move it to the right place in the structure and fix the doc to
	not claim that it is called before select().

2014-12-13 17:29  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	disable use of LITERAL+ for payloads > 100k

	when LITERAL+ is used, the server has no chance for early rejection of
	messages. this means that the client can upload megabytes for nothing.
	so simply don't use LITERAL+ for big messages. of course this adds
	server roundtrips, but that's tough luck.

	the limit could be arguably higher than 100k (or even configurable).
	i set it to ~2 sec with my fairly average DSL line.

2014-12-13 17:01  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, socket.c, socket.h:

	fix handling of unsolicited BYE responses

	they can come in at any time, after which we must expect the connection
	to be closed (and not complain about it).

2014-12-13 16:57  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	fix treatment of untagged NO and BAD responses

	they aren't possible greeting responses. however, they are warning resp.
	error reports from the server, so print them accordingly.

2014-12-13 11:09  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac, src/Makefile.am, src/drv_imap.c, src/socket.c,
	  src/socket.h:

	added support for IMAP DEFLATE

	initial patch by Jesse Weaver <pianohacker@gmail.com>, but mostly
	rewritten by me.

2014-11-08 14:42  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: socket.c, socket.h:

	make socket writing buffered

	the primary objective is reducing the number of small SSL packets (which
	are always padded), but fewer syscalls in the non-SSL case should be
	good as well.

2014-10-26 20:10  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, socket.c, socket.h:

	vectorize socket_write()

	the objective is making the buffer code aware of the total size of a
	write in advance. this commit doesn't take advantage of that yet.

2014-11-30 18:51  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, util.c:

	remove support for faking notifications

	with the existence of timers, this is now superfluous.

2014-11-30 18:44  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: socket.c, socket.h:

	use null timer instead of faking a socket notification

2014-11-30 17:41  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: Makefile.am, common.h, tst_timers.c, util.c:

	add timers to mainloop

	they are called "wakeups", though, as timer_t already exists in time.h.

2014-11-29 18:15  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, socket.c, socket.h, util.c:

	change socket notifier design

	instead of keeping the structures in an opaque array (which was a shadow
	of the struct pollfd array if poll() was supported), make them directly
	addressable.

	this has the advantage that notifier-altering operations (mostly
	en-/disabling) don't need to look up the structure by file handle each
	time.
	on the downside, data locality in the main loop is worse.
	neither of these have any real effect on performance.

	note that the structures are not allocated separately, but embedded into
	the the parent structure (like sockets already were).

2014-12-07 11:51  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.c:

	factor out socket_open_internal()

2014-12-07 12:19  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: common.h, config.c, driver.h, drv_imap.c,
	  drv_maildir.c, sync.c, sync.h, util.c:

	introduce uchar, ushort & uint typedefs

2015-01-11 13:18  Oswald Buddenhagen <ossi@users.sf.net>

	* Makefile.am:

	skip merges during ChangeLog generation

2015-01-11 13:29  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, drv_imap.c, drv_maildir.c, sync.c:

	fix UID assignment with some non-UIDPLUS servers

	the seznam.cz IMAP server seems very eager to send UIDNEXT responses
	despite not supporting UIDPLUS. this doesn't appear to be a particularly
	sensible combination, but it's valid nonetheless.

	however, that means that we need to save the UIDNEXT value before we
	start storing messages, lest imap_find_new_msgs() will simply overlook
	them. we do that outside the driver, in an already present field - this
	actually makes the main path more consistent with the journal recovery
	path.

	analysis by Tomas Tintera <trosos@seznam.cz>.

	REFMAIL: 20141220215032.GA10115@kyvadlo.trosos.seznam.cz

2015-01-02 11:38  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	fix conditional for early failure in cancel_done()

2015-01-02 10:29  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main.c:

	don't leave 2nd store in limbo if opening 1st store fails synchronously

	we can't leave the store FRESH, as otherwise the error handling code
	will assume it is still being opened and will return to the main loop.
	depending on the config this would cause an immediate termination or an
	indefinite wait.

2014-10-26 21:03  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	remove stray CRLF from AUTHENTICATE continuations

	this re-introduces 6741bc94 (just a bit differently), thus effectively
	reverting fbfcfea5. i suppose this extra CRLF is needed by a broken
	CRAM-MD5 implementation of some server, which is why it was there in the
	original implementation as well. however, it breaks more pedantic
	non-broken servers. if somebody complains, we'll need to add a much
	more sophisticated hack.

2014-10-26 19:17  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.h:

	cleanup dead cram() prototype

2014-12-29 01:16  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	fix more memcmp() abuse

	amends 1217193fb and 4f383a807.

2014-11-08 12:50  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: socket.c, socket.h:

	fix acceptance of trusted SSL certs

	we should make no assumptions about the layout of OpenSSL's certificate
	store, in particular when they are wrong. so copy the interesting part
	instead of "deep-linking" into it.

	this code is uglier than it should be, but OpenSSL's extensive use of
	macros to manage data types would force us to include the ssl headers
	into our headers otherwise, which would be even uglier.

	REFMAIL: <545442CC.9020400@nodivisions.com>

2014-10-25 15:30  Oswald Buddenhagen <ossi@users.sf.net>

	* README, src/common.h, src/config.c, src/drv_maildir.c,
	  src/main.c, src/mbsync.1, src/sync.c:

	introduce FieldDelimiter and InfoDelimiter options

	... for windows fs compatibility.

	the maildir-specific InfoDelimiter inherits the global FieldDelimiter
	(which affects SyncState), based on the assumption that if the sync
	state is on a windows FS, the mailboxes certainly will be as well, while
	the inverse is not necessarily true (when running on unix, anyway).

	REFMAIL: <CA+m_8J1ynqAjHRJagvKt9sb31yz047Q7NH-ODRmHOKyfru8vtA@mail.gmail.com>

2014-10-25 13:06  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, sync.c:

	move orig_name out of store_t

	it's state specific to the synchronizer.

2014-07-27 16:41  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, socket.c:

	nuke home-grown CRAM-MD5 support

	it was obsoleted by SASL support.
	i deem the additional dependency acceptable when one wants the feature.

2014-07-27 16:41  Oswald Buddenhagen <ossi@users.sf.net>

	* README, configure.ac, src/Makefile.am, src/drv_imap.c,
	  src/mbsync.1:

	add SASL support

	patch initially by Jack Stone <jwjstone@fastmail.fm>,
	cleaned up by Jan Synacek <jsynacek@redhat.com>,
	... and then almost completely rewritten by me. ^^

2014-07-27 17:29  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	factor out ensure_user() and ensure_password()

2014-07-12 19:02  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, mbsync.1:

	rework authentication mechanism configuration

	RequireCRAM (another fairly stupid "use if available" option) is now
	deprecated. instead, the AuthMech option can be used to give a precise
	list of acceptable authentication mechanisms (which is currently "a bit"
	short). in particular, this allows *not* using CRAM-MD5 even if it's
	available.

2014-07-27 13:42  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, mbsync.1, socket.c, socket.h:

	make it possible to disable usage of system cert store

2014-07-27 16:10  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: mbsync.1, socket.c:

	require Host if SSL is used despite Tunnel

2014-07-27 13:12  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: socket.c, socket.h:

	make SSL certificate verification less arcane

	instead of using a callback which messes with the certificate chain
	verification, simply let OpenSSL ignore errors during that phase and
	check the result only afterwards.

2014-07-12 18:35  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, config.h, drv_imap.c, mbsync.1, socket.c,
	  socket.h:

	re-design SSL/TLS configuration

	the combinations of the various options made quite a mess. additionally,
	'RequireSSL no' is inherently insecure - "use SSL if available" is plain
	stupid.

	the old options are still accepted, but will elicit a warning.

2014-07-06 08:06  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, socket.c, socket.h:

	move use_imaps out of server_conf_t

	it doesn't belong there - it's a property of imap_server_conf_t.
	the port setup is now done while reading the config.

	this makes socket.[hc] imap-agnostic.

2014-07-12 11:50  Oswald Buddenhagen <ossi@users.sf.net>

	* src/compat/: isync.1, main.c:

	deprecate the compat wrapper

	after a decade, it's about time to phase it out.

2014-07-05 14:37  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac:

	bump version

2014-10-04 16:26  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: driver.h, drv_imap.c, drv_maildir.c, sync.c:

	fix memory management of current mailbox name

	it was a stupid idea to store the pointer to a variable we need to
	dispose in a structure which has its own lifetime.

2014-10-04 15:07  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac, src/common.h, src/compat/config.c,
	  src/compat/isync.h, src/compat/util.c, src/drv_imap.c,
	  src/drv_maildir.c, src/main.c, src/sync.c, src/util.c:

	stop abusing memcmp()

	memcmp() is unfortunately not guaranteed to read forward byte-by-byte,
	which means that the clever use as a strncmp() without the pointless
	strlen()s is not permitted, and can actually misbehave with
	SSE-optimized string functions.

	so implement proper equals() and starts_with() functions. as a bonus,
	the calls are less cryptic.

2014-10-04 11:12  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, mbsync.1:

	permit IMAP Stores with explicitly empty Path

	this is useful if the server sends an unhelpful NAMESPACE like
	"INBOX." (which precludes clean use of Patterns with the real INBOX).

2014-10-04 13:43  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	don't attempt to filter LIST response if there is no Path

	we won't filter anything in that case anyway.

2014-10-04 10:16  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, drv_imap.c, drv_maildir.c:

	permit Maildir Stores without a Path

	it is perfectly reasonable to have a Store which has only an Inbox.

2014-10-04 13:37  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	use resolved Path for initial filtering of LIST response

	otherwise we'd ignore NAMESPACE, and funny things could happen.

2014-10-04 15:30  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	consider unexpected structure of NAMESPACE fatal

2014-10-04 09:43  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	ignore INBOX only in Path itself, not its subfolders

	a box foo/INBOX cannot be mistaken for the INBOX, so there is no point
	in filtering these out.

2014-07-12 12:07  Oswald Buddenhagen <ossi@users.sf.net>

	* src/mbsync.1:

	use \fB and \fI consistently

	notably, the docu for the Sync option had it mixed up in the
	description.

2014-07-05 21:11  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	complain about RequireSSL with no SSL versions enabled

2014-07-05 21:10  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	actually use STARTTLS if only TLSv1.1 or TLSv1.2 is enabled

2014-07-05 21:03  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	clarify error message about missing connection details

2014-07-05 21:02  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	make store/account error messages less redundant

	this will become more relevant when more are added.

2014-07-05 20:53  Oswald Buddenhagen <ossi@users.sf.net>

	* src/mbsync.1:

	clarify effect of Tunnel on Host and Port

2014-07-05 20:52  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, mbsync.1:

	don't ignore RequireSSL for PREAUTHenticated connections

	such connections don't support STARTTLS. that is reasonable, as whatever
	makes the connection preauthenticated (typically a Tunnel used to launch
	imapd via a shell login) must already rely on the connection's security.
	consequently, we would not try to use STARTTLS with such connections.
	unfortunately, we'd also skip the RequireSSL check as a side effect.

	this means that a rogue server (via a MITM attack) could simply offer a
	preauthenticated connection to make us not use SSL, and thus bypass
	server authentication. as a result, we could send potentially sensitive
	data to the attacker:
	- with Patterns used, we would send a LIST command which reveals the
	  remote Path setting. this isn't very useful to an attacker. also, IMAP
	  Accounts usually rely on the server-provided NAMESPACE to start with.
	- with Create enabled for the remote Store, we would upload messages
	  from newly appeared local folders. this isn't a very likely situation,
	  unless the attacker manages to convince the victim to move/copy
	  interesting mails to a new folder right before the attack.
	- with Expunge enabled for the local Store, previously synchronized
	  folders would be wiped. however, this would require the attacker to
	  know the correct UIDVALIDITY of each remote folder, which would
	  require incredible luck or convincing the victim to disclose them.
	  the first mismatch would likely tip off the victim.

	in practice, someone with the level of technical and social engineering
	skills required for this attack would very likely find more attractive
	attack vectors. therefore, i don't consider this a particularly serious
	issue.

	configurations with UseIMAPS enabled or using a secure Tunnel were not
	affected to start with.

	a side effect of this fix is that most users of Tunnel will now need to
	explicitly set RequireSSL to false.
	an alternative approach would be defaulting all SSL-related settings to
	off when Tunnel is used. this would be too invasive for a patch release,
	but i'll consider it for 1.2.

	see also CVE-2014-2567 for the Trojita MUA.

2014-07-05 20:54  Oswald Buddenhagen <ossi@users.sf.net>

	* .gitignore:

	ignore coverity state directory

2014-07-02 06:47  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	initialize store_t::name

	the field is marked foreign (for the drivers), so a recycled store may
	contain an old pointer in it. that would make our error path crash.

	REFMAIL: CAF_KswU7aBS7unnK+rdZy1PG_8SZUAW=tcg75HixDLLE0w3Lhw@mail.gmail.com

2014-07-02 06:40  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	actually print the faulty mailbox name, not some garbage

	REFMAIL: CAF_KswU7aBS7unnK+rdZy1PG_8SZUAW=tcg75HixDLLE0w3Lhw@mail.gmail.com

2014-06-28 12:27  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac:

	bump version

2014-06-28 09:58  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	detect inconsistent state of highest assigned UID

	the highest assigned UID must always be at least as high as the highest
	actually found UID, as otherwise we'd hand out duplicate UIDs at some
	point. also, getting into such a state in the first place indicates some
	potentially serious trouble, or at least external interference (e.g.,
	moving/copying a message from another folder without giving it a
	pristine filename).

	REFMAIL: 20140626211831.GA11590@sie.protva.ru

2014-06-28 09:04  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	zero-terminate imap literals

	now that we properly support literals for strings, we must expect that
	the consumer code will use them as strings.

	amends fc77feacc.

	discovered by Armands Liepins <armandsl@gmail.com>

	REFMAIL: CAF_KswXoxdm7KXnWW4b_1odf=XsE4qRqRN4AsecwcPF1d+dSTA@mail.gmail.com

2014-04-13 15:07  Oswald Buddenhagen <ossi@users.sf.net>

	* src/mbsync.1:

	don't lie about the default of User

	unlike the isync wrapper, mbsync does not have a default for the IMAP
	user. the remote user seldomly matches the local one, so "forwarding" it
	is more confusing than helpful.

	CCMAIL: 744389@bugs.debian.org

2014-04-12 17:02  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	don't forget to reset message counts when skipping scan

	amends b6949c64d2.

	CCMAIL: 744259@bugs.debian.org

2014-04-12 17:00  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	remove apparently pointless resetting of recent message count

	past this point, it's not used for anything anyway.

2014-04-12 16:59  Oswald Buddenhagen <ossi@users.sf.net>

	* src/compat/convert.c:

	error-check renaming of uid mapping database

	for pedantry.

	found by coverity.

2014-04-12 16:34  Oswald Buddenhagen <ossi@users.sf.net>

	* src/compat/convert.c:

	error-check reading of old uidvalidity and maxuid files

	found by coverity.

2014-04-12 16:31  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	error-check committing of sync state

	a failure here is rather unlikely, but let's be pedantic.
	a failure is not fatal (we'll just enter the journal replay path next
	time), so only print warnings.

	found by coverity.

2014-04-12 16:30  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	better error messages for sync state and journal related errors

	we can make perfectly good use of errno here.

2014-04-12 16:28  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	remove pointless/counterproductive "Disk full?" error message suffixes

	the affected functions will set errno to ENOSPC when necessary.

2014-04-12 14:56  Oswald Buddenhagen <ossi@users.sf.net>

	* src/compat/config.c:

	fix "inverse copy&pasto" in account labeling code

	the code was copied and the original adjusted ... but not quite
	completely.
	this means that clashing server names never really worked since - not
	that i would have expected this to be a particularly common
	configuration to start with. :D

	also added comments explaining why there are two implementations of the
	same thing.

	amends aea4be19e3 (anno 2006).

	found by coverity.

2014-04-12 14:06  Oswald Buddenhagen <ossi@users.sf.net>

	* src/config.c:

	assert !where implying !pseudo

	to help poor coverity.

2014-04-12 13:28  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	don't crash in message expiration debug print

	we would try to print the uids from the non-existing srec of unpaired
	messages while preparing expiration.
	this would happen only if a) MaxMessages was configured and b) new
	messages appeared on the slave but we were not pushing, so it's a bit of
	a corner case.

	found by coverity.

2014-04-12 13:16  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main.c:

	fix segfault on passing --{create,expunge}-{master,slave}

	stupid copy&pasto.

	found by coverity.

2014-04-12 13:02  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	don't crash on malformed response code

	this would happen in the absurd corner case that the response code is
	properly terminated with a closing bracket, but the atom itself is an
	unterminated double-quoted string.

	NOT found by coverity.

2014-04-12 12:58  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	don't crash on truncated LIST response

	found by coverity.

2014-04-12 11:08  Oswald Buddenhagen <ossi@users.sf.net>

	* src/compat/main.c:

	remove pointless pointer assignment

2014-04-12 11:03  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_maildir.c, mdconvert.c:

	fix hypothetical buffer overflows

	if something managed to make the maildir .uidvalidity files big enough
	(possible only by appending garbage or scrambling them alltogether), we
	would overflow the read buffer by one when appending the terminating
	null.
	this is not expected to have any real-world impact.

	found by coverity.

2014-04-12 10:46  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_maildir.c, mdconvert.c:

	close a bunch of fd leaks in error paths

	found by coverity.

2014-03-19 09:27  Oswald Buddenhagen <ossi@users.sf.net>

	* src/util.c:

	actually use prime numbers for all hash bucket sizes

	for some reason lost in history, the prime_deltas were actually wrong,
	leading to using composite numbers.
	the right sequence is available at http://oeis.org/A092131.

2014-03-19 09:09  Oswald Buddenhagen <ossi@users.sf.net>

	* src/config.c:

	fix zero MaxSize override in Channels

	REFMAIL: CA+Tk8fzb9i9LrC_k4G978c5XR5urNz_s0fpOn_-6EsdrBnEzSQ@mail.gmail.com

2014-03-10 10:57  Oswald Buddenhagen <ossi@users.sf.net>

	* src/compat/: config.c, isync.h, util.c:

	rework maildir store mapping

	the trivial approach of having "home" and "root" stores produced ugly
	results, and totally failed with the introduction of nested folder
	handling.
	instead, create a store per local directory, just as one would manually.

	CCMAIL: 737708@bugs.debian.org

2014-03-10 10:57  Oswald Buddenhagen <ossi@users.sf.net>

	* src/compat/config.c:

	don't needlessly quote strings

2014-03-10 10:54  Oswald Buddenhagen <ossi@users.sf.net>

	* src/compat/main.c:

	don't needlessly spell out INBOX

2014-03-09 15:38  Oswald Buddenhagen <ossi@users.sf.net>

	* src/compat/config.c:

	write Sync and Expunge to global section if applicable

	makes for leaner Channel sections.

	note: the global delete and expunge variables exist so the command line
	can override the config file despite the otherwise backwards behavior.

2014-03-09 14:56  Oswald Buddenhagen <ossi@users.sf.net>

	* src/compat/config.c:

	don't bother checking impossible condition

	the config readear already verified that at least host or tunnel are
	set.

2014-02-08 12:21  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	fix crash on store without prior fetch with non-UIDPLUS servers

	we'd never initialize the message list append pointer, so
	imap_find_new_msgs()'s FETCH would go awry.

	REFMAIL: <20140207101719.GB17125@mac.home>

2014-02-02 11:24  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.c:

	remove pointless use of AI_V4MAPPED flag

	this flag is ineffective if ai_family is not explicitly AF_INET6.
	on top of that, attempting to use it breaks on FreeBSD.

2014-01-25 12:19  Oswald Buddenhagen <ossi@users.sf.net>

	* src/mbsync.1:

	fix typos

2014-01-25 10:34  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	don't error out if we don't get an X-TUID header

	the BODY[] item in the FETCH response corresponds to what we requested,
	and its presence doesn't imply that it actually contains anything useful
	- new messages may appear in the mailbox in addition to those we stored
	ourselves, and these will obviously have no TUID.

2014-01-02 19:50  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac, src/common.h, src/drv_imap.c, src/util.c:

	make date parsing portable, take 2

	the global timezone variable is glibc-specific.
	so use timegm() instead of mktime() for the conversion.
	as that is specific to the BSDs and glibc, provide a fallback.
	amends 62a6099.

2014-01-02 18:36  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_maildir.c, sync.c:

	fix _POSIX_SYNCHRONIZED_IO usage

	it can be -1 for unsupported, or 0 for runtime detection (which we don't
	do).

2014-01-02 20:08  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac:

	bump version

2013-12-08 21:29  Oswald Buddenhagen <ossi@users.sf.net>

	* README, src/mbsyncrc.sample:

	pre-release doc updates

2013-12-14 11:37  Oswald Buddenhagen <ossi@users.sf.net>

	* src/mbsync.1:

	elaborate on expunging and trashing

2013-12-13 18:07  Oswald Buddenhagen <ossi@users.sf.net>

	* src/mbsync.1:

	clarify wording in MapInbox doc

2013-12-15 11:46  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	avoid array underflow in IMAP LIST .lock workaround

	suggested by Mark Wielaard <mark@klomp.org>.

	fwiw, the workaround really is still necessary with panda imap ...

2013-12-13 14:36  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	MaxMessages: ignore entries with no master while calculating bulk fetch

2013-12-11 15:29  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	adjust comments to new reality

2013-12-11 15:25  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	ensure sequencing of message propagation and store closing

	by putting the message propagation last, d3f634702 uncovered a
	long-standing problem: we might have closed the source store before all
	messages were propagated from it.

2013-12-11 15:13  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	fix error paths wrt sync drivers, take 3

	msgs_copied() was not checked at all, and msgs_flags_set() was doing it
	wrong (sync_close() was not checked).

	instead of trying to fix/extend the msgs_flags_set() model (ref-counting
	and cancelation checking in lower-level functions, and return values to
	propagate the status), place the refs/derefs around higher-level scopes
	and do the checking only there. this is effectively simpler, and does
	away with some obscure macros.

2013-12-11 13:30  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	don't use UID EXPUNGE unless trashing

	a simple CLOSE is way more efficient, so use it if no adverse effects
	can come from it.

2013-12-08 19:46  Oswald Buddenhagen <ossi@users.sf.net>

	* .gitignore, configure.ac, src/Makefile.am, src/common.h,
	  src/compat/isync.h, src/config.c, src/config.h, src/driver.c,
	  src/driver.h, src/drv_imap.c, src/drv_maildir.c, src/main.c,
	  src/mdconvert.c, src/socket.c, src/socket.h, src/sync.c,
	  src/sync.h, src/util.c:

	reshuffle sources a bit

	split header and move some code to more logical places.

2013-12-08 15:37  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, drv_maildir.c, isync.h, main.c:

	tag verbose output when channel links two verbose stores

	otherwise it's pure guesswork to assign the output to particular stores.

2013-12-08 15:32  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, socket.c:

	move verbose socket logging out of socket driver

	the way it's used, it's more of a high-level function.

2013-12-08 14:49  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, drv_maildir.c, isync.h, main.c:

	remove own_store() function from driver model

	the drivers which support it can abstract it inside open_store() just
	fine.

2013-12-08 14:11  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	make use of IMAP MOVE extension

	the Maildir driver is always exposing behavior equivalent to this - it's
	more efficient.

2013-12-08 09:48  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	don't check for INBOX more than necessary

2013-12-08 09:44  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	fix listing of nested maildir mailboxes

2013-12-08 08:49  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: main.c, mbsync.1, mbsyncrc.sample:

	allow prefixes to Patterns

	this makes it possible to "rename" a "namespace" while syncing.

2013-12-08 08:51  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main.c:

	less spaghetti

2013-12-07 16:24  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main.c:

	factor out sync_listed_boxes()

2013-12-07 15:41  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: main.c, mbsync.1:

	refuse box list overrides if Channel has no Patterns

	as the named boxes are the same on both sides, they logically make
	sense only when the channel is in that mode anyway, which is the case
	when using patterns.

2013-12-07 15:11  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: isync.h, main.c, util.c:

	treat manually specified box list the same as one coming from Patterns

2013-12-01 16:57  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.c:

	make host resolution error messages more useful in non-ipv6 builds

2013-12-01 16:45  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	avoid useless delay after creating maildir box

	we would see the recent timestamp of the creation and conclude that
	something is going on, so we'd wait. this is obviously nonsense.
	as we know that a freshly created mailbox is empty, simply skip the
	message scan alltogether.

2013-11-02 20:42  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, drv_maildir.c, isync.h, mbsync.1,
	  run-tests.pl, sync.c:

	reduce FSync option to a boolean

	there is no use for Thorough mode any more, so simplify the
	configuration.

2013-11-02 20:41  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	don't fsync after logging every TUID

	as we now don't actually start propagating new messages until all TUIDs
	have been generated, it's sufficient to sync just once. this makes it
	a cheap operation, so we can do it at SYNC_NORMAL level already.

2013-11-24 19:26  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, isync.h, mbsync.1, run-tests.pl, sync.c:

	add ExpireUnread option

2013-11-24 18:39  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, mbsync.1:

	make it possible to specify CopyArrivalDate and MaxMessages globally

	sneaky change on the side: the wording of the man page is changed from
	"outside any section" to "before any section" to get global options.
	this is not entirely true ... the previously existing options behave as
	before, while the two newcomers actually affect subsequent channels.

2013-11-24 18:32  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, isync.h, main.c, sync.c:

	replace global_* with a channel_conf_t instance

	this makes the (growing) list of getopt_helper()'s parameters
	manageable. the few wasted bytes are worth it.

2013-11-24 18:55  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, isync.h, main.c:

	do not unnecessarily use bitfields

	they don't save much (if any) space in our usage, while they make the
	machine code more bloated and slow.

2013-11-24 17:26  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	move handling of new messages after that of old ones

	i.e., move it back. whatever the original reason was, it's now gone.

	this order is way more natural, which allows us to remove the osrecadd
	and S_DONE hacks.

2013-11-04 08:54  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	verify idempotence of all sync operations

2013-11-30 12:03  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: run-tests.pl, sync.c:

	make MaxMessages work for new mails as well

	this helps enormously on the first sync of a 100k message box with a
	limit of 1k messages. it also happens to make the syncing idempotent.

	in a few conditionals we now explicitly test for max_messages being
	enabled, not smaxxuid != 0, as after the initial fetch with no important
	messages smaxxuid is zero, but we still have to skip over 99k messages
	in the above case.

2013-11-23 14:55  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	delay propagation of new messages

	previous sequence:
	  examine & propagate new => examine old => propagate old
	new sequence:
	  examine new => examine old => propagate new => propagate old

	this alone does not buy us much ...

2013-11-02 18:33  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	make message propagation recording less magic

	assign the sync record to the source message asap, and later on rely
	on a more explicit condition than not doing so.

2013-11-02 19:47  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	log maxuid bumping less aggressively

	we can bump the internal variable whereever convenient, but we cannot
	log it until we know that all messages were copied, as otherwise we
	could miss some new messages after an interruption. with the new
	approach, interruption would merely cause some additonal traffic.

2013-11-17 16:36  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	document message expiration transactions

2013-11-24 14:58  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	propagate deletions with other flag changes

	less code duplication, more logical order of issued driver commands
	(especially after the next commit), and the "side effect" of letting the
	message expiration code see those deletions if they are asynchronous.

2013-11-17 10:23  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	don't delay loading master even if messages were expired

	the delay optimized the corner case of previously important but now
	expired messages on the slave disappearing, either through an external
	expunge or after a journal replay. no point in pessimizing the common
	case.

2013-11-17 08:06  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: run-tests.pl, sync.c:

	remove cleanup of expired entries during setup of master load

	the removed code would only ever trigger if a) we were after a journal
	replay or b) something external expunged the expired messages - both are
	corner cases not worth the extra code.
	however, this means that the syncing code further down now needs to take
	care of these zombies.
	in the end, the normal cleanup will take care of all expired entries,
	new and old.

2013-11-24 18:50  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	micro-optimization/-clarification: swap condition order

2013-11-23 11:01  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	make message counting in expiration code less confusing

2013-11-10 18:57  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	count unread messages like flagged messages when expiring

	that is, don't count them towards the total only below the cut-off
	point. making them extend the working set even though they are inside it
	is counterintuitive.

2013-11-09 10:25  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	use post-sync "seen" flag to determine expirability

	otherwise it wouldn't be idempotent.

2013-11-08 11:05  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: compat/isync.1, sync.c:

	don't protect recent messages from MaxMessages

	while maildir has a clearly defined meaning of "recent" and for example
	mutt handles it graciously, IMAP's definition is fubared to the point
	that some servers (for example gmail) simply refuse to support it.
	for symmetry reasons it is best to pretend that it doesn't exist at all.
	it doesn't seem too useful anyway (the user can simply mark the messages
	as read to allow pruning).
	and last but not least, the man page of mbsync says nothing about
	"recent", only "unread". unlike the isync man page, though.

2013-11-23 11:22  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	always get slave flags when we are expiring

	even if we are not propagating new messages, the appearance of new
	messages on the slave can lead to expiring older messages. for that, we
	need to know their importance, and thus flags.

	the alternative would be not doing an expiration run when not fetching
	new messages, but that would mean more conditionals all over the place.
	as the decision is somewhat arbitrary, just do the simpler thing.

2013-11-16 16:59  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	do not trash expired messages

	we are not actually deleting them, so there is no point in saving them
	in the trash.

2013-11-16 12:25  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: run-tests.pl, sync.c:

	make sync state header format less obscure

	the header is not space-critical, so use proper name-value pairs.
	this has the additional advantage that subsequent format changes can be
	done much easier.

2013-11-16 12:21  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	make state loading in showstate() similar to ckstate()

2013-11-09 12:06  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	take configs out of target state defs

	cleaner and less duplication

2013-11-16 12:41  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	more precise failure reporting

2013-11-03 19:17  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	make it possible to run only selected tests

2013-11-09 10:42  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	set srec->msg[] when finding messages by tuid

	otherwise we would propagate phantom deletions.

	this affected only sync runs after an interruption while storing
	messages, so it went (mostly?) unnoticed.

2013-11-09 10:41  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	remove pointless assignment

	we already know that tmsg->srec is null at this point.

2013-11-02 22:32  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	assert no stray TUIDs

2013-11-30 14:07  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	initialize struct tm

	strptime() does not initialize at least tm_isdst, which leads to an
	uninited value reference in mktime().

2013-11-09 13:35  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, main.c:

	make use of strptime() portable

	it does not (officially) support the %z conversion, so re-implement that
	part by hand.

2013-11-09 12:53  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	fix compilation with older gcc versions

	the warning suppression pragma within function scope is apparently a new
	thing.
	as i don't want to disable the check for the entire function (even if
	this currently would make no difference), just use a wrapper function
	to suppress the format string check.

2013-11-09 12:50  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac:

	fix strftime() %z conversion specifier check

	only glibc does something sane with gmtime()+strftime(). on bsd (incl.
	mac os), strftime() can be used only with localtime().

2013-11-06 07:40  Oswald Buddenhagen <ossi@users.sf.net>

	* .gitignore:

	ignore automake's "compile" script

2013-11-06 07:37  Oswald Buddenhagen <ossi@users.sf.net>

	* autogen.sh:

	use autoreconf instead of calling separate tools

	this has been the correct way since a long time.

	Pointed-out-by: Felipe Contreras <felipe.contreras@gmail.com>

2013-11-02 19:06  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: isync.h, main.c, run-tests.pl, sync.c:

	add/fix comments and improve debug messages

2013-11-02 19:02  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	simplify condition

	... and document the cases.

2013-11-02 18:39  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	micro-optimization/-clarification

2013-10-26 09:44  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	move initializations for clarity

2013-05-20 16:54  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	MaxMessages: make condition exactly symmetrical to condition below

2013-05-20 16:53  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	rewrite condition for readability and consistency

2013-11-02 14:04  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	remove assumption about value of M constant

2013-11-02 11:57  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	fix enum abuse

	amends 9c86ec344.

	S_FIND was for the sync record status field. it has no business in the
	sync vars status fields. its value coincided with ST_SELECTED, which
	luckily only means that we always tried to match up TUIDs even if there
	was nothing to do.

	the need for TUID matching arises in two mostly independent
	circumstances, so add two separate flags ST_FIND_{OLD,NEW}.

2013-11-03 19:20  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	create unseen messages in /new/

	seen messages still go to /cur/.
	this is consistent with the actual maildir driver.

2013-11-03 11:59  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	be a bit more verbose

2013-11-03 11:59  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	properly handle unexpected exit while replaying journal

2013-11-03 11:49  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	ensure that the journal replay pass really does nothing

2013-11-02 15:43  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	sort messages by serial number instead of UID in box dumper

	the input data is sorted that way, so it's easier to compare.

2013-11-02 14:42  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	fix error message in sync state dumper

2013-09-25 15:13  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	deal with messages disappearing between being listed and fetched

2013-09-25 18:56  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, mbsync.1:

	support backslash-escaping in the config file

	note that no attempt is made at making this work in the compat wrapper.

2013-09-25 18:55  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	support backslashes and quotes in quoted IMAP strings

	the RFCs require it - well hidden in the BNF at the bottom.

	patch somewhat inspired by "guns" <self@sungpae.com>.

2013-09-25 16:53  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	make next_arg() more readable & efficient

2013-09-01 15:35  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac, src/isync.h, src/socket.c:

	IPv6 support

	inspired by a patch by "Todd T. Fries" <todd@fries.net>.

2013-09-01 14:32  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: isync.h, socket.c:

	support multi-homed servers

2013-08-03 13:10  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, drv_imap.c, isync.h, main.c, mbsync.1,
	  sync.c, util.c:

	support multi-character path separators

	this applies to both the IMAP PathDelimiter (which is needed by Lotus
	Domino), as well as the Flatten-ed separators.

2013-07-27 16:46  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	CHECK before FETCH after STORE

	m$ exchange does not seem to update the index in time otherwise.

2013-07-28 13:55  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.ac, src/config.c, src/drv_imap.c,
	  src/drv_maildir.c, src/isync.h, src/mbsync.1, src/sync.c:

	added sync support for the arrival date of messages

	initial patch by Marc Hoersken <info@marc-hoersken.de>

2013-07-27 18:17  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	warn if we cannot find some messages by TUID

2013-07-27 16:44  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_maildir.c, sync.c:

	make better use of ATTR_UNUSED

2013-07-27 13:35  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	be somewhat stricter about the LIST response syntax

	the first token *must* be a list.

2013-07-27 13:32  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	allow the mailbox names in LIST responses to be literals

	Lotus Domino seems to send them like that.

2013-07-27 12:31  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	make parse_list() callback based

	this allows us to parse IMAP literals ({}) in every list.

2013-07-27 08:37  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, mbsync.1, mbsyncrc.sample:

	add PassCmd option to query IMAP password dynamically

	inspired by patches by
	Aurélien Francillon <aurelien.francillon@eurecom.fr>,
	Martin Stenberg <martin@gnutiken.se> and
	sbfnk@users.sf.net.

2013-05-09 16:51  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	don't unnecessarily use continue

2013-05-11 08:12  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, sync.c:

	use INT_MAX instead of zero for "no size limit"

	this simplifies the actual conditions

2013-04-20 14:57  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, drv_maildir.c, mbsync.1, socket.c, sync.c:

	update copyrights

2013-04-13 17:05  Oswald Buddenhagen <ossi@users.sf.net>

	* src/mbsync.1:

	man page fixups

2013-04-13 17:05  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: main.c, mbsync.1:

	don't let wildcards match INBOX, unless it lives under Path

	it's counter-intuitive to have '*' match the (always present) INBOX
	when the rest of the mailboxes lives in a different namespace.

2013-04-13 17:25  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	always list INBOX when asked for it

	it's there even if it's not there. says IMAP. no need to contradict.

2013-04-01 10:20  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	split maildir_list_part()

	the boolean argument switched two entirely separate functions.

2013-04-01 10:30  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	remove some temporaries in maildir_list_part()

2013-04-13 08:47  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.c:

	fix CRAM-MD5 authentication

	the decoded challenge may be padded, so we really need to use strlen()
	rather than just the decoded length.

2013-04-13 08:50  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.c:

	more consistency in char signedness

2013-04-07 15:20  Felipe Contreras <felipe.contreras@gmail.com>

	* src/drv_maildir.c:

	maildir: fix trash path double-free

	It should be freed at the very end.

	Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>

2013-04-07 14:53  Felipe Contreras <felipe.contreras@gmail.com>

	* configure.ac:

	Fix build with recent autoconf and modernize configure.ac

	configure.ac:2: warning: macro 'AM_CONFIG_HEADERS' not found in library
	configure.ac:7: error: 'AM_PROG_CC_STDC': this macro is obsolete.
	    You should simply use the 'AC_PROG_CC' macro instead.
	    Also, your code should no longer depend upon 'am_cv_prog_cc_stdc',
	    but upon 'ac_cv_prog_cc_stdc'.
	configure.ac:3: warning: AM_INIT_AUTOMAKE: two- and three-arguments

	Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>

2013-04-07 10:42  Felipe Contreras <felipe.contreras@gmail.com>

	* configure.ac:

	Rename configure.in to the modern equivalent

	Fixes:

	 aclocal: warning: autoconf input should be named 'configure.ac', not 'configure.in'

	Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>

2013-04-07 14:54  Oswald Buddenhagen <ossi@users.sf.net>

	* src/mbsync.1:

	discourage use of MapInbox

2013-03-30 09:10  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	don't try to fetch status of minus one message

	this would happen if we were trying to find newly pushed messages, but
	none actually arrived.
	as imap's ranges are not ordered, this would actually fetch one message.

2013-03-30 15:27  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: run-tests.pl, sync.c:

	don't record newuid in the sync state

	this value is only ever used to find just pushed messages by TUID, so we
	can simply use the UIDNEXT value from before we started pushing - and of
	course, we need to record that in the journal. it makes no sense to log
	the new value after completing a search, as there won't be a next search
	before we push the next messages.

2013-03-30 08:38  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	rename sync_vars_t::uidnext => newuid & fix comment

	the purpose of this variable is to hold the UIDNEXT value from before
	we started pushing new messages, i.e., the minimal uid we can expect
	them to have.

2013-03-30 13:14  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, mbsync.1, util.c:

	make paths relative to CWD, after all

	the test suite actually relies on it. it would be possible to adjust it,
	but there is not much reason to make paths relative to HOME (as we
	support convenient tilde expansion). so use the least invasive approach,
	which is simply the old behavior. adjust the documentation accordingly.

	This reverts commit da5ce5d8f42a15a2842d6d14043452f1a7892a0a.

2013-03-29 17:22  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.c:

	improve socket error reporting

	always use getsockopt() to query the meaning of POLLERR, rather than
	reporting "Unidentified socket error".
	this is unlikely to have any effect when using select(), as that one
	pretty much never signals exceptional conditions.

2013-03-29 16:51  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.c:

	factor out socket_connect_failed()

2013-03-29 17:11  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.c:

	improve socket connect() error reporting with poll()

	turns out that poll() may (and on linux does) signal POLLERR on
	connection failure. this is unlike select(), which is specified to
	signal write readiness in every case.
	consequently, check whether we are connecting before checking for
	POLLERR.

2013-03-29 15:00  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: isync.h, main.c:

	introduce -DC option to only install a crash handler

2013-03-24 13:46  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.in:

	don't claim that we are looking for exactly bdb 4.2

2013-03-24 12:09  Oswald Buddenhagen <ossi@users.sf.net>

	* src/mbsync.1:

	match flag names in man page

	"Full" is an alias for "All", but let's stick to one.

2013-03-24 10:10  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, util.c:

	make path expansion match docu: paths are relative to ~

	the current behavior of being relative to the current directory sort of
	makes no sense, and contradicts the docu.

2013-03-24 10:10  Oswald Buddenhagen <ossi@users.sf.net>

	* src/compat/: isync.1, main.c:

	disable SSLv2 by default in the wrapper as well

2013-03-23 14:07  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	downcast time_t to long for printing

	time_t may be long long. to keep the sprintf format strings simple, just
	downcast - this is not going to be a problem for the next 30 years, and
	until then long will be 64-bit everywhere anyway.

	suggested 3.5 years ago by Antoine Reilles <tonio@NetBSD.org>.

2013-03-23 08:59  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	fix cram-md5 authentication

	we need to send a newline after the response for imap to grok it.

2013-03-23 09:34  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	fix crashes in imap_open_store() error paths

	it's not a good idea to invoke imap_open_store_bail() twice, either ...

2013-03-17 13:32  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.c:

	fix crash in ssl connection error path

	not a good idea to invoke the callback twice ...

2013-03-17 11:41  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: isync.h, mbsync.1, socket.c:

	rewrite SSL certificate verification. again.

	leave all the hard work to OpenSSL. this has several consequences:
	- certificate chain validation actually works instead of throwing
	  around error 20
	- the interactive approval is gone. i don't expect it to be useful
	  anyway, as mbsync is mostly a batch tool
	- the code is much shorter

2013-02-21 07:02  Oswald Buddenhagen <ossi@users.sf.net>

	* README:

	language fix

2013-02-21 07:01  Oswald Buddenhagen <ossi@users.sf.net>

	* README:

	make build instructions more explicit

2013-02-03 16:34  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.c:

	fix CVE-2013-0289: add SSL subject verification

	we did not check a valid certificate's subject at all so far.
	this is no problem if the certificate file contains only exactly the
	wanted host's certificate - before revision 04fdf7d1 (dec 2000, < v0.4),
	this was even enforced (more or less - if the peer cert had been
	signed directly by a root cert, it would be accepted as well).
	however, when the file contains root certificates (like the system-wide
	certificate file typically does), any host with a valid certificate
	could pretend to be the wanted host.

2013-02-03 16:47  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, isync.h, mbsync.1, socket.c:

	add support for (disabling) TLS v1.1 and v1.2

2012-10-16 07:27  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	more error checking of IMAP responses

	REFMAIL: CA+Tk8fyu-6bwXq=ee2BgcKK_13m9S0RS+-0DhM=_jFqSKCH8aw@mail.gmail.com

2012-09-22 15:48  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, socket.c, util.c:

	flush stdout more

	to make sure it is timely written and not interleaved with stderr even
	when when redirected.

2012-09-22 15:35  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	fix TrashRemoteNew copy direction

2012-09-16 11:03  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main.c:

	consider hierarchy delimiter flattening when deciding what to list

	flattened sub-folders of INBOX actually end up in Path, so list that
	instead.

	REFMAIL: 6c0ecbff0d025387020281c5d2f5e6e8@smallsys.org

2012-09-16 10:34  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main.c:

	try harder to list all necessary boxes

	the pattern "INB*" may or may not refer to something in the INBOX. even
	just "*" may. so list both the INBOX and the Path in case of
	uncertainty.

2012-09-15 13:15  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, drv_maildir.c, isync.h, mbsync.1,
	  run-tests.pl, sync.c:

	add option to control amount of fsync()ing

2012-09-15 12:38  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	avoid that a system crash can cause messages to be propagated twice

	fdatasync() the journal after creating the pair record and recording
	the TUID, but before the message propagation actually starts.

	all other writes to the journal are not flushed, as they will at worst
	cause some unnecessary network traffic without visible effect.

2012-09-15 12:15  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	avoid that a system crash can lose mails

	this fixes two possible failure scenarios:
	- if the journal is committed but the mails are not, the missing files
	  would be erroneously interpreted as deletions which would be
	  propagated
	- less seriously, if the mail files' meta data was committed but the
	  file contents were not, we would end up with empty files, which would
	  have to be re-fetched "behind mbsync's back" (just deleting the files
	  would not work - see above)

2012-09-15 11:25  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	avoid that a system crash can clobber the sync state file

	make sure that the new state is committed to disk before overwriting the
	old version - by default meta data is committed first, so we may end up
	with no valid state at all otherwise.

2012-09-15 09:57  Oswald Buddenhagen <ossi@users.sf.net>

	* src/compat/config.c:

	quote mailbox names written to config file

2012-09-15 09:49  Oswald Buddenhagen <ossi@users.sf.net>

	* src/config.c:

	make more config file errors fatal

	we really shouldn't just synchronize despite config parsing errors.

2012-09-15 09:46  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, drv_imap.c, drv_maildir.c, isync.h:

	store config error status in conffile_t object

	this makes passing it around more straight-forward

2012-09-15 09:24  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, drv_imap.c, isync.h, util.c:

	make config parser a bit more careful about quotes

	the parsing is more shell-like now:
	- quoted and unquoted parts can be mixed in one argument
	- the hashmark can be meaningfully quoted

2012-09-09 10:18  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	call fdatasync() after updating .uidvalidity files

	they must be flushed before the file system meta data, as otherwise we
	may end up with duplicate UIDs after a system crash.

2012-09-02 15:35  Ben Kibbey <bjk@luxsci.net>

	* src/socket.c:

	Fix certificate verification.

	The connection state wasn't getting updated.

2012-08-26 13:17  Oswald Buddenhagen <ossi@users.sf.net>

	* README, src/compat/isync.1, src/mbsync.1:

	pre-release doc updates

2011-04-10 17:25  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: compat/main.c, config.c, drv_imap.c, drv_maildir.c,
	  isync.h, main.c, sync.c, util.c:

	update copyrights

	make the wrapper's help string also mention copyrights pertaining only
	to the actual syncer, as this is the only string many people will ever
	see.

2011-04-10 17:34  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: compat/config.c, compat/convert.c, compat/isync.1,
	  compat/isync.h, compat/main.c, compat/util.c, config.c,
	  drv_imap.c, drv_maildir.c, isync.h, main.c, mbsync.1,
	  mdconvert.1, mdconvert.c, run-tests.pl, socket.c, sync.c,
	  util.c:

	replace FSF address with something more ... contemporary

2012-08-26 14:29  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: Makefile.am, compat/Makefile.am:

	install the config examples to docdir

2012-08-26 14:16  Oswald Buddenhagen <ossi@users.sf.net>

	* Makefile.am:

	update debian packaging

2012-08-26 13:02  Oswald Buddenhagen <ossi@users.sf.net>

	* Makefile.am, isync.spec.in:

	fix rpm packaging

2012-08-26 11:36  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: isync.h, sync.c, util.c:

	use a hash table for message => sync record lookup

	this removes the pathological O(<number of sync records> * <number of
	new messages>) case at the cost of being a bit more cpu-intensive (but
	O(<number of all messages>)) for old messages.

2012-08-25 18:30  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, mbsync.1:

	make use of UID EXPUNGE

2012-08-18 11:58  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, isync.h, main.c, mbsync.1, sync.c:

	introduce ability to flatten the hierarchy of Stores

2012-08-11 16:34  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.in, src/drv_imap.c, src/drv_maildir.c, src/isync.h,
	  src/main.c, src/mbsync.1, src/util.c:

	add support for hierarchical mailboxes

2012-08-11 15:11  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	calculate trash box path already in maildir_open_store()

	this gives us some cleaner code paths later on, as we can treat the
	trash box like a regular mailbox.

2012-08-11 15:05  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	ensure that mailbox creation in maildir_store() is limited to trashing

	other mailboxes would have been maildir_select()ed already.

2011-06-13 10:13  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	refactor: imap_select2_p2 => imap_refcounted_done_box

	soon, we'll use it for something different, too

2012-08-25 13:34  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	don't crash when select() on master fails synchronously

	svars->drv[S] would not be initialized yet, so cancel_sync() would
	crash.

2012-08-18 10:48  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: isync.h, main.c, sync.c:

	fix error handling of invalid SyncState *

	when we find that the store is incompatible with in-store sync state,
	we want to fail the whole channel. however, we must not claim that the
	store died, otherwise it won't be disposed of properly.

2011-06-02 17:21  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, drv_maildir.c:

	reject qualified mailboxes with the magic name INBOX

	otherwise we couldn't tell them apart from the real INBOX after
	stripping away the Path.

2011-07-25 07:25  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_maildir.c, mdconvert.c:

	suppress bdb complaints about unknown file format

	pass DB_TRUNCATE when creating databases. otherwise bdb will complain
	about the empty file we pass it (we have to create it upfront to
	implement our locking).

2011-06-02 10:43  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, mbsync.1:

	Revert "fix UIDNEXT handling"

	in fact, UIDNEXT (and UIDVALIDITY) null is *not* allowed (see RFC3501
	section 9). them popping up nonetheless was a dovecot bug (which would
	also confuse dovecot itself).
	having it in as a workaround was no good either, as quite some other
	code in mbsync assumes that UIDs are not null.

	This reverts commit e1fa867 and most of 39006d7.

	-REFMAIL: 4CA62BA1.4020104@lemma.co.uk

2012-08-25 13:29  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_maildir.c, isync.h, main.c, run-tests.pl:

	deal with concurrent maildir modifications during listing

	files may be renamed (due to new -> cur transition or flag changes),
	which may lead to two effects if ignored:
	- we see both the old and the new name, so we report a spurious
	  duplicate UID
	- we see neither name, so we report a spurious deletion

	as countermeasure, record and compare directory modification times. upon
	mismatch, we just start over - as usual.

2011-05-03 07:42  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	make maildir uidvalidity change fatal

	it's best to give the user a chance to fix it rather than completely
	messing up the syncstate by re-enumerating the UIDs.

2011-05-22 15:53  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	cleanup maildir error paths

	don't try to unlock and close databases and files - this will happen a
	moment later anyway, through cancelation or re-selection.
	ironically, this plugs a memory leak, because an open main database is
	used as a signal to close a temporary db in maildir_scan().

2011-05-22 15:23  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	fix potential double free

	the store may be discarded before we reach maildir_select() again, which
	will leave us with a dangling pointer.

2011-05-22 15:22  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	plug memory leak in maildir_store_msg() upon failure to acquire UID

2011-04-10 11:06  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, drv_maildir.c, isync.h, run-tests.pl,
	  sync.c:

	employ alternative scheme to finding messages by TUID

	instead of SEARCHing every single message (which is slow and happens to
	be unreliabe with M$ Exchange 2010), just FETCH the new messages from
	the mailbox - the ones we just appended will be amongst them.

2011-04-03 09:29  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	clearer debug msg

2011-04-11 08:46  Oswald Buddenhagen <oswald.buddenhagen@nokia.com>

	* src/: isync.h, mdconvert.c:

	use ATTR_PRINTFALIKE

2012-09-01 15:21  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: socket.c, sync.c, util.c:

	fix line wrapping before info messages

	unless an info message is explictly marked as a continuation, it must
	terminate any pending line (typically the progress information) first.

	debug output is not affected, as it is mutually exclusive with info
	output, and no debug lines are left unterminated outside clear scopes.

2011-06-02 08:14  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: isync.h, main.c, util.c:

	remove Ontty flag

	i can't figure out why i added it in the first place. it doesn't seem to
	make any sense ...

2011-04-11 08:45  Oswald Buddenhagen <oswald.buddenhagen@nokia.com>

	* src/: isync.h, sync.c, util.c:

	centralize flushing of unfinished debug lines

2011-04-10 13:32  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: compat/config.c, compat/convert.c, compat/isync.h,
	  compat/main.c, compat/util.c, config.c, drv_imap.c,
	  drv_maildir.c, isync.h, mdconvert.c, socket.c, sync.c,
	  util.c:

	unify error reporting

	- introduce sys_error() and use it instead of perror() and
	  error(strerror()) in all expected error conditions
	- perror() is used only for "something's really wrong with the system"
	  kind of errors
	- file names, etc. are quoted if they are not validated yet, so e.g. an
	  empty string becomes immediately obvious
	- improve and unify language
	- add missing newlines

2011-03-27 18:39  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	don't complain about disappearing temp files

	some other process might be cleaning up concurrently ...

2011-03-27 15:50  Oswald Buddenhagen <ossi@users.sf.net>

	* src/isync.h:

	enlarge receive buffer considerably

	the tiny buffer makes no sense in the face of huge payloads and now
	additionally masses of replies from pipelined commands.

2011-03-13 14:03  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.in, src/drv_imap.c, src/mdconvert.c:

	compile with -ansi -pedantic on gcc

	greatly helps portability ...

2012-09-01 19:14  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.in, src/compat/isync.h, src/compat/main.c,
	  src/isync.h:

	define _GNU_SOURCE on the command line

	that way it is already set in configure and can thus be used by tests.

2011-03-20 17:23  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	centralize imap_cmd_refcounted_state refcount decrementing

	no else branches remain, so the if() can be put into
	imap_refcounted_done()

2011-03-12 15:16  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	get rid of redundant literal_pending state flag

2012-08-25 16:26  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.in, src/drv_imap.c, src/isync.h, src/mbsync.1,
	  src/socket.c:

	fully asynchronous IMAP operation

	- asynchronous sockets using an event loop
	  - connect & starttls have completion callback parameters
	  - callbacks for notification about filled input buffer and emptied
	    output buffer
	- unsent imap command queue
	  - used when
	    - socket output buffer is non-empty
	    - number of commands in flight exceeds limit
	    - last sent command requires round-trip
	    - command has a dependency on completion of previous command
	  - trashnc is tri-state so only a single "scout" trash APPEND/COPY is
	    sent at first. a possibly resulting CREATE is injected in front of
	    the remaining trash commands, so they can succeed (or be cancel()d
	    if it fails).
	  - queue's presence necessitates imap_cancel implementation

2011-03-13 13:29  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.in, src/isync.h, src/main.c, src/util.c:

	add simple mainloop implementation

	not used so far

2011-03-19 18:40  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.c:

	move responsibility for closing sockets on error to user

	the only user being imap and the first thing in imap_cancel_store()
	being a call to socket_close(), this code was pretty pointless anyway.

2011-03-27 14:50  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, isync.h, socket.c:

	make socket read/write error reporting callback-based

	the functions still have synchronous return codes as well - this enables
	early error returns without having to resort to refcounting.

2011-04-03 16:47  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, isync.h, socket.c:

	decouple the filling of the read buffer from consuming it

	this prepares the code for being called from a callback.

	notably, this makes the imap list parser have a "soft stack", so the
	recursion can be suspended at any time.

2011-03-27 10:34  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	centralize imap_cmd disposal

2011-03-13 13:12  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, isync.h, socket.c:

	make socket_write() capable of taking ownership of the buffer

	that way the user code doesn't have to free it any more.

2011-03-13 12:40  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, socket.c:

	change socket_write() return code semantics

	instead of returning a write()-like result, return only a binary status
	code - write errors are handled internally anyway, so user code doesn't
	have to check the write length.

2011-03-27 14:58  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, mbsync.1:

	make IMAP pipeline depth configurable

	currently, this affects only "clustered" message listings and
	flag stores.

2011-03-19 21:12  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	cancel submitted commands when canceling store

	we already have some minimal asynchronicity, so there might be commands
	in flight when a fatal error comes in.

2011-01-23 13:06  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, isync.h, socket.c:

	Socket_t + buffer_t => conn_t

	remove the layering, in favor of a "buffered connection" abstraction.

2011-04-10 11:28  Oswald Buddenhagen <ossi@users.sf.net>

	* src/socket.c:

	security fix: failure to load the certificate file is *not* OK ...

2011-01-23 12:43  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: Makefile.am, drv_imap.c, isync.h, socket.c:

	move socket code to a separate file

	this makes the layering more obvious

2011-03-13 11:06  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	move greeting response handling into get_cmd_result()

	the primary purpose of this is getting rid of the "free-standing"
	buffer_gets() call.

2011-04-03 16:21  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, isync.h, sync.c:

	docs

	- insert "separator comments" between driver entry points
	- document driver API
	- document sync_vars_t parts that are stored in the sync state header

2011-04-03 16:15  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	make imap_exec() result reporting callback-based

	this makes the IMAP command submission interface asynchronous.

	the functions still have synchronous return codes as well - this enables
	clean error return paths. only when we invoke callbacks we resort to
	refcounting.

	as a "side effect", properly sequence commands after CREATE resulting
	from [TRYCREATE].

2011-07-24 18:27  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	rely on the maildir's existence with "SyncState *"

	now that we open the box first, we know that it will exist at this
	point.

2011-07-24 18:26  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	validate maildirs more strictly

	now that "SyncState *" won't create fake mailboxes any more, we can make
	a full validity check again.

2011-07-23 14:06  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, drv_maildir.c, isync.h, sync.c:

	split out drv->load() from drv->select()

2011-07-23 14:13  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	make creation of trash folder independent from -C option

	the trash is not a box which is synced, but a "byproduct" of
	manipulating synced boxes, so it makes no sense to bind it to the same
	option.

2012-07-29 23:07  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	minor cleanup: use ctx->gen instead of gctx for consistency

2012-07-29 21:15  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	make callbacks return early when canceling

	even after driver->cancel() the store may complete commands successfully.
	return early in this case, so we don't attempt to continue syncing.

2012-07-29 21:14  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, drv_maildir.c, isync.h, sync.c:

	fix error paths wrt sync drivers, take 2

	synchronous error codes which are passed through callbacks aren't a
	particularly good idea, after all: latest when the callback does stuff
	which does not concern the caller, the return code becomes ambiguous.
	instead, protect the sync_vars object with a refcount when invoking
	driver functions from loops, as the callbacks they call could invalidate
	the object and we would have no way of knowing that the loop should be
	aborted prematurely. the upcoming async imap driver will also need a
	refcount to protect the cancelation marker of the imap socket dispatcher
	loop.

2011-04-03 14:29  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	don't call cancel() repeatedly on a store

	erroring command replies will trickle in even after canceling

2012-07-15 10:55  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, drv_maildir.c, isync.h, main.c, sync.c:

	replace DRV_STORE_BAD with a separate bad_callback()

	that way we don't have to piggy-back (possibly asynchronous) fatal
	errors to particular commands.

	internally, the drivers still use synchronous return values as well,
	so they don't try to access the invalidated store after calling back.

2012-07-22 15:46  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	don't access free'd memory in cancel_sync()

	as it happens, the 1st round *may* trash svars - if we get the
	cancelation request after the slave store has already died.

2012-07-22 15:32  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, drv_maildir.c, isync.h, sync.c:

	make drv->cancel()'s callback have no status code

	this function is not going to actually execute any commands, so it
	makes no sense for the callback to have a status code.

2012-06-17 12:52  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	don't decode aux pointer on DRV_CANCELED

	the aux data was already free()d by the error callback by the time we
	get this status code.

2011-03-20 12:45  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	always use return value from get_cmd_result()

	once we have callback-based error reporting, this will ensure that we
	don't operate on invalidated data structures.

2010-12-05 15:49  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	make response code parse failure of untagged OK/NO/BYE/BAD non-fatal

	as such, it does not disrupt the data stream

2012-07-15 10:50  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main.c:

	de-duplicate code a bit

2010-12-15 18:01  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	remove redundant use_ssl variables

	just use the presence of an SSL object as an indicator. if something
	goes wrong during the ssl handshake or certificate validation, the
	socket must be immediately closed anyway.

2010-11-20 22:48  Oswald Buddenhagen <ossi@users.sf.net>

	* src/isync.h:

	DRV_SERVER_BAD is and will probably stay unused => trash

2010-11-20 09:17  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	after [TRYCREATE], just resend the same command instead of cloning it

2011-03-20 15:27  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	use return values from correct set in get_cmd_result()

	DRV_OK == RESP_OK, so this worked by accident

2010-11-15 09:38  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	do away with the dreaded rcaps hack

	don't pretend that the server has no literal+ for the time of the
	first relevant command's synchronous execution. instead, enable the
	lower layer to do the processing by telling it for which commands
	trashnc ("trash's existence not confirmed") is relevant.

2010-11-15 09:30  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	purge imap_store_t::currentnc vestiges

	we always actually open the mailbox before appending to it, so we
	obviously know that it exists - that's why the code was already
	commented out. changing this assumption would significantly complicate
	matters for little gain, so let's just assume it won't happen.

	consequently, also don't set param.create when appending to regular
	mailboxes.

2011-06-13 10:02  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, drv_maildir.c, main.c:

	move setting of ctx->listed outside the drivers

	it's essentially an external state flag

2011-04-10 07:58  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	de-duplicate error paths

	makes the code more compact. yay for gotos.

2011-07-23 10:49  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	check return value from close() after write()

	otherwise we may lose data when quota is exceeded
	or nfs is in a bad mood.

2012-07-07 15:19  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: compat/convert.c, drv_imap.c, drv_maildir.c, sync.c:

	fix a bunch of warnings

2011-03-27 10:06  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: compat/main.c, drv_imap.c, main.c:

	avoid preprocessor warnings on missing features: #if => #ifdef

2011-03-12 15:20  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	less bizarre code

	we know that there is only one command in progress, so there
	is no need to employ tricks to access the last command.

2011-01-23 12:35  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	make cram() sane

	- don't silently fail in release mode (expression with side effects
	  inside assert())
	- save some redundand strlen()s by not throwing away known lengths
	- reorganize the code for legibility

2010-11-20 22:04  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	don't compare find_old_done with find_new_total

	this didn't have any effect as no async drivers currently exist.

2010-12-19 22:33  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main.c:

	don't hang if store cannot be opened asynchronously

2011-03-06 22:04  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	don't leak SSL objects

2011-03-27 09:01  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	add CR after TUID during LF => CRLF conversion

2011-03-27 08:52  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	fix (another) out-of-bounds access in CRLF conversion

	if the header contained no CRs but the body (or the post-TUID part of
	the header) did, the TUID insertion would add an excess CR, thus
	overflowing the buffer by one byte.

2010-11-14 16:23  Oswald Buddenhagen <ossi@users.sf.net>

	* src/mbsync.1:

	document some breakage

2010-11-14 15:44  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: compat/convert.c, drv_imap.c, drv_maildir.c:

	turns out, free(NULL) is just fine ...

2010-10-03 12:31  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	fix UIDNEXT handling

	UIDNEXT *can* be legally zero, so deal with it.

	-REFMAIL: 4CA62BA1.4020104@lemma.co.uk

2010-10-03 09:53  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	don't hang after failed start_tls()

	we'd send a LOGOUT command in plain text while the server was already
	expecting an encrypted command, which would typically lead to waiting
	for more data and thus an indefinite hang.
	so close the socket immediately instead of letting the normal shutdown
	path take care of it.
	inspired by a patch by Steven Flintham.

	-REFMAIL: 4C9AB98E.3000400@lemma.co.uk

2010-09-26 13:26  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	remove useless message

	don't complain about missing greeting response - we already complained
	about an unexpected EOF anyway.

2010-04-05 11:15  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	assert valid file handles

	i've seen error logs of the type
	  SSL_write: Bad file descriptor
	and i simply can't nail it, so go for some more drastic measures.

2010-04-05 11:08  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	formatting

2010-04-05 11:08  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	beautify error messages

	don't print the error number - we print the error string anyway, so it
	adds no value.
	add some whitespace to the messages as well.

2010-04-05 11:06  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	fix uninitialized variable read

	this is basically a security fix for nonsensical configurations:
	if the specified CertificateFile did not contain any certificates,
	we *might* have accepted an arbitrary server certificate.

2010-02-28 21:23  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: compat/isync.1, mbsync.1:

	remove mail addresses from man pages

	apparently, some people don't see the "maintained by" bits, so make them
	look harder for explicit contact information (to be found in AUTHORS).

2010-02-07 20:20  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	fix compile with SSL on Mac OS X

	patch by Remko Tronçon <remko@el-tramo.be>
	BUG: 2126899

2010-02-07 16:36  Oswald Buddenhagen <ossi@users.sf.net>

	* src/compat/: isync.1, main.c:

	add -P option to isync wrapper

	not really a backwards compat option, but whatever ...

	based on a patch submitted long ago by "nobody".
	BUG: 1433532

2010-02-07 21:13  Oswald Buddenhagen <ossi@users.sf.net>

	* isync.spec.in:

	fix rpm spec file

	-REFMAIL: 20090122213325.GA11572@crow.ths.tcoek12.org

2010-02-07 21:12  Oswald Buddenhagen <ossi@users.sf.net>

	* Makefile.am:

	(new?) automake already sets docdir correctly for us

2010-02-07 11:24  Oswald Buddenhagen <ossi@users.sf.net>

	* .gitignore, Makefile.am, src/.gitignore,
	  src/compat/.gitignore:

	cvsignore => gitignore

2010-02-07 11:23  Oswald Buddenhagen <ossi@users.sf.net>

	* Makefile.am, autogen.sh:

	adjust ChangeLog generation to git

	now that log generation is cheap, don't store it in the SCM any more.

2010-02-06 18:38  Oswald Buddenhagen <ossi@users.sf.net>

	* Makefile.am:

	fix "make distcheck"

	this makes the deb-clean target shadow build safe

2010-02-06 09:40  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: compat/main.c, drv_imap.c, isync.h, main.c:

	add extra verbose mode which dumps the message contents

	i needed that to debug the line ending issues. maybe it will find other
	uses as well ...

2010-02-06 09:34  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_maildir.c, isync.h, sync.c:

	fix line ending conversion logic

	imap may very well store messages with LF line endings. only RFC2822
	requires CRLF.
	consequently, preserve the line endings as much as possible unless the
	mailbox format does not support it (this would be the case for unix mbox
	- i actually have no idea about maildir).

2010-02-06 09:32  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	some more error reporting relating malformed messages

2008-08-31 20:14  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	refactoring. main part is killing struct imap_cmd_cb as such.
	issue_imap_cmd is split into new_imap_cmd and submit_imap_cmd, so the
	command can be parametrized after it was instanciated.

2008-08-23 07:54  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, sync.c:

	deal with UIDVALIDITY of 0 properly.
	-REF: 20080822094543.GA3528@ugly.local

2008-04-13 09:56  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	give the implicitly created imap account config the name of the store.

2008-04-13 09:51  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	make ssl certificate handling much more useful:
	- system-wide ca certs are auto-loaded
	- private certs are accepted even if they are self-signed

2008-04-12 08:58  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	- accept unset CertificateFile
	- print the certificate's fingerprint
	- make the certificate acceptance prompt much less scary

2008-04-12 08:13  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	ignore system flag extensions (\X-...)

2008-03-16 09:09  Oswald Buddenhagen <ossi@users.sf.net>

	* README:

	minor updates

2008-02-23 14:18  Oswald Buddenhagen <ossi@users.sf.net>

	* src/compat/config.c:

	compat wrapper: don't crash if neither host nor tunnel are specified.
	fixes:
	CCMAIL: 449006@bugs.debian.org

2008-02-23 09:37  Oswald Buddenhagen <ossi@users.sf.net>

	* src/compat/config.c:

	quote user name in generated config.
	fixes:
	CCMAIL: 456775@bugs.debian.org

2008-02-23 09:18  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main.c:

	don't overlook 2nd and later single-letter options in last argument.
	reported by fedora
	-REF: <1197916586.13945.120.camel@localhost.localdomain>

2008-02-23 09:01  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: compat/convert.c, drv_maildir.c, mdconvert.c:

	put pointers to bdb open() into parentheses, so they won't be
	macro-expanded as libc open.
	patch by fedora
	-REF: <1197916586.13945.120.camel@localhost.localdomain>

2008-02-23 08:53  Oswald Buddenhagen <ossi@users.sf.net>

	* AUTHORS:

	reshuffle for "contact priority's" sake

2007-09-22 08:45  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	don't use #ifdef inside htons() arguments - it can be a macro.
	-REF: <lyy7ezyjah.fsf@gfn.org>
	CCMAIL: Scott Gifford <sgifford@suspectclass.com>

2007-04-04 17:03  Oswald Buddenhagen <ossi@users.sf.net>

	* Makefile.am:

	forward port (finally ...): add target for creating signed package

2007-04-04 16:19  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main.c:

	#ifdef __linux__ for the crash handler. it compiles on other platforms,
	but the functionality is bound to linux' /proc structure.

2007-02-10 15:37  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	fix crash due to uninited var when parsing IMAPServer. Thanks to
	CCMAIL: Antoine Reilles <tonio@NetBSD.org>
	REF: <20070118182534.GA22288@arcelot.loria.fr>

2006-12-09 10:39  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, drv_maildir.c, isync.h, sync.c:

	fix error paths wrt sync drivers

2006-12-09 10:38  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	handle abnormal program exit during regtest

2006-12-04 17:47  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main.c:

	initialize mvars->t[1] to 1. helps enormously ... :}

2006-11-18 13:17  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	reverse-map <Inbox> to INBOX when encountered during listing.
	usually this will be a no-op (when putting INBOX in Path, people
	generally call it INBOX), but better safe than sorry.

2006-11-09 17:57  Oswald Buddenhagen <ossi@users.sf.net>

	* src/compat/main.c:

	make compat wrapper default to current user for imap login

2006-11-01 06:19  Oswald Buddenhagen <ossi@users.sf.net>

	* src/compat/config.c:

	put INBOX in Maildir

2006-10-24 17:37  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	don't crash on truncating database. seems to affect only some bdb
	versions (e.g., 4.2).

2006-08-10 07:01  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	fix bug in newline conversion causing buffer overflows.
	this leads to segfaults and has some security impact.

2006-08-10 06:33  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	memmove for overlapping mem copies.

2006-07-31 05:30  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	glibc seems to be *really* fucked up.

2006-07-29 11:52  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_maildir.c, mdconvert.c:

	work around glibc bug: printf("%.*s", INT_MAX, s) tries to allocate 2G.

2006-06-05 11:59  Oswald Buddenhagen <ossi@users.sf.net>

	* src/compat/config.c:

	enable the old account naming scheme to deal with duplicated ip
	addresses.
	this is not incompatible - previously, it would just create garbage.

2006-06-05 11:55  Oswald Buddenhagen <ossi@users.sf.net>

	* src/compat/: config.c, isync.h:

	create more descriptive account names, so password prompts look sane.
	the channel names follow the old scheme, though - they are used to
	compose sync state file names, and i don't feel like writing a migrator
	for this.

2006-05-28 16:03  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	don't crash in imap driver when Host is not specified.

2006-05-28 16:02  Oswald Buddenhagen <ossi@users.sf.net>

	* src/mbsync.1:

	be *slightly* more explicit about which options Tunnel makes
	superfluous.

2006-05-28 15:43  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, mbsync.1:

	un-document "Host imaps:[...]" syntax and introduce new option UseIMAPS
	instead.
	apply ted's patch to support UseIMAPS in conjunction with Tunnel.
	document that SSLv2 is No Good (TM).

2006-05-28 13:38  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	move assigning default port to the place of use

2006-05-27 12:44  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	add comment

2006-05-27 12:43  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	seen messages are eligible for expiration even if they are recent in the
	mailbox.

2006-03-21 20:05  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main.c:

	no/empty mailbox name means INBOX

2006-03-21 20:03  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, drv_maildir.c, isync.h, main.c, sync.c,
	  util.c:

	make the driver model, sync_chans() and sync_boxes() fully async.
	async drivers to follow ...

2006-03-21 17:50  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	unscrew lf=>crlf conversion and tuid insertion

2006-03-21 17:40  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	ok, mismerging and not running the reg-tests is lame. unscrew expunging
	again.

2006-03-21 16:03  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	don't enter trash loop if not trashing at all. also, move expunge
	message where it belongs. not adding info("trashing"), as it will be
	replaced in a moment anyway.

2006-03-21 15:53  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: main.c, sync.c:

	async merge: aggregate most variables of main() & sync_boxes() in
	main_vars_t resp. sync_vars_t.
	also some minor var renames, whitespace, comments.

2006-03-21 10:38  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main.c:

	split box list preparation from "consumption".

2006-03-21 10:30  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: isync.h, main.c, sync.c:

	info() about opening of stores

2006-03-20 20:39  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	do not repeatedly get namespace from server.

2006-03-20 20:34  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	handle socket() failure and correctly report gethostbyname() failure.

2006-03-20 20:16  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, drv_maildir.c, isync.h, main.c, sync.c,
	  util.c:

	update copyrights

2006-03-20 19:38  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, drv_maildir.c, isync.h, main.c:

	move whole responsibility for recycling open stores/server connections
	to the drivers.

2006-03-20 19:27  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, drv_maildir.c, isync.h, main.c:

	keep the result of driver->list() and a flag whether it is valid in the store.

2006-03-20 18:36  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, isync.h:

	aggregate all (two ...) drivers in an array instead of naming them in
	each (one ...) location explicitly.

2006-03-20 17:21  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	whitespace and code verbosity

2006-03-20 15:01  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	merge imap_t into imap_store_t - there is really no point in having them
	separated.

2006-03-19 11:29  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, drv_imap.c, drv_maildir.c, isync.h, main.c,
	  sync.c, util.c:

	"fprintf( stderr," => "error(". new functions debugn() and infon()
	for messages with missing newline; warn() and error() act upon this.

2006-03-19 10:44  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	make config parsing more robust against bogus input and report errors
	more clearly.

2006-02-12 11:42  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	factor out box selection from sync_boxes to avoid code dupe

2006-02-11 20:28  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	lock the sync state open the journal before opening the master. this is
	a bit ugly for the "SyncState *" case, as we have to create a directory
	without making it a maildir right away. however, this makes the code
	quite a bit simpler to understand and simpler to parallelize.

2006-02-11 20:14  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	don't barf at directories with none of {tmp,new,cur}/ and turn them
	into maildirs instead. see next commit.

2006-02-11 20:02  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	don't commit state file when a fatal error occurs

2006-02-11 19:52  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	unbelieveable, but close() can actually fail

2006-02-11 19:48  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	add copyright + license

2006-02-09 17:44  Oswald Buddenhagen <ossi@users.sf.net>

	* acinclude.m4, get-cert, src/compat/config.c,
	  src/compat/convert.c, src/compat/isync.1, src/compat/isync.h,
	  src/compat/main.c, src/compat/util.c, src/config.c,
	  src/drv_imap.c, src/drv_maildir.c, src/isync.h, src/main.c,
	  src/mbsync.1, src/mdconvert.1, src/mdconvert.c, src/sync.c,
	  src/util.c:

	update fsf's postal address. i think it's sort of useless nowadays
	anyway, but heck ...

2006-02-05 17:42  Oswald Buddenhagen <ossi@users.sf.net>

	* src/mbsync.1:

	typos

2006-02-05 17:39  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.in:

	bump version. no, i'm not releasing yet ... :)

2006-02-05 17:38  Oswald Buddenhagen <ossi@users.sf.net>

	* src/Makefile.am:

	include run-tests.pl in distribution

2006-02-03 23:43  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	and now don't clobber the mails ...

2006-02-03 21:33  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, drv_maildir.c, isync.h, sync.c, util.c:

	wrap message storing into transactions. nice side effect: drivers don't
	need to deal with line end conversion any move.

2006-02-02 17:03  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: isync.h, sync.c:

	major overhaul of flag change propagation and MaxMessages handling:
	- wrap message (un)expirations into transactions
	- no redundand flag propagations in conjunction with expirations
	- better prepared for the upcoming async operation

2006-02-02 13:48  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main.c:

	crash handler that launches gdb. activated when started with -D option.
	simplifies debugging crashes during the reg-tests.

2006-02-02 11:23  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	less cluttered debug output

2006-02-02 11:12  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	cosmetics: move around variable declarations and remove obsolete comment

2006-02-02 11:07  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	versioned journal. the commands and their meanings change all the time,
	so better handle that case.
	ps: yes, i think not upgrading mbsync between interrupting and resuming
	a run is a reasonable requirement.

2006-02-02 10:44  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	make the sync entry search in the journal replay wrap around at the end
	of the list. the "always forward" assumption is violated in some cases.

2006-02-02 10:25  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	much improved journal replay testing.
	some clenup.

2006-02-02 10:04  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: run-tests.pl, sync.c:

	orphan/kill all affected entries after expunge

2006-01-31 13:57  Oswald Buddenhagen <ossi@users.sf.net>

	* Makefile.am:

	deal with branches in "make log"

2006-01-30 13:49  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: isync.h, sync.c:

	M_EXPIRED -> M_EXPIRE

2006-01-30 13:11  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	sanitize S_DEL

2006-01-30 13:01  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	remove superfluous temporary rflags from sync_boxes

2006-01-30 11:12  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: isync.h, sync.c:

	now that messages know their sync records, M_SYNCES is superfluous.

2006-01-30 10:26  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: isync.h, sync.c:

	establish bi-directional mapping between mails and sync records. use it
	to merge the --renew case into the --new case.

2006-01-30 09:33  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	declaring ex[M] instead of ex[2] is, indeed, no good. long live watchpoints.

2006-01-29 18:40  Oswald Buddenhagen <ossi@users.sf.net>

	* src/compat/main.c:

	whoops - 'isync -w' would write .mbsyncrc to a wrong directory

2006-01-29 15:52  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	move fetching new messages in front of syncing old entries. this alone
	does not buy us a whole lot ...

2006-01-29 15:48  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	test for journalling and journal replay.

2006-01-29 15:46  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: isync.h, main.c, sync.c:

	undocumented flag -J to skip committing the new sync state.

2006-01-29 14:46  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, isync.h, main.c, sync.c, util.c:

	merge Quiet, Verbose & Debug into DFlags

2006-01-29 11:49  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: isync.h, sync.c:

	M_NOT_SYNCED => M_SYNCED. now that sync records know their messages, it
	is simpler to track the positive case.

2006-01-29 11:35  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	move driver options composition below journal replay - it might make
	additional actions necessary (it doesn't, yet).

2006-01-29 11:22  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: drv_imap.c, drv_maildir.c, isync.h, sync.c:

	split driver->prepare into ->prepare_opts and ->prepare_paths

2006-01-25 06:35  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	#include limits.h (for INT_MAX)
	REF: <a8e45e1b0601241753j1e14cc1cm3fc3c65c7acb0c1b@mail.gmail.com>

2006-01-13 16:10  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	less confusing uid ranges in debug

2006-01-12 06:36  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.in, src/drv_imap.c:

	solaris 10 fix: use sys/filio.h for FIONREAD. untested.
	REF: <20060111215014.GA601@49.180.97-84.rev.gaoland.net>

2006-01-08 19:25  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	adjust to: omit flags other than "deleted" when expunging target.

2006-01-03 09:28  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	collect stderr as well.

2005-12-29 13:08  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	don't record we synced flags if we didn't.

2005-12-28 20:45  Oswald Buddenhagen <ossi@users.sf.net>

	* src/util.c:

	have to flush debug as well ...

2005-12-28 20:05  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	of course F_DELETED will have been added to expired slave messages, so
	don't complain about it.

2005-12-28 19:17  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	put message references into the sync records. match up the uids after
	opening the boxes instead of "sort-of-on-demand" - this is much simpler.
	match from messages to sync records, not the other way round - makes the
	debug output shorter, as the separate dump_box() is gone now.

2005-12-28 19:10  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	"reformat" S_EXP_S setting logic for understandability.

2005-12-28 11:07  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main.c:

	whoops

2005-12-28 10:02  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, isync.h, main.c, sync.c:

	- instead of having {m,s}foo, we have foo[2] now, so we can do
	  everything with loops instead of symmetric function calls
	- added some const

2005-12-27 17:44  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	show debug output on error.

2005-12-27 17:31  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	make the error case output more useful by dumping the entire data set.

2005-12-26 16:02  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	fix error message

2005-12-26 16:02  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	add expiration tests

2005-12-26 16:01  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	add MaxSize tests

2005-12-26 16:00  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	when dumping mailboxes, sort by uid 1st.

2005-12-26 15:58  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	detect excess messages after sync

2005-12-26 15:57  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	sync state reader:
	- grok negative uids
	- more robust

2005-12-26 15:54  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	don't eat array lead-in on empty arrays

2005-12-26 15:02  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	why would somebody manipulate an expired message? right, he wouldn't:
	he would either expunge the mailbox or configure his MUA to hide trashed
	messages. consequently don't sync expired message flags, let alone
	interpret them in a special way.
	one special feature remains, though: if a non-expunged expired message
	is flagged on the master, it will be unexpired on the slave. i'm not
	sure whether i should remove or document this feature.

2005-12-26 14:55  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	message tweaks

2005-12-23 10:22  Oswald Buddenhagen <ossi@users.sf.net>

	* src/run-tests.pl:

	more logical order

2005-12-22 18:06  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: .cvsignore, run-tests.pl:

	add some regression testing.

2005-12-22 14:59  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	fix sync entries not being purged due to c&p error.

2005-12-21 13:04  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	less confusing error message on invalid mailbox.

2005-12-18 14:10  Oswald Buddenhagen <ossi@users.sf.net>

	* src/config.c:

	it's beyond me what this memset was supposed to do ...

2005-12-18 13:41  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, main.c:

	trailing whitespace

2005-12-17 13:47  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	revert 1.8 - what was i smoking?! the CREATE argument is already quoted;
	we just extracted it from the previous command.

2005-09-29 21:07  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	make flag changes unset "new" status - unless a ghost is acting in the
	background, a flag change indicates that the message was at least
	noticed.

2005-09-29 21:05  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	don't call the driver's set_flags() if the flags did not change at all.

2005-09-21 16:14  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	64-bit cleanness

2005-03-28 10:43  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	quote CREATE argument

2005-03-28 10:26  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.in:

	bump version

2005-03-28 10:26  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	fix inverted condition leading to endless loop when message is changed
	while isync is running.

2004-11-13 09:19  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	cope with out-of-disk-space halfways gracefully (that is, don't clobber
	the sync state including the journal, but exit immediately).

2004-10-17 16:31  Oswald Buddenhagen <ossi@users.sf.net>

	* AUTHORS:

	sf.net -> sourceforge.net. otherwise the list-post is different from the
	actual address, which makes mutt add two to addresses on list-reply ...

2004-10-17 15:34  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	ignore user-defined flags (for now).
	also, split off the backslash from the "core" flag names.

2004-10-17 09:00  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	fix segfault due to wrong pointer being passed to parse_response_code.
	inspired by Raimar Döffinger

2004-10-17 08:30  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	remove spurious crlf during cram auth. not sure that this instance of
	socket_write should be (re)moved, but as long as the .cont callback is
	used only for this ...
	investigation & patch by Mike Delaney.

2004-09-24 08:45  Oswald Buddenhagen <ossi@users.sf.net>

	* Makefile.am:

	install supplementary doc files.
	REF: 38C5E3CF30C73C4984F41AE8786C852AB739@khyron.ads.cs.umass.edu

2004-09-20 11:31  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	use legacy flock() only on linux. at least on OS X flock aliases to
	fcntl.

2004-09-20 11:28  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: compat/main.c, drv_imap.c, isync.h, util.c:

	stdarg.h at the right places

2004-09-15 09:33  Oswald Buddenhagen <ossi@users.sf.net>

	* README:

	update c-client compatibility

2004-09-15 09:06  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	when storing \seen messages, don't set the \recent flag on them. could
	well be that this is incorrect, but some mailers need it that way.
	when trashing messages, preserve their \recent status as well.

2004-09-15 08:44  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.in:

	whoops, wrong define

2004-09-08 16:40  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.in:

	don't encode maturity in version number

2004-09-08 16:38  Oswald Buddenhagen <ossi@users.sf.net>

	* Makefile.am:

	optimize rpms for i686

2004-09-08 16:28  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.in:

	sanitize the OpenSSL detection

2004-09-08 16:14  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	stddef.h for offsetof

2004-09-08 14:52  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	first check _both_ bounds, then compare ...

2004-09-07 11:59  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	print name of mailbox being opened.

2004-08-13 11:03  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_imap.c:

	fix -C for imap mailboxes:
	- SELECT does not return [TRYCREATE]
	- fix bit field truncation

2004-06-17 13:44  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.in:

	A{C,S}_HELP_STRING aliasing tricks.

2004-05-23 16:39  Oswald Buddenhagen <ossi@users.sf.net>

	* src/drv_maildir.c:

	store new UIDVALIDITY immediately after initializing it

2004-04-27 20:23  Oswald Buddenhagen <ossi@users.sf.net>

	* src/compat/main.c:

	old -l is new -l -C

2004-04-26 14:48  Oswald Buddenhagen <ossi@users.sf.net>

	* src/compat/: config.c, isync.h, main.c:

	full support for absolute paths in Mailboxes

2004-04-26 14:09  Oswald Buddenhagen <ossi@users.sf.net>

	* src/compat/config.c:

	strip $HOME and ~ from Mailbox paths

2004-03-29 22:32  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: compat/util.c, util.c:

	fix return values of asprintf replacement.

2004-03-29 06:52  Oswald Buddenhagen <ossi@users.sf.net>

	* src/compat/: config.c, isync.1, isync.h, main.c:

	unscrew --delete by merging it into the config file. merge --expunge as
	well for symmetry.

2004-03-27 16:07  Oswald Buddenhagen <ossi@users.sf.net>

	* .cvsignore, Makefile.am, README, configure.in, isync.spec.in,
	  src/.cvsignore, src/Makefile.am, src/compat/.cvsignore,
	  src/compat/Makefile.am, src/compat/config.c,
	  src/compat/convert.c, src/compat/isync.1, src/compat/isync.h,
	  src/compat/isyncrc.sample, src/compat/main.c,
	  src/compat/util.c, src/config.c, src/cram.c, src/dotlock.c,
	  src/dotlock.h, src/drv_imap.c, src/drv_maildir.c, src/imap.c,
	  src/isync.h, src/list.c, src/maildir.c, src/main.c,
	  src/mbsync.1, src/mbsyncrc.sample, src/mdconvert.1,
	  src/mdconvert.c, src/sync.c, src/util.c:

	The Big Rewrite. too many change to list them all.

	as opposed to earlier threats, BerkDB was not entirely dropped; i
	suppose the isync 0.7 -> 0.8 change had a reason, so i added an
	alternative UID storage scheme.
	note that BDB 4.0 is not sufficient, as the db->open function changed in
	an incompatible way ...

	i updated the debian packaging except for a changelog entry.
	note that i removed the upgrade blurb, as upstream now has a smooth
	upgrade path down to at least isync 0.4.

2004-03-26 16:34  Oswald Buddenhagen <ossi@users.sf.net>

	* get-cert:

	excessively secure temp file creation.
	more user friendliness.

2004-02-07 15:36  Oswald Buddenhagen <ossi@users.sf.net>

	* src/dotlock.c:

	portability: don't rely on struct flock layout

2004-02-01 16:44  Oswald Buddenhagen <ossi@users.sf.net>

	* .cvsignore:

	shht

2004-02-01 16:27  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: main.c, sync.c:

	once again: (slightly) better output.
	make maildir flag setting failure non-fatal. maildir sucks ...

2004-01-31 01:01  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: imap.c, isync.h:

	more sophisticated CAPABILITY handling. also, don't issue the command if
	the initial response already had it in the status code.

2004-01-30 23:39  Oswald Buddenhagen <ossi@users.sf.net>

	* src/imap.c:

	don't ask for NAMESPACE if Folder was specified

2004-01-30 23:35  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: imap.c, isync.h:

	following the "screw murphy" principle and commiting untested patch:
	obey LOGINDISABLED

2004-01-27 21:01  Oswald Buddenhagen <ossi@users.sf.net>

	* src/imap.c:

	PREAUTH cannot come out of the blue

2004-01-27 20:58  Oswald Buddenhagen <ossi@users.sf.net>

	* src/imap.c:

	cleanup around parse_fetch

2004-01-27 20:50  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: imap.c, isync.h, main.c:

	make Tag int, move it to imap.c

2004-01-27 00:11  Nicolas Boullis <nboullis@users.sf.net>

	* acinclude.m4, configure.in:

	Add a --disable-maintainer-mode option to configure.

2004-01-20 01:55  Oswald Buddenhagen <ossi@users.sf.net>

	* src/imap.c:

	don't use STARTTLS for PREAUTH connections. uw-imap doesn't seem to like
	it, and it does not make too much sense anyway - i think - state converse
	opinions now.

2004-01-20 01:27  Oswald Buddenhagen <ossi@users.sf.net>

	* Makefile.am:

	exclude ChangeLog (do'h), NEWS and TODO when creating ChangeLog. exclude
	debian/ as well, based on the fact that it already has a detailed log -
	is that ok with everybody?

2004-01-18 02:22  Oswald Buddenhagen <ossi@users.sf.net>

	* isync.1, src/imap.c, src/isync.h, src/maildir.c, src/main.c,
	  src/sync.c:

	another message output cleanup, still not perfect (info messages will be
	interleaved with progress dots).
	support specifying -q twice to suppress warnings as well.

2004-01-17 11:38  Oswald Buddenhagen <ossi@users.sf.net>

	* isync.1:

	document mua interaction

2004-01-16 10:11  Oswald Buddenhagen <ossi@users.sf.net>

	* AUTHORS:

	credit where credit is due. are the comments satisfactory for everybody?

2004-01-15 03:51  Theodore Ts'o <tytso@users.sf.net>

	* get-cert:

	Script that can be used to extract the server's certificate from an IMAP
	server.

2004-01-15 02:23  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.in:

	remove useless define and more verbose error message.

2004-01-13 03:56  Theodore Ts'o <tytso@users.sf.net>

	* configure.in:

	Use a more sophisticated test for the existence of libdb that works for
	berk_db 4.0.

2004-01-12 01:49  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.in:

	bah, forgot to remove debian/Makefile.in from AC_OUTPUT. :}
	kde's overly sophisticated build system does that automatically ...

2004-01-12 01:24  Theodore Ts'o <tytso@users.sf.net>

	* src/: imap.c, isync.h, main.c:

	Optimized isync by not fetching the sizes of messages if they are
	unneeded (i.e., if MaxSize is not specified in the config file).

	Patch and idea originally from Nicolas Boullis <nboullis@debian.org>,
	modified/polished by Theodore Ts'o per comments by Oswald Buddenhagen.

2004-01-12 00:52  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.in, src/isync.h, src/maildir.c, src/sync.c:

	sync uid database after every message. this is accompanied by a dbm ->
	db4 migration. patch by theodore, with some final polishing by me.

2004-01-12 00:38  Oswald Buddenhagen <ossi@users.sf.net>

	* Makefile.am:

	use ../CVSROOT/accounts for UID mapping in ChangeLog.

2004-01-12 00:36  Oswald Buddenhagen <ossi@users.sf.net>

	* AUTHORS:

	be more explicit about contact address

2004-01-11 12:38  Oswald Buddenhagen <ossi@users.sf.net>

	* .cvsignore:

	new stuff

2004-01-11 12:35  Oswald Buddenhagen <ossi@users.sf.net>

	* Makefile.am:

	getting rid of Makefile.am in debian/ - it seems to be non-standard and
	is a pita to maintain anyway. instead, make distdir and distclean depend
	on a partial debian-clean.

2004-01-11 11:53  Oswald Buddenhagen <ossi@users.sf.net>

	* autogen.sh:

	don't call configure

2004-01-09 20:43  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main.c:

	ignore anything that does not look remotely like a maildir when
	collecting mailboxes for OneToOne.

2003-12-07 15:37  Oswald Buddenhagen <ossi@users.sf.net>

	* isyncrc.sample:

	add sample CertificateFile

2003-12-07 15:36  Oswald Buddenhagen <ossi@users.sf.net>

	* src/imap.c:

	add trailing space to password prompt

2003-12-07 15:34  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main.c:

	make imaps: on the command line adjust the port and ssl options as well

2003-12-07 15:09  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.in:

	bump version

2003-12-02 02:53  Oswald Buddenhagen <ossi@users.sf.net>

	* src/imap.c:

	echo the mailbox the password is for

2003-11-11 03:02  Oswald Buddenhagen <ossi@users.sf.net>

	* AUTHORS:

	be more explicit about maintainership, as people don't seem to get it.

2003-09-02 12:06  Oswald Buddenhagen <ossi@users.sf.net>

	* isync.1:

	minor additions

2003-07-02 17:18  Oswald Buddenhagen <ossi@users.sf.net>

	* src/imap.c:

	fix crash when syncing multiple mailboxes over a Tunnel

2003-05-14 13:42  Oswald Buddenhagen <ossi@users.sf.net>

	* isync.1:

	minor

2003-05-07 00:06  Oswald Buddenhagen <ossi@users.sf.net>

	* .cvsignore, Makefile.am, autogen.sh, configure.in,
	  src/config.c, src/cram.c, src/dotlock.c, src/imap.c,
	  src/isync.h, src/list.c, src/maildir.c, src/main.c,
	  src/sync.c:

	- make it work without SSL
	- switch from -Ds in Makefile to config.h
	- small header cleaup

2003-05-07 00:04  Oswald Buddenhagen <ossi@users.sf.net>

	* isync.spec.in:

	make it actually work

2003-05-06 02:17  Oswald Buddenhagen <ossi@users.sf.net>

	* Makefile.am:

	minors

2003-05-06 02:15  Oswald Buddenhagen <ossi@users.sf.net>

	* README:

	i'm bored :)

2003-05-05 17:58  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, isync.h, main.c:

	don't free any config strings - who cares for a few bytes?
	this fixes some crashes at exit.

2003-05-05 17:17  Oswald Buddenhagen <ossi@users.sf.net>

	* Makefile.am:

	switch ChangeLog generation to cvs2cl

2003-05-05 13:43  Oswald Buddenhagen <ossi@users.sf.net>

	* isync.1:

	minor fixes

2003-05-05 13:41  Oswald Buddenhagen <ossi@users.sf.net>

	* configure.in:

	cleanup

2003-05-05 13:24  Oswald Buddenhagen <ossi@users.sf.net>

	* src/main.c:

	accumulate status over multiple mailboxes, i.e., don't abort after first
	failure

2003-05-05 12:54  Oswald Buddenhagen <ossi@users.sf.net>

	* src/imap.c:

	fix imaps:

2003-02-27 18:43  Oswald Buddenhagen <ossi@users.sf.net>

	* src/sync.c:

	ignore \Recent, as it is voided by the syncronization run itself.

2002-12-28 15:31  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: config.c, cram.c, imap.c, isync.h, list.c, maildir.c,
	  main.c, sync.c:

	- update copyrights. 2003 didn't begin yet, but who cares? :)

2002-12-28 04:14  Oswald Buddenhagen <ossi@users.sf.net>

	* isync.1:

	- fixed typo
	- updated maintainer and location

2002-12-28 04:12  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: maildir.c, sync.c:

	- update isyncmaxuid properly

2002-12-28 04:04  Oswald Buddenhagen <ossi@users.sf.net>

	* src/config.c:

	- fixed two crashes

2002-12-28 04:02  Oswald Buddenhagen <ossi@users.sf.net>

	* src/imap.c:

	- handle bogus search responses more gracefully

2002-12-28 04:00  Oswald Buddenhagen <ossi@users.sf.net>

	* src/imap.c:

	- workaround imap server bug: lock files are no mailboxes

2002-12-28 03:58  Oswald Buddenhagen <ossi@users.sf.net>

	* src/: imap.c, sync.c:

	- improve console output

2002-12-28 03:11  Oswald Buddenhagen <ossi@users.sf.net>

	* .cvsignore:

	- ssht!

2002-12-28 03:05  Oswald Buddenhagen <ossi@users.sf.net>

	* .cvsignore, AUTHORS, Makefile.am, README, autogen.sh,
	  configure.in, isync.spec.in, src/.cvsignore, src/Makefile.am,
	  src/config.c, src/cram.c, src/dotlock.c, src/dotlock.h,
	  src/imap.c, src/isync.h, src/list.c, src/maildir.c,
	  src/main.c, src/sync.c:

	- took over maintenance
	- moved to sourceforge
	- reorganized cvs structure

2002-10-30 02:31  Michael Elkins <me@mutt.org>

	* config.c, cram.c, dotlock.c, dotlock.h, imap.c, isync.1,
	  isync.h, list.c, maildir.c, main.c, sync.c:

	Updated the copyright notice to allow an exception for linking with OpenSSL,
	which has a non-GPL compatible license.

2002-10-30 02:23  Michael Elkins <me@mutt.org>

	* .cvsignore, config.c, imap.c, isync.1, isync.h, maildir.c,
	  main.c, sync.c:

	Bunch 'o patches from Oswald Buddenhagen:

	i implemented some cool stuff (tm).
	first, the long missing "create server-side missing mailboxes". -C now
	creates both local and remote boxes; -L and -R create only local/remote.
	second, i implemented a 1:1 remote:local folder mapping (-1) with an
	optional INBOX exception (inbox/-I). the remote folder is specified with
	the folder keyword (or -F switch) and takes precedence over the
	namespace setting. the local directory with the mailboxes can now be
	specified on the command line, too (-M).

	another patch:
	- made the -1 switch settable permanently (OneToOne). after all, you
	  usually define your mailbox layout once forever. removed -A, as it is
	  semantically -a modified by -1.
	- cleaned up message output a bit. still, the quiet variable should be
	  used throughout the program. at best, create some generic output
	  function, which obeys a global verbosity level variable.
	- optimized + cleaned up configuration parser slightly
	- minor cleanups

	add an (almost) unique id to every uploaded message and search for it
	right after. i thought about using the message-id, but a) it is not
	guaranteed to be unique in a mailbox (imagine you edit a mail and store
	the dupe in the same box) and b) some mails (e.g., postponed) don't even
	have one. a downside of the current implementation is, that this
	id-header remains in the mailbox, but given that it wastes only 27 bytes
	per mail and removing it would mean several roundtrips more, this seems
	acceptable.
	i changed the line-counting loop to use a mmapped file instead of
	reading it in chunks, as it makes things simpler and is probably even
	faster for big mails.
	the amount of goto statements in my code may be scary, but c is simply
	lacking a multi-level break statement. :)

	this is the "shut up" patch. :) it makes the -q option consequent, so to
	say.
	additionally it adds an -l option which gathers all defined/found
	mailboxes and just outputs the list. don't ask what i need it for. ;)

2002-10-30 02:01  Michael Elkins <me@mutt.org>

	* maildir.c:

	fixed missing closedir() call (Joey Hess)

2002-06-27 03:55  Michael Elkins <me@mutt.org>

	* imap.c:

	explicitly set global.pass to NULL when getpass() returns an empty string.

2002-06-27 03:51  Michael Elkins <me@mutt.org>

	* imap.c:

	Oswald Buddenhagen <ossi@kde.org>
	* fix imap_open() brokeness with PREAUTH (missed hunk from previous patch)

2002-06-22 17:06  Michael Elkins <me@mutt.org>

	* dotlock.c, imap.c:

	fixed errors introduced by ME when hand-applying Oswald Nuddenhagen's
	patch.

2002-06-22 01:21  Michael Elkins <me@mutt.org>

	* autogen.sh, dotlock.c, imap.c, isync.h, main.c:

	Patch from Oswald Buddenhagen <ossi@kde.org>
	        - move prompt for password to imap_open()
	        - don't ask for global password in PREAUTH state
	        - use socketpair() to create one full-duplex fd in tunnel mode
	          instead of two half-duplex pipes
	        - don't set lck.l_pid in fcntl() call (its read-only)
	        - use F_SETLK instead of F_SETLKW to avoid infinite waiting
	        - use "$@" in autogen.sh to get proper word expansion

2002-06-21 00:26  Michael Elkins <me@mutt.org>

	* configure.in, isync.h:

	Fixed to compile under FreeBSD 4.6-RELEASE.  Must include ndbm.h rather than
	db.h.

2002-06-20 23:33  Michael Elkins <me@mutt.org>

	* Makefile.am, dotlock.c, dotlock.h, maildir.c:

	remove debian/files

	move dotlocking code to dotlock.c.

	dotlocking code fixed to ignore whether or not the lockfile exists on
	open().  we only care about whether fcntl() was able to lock it.

2002-06-19 02:31  Michael Elkins <me@mutt.org>

	* sync.c:

	Don't bother uploaded messages marked deleted when we are going to expunge.

2002-06-19 01:11  Michael Elkins <me@mutt.org>

	* AUTHORS, imap.c, maildir.c:

	fixed unused var warning in imap_open()

	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

2002-06-19 00:44  Michael Elkins <me@mutt.org>

	* Makefile.am:

	Debian package cleanups from Oswald Buddenhagen <ossi@kde.org>

2002-06-18 06:37  Michael Elkins <me@mutt.org>

	* README, isync.1, isync.h, maildir.c, main.c, sync.c:

	updated URL for project

	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

2002-04-19 19:43  Michael Elkins <me@mutt.org>

	* config.c, configure.in, imap.c, isync.1, isync.h,
	  isyncrc.sample, main.c:

	PREAUTH support from Oswald Buddenhagen <ossi@kde.org>

	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).

2002-01-28 19:39  Michael Elkins <me@mutt.org>

	* isync.spec.in:

	post 0.8 release commit

2002-01-28 19:34  Michael Elkins <me@mutt.org>

	* configure.in:

	check for dbm_open() in libc and libdb

2002-01-17 19:33  Michael Elkins <me@mutt.org>

	* sync.c:

	don't bother renaming the message file if we are about to unlink() it

2002-01-16 22:23  Michael Elkins <me@mutt.org>

	* AUTHORS, Makefile.am, sync.c:

	remove tilde backup files for distclean

	fixed indentation

	added full name to AUTHORS

	reformated NEWS blurb for 0.8

2002-01-16 22:13  Michael Elkins <me@mutt.org>

	* maildir.c, sync.c:

	sync_mailbox() did not update the msg struct when flags were changed,
	causing the expunge command to fail

	remove bogus strfcpy() line

2002-01-16 21:51  Michael Elkins <me@mutt.org>

	* Makefile.am, configure.in:

	added debian build files dist target so that people can use them to build
	their own .deb packages without having to use CVS

2002-01-16 21:43  Michael Elkins <me@mutt.org>

	* isync.1, maildir.c, sync.c:

	added debian build files

	fixed indentation

	added bug note to manpage about db file format not being architecture
	independent

2002-01-16 21:22  Michael Elkins <me@mutt.org>

	* maildir.c, sync.c:

	remove the uid from the db when a message is deleted from the maildir

	optimize db fetch/store to not copy the base filename

2002-01-16 19:47  Michael Elkins <me@mutt.org>

	* config.c, configure.in, cram.c, imap.c, isync.1, isync.h,
	  list.c, maildir.c, main.c, sync.c:

	updated year in copyright notice

	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.

2001-11-20 18:28  Michael Elkins <me@mutt.org>

	* Makefile.am, isync.spec.in:

	post 0.7-release commit

2001-11-20 18:06  Michael Elkins <me@mutt.org>

	* Makefile.am, isync.1, isync.h, maildir.c, main.c:

	added --create/-C command line option to force creation of the local
	maildir-style mailbox if nonexistent

	debug.h was not included in isync_SOURCES in Makefile.am

2001-11-19 19:41  Michael Elkins <me@mutt.org>

	* Makefile.am, config.c, configure.in, isync.h, list.c, main.c:

	added memory debugging code

	fixed memory leak in free_list()

	free memory associated with global settings on exit

2001-11-16 21:23  Michael Elkins <me@mutt.org>

	* cram.c, imap.c, isync.h, sync.c:

	remove c++ style comments

	use %lu and cast off_t to unsigned long in printf()

2001-11-15 23:59  Michael Elkins <me@mutt.org>

	* config.c, isync.1, isync.h, main.c, sync.c:

	Added MaxMessages patch from Eivind Eklund <eivind@FreeBSD.org>.

	config_defaults() can just use memcpy() instead of assigning each struct
	member individually.

	config_defaults() can be declared static

2001-11-14 17:40  Michael Elkins <me@mutt.org>

	* config.c, configure.in:

	move strndup() code into config.c for less complexity

	change AC_REPLACE_FUNC(strndup) to AC_CHECK_FUNCS(strndup)

	sed expression checking for gcc-3.0 should be quoted beccause it
	fails under Solaris 2.7

2001-11-13 00:36  Michael Elkins <me@mutt.org>

	* config.c, sync.c:

	strndup() could return a non-NULL terminated string

	size_t should be printed with %lu

	when expending tildes (~), an extra slash was inserted after the user's home
	directory

2001-11-12 23:03  Michael Elkins <me@mutt.org>

	* isync.h, maildir.c, main.c:

	merge maildir_sync() and maildir_close().  the maxuid in a maildir still
	needs to be updated in --fast mode, and the sync code already checks to see
	if any changes were made to the mailbox.

2001-11-09 00:35  Michael Elkins <me@mutt.org>

	* README:

	add FreeBSD to the list of tested platforms

2001-11-09 00:23  Michael Elkins <me@mutt.org>

	* config.c, configure.in, imap.c, maildir.c:

	update version to 0.7

	detect short write in write_strip()

	fix compilation warnings with gcc-2.95.4

2001-10-31 19:50  Michael Elkins <me@mutt.org>

	* configure.in, imap.c, isync.h, main.c, sync.c:

	set compiler warnings for gcc-3.0 as well

	display message with count of uploaded messages

	--quiet now supresses warnings in sync_mailbox()

	fixed compiler warnings with -Wshadow

2001-10-31 06:06  Michael Elkins <me@mutt.org>

	* isync.1:

	post 0.6 commit

2001-10-30 22:57  Michael Elkins <me@mutt.org>

	* README, configure.in:

	add strndup replacement function for systems which lack it

2001-10-03 17:10  Michael Elkins <me@mutt.org>

	* Makefile.am, maildir.c:

	fixed broken code in maildir_clean_tmp()

2001-10-03 16:48  Michael Elkins <me@mutt.org>

	* maildir.c:

	added code to clean the tmp directory in a maildir to comply with
	maildir(5)

2001-10-03 06:32  Michael Elkins <me@mutt.org>

	* config.c:

	forgot to add code to parse the `Delete' option

2001-10-03 06:18  Michael Elkins <me@mutt.org>

	* main.c:

	forgot conditional #if HAVE_LIBSSL around setting of .use_imaps in main()
	from command line arguments

2001-10-03 06:15  Michael Elkins <me@mutt.org>

	* main.c:

	update Copyright printed by --help

	add compile time option list to --help output

2001-10-03 05:42  Michael Elkins <me@mutt.org>

	* config.c, isync.1, isync.h, isyncrc.sample, main.c, sync.c:

	added `Delete' configuration option to force -d option

	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.

2001-10-03 00:01  Michael Elkins <me@mutt.org>

	* imap.c, sync.c:

	fixed maildir message filenames to comply with the maildir(5) specification.

	fixed write_strip() and imap_fetch_message() to check the return code of
	write() and fsync() to comply with maildir(5) spec.

2001-10-02 23:43  Michael Elkins <me@mutt.org>

	* main.c:

	the `Expunge' config directive didn't work since only the -e command line
	argument was consulted.

2001-10-02 22:46  Michael Elkins <me@mutt.org>

	* config.c, imap.c, isync.h:

	we should issue a CAPABILITY even if we aren't going to use ssl/tls so that
	cram-md5 auth still works.

2001-07-18 18:56  Michael Elkins <me@mutt.org>

	* config.c:

	find_box() should attempt to expand all filenames if none of the other
	methods found a match.

2001-07-18 18:49  Michael Elkins <me@mutt.org>

	* config.c, isync.h, maildir.c:

	fixed to not expand filenames until they are used inside of maildir_open(),
	so that aliases are not required for simple filenames.
	[re: http://bugs.debian.org/102255]

2001-06-22 23:30  Michael Elkins <me@mutt.org>

	* main.c:

	--host option didn't check for imaps: prefix

2001-06-21 20:45  Michael Elkins <me@mutt.org>

	* main.c:

	fixed core when specifying multiple mailboxes on the command line

2001-06-18 21:38  Michael Elkins <me@mutt.org>

	* configure.in, imap.c, isync.1:

	handle untagged responses in imap_fetch_message() so that it doesn't bomb
	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.

2001-06-18 17:49  Michael Elkins <me@mutt.org>

	* config.c, imap.c, isync.h, main.c:

	isync should continue to process additional mailboxes even if there is an
	error with a previous mailbox.

	added -a (--all) flag to synchronize all mailboxes defined in ~/.isyncrc

2001-02-28 01:02  Michael Elkins <me@mutt.org>

	* config.c, imap.c:

	fixed compiler warnings under Solaris 2.7

2001-02-19 18:44  Michael Elkins <me@mutt.org>

	* cram.c, imap.c, maildir.c:

	rfc2595 compliance patch from Daniel Resare <noa@metamatrix.se>
	        - CAPABILITY should be reissued after starting TLS since the
	          previous call was not protected

2001-02-14 20:46  Michael Elkins <me@mutt.org>

	* config.c, imap.c, isync.1, main.c, sync.c:

	patch from Daniel Resare <noa@metamatrix.se>:
	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

2001-02-01 23:35  Michael Elkins <me@mutt.org>

	* imap.c:

	patch from Daniel Resare <noa@metamatrix.se>
	        - don't initialize ssl support if none of use_sslv* is enabled

2001-01-26 20:21  Michael Elkins <me@mutt.org>

	* imap.c, isync.h:

	include <sys/types.h> for off_t

	patch from "lorenzo martignoni" <lorenzo.martignoni@technologist.com>
	        - fixed uploading of message to IMAP server

2001-01-24 07:09  Michael Elkins <me@mutt.org>

	* config.c, cram.c, imap.c, isync.1, list.c, maildir.c, main.c,
	  sync.c:

	fixed cram compilation error under bsd

	updated man page

2001-01-16 19:45  Michael Elkins <me@mutt.org>

	* config.c, imap.c, isync.1, isync.h, main.c:

	added support for tilde (~) expansion in the `Mailbox' and `CertificateFile'
	configuration directives

	added `Maildir' configuration command to specify the default location of the
	user's mailboxes.  If a relative path is used in a `Mailbox' command, this
	path is used as a prefix.

2001-01-11 10:21  Michael Elkins <me@mutt.org>

	* configure.in, imap.c, isync.h:

	set imap->prefix to be the namespace prefix

	update version to 0.5

	fixed compilation warnings in imap.c

2001-01-11 10:13  Michael Elkins <me@mutt.org>

	* Makefile.am, config.c, imap.c, isync.1, isync.h,
	  isyncrc.sample, main.c, sync.c:

	broke config code into config.c

	added support for uploading local messages with no UID to the IMAP server

	added Expunge configuration option

	added CopyDeletedTo configuration option

2001-01-09 20:09  Michael Elkins <me@mutt.org>

	* maildir.c, sync.c:

	always put changed messages in the cur/ subdirectory since they are no
	longer new.

	don't set \Seen implicitly for messages in the cur/ folder.  Require the S
	flag on the message since Mutt will move Old (unread, but not recent)
	messges into cur/.

2001-01-08 09:45  Michael Elkins <me@mutt.org>

	* Makefile.am, main.c:

	patch from Hugo Haas <hugo@larve.net>
	        -c was not specified in the getopt*() calls

	        set global password to the one the user inputs and use that as the
	        default for remaining mailboxes

2001-01-05 21:20  Michael Elkins <me@mutt.org>

	* configure.in:

	added --with-ssl-dir to specify an alternate installation of OpenSSL

2000-12-31 22:39  Michael Elkins <me@mutt.org>

	* isync.spec.in:

	pre 0.4 commit.

	updated rpm spec file

2000-12-31 22:37  Michael Elkins <me@mutt.org>

	* sync.c:

	display how many messages were fetched from the server

2000-12-31 22:17  Michael Elkins <me@mutt.org>

	* imap.c:

	fixed compilation error with no libssl support ("lorenzo martignoni"
	<lorenzo.martignoni@technologist.com>)

2000-12-28 18:44  Michael Elkins <me@mutt.org>

	* main.c:

	fixed config parser to accept arbitrary whitespace

2000-12-27 21:16  Michael Elkins <me@mutt.org>

	* imap.c:

	use imap_close to terminate a connection in imap_open()

2000-12-27 21:14  Michael Elkins <me@mutt.org>

	* imap.c, isync.1, isync.h, maildir.c, main.c:

	allow leading whitespace in config files

	now possible to sync multiple mailboxes by specifying multiple aliases on
	the command line.  IMAP connections are reused if possible.

	don't initialize ssl unless we are going to use it.

2000-12-23 21:57  Michael Elkins <me@mutt.org>

	* imap.c, isync.h:

	don't use NAMESPACE unless the server supports it

2000-12-23 00:02  Michael Elkins <me@mutt.org>

	* Makefile.am, README, cram.c, imap.c, isync.h:

	added CRAM-MD5 authentication support.

	parse server capability string to determine if STARTTLS is available

2000-12-22 21:22  Michael Elkins <me@mutt.org>

	* README, imap.c, isync.1, isync.h, main.c:

	isync-brokenservers.diff (Jeremy Katz <katzj@linuxpower.org>)
	adds support for disabling NAMESPACE, and disable various flavors of TLS/SSL
	for use with some broken IMAP servers.

2000-12-22 19:30  Michael Elkins <me@mutt.org>

	* imap.c, sync.c:

	prompt user if they wish to continue if the server's X.509 certificate can't
	be verified.

	sync_mailbox should consider uid == 0 to be "unknown"

2000-12-22 15:48  Michael Elkins <me@mutt.org>

	* main.c, sync.c:

	fixed sync_mailbox() to correctly write new messages to the local maildir
	box (Thomas Roessler <roessler@does-not-exist.org>)

2000-12-22 15:24  Michael Elkins <me@mutt.org>

	* main.c:

	set default MaxSize to 0 (unlimited)

	invert test for password being set after getpass() call (Magnus Jonsson
	<bigfoot@acc.umu.se>)

2000-12-22 07:14  Michael Elkins <me@mutt.org>

	* configure.in, imap.c, isync.1, isync.h, isyncrc.sample,
	  maildir.c, main.c, sync.c:

	added MaxSize configuration variable

	fixed --fast to work robustly without relying on the \Recent flag in
	messages

2000-12-21 23:10  Michael Elkins <me@mutt.org>

	* imap.c, isync.h, maildir.c, sync.c:

	RFC822.PEEK is obsolete in RFC2060.  Use BODY.PEEK[] instead, which does
	the same thing

	keep track of the uidvalidity so isync can detect if the mailbox on the
	server has changed since the last sync.

2000-12-21 20:56  Michael Elkins <me@mutt.org>

	* Makefile.am, isync.spec.in:

	added support for building RPMS

2000-12-21 19:49  Michael Elkins <me@mutt.org>

	* Makefile.am, isync.1:

	added target for creating html version of the man page

	documented the imaps: prefix to the Host command

2000-12-21 19:11  Michael Elkins <me@mutt.org>

	* imap.c, sync.c:

	can't assume flag order when fetching a message.  just search for the
	first `{' to find the message size.

2000-12-21 18:16  Michael Elkins <me@mutt.org>

	* isync.1, sync.c:

	added BUGS section to manpage detailing the fact that we break the
	maildir(5) spec by parsing the filename

	change message delivery to use the method described in maildir(5)

2000-12-21 17:51  Michael Elkins <me@mutt.org>

	* configure.in, main.c, sync.c:

	use getpass() to get the user's password

	unlink the temp file if we are unable to fetch a new message from the
	server.

	update version to 0.3

2000-12-21 11:14  Michael Elkins <me@mutt.org>

	* isync.1:

	fixed typo in man page for --verbose option

2000-12-21 10:24  Michael Elkins <me@mutt.org>

	* Makefile.am, README, imap.c, isync.h, list.c:

	added generic IMAP list parser and rewrote imap_exec() to handle
	arbitrary data instead of hardcoded

2000-12-21 06:51  Michael Elkins <me@mutt.org>

	* Makefile.am, README, configure.in, main.c:

	fixes to compile cleanly under Solaris 2.7

2000-12-21 06:27  Michael Elkins <me@mutt.org>

	* configure.in, imap.c, isync.1, isync.h, main.c:

	added OpenSSL support

2000-12-21 00:35  Michael Elkins <me@mutt.org>

	* configure.in, main.c:

	config options were not case insensitive

2000-12-21 00:30  Michael Elkins <me@mutt.org>

	* imap.c, isync.h, maildir.c, main.c, sync.c:

	don't fetch deleted messages when expunging

	display number of messages that are to be deleted

	flags for \Recent messages were not properly fetched

	local messages with updated flags were not corrected renamed

2000-12-20 22:28  Michael Elkins <me@mutt.org>

	* Makefile.am:

	updated ChangeLog

	added log: rule in Makefile.am

2000-12-20 22:10  Michael Elkins <me@mutt.org>

	* autogen.sh:

	added autogen.sh to regenerate the build environment

2000-12-20 22:00  Michael Elkins <me@mutt.org>

	* COPYING:

	added missing files

2000-12-20 21:41  Michael Elkins <me@mutt.org>

	* AUTHORS, Makefile.am, README, configure.in, imap.c, isync.1,
	  isync.h, isyncrc.sample, maildir.c, main.c, sync.c:

	initial import

