1346 Commits

Author SHA1 Message Date
Oswald Buddenhagen
e13b9399c1 make imap_msgs test actually return non-zero on failure 2025-09-25 18:36:51 +02:00
Oswald Buddenhagen
388e926e9e clarify that maildir message moves should preserve the flag field 2025-09-25 18:36:51 +02:00
Oswald Buddenhagen
23624e0fad mention that plain --debug excludes driver-all as well
amends 4cc5ad5a.
2025-09-25 18:36:51 +02:00
Oswald Buddenhagen
e46fee23df fix conditional on undefined value on some config syntax errors
if the first token on a line was an unterminated escape/quote, we'd
branch based on an uninitialized 'comment' variable.

amends 725a122e.
2025-09-25 18:30:51 +02:00
Oswald Buddenhagen
d0e9ea471e fix crash in mkdir_p() with invalid path
if the user specified Inbox as a non-existing path in a directory they
can't write to, we'd hit the root and crash due to a null pointer deref.

REFMAIL: CAEJTn2UzcnD_p=ogAcaci8Pecb8pDk=2qi6P0JX1pUA-HkVH3A@mail.gmail.com
2025-09-25 18:30:51 +02:00
Oswald Buddenhagen
ffc0884efe release preparation
update NEWS and AUTHORS
v1.5.1
2025-03-11 20:01:36 +01:00
Oswald Buddenhagen
ea22b09ac7 expand NEWS
include bug fixes and other improvements, as otherwise they wouldn't be
documented in a user-accessible way, given that ChangeLog wasn't all
that usable, and is gone entirely now.

this backfills from the release notes i have put next to each tar ball
since 1.0.5. and then some edits, in particular release dates.
2025-03-11 20:01:36 +01:00
Oswald Buddenhagen
8f58baa153 stub out ChangeLog
that file is a relic from the times before distributed VCS with atomic
commits existed. ours was slightly filtered, but still way too noisy to
be useful for end users. so basically, it had no target audience.

the file itself is left in place, because automake complains otherwise
(we don't want to use 'foreign' strictness, as otherwise INSTALL is not
added by autoreconf --install).
2025-03-11 19:58:41 +01:00
Oswald Buddenhagen
281a9ba465 prefix deprecation notices with file name
so it's (even) more obvious that these refer to the configuration,
rather than being some internal sloppiness.
2025-03-11 12:44:22 +01:00
Oswald Buddenhagen
61f0810bb1 fix -ls hanging after synchronous error
we need to make a note that we're already done with the Store, as
otherwise we'll wait for a callback that never comes.
2025-01-28 10:30:47 +01:00
Oswald Buddenhagen
1e0b661d09 fix --dry-run without --debug-driver
the stubbing is implemented by the proxy driver, so we need to hook it
in in that case as well. the driver is already prepared for that, as
it's also used to implement -Ta/-TA.
2025-01-28 00:49:17 +01:00
Oswald Buddenhagen
277e3cee1b explicitly strip newline from contents of VERSION
while m4 1.4.19 + autoconf 2.72 from my debian unstable drop the
trailing newline automatically, m4 1.4.18 + autoconf 2.69 shipped
with ubuntu 20.4 don't, leading to an invalid configure script.

reported and verified by Donat Wegner <dmw64@web.de>.
2025-01-13 13:14:55 +01:00
Paymon MARANDI
884413b488 build: also consider builds off of git with git clone --depth 1
one case where this could happen is a shallow clone, purely for build
purposes. in source based distros, like gentoo, setting depth of the
clone to 1, globally, is a common configuration. this patch avoids that
those builds fail.

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2024-12-04 17:20:49 +01:00
Oswald Buddenhagen
15c7e02e4a accept zero-sized messages from IMAP
while such a thing is rather pointless, completely empty messages are
not forbidden. consequently, we should be able to deal with them, and
above all not crash.
2024-11-25 10:46:44 +01:00
Behnam Lal
d7305e12d9 mbsync-get-cert: add support for STARTTLS
nowadays, many servers offer STARTTLS on the default IMAP port 143
instead of (or in addition to) the traditional IMAP over SSL/TLS (IMAPS)
on port 993.

this patch has been fixed up somewhat by the maintainer.
2024-11-24 11:22:34 +01:00
Oswald Buddenhagen
a1be7e9a36 make summary more concise
the verbose summary was actually hard to read due to the numbers getting
lost between the words.

i considered highlighting the numbers using ansi escapes, but the
irregular structure would be still hard to parse, and the escapes would
be unsuitable for log files.

also considered was clustering the numbers at the beginnings of the
lines, but that would result in a messy sentence structure.

a proper tabular format would introduce a lot more spacing, and would be
a lot harder to implement for little tangible benefit.

i tried just using the progress counter format, but with plain numbers
instead of the "x/y", but it looked kinda stupid.

so instead use a slightly expanded, semi-tabular version of that, as
suggested by Akshay Hegde on the list. this format bears a risk of
exceeding 80 columns, and in log files the internal spacing looks kinda
out of place, but these should be minor issues in practice.

amends a1a3313e.

REF: <ZzwSfSZN-lNNK55D@akshay.is>
2024-11-24 11:22:34 +01:00
Oswald Buddenhagen
1e7a75095b fix crash when resuming message propagation with MaxMessages
the problem is triggered by the source-side message disappearing
after a transaction to propagate it was started and then interrupted.

it seems tempting to centralize the null-check, but some of the other
branches are taken in situations where the relevant messages from the
source store have not been requested.

