Commit Graph

1302 Commits

Author SHA1 Message Date
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
Oswald Buddenhagen
c9e57161cc autotest: add missing next in cmptrash()
this doesn't really matter, as the branches are mutually exclusive
anyway, but still.

amends 01329bdf.
2022-06-20 17:33:03 +02:00
Oswald Buddenhagen
a87d6ddaca bump version 2022-06-19 16:12:55 +02:00
Oswald Buddenhagen
21c8529383 update TODO
remove items:
- the "Unidentified socket error" should be gone since 7ba7be111
- imap_commit_cmds() is implemented since cfaa4848d
- we will never use MULTIAPPEND and FETCH BODY with multiple messages,
  as that would significantly complicate matters for no tangible benefit

... and add some new thoughts.

the idea to use strings of colons for quoting patterns doesn't work, as
colons in "regular" patterns could not be quoted.
2022-06-19 16:12:55 +02:00
Oswald Buddenhagen
7619705428 whitespace fixes
consistently surround '|' with spaces.
2022-06-19 16:12:55 +02:00
Oswald Buddenhagen
090ba0caa3 drop unused 'flags' parameter of maildir_list_{recurse,inbox,path}()
amends 416ced25.
2022-06-19 16:12:55 +02:00
Oswald Buddenhagen
46584e5358 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-19 16:12:55 +02:00
Oswald Buddenhagen
3bfc3c5063 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-19 16:12:55 +02:00
Oswald Buddenhagen
acd6b4b0b8 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-19 16:12:55 +02:00
Oswald Buddenhagen
32d500ed15 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-06-19 16:12:55 +02:00
Oswald Buddenhagen
52c063fd45 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-06-19 16:12:55 +02:00
Oswald Buddenhagen
efab63fb8e 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-06-19 16:12:55 +02:00
Oswald Buddenhagen
9169ee8fd8 assume Tunnel to be secure more consistently
follows up on 27458133.
2022-06-19 16:12:55 +02:00
Oswald Buddenhagen
8ba4192b23 autotest conversion of even more malformed messages
this follows up on 87065c12.
2022-06-19 16:12:55 +02:00
Oswald Buddenhagen
bfcc2d7d19 default to CRLF output in copy_msg_convert()
if we have nothing to go on, assume canonical line endings.
2022-06-19 16:12:55 +02:00
Oswald Buddenhagen
6dc9312dbc 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-06-19 16:12:55 +02:00
Oswald Buddenhagen
faec30abf4 rename SSLType => TLSType
for consistency with TLSVersions.
the variable names are unchanged to avoid churn.
2022-06-19 16:12:55 +02:00
Oswald Buddenhagen
a7f1b86475 disable TLS 1.0 & 1.1 by default
these were not reasonable defaults any more.
2022-06-19 16:12:55 +02:00
Oswald Buddenhagen
e3056b26e9 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-06-19 16:12:55 +02:00
Oswald Buddenhagen
7e0e14a686 prune legacy SSL options
they have been deprecated since v1.2.
2022-06-19 16:12:55 +02:00
Oswald Buddenhagen
f7458a96d3 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-06-19 16:12:52 +02:00
Oswald Buddenhagen
4c14123144 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-06-19 16:12:08 +02:00
Oswald Buddenhagen
f29dbb18f1 dissolve SVARS_CHECK_CANCEL_RET
it was small and used only twice, so didn't really pull its weight.
2022-06-19 16:12:08 +02:00
Oswald Buddenhagen
ffb290084a stop abusing SYNC_* for what really should be COPY_* 2022-06-19 16:12:08 +02:00
Oswald Buddenhagen
9e0efd409a prefer DECL_INIT_SVARS over DECL_SVARS+INIT_SVARS
... as a result of relying on C99+.
2022-06-19 16:12:08 +02:00
Oswald Buddenhagen
6bfffa177a make more use of SVARS_CHECK_RET{,_VARS} macro 2022-06-19 16:12:08 +02:00
Oswald Buddenhagen
4d75c45507 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-06-19 16:12:06 +02:00
Oswald Buddenhagen
edc901b7af include expunges in progress counters 2022-06-19 16:11:43 +02:00
Oswald Buddenhagen
8fbc4323f4 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-06-19 16:10:57 +02:00
Oswald Buddenhagen
1867a7c5ea 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-06-19 16:10:57 +02:00
Oswald Buddenhagen
8566283c59 make expiration target side configurable
REFMAIL: 87k0fauw7q.fsf@wavexx.thregr.org
2022-06-19 16:10:57 +02:00
Oswald Buddenhagen
abb596709b add --dry-run mode
REFMAIL: 20211130142121.xon5oygrpdfj5s2t@fastmail.com
2022-06-19 16:10:57 +02:00
Oswald Buddenhagen
5b9256f5dc 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-06-19 16:10:57 +02:00
Oswald Buddenhagen
ed92816fdb 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-19 16:10:57 +02:00
Oswald Buddenhagen
669f7dbd8f add test for copy_msg_convert() 2022-06-19 16:10:57 +02:00
Oswald Buddenhagen
dbffebf560 factor out ADD_NL() inside copy_msg_convert() 2022-06-19 16:10:57 +02:00
Oswald Buddenhagen
a32964c34e factor copy_msg_convert() out to own source file 2022-06-19 16:10:57 +02:00
Oswald Buddenhagen
46d244533e 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-06-19 16:10:57 +02:00
Oswald Buddenhagen
9b72e10320 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-19 16:10:57 +02:00
Oswald Buddenhagen
3aead33008 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).
2022-06-19 16:10:57 +02:00
Oswald Buddenhagen
f748bd45df 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-19 16:10:57 +02:00
Oswald Buddenhagen
80831e50b9 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-06-19 16:10:57 +02:00
Oswald Buddenhagen
0079ec774a add escaping of non-printable & non-ASCII characters to xvasprintf() 2022-06-19 16:10:57 +02:00
Oswald Buddenhagen
57173bd289 restructure xvasprintf() for uniformity
%\\s now supports length limitations, and \\ on other format specifiers
is now ignored (like .* already was on non-strings).
2022-06-19 16:10:57 +02:00
Oswald Buddenhagen
1a89f8a178 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-19 16:10:57 +02:00