Commit Graph

1270 Commits

Author SHA1 Message Date
8372be17dd mu-server: more info for mu4e-analyze-last-query
Include the search parameters besides the query.
2025-02-07 23:43:37 +02:00
aad5fc7df5 mu-server: minor cleanups 2025-02-05 21:07:14 +02:00
c0887603c5 guile: avoid body duplication
In message, don't re-fill when unneeded. Add tests.

Fixes #2802.
2025-02-05 21:16:15 +02:00
09965b2d09 test: add unit-tests for related/new/skip-dups
Test the interaction between related/new/skipped-duplicates. Seems to
work as expected.
2025-02-02 11:38:32 +02:00
e2cd37eaf5 mu-info: add example for ref:, thread: 2025-01-13 22:11:58 +02:00
f54e0c0476 mu-query-parser: cosmetic 2025-01-08 22:12:47 +02:00
5f8e0b71f0 server: make parsed queries available to mu4e
Basically, make the "mu find .... --analyze" information available in
mu4e, through a function mu4e-server-last-query.

This is shows the query as the server saw it, as well as the parse
s-expressions. This can be useful to see how some query is interpreted.
2025-01-08 22:12:47 +02:00
dee7e5951c utils-file: add unit-test for expand_file 2024-12-09 19:41:58 +02:00
0e0d4a0cb6 mu-sexp: add -unix output for json tstamps
The json output (for mu-find etc.) just showed the converted sexp
output, including the clumsy emacs-style tstamps (for changed/date).

Add unix timestamps as well, which are easier to work with outside
emacs.

This handles #2770.
2024-12-07 12:14:55 +02:00
646ad2e840 lib/utils: include fmt/xchar.h
Needed for 'join'
2024-12-06 20:14:11 +02:00
8fefc52eee query: add related: combi-field + test
Add a new combination (pseudo) field "related:", which combines
"message-id" and "references"
2024-12-02 11:43:14 +02:00
ed4d0f5e9d tests: add tests for ref: searching 2024-12-01 23:27:32 +02:00
8c7db59972 fields: make combi-fields introspectable
And add the display of combination-fields to 'mu info fields'.
2024-11-30 22:58:15 +02:00
c872efae34 search: make references searchable
Allow searching for message that have the given message-id in
References: or Reply-To:
2024-11-26 11:21:38 +02:00
831deb2364 lib/store-worker: remove
We're not using it.
2024-11-26 11:21:38 +02:00
d5d57b4327 remove non-single-threaded option
Single-threaded is the build-default, and seems to work well enough for
1.12.7, so remove the option to turn it off.

This is because build-options that influence such low-level/core
behavior are a pain to maintain.
2024-11-26 10:27:52 +02:00
b0d8d42dd2 indexer: make lazy check even lazier
In lazy-mode, we were skipping directories that did not change; however,
this didn't help for the case were users received new messages in big
maildirs.

So, add another check where we compare the ctime of message files with
the time of the last indexing operation. If it's smaller, ignore the
message-file. This is faster than having to consult the Xapian database
for each message.

Note that this requires in mu4e:
      (setq mu4e-index-lazy-check t)
or
   --lazy-check
as a parameter for 'mu index'.
2024-11-10 13:47:54 +02:00
fa59040ebc message: treat pcks7::smt::Unknown as encrypted
GMime isn't more specific, so let's assume it's encrypted; better than
nothing.

Fixes #2784.
2024-11-10 11:07:15 +02:00
d2343c6d62 mu-server: try avoiding xapian multi-threaded access
Try to avoid multi-threaded operations with Xapian.

This remove the thread workers during indexing, and avoids the indexing
background thread. So, mu4e has to wait once again during indexing.

We can improve upon that, but first we need to know if it avoids the
problem of issue #2756.
2024-10-08 11:23:04 +03:00
29dc1cea0c Fix typos. 2024-09-22 17:27:18 +00:00
e9ca3ad9f6 scanner: ignore emacs auto-saves
It's better to _not_ have auto-saves for your draft directory, but if
you do, ignore them at least in mu.

It may still trip up mbsync and friends, but not much we can do about
that.

Clean up the implementation a bit as well.
2024-09-03 23:02:35 +03:00
075394b35f lib: use time_t_max for empty datetime
In Mu::parse_date_time, when provided with an empty string, return
time_t_max instead of G_MAXINT64. For systems with a 64-bit time_t, there
is no difference. With a 32-bit time_t it caused a test to fail:

    not ok /utils/date-basic - ERROR:../mu-1.12.4/lib/utils/tests/test-utils.cc:92
    void test_date_basic(): assertion failed
    (parse_date_time(std::get<0>(test), std::get<1>(test)).value_or(-1)
      == std::get<2>(test)): (18446744073709551615 == 2147483647)