no autotest, as our test suite does not support injecting changes before
resuming.

amends 0089f49.
2024-11-24 11:22:34 +01:00
Oswald Buddenhagen
5f953c5162 fix omissions in making expiration target side configurable
amends 8566283c.
2024-11-24 11:22:34 +01:00
Oswald Buddenhagen
bf34d9fd29 do not let both-sided uidvalidity change deter us
the algorithm is symmetrical, comparing the msgids that belong to the
paired uids. so it doesn't matter for recovering one side if the other
side's uidvalidity also changed. it does however impact our ability to
say on which side the change was genuine.

the pointless limitation was presumably a vestige from an earlier
iteration.

amends 77acc26 and 594e60b.
2024-11-24 11:22:34 +01:00
Ludovico Gerardi
3c4b5f1c83 remove stray closing brace from man page
amends 5d5e07eb.
2024-09-29 14:48:01 +02:00
Oswald Buddenhagen
8c781d4fb5 fix implicit listing of Maildir INBOX under Path
commit acd6b4b0 ("simplify/fix recursive maildir listing") argued that
listing INBOX when it is encountered while listing Path would be
unnecessary, as the caller would list it separately anyway if requested.
however, it is actually documented that Patterns will implicitly match
INBOX nested into Path. so revert that commit.

REFMAIL: 20240818002409.4c918eb4@inari
2024-08-21 12:35:01 +02:00
Oswald Buddenhagen
17c9cc1140 improve reporting of failure to open previously present mailbox
tell explicitly that the box cannot be opened _any more_, so it's clear
that Delete, rather than Create, would apply.

fwiw, it would be preferable to actually differentiate between absent
mailboxes and ones that fail to open for other reasons. but
unfortunately, IMAP doesn't report the difference (gmail has a
non-standard [NONEXISTENT] response code, though).
2024-08-21 12:28:19 +02:00
Oswald Buddenhagen
dd27850e54 fix typos
most found using https://github.com/crate-ci/typos .
2024-08-19 12:33:41 +02:00
Oswald Buddenhagen
76e5f223ee add missing trailing newlines in error() calls 2024-08-06 17:16:09 +02:00
Oswald Buddenhagen
d54c22d20e fix IMAP INBOX case normalization
while is_INBOX() was adjusted to work with not null-terminated strings,
is_inbox() wasn't.

amends 3aead33.
2024-08-06 17:16:09 +02:00
Oswald Buddenhagen
4c2031d616 fix initial build from git
we need to ignore the absence of VERSION, as aclocal executes the
include() while ignoring the prior m4_syscmd().
2024-08-06 17:16:09 +02:00
Oswald Buddenhagen
4279aea6a0 generalize AUTHORS section of man page v1.5.0 2024-08-02 12:27:54 +02:00
Oswald Buddenhagen
6fbbcbb2c7 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 12:27:54 +02:00
Oswald Buddenhagen
8421b3cb22 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.
2024-08-02 12:23:44 +02:00
Oswald Buddenhagen
f467b57a95 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.
2024-07-31 21:30:42 +02:00
Oswald Buddenhagen
7bca6967a7 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.
2024-07-31 21:30:34 +02:00
Husain Alshehhi
5f81162f5e 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.
2024-07-31 21:23:58 +02:00
Oswald Buddenhagen
ee832951e2 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.
2024-07-31 21:23:58 +02:00
Oswald Buddenhagen
31c504d432 remove redundant argument from BIT_FORMATTER_PROTO()
it doesn't need to know the enum prefix.

amends 17db5de0c & 950ebe833.
2024-07-31 21:23:58 +02:00
Oswald Buddenhagen
43271d8fad eliminate commit_cmds driver callback
no driver implements it, and this isn't likely to change any time soon.
2024-07-31 21:23:58 +02:00
Oswald Buddenhagen
8b8313997c 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 cfaa4848dd.
2024-07-31 21:23:58 +02:00
Oswald Buddenhagen
84194a7a9f 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-31 21:23:58 +02:00
Oswald Buddenhagen
ceb0fa9803 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-31 21:23:58 +02:00
Oswald Buddenhagen
12e30ce560 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-07-31 18:38:15 +02:00
Oswald Buddenhagen
e70c300f74 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
2024-02-07 11:40:04 +01:00
Oswald Buddenhagen
65cd4429bb document defaults of referenced XDG env vars
so users don't have to google the spec.
2022-07-09 08:28:45 +02:00
Oswald Buddenhagen
8648d7a479 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-05 11:40:54 +02:00
Oswald Buddenhagen
ec50c55c36 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-04 18:28:30 +02:00
Oswald Buddenhagen
ced20ad0d9 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-04 18:28:30 +02:00
Oswald Buddenhagen
b841374827 fix broken Tunnel potentially causing SIGPIPE
we need to ignore the signal, so the regular error handling can kick in.
2022-07-04 18:28:30 +02:00
Oswald Buddenhagen
b9a4746b54 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-04 18:28:30 +02:00
Oswald Buddenhagen
460bfbb8ac 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 15:13:10 +02:00
Oswald Buddenhagen
92faccc639 improve wording of --ext-exit docu 2022-07-01 14:57:39 +02:00
Oswald Buddenhagen
f6ccf9c4f5 fix lineup of --ext-exit in help output 2022-07-01 14:57:39 +02:00
Oswald Buddenhagen
16ecde504d 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-26 12:21:58 +02:00