Commit Graph

1300 Commits

Author SHA1 Message Date
8d3b65c5d8 utils: refactor count_nl from mu-cmd-find
And update users.
Please enter the commit message for your changes. Lines starting
2025-07-27 19:39:23 +03:00
28ea23a2a3 contacts-cache: cosmetics 2025-07-27 19:39:23 +03:00
33958cd0f7 fmt: prefer system package if found
mu embeds a "vendored" subset of the libfmt package under thirdparty; but it's
better to use the system-package if the user has one.

So, use the system package if found or user -Duse-embedded-fmt=true is
specified.
2025-07-24 19:55:27 +03:00
3b8edda881 mu-config.hh: unbreak mac build
The mac build broke (CI) because there's no conversion from time_t -> SCM
defined. Since we want to use int64_t anyway (2038), simply change to that.
2025-07-12 12:00:09 +03:00
8d46f80bb9 mu-config: split get() into get_str() and decode()
Makes it easier to use elsewhere.
2025-07-12 09:35:37 +03:00
652c7dc6b5 mu-mime-object.hh: fix some typos 2025-07-05 11:04:37 +03:00
e647ca924d server: make index log back-off a bit more concise 2025-06-30 21:50:16 +03:00
0d7ddba9fd fix typo 2025-07-01 00:48:40 +08:00
507925ca4b indexer sleep exp backoff 2025-07-01 00:34:36 +08:00
7f274fe518 mu-test: fix logging verbosity
We were logging _everything since the g_log_set_handler was only set for the
default domain, not "mu". Let's fix this.
2025-06-16 10:57:36 +03:00
eb75141d0a mu_utils: add to_string_char
Like to_string_gchar, but for malloc/free strings.
2025-06-14 13:14:03 +03:00
151917ce51 mu-maildir.cc: fix typo
Use the right #define in the dirent check. Seems we were always following the
slow path.
2025-06-10 10:04:53 +03:00
1527976729 mu-cfind/contacts-cache: refactor matching in for_each
Move some of the code in from the command-line tool to contacts-cache, for
possible re-use. Clean up a bit while doing so.
2025-06-10 10:04:53 +03:00
9496d6523d lib: improve xapianizer / xapian_term 2025-05-26 09:17:37 +03:00
668d5ffb99 contacts/contacts-cache: cleanups
refactor code a bit; move sorting to Contact

remove unneeded hashing in Contact (just use the email address)
2025-05-26 09:17:37 +03:00
cc1112d342 tests: skip some slow tests when valgrinding 2025-05-24 21:04:49 +03:00
e367f5b0d1 mu-scanner: improve ignore_dentry check 2025-05-24 19:18:52 +03:00
452969355c mu-test: add valgrind check
Make it a bit easier to skip some tests when running under valgrind.
2025-05-24 19:18:10 +03:00
ec3b55f2ab message: retain non-file flags when moving
The content-flags won't change, and the unread-flag can be re-calculated.

Add a unit test, and some small doc improvements.

Fixes #2831.
2025-05-24 17:17:00 +03:00
f75e1203d4 mu: rename --my-address into --personal-address
This makes things a bit more uniform with all the places where we use
"personal".

--my-address remains as an alias for the command-line option.

Add unit test.

Resolves #2806.
2025-05-24 17:17:00 +03:00
a7778fc333 test-store: don't break on slow systems
The 'circular-symlink' test.
2025-04-13 20:34:44 +03:00
a2a1838da4 mu-server: cleanup find prop handling
Rework the overly long find-handler.

Improve parsing of options, and return better return properties (for use
in mu4e).
2025-04-12 15:07:28 +07:00
17b85e8390 test-circular-symlink: loosen test a bit
Work-around some weirdness. No energy to do a root-cause analysis ;)

Fixes #2832.
2025-04-12 00:56:43 +07:00
507ea8e18e mu-sexp: don't require > c++17 2025-03-23 20:22:56 +02:00
44ba631a34 mu-find: implement format=json2
Implement a new experimental json2 format for mu-find, which gets rid of
the ":" prefixes for fields, i.e., "subject" instead of ":subject".
Document it as well.
2025-03-23 19:47:09 +02:00
4cda859eb8 mu-sexp: tighten definition of plistp
In a plist, we also require the first of each two element pairs to start
with ':'

Fixes #2830.
2025-03-23 19:47:09 +02:00
c91e4ef515 mu-sexp: fix c++23 warning for suffix operator
Space between operator"" and _xxx is deprecated.
2025-03-23 19:47:09 +02:00
18092c7ff9 indexer: minor tweaking 2025-02-23 11:39:21 +02:00
cdb619e4f5 Improve performance of index cleanup: use readdir(3), not access(2)
This change makes index cleanup ~4x faster by changing how we
determine whether a file mentioned by the database still exists on
disk.  Previously, we'd call access(2) for each file the database
mentioned.  Doing so produced a lot of system call overhead.  Now, we
read the directory entries of the directories containing the files
whose existence we're checking, build a hash table from what we find,
then do the existence check against this hash table instead of
entering the kernel.

The semantics of the cleanup check do change subtly, however.
Previously, we checked whether the mentioned file was *readable*.
Now we check merely that it exists.  Extant but unreadable files in
maildirs should be rare.

BEFORE:

$ time mu index --lazy-check
lazily indexing maildir /home/dancol/Mail -> store /home/dancol/.cache/mu/xapian
/ indexing messages; checked: 0; updated/new: 0; cleaned-up: 0

real    0m19.310s
user    0m1.803s
sys     0m12.999s

AFTER:

$ time mu --debug index --lazy-check
lazily indexing maildir /home/dancol/Mail -> store /home/dancol/.cache/mu/xapian
- indexing messages; checked: 0; updated/new: 0; cleaned-up: 0

real    0m4.584s
user    0m2.433s
sys     0m2.133s
2025-02-23 11:39:17 +02:00
7baf1bf5e5 mu: remove empty refs + unit-test
Some message can have an _empty_ message-id, e.g. with:
  In-Reply-To: <>
which we weren't filter out.

This would yield and _empty_ Thread-Id, in mu-message.cc

And this would make mu-query believe it had no matches in the first
query, in Query::Private::run_related, and effectively throw away the
results. (Xapian using empty string both for a "not found" result, and
"found an empty string doesn't help either).

So, avoid having an empty reference. Also add a unit-test.

Fixes #2812.
2025-02-13 22:48:03 +02:00
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