This edge case probably only affected the test, as when other parts of
the application call parse_date_time (e.g. mu-server.cc and
mu-query-processor.cc), they check if the input string is empty first.
2024-08-26 14:46:54 +00:00
c28bfe04e1 message: detect top-level smime parts + test
Fixes #2745
2024-08-22 22:34:34 +03:00
687db1aed6 mu-server: cosmetic 2024-08-21 06:19:35 +03:00
407c6ed4d1 xapian-db: improve errors, fix warnings 2024-08-21 06:18:37 +03:00
d7426238bd Update mu-store-worker.hh, remove duplicate ;
Fix gcc warning:
```
mu4e                           pre-build              [26/198] Compiling C++ object lib/libmu.a.p/mu-query-parser.cc.o               34.390111
mu4e                           pre-build              In file included from ../lib/mu-store.hh:34,                                   34.390132
mu4e                           pre-build                               from ../lib/mu-query-parser.hh:25,                            34.390140
mu4e                           pre-build                               from ../lib/mu-query-parser.cc:20:                            34.390146
mu4e                           pre-build              ../lib/mu-store-worker.hh:162:23: warning: extra ‘;’ [-Wpedantic]              34.390152
mu4e                           pre-build                162 |         Store& store_;;                                                34.390166
mu4e                           pre-build                    |                       ^                                                34.390172
mu4e                           pre-build                    |                       -                                                34.390177
mu4e                           pre-build              [27/198] Compiling C++ object lib/libmu.a.p/mu-contacts-cache.cc.o             34.538682
```
2024-08-08 15:47:38 +08:00
f01360ae9f lib: commit to disk after indexing 2024-08-04 22:28:13 +03:00
c6e8f894c1 test_index_move: extend unit test
Double-check the changed values are seen in a newly opened store.
2024-07-27 09:36:15 +03:00
e6fd83d00d logging: reduce debug logging a bit 2024-06-17 21:40:58 +03:00
5bd439271d store-worker: temporarily revert
Of course, after merging some problems come up.
Let's fix those first.

This reverts commit f2f01595a5.
2024-06-05 12:21:24 +03:00
b4ff8d62af server: support doccount data request
So we can update doccount in mu4e after indexing
2024-06-03 21:01:17 +03:00
697d6b6b4f server: pass sexp-commmands through store worker
To ensure all Xapian rw commands happen in the same thread.
2024-06-03 21:01:17 +03:00
f2f01595a5 indexer: use store-worker
Use the store worker (-thread) to do all database modification.

Currently, the "removed" field of Progress is always 0.
2024-06-03 21:01:17 +03:00
cf9c09867f store-worker: implement
store-worker is a thread + async queue to throttle requests to a single thread.
2024-06-03 21:01:11 +03:00
c05b28e761 xapian-db: remove locks, transaction levels
Simplify xapian-db: locks should go elsewhere; transaction level add
too much complication.
2024-06-03 21:01:07 +03:00
626b16a8f1 mu-config: cosmetic 2024-06-01 17:30:16 +03:00
e3ab780413 message: add default ctor
Useful for stuffing messages in async-queues
2024-06-01 17:30:16 +03:00
1e9f772e0a lib: fix batch-size after db creation
Ensure we use the user-specified batch-size immediately after db creation.
2024-06-01 17:30:16 +03:00
aeb6d44172 mu-store/indexer: consume messages from workers
Add store::consume_message, which is like add message but std::move from
the caller such that the messages longer has copies (with
Xapian::Document) on the caller side; this is to avoid threading issues.
2024-05-08 19:11:40 +03:00
ceed832cb9 mu-query: minor cleanups 2024-05-08 00:06:28 +03:00
23941735df logging: rework a bit, maybe support syslog
Seems journal logging fails on NetBSD (no surprise), but has some
unwanted/not-fully-understood side-effects.

In any case, outside Linux there's no use in even trying to use
journald; so we don't do that anymore.

Add conditional support for syslog (requires glib 2.80).
2024-05-07 09:27:50 +03:00
5a1ca77b47 scanner: don't skip directory entries with type DT_UNKNOWN
According to the readdir(2) man-page, not all file-systems support returning the
entry's file-type in `d_type`.  For example, the reprotest reproducibility tool,
uses the disorderfs FUSE file-system to shuffle the order in which directory
entries are returned, and this does not set `d_type`.  Therefore, in addition to
entries with type `DT_DIR` and `DT_LNK`, also process entries with type
`DT_UNKNOWN`.

Signed-off-by: Jeremy Sowden <azazel@debian.org>
2024-05-01 20:43:18 +01:00
5a48664033 lib: centralize xapian include, enable move semantics
Only include xapian.h in one place, so we can have consistent options.
With that in place, we can enable C++ move semantics.

We don't do anything with that yet, but we check in the meson.build file
to see if we have the required xapian version.
2024-05-01 17:02:24 +03:00
32bb79b316 draft: explicitly remove drafts after sending
This seems necessary in some cases.
2024-04-30 18:10:26 +03:00
6e8418bc64 mu-server: better handle msgid-not-found in move
It's opportunistic: messages referred to be msgid may not exist, and
that's okay.
2024-04-28 22:06:07 +03:00
a0d60d23b0 compat: include sys/wait.h where needed
netbsd needs this explicitly, other systems let us get away without it.
2024-04-21 22:08:10 +03:00
29ce96923a test-mu-utils: update parse_date_time tests
We're using ::time_t now.
2024-04-14 11:30:20 +03:00
a6ec43a740 mu-utils: update casting from int64_t -> time_t
Esp. for systems with 32-bit time_t.
2024-04-13 20:06:39 +03:00
4938d98f76 mu-indexer: re-enable database lock
Seeing some db corruption; re-enabling this (old) lock to see if it
helps. It _does_ slow down indexing significantly.
2024-04-10 21:47:04 +03:00
5e8c7493d9 mu-server: get rid of the sent-handler
We no longer need it; we can handle mu4e's sending directly in
mu4e-compose.
2024-04-10 21:47:04 +03:00