about summary refs log tree commit homepage
path: root/t/lei-q-kw.t
DateCommit message (Collapse)
2021-08-19lei q: make --save the default
Since "lei up" is more often useful than not and incurs neglible overhead; enable --save by default and allow --no-save to work. This also fixes a long-standing when overwriting --output destinations with saved searches: dedupe data from previous searches are reset and no longer influences the new (changed) search, so results no longer go missing if two sequential invocations of "lei q --save" point to the same --output.
2021-07-25t/lei*: check error messages on failures
I just hit an unreproducible failure in t/lei-p2q.t and lacked $lei_err information to diagnose it. Hopefully this helps track down odd failures in the future.
2021-05-28t/lei-*: better diagnostics for occasional failures
Some of these have been failing occasionally, not sure how, yet...
2021-05-23lei <q|up>: set \Recent on non-empty mbox and Maildir
Despite JMAP not supporting the equivalent of the IMAP \Recent flag, it is useful for "lei q --augment", and "lei up" users to be able to distinguish new results from old-but-unread messages in an mbox or Maildir. For mbox family messages, we'll drop the "O" status flag when appending to mboxes, and we'll write to the "new" subdirectory of Maildirs. Behavior when writing to initially empty Maildirs and mboxes remains unchanged since there's no need to distinguish between new and old results in the initial case. Having users wait for a rename(2) storm or complete mbox rewrite hurts UX. With IMAP mailboxes, \Recent is already enforced by the IMAP server and IMAP clients have no way of changing it(*) (*) mutt uses the "Old" IMAP flag which isn't part of RFC 3501, other MUAs may do similar things.
2021-04-22lei: flesh out `forwarded' kw support for Maildir and IMAP
Maildir and IMAP can both handle `forwarded'. Ensure we don't lose `forwarded' when reading from stores which do not support it, but ensure we can set it when reading from IMAP and Maildir stores.
2021-03-25lei import: force store, improve test diagnostics
"lei import" should never be without a {sto}, and *_done should not be called multiple times, so ensure we can fail if it's missing. Update some existing tests to complain loudly by introducing a handy "xbail" function which wraps "explain" and BAIL_OUT. BAIL_OUT was painful to type and concatenating the result of "explain" doesn't work as I thought it would since "explain" always returns an array, and BAIL_OUT only accepts a single scalar arg (unlike "die").
2021-03-21lei import: vivify external-only messages
Keyword storage for external-only messages was preventing messages from being explicitly imported. Teach lei_store to vivify keyword-only entries into fully-indexed messages on import.
2021-03-21lei_to_mail: match mutt order of status headers
These changes may make it easier to do byte-for-byte comparisons with mail copied out of mutt, a popular MUA for our target audience. mutt currently outputs the 'R' (seen) flag before the 'O' character in the Status: header. We'll assume that stays the case (it has been for a while). Status now comes before X-Status, also matching mutt behavior.
2021-03-21lei q: put keywords on one line in --pretty output
Don't waste precious terminal space when there are only a small number of possible keywords supported/reserved for JMAP. In the future, we may implement more sophisticated wrapping for labels, but it we'll cross tha bridge when we come to it.
2021-03-21lei q: support vmd for external-only messages
"lei q" now preserves changes per-message keywords across invocations when it's --output (Maildir or mbox) is reused (with or without --augment). In the future, these changes will be monitored via inotify, EVFILT_VNODE or IMAP IDLE, too. Unfortunately, this currently prevents "lei import" from ever importing a message that's in an external. That will be fixed in a future change.
2021-03-05lei q: fix --import-before default and FIFO output
commit 6c551bffd75afb41d9b5e4774068abe7e06ed0e7 ("lei q: --import-augment for mbox and mbox.gz") added a check to in _pre_augment_mbox for the option being a ref() to distinguish between default values and user-supplied values (which are non-ref SCALARs from Getopt::Long). However, LeiQuery failed to use a SCALAR ref as the default value, making the check in _pre_augment_mbox useless. We now update LeiQuery to use \1 instead of 1 as the default value so "lei q -f mboxrd ..." to stdout works once again. Unfortunately, testing with redirects pointed to regular files didn't trigger the code paths being updated. Testing with a FIFO revealed further bugs in the FIFO handling code which are also fixed in this commit. We'll also update the $lei->out error message to be less-specific about "stdout" and use the term "output", instead, since LeiToMail replaces stdout for all mbox outputs.
2021-03-04lei q: s/import-augment/import-before/g
Since this importing of keywords is active even when --augment isn't specified, calling it --import-before seems more appropriate. In the future, this will likely default to adding unseen emails to lei/store, not just updating keywords. Link: https://public-inbox.org/meta/20210303222930.GA18597@dcvr/T/
2021-03-04lei q: --import-augment for mbox and mbox.gz
The trickiest output formats we support due to the possibility of filesystem FIFOS and pipes for <gzip|xz|bzip2>. This completes another phase of keyword sync support.
2021-03-04lei q: import flags when clobbering/augmenting Maildirs
This will eventually be supported for other mail stores, but Maildir is the easiest to test and support, here. This lets us avoid a situation where flag changes get lost between search results.