150 Commits

Author SHA1 Message Date
f504289a02 labels: ensure c++17 compatibility
This broke the build earlier.
2025-08-16 08:43:41 +03:00
46fa4f2aa2 mu: add 'label' command + manpage + tests
Add a label command and document it.
2025-08-15 21:03:19 +03:00
552bb3a7c8 message: add support for labels + tests
Labels are strings associated with messages, which can be used for searching
them.
2025-08-15 21:02:24 +03:00
34d3bf2e28 tests: only build when needed
Build the tests lazily, i.e., not before `meson test`. This helps with
build-times.
2025-08-15 21:01:05 +03:00
652c7dc6b5 mu-mime-object.hh: fix some typos 2025-07-05 11:04:37 +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
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
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
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
e2cd37eaf5 mu-info: add example for ref:, thread: 2025-01-13 22:11:58 +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
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
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
c28bfe04e1 message: detect top-level smime parts + test
Fixes #2745
2024-08-22 22:34:34 +03:00
e6fd83d00d logging: reduce debug logging a bit 2024-06-17 21:40:58 +03:00
e3ab780413 message: add default ctor
Useful for stuffing messages in async-queues
2024-06-01 17:30:16 +03: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
d13feb2d99 mu-contact: move email validation to contacts cache
So we can be sure the regexp is initialized. This _may_ help for
 https://bugzilla.opensuse.org/show_bug.cgi?id=1221861
though it is very hard to tell!
2024-04-02 07:40:20 +03:00
52826aa758 message: flag list-unsubscribe as MailingList
Flag message that merely have a List-Unsubscribe header with
Flags::MailingList too (some marketing message have this header, yet
miss "List-Id".

Add a test as well.
2024-03-15 19:47:37 +02:00
df0a33b97c message: make sure HAVE_CLD2 is found
This broke the language detection code
2024-03-01 16:43:13 +02:00
30b8238522 tests: move to tests/, make optional
While not recommended, sometimes it can be useful to disable building
the unit tests. This can be done now with
    meson -Dtests=disabled build
2024-01-06 18:35:22 +02:00
5d37c18d7d lib: use flags_maildir_file
It's a better name. And fix some typos.
2023-09-24 17:29:56 +03:00
2d20074b99 mu-move: add new move sub command
Add sub-command to move messages; add tests and docs.

Fixes #157
2023-09-24 17:29:08 +03:00
ae87be6a48 flags: add flags_mail_dir_file util
And some whitespace cleanup
2023-09-19 22:26:45 +03:00
94c90bd0c5 fields: 'phrasable' instead of 'indexable'
'Phrasable' is probably a bit clearer description.
2023-09-17 18:11:10 +03:00
c8568eecd4 utils/file: add basename/dirname helpers and use them 2023-09-10 10:15:28 +03:00
89ed21e0c5 lib: improve printability for some types
A little fmt pixie dust
2023-09-09 17:26:20 +03:00
264bb092f0 support xapian ngrams
Xapian supports an "ngrams" option to help with languages/scripts
without explicit wordbreaks, such as Chinese / Japanese / Korean.

Add some plumbing for supporting this in mu as well. Experimental for
now.
2023-09-09 17:26:20 +03:00
b2918e2bea mu-priority: implement priority_from_name 2023-08-21 18:29:21 +03:00
bd17c218fb mu-flags: get flag-info for shortcut, too 2023-08-21 18:29:21 +03:00
04219b55f7 message & friends: make formattable
So we can easily debug-print them.
2023-08-09 23:24:47 +03:00
aea95b5be0 mu-server: use strings, not sexps object (optimization)
When passing messages to mu, often we got a (parsed from string)
message-sexp from the message document; then appended some more
properties ("build_message_sexp").

Instead, we can do it in terms of the strings; this is _a little_
inelegant, but also much faster; compare:

(base)
[mu4e] Found 500 matching messages; 0 hidden; search: 1298.0 ms (2.60 ms/msg); render: 642.1 ms (1.28 ms/msg)

(with temp-file optimization (earlier commit)
[mu4e] Found 500 matching messages; 0 hidden; search: 1152.7 ms (2.31 ms/msg); render: 270.1 ms (0.54 ms/msg)

(with temp file optimize _and_ the string opt (this commit)
[mu4e] Found 500 matching messages; 0 hidden; search: 266.0 ms (0.53 ms/msg); render: 199.7 ms (0.40 ms/msg)
2023-08-04 00:09:02 +03:00
1018f0f0a1 mu-document: Make sexp() lazy (optimization)
This makes queries where we don't need the sexp much faster; e.g.

before:
   mu find "a" --include-related  47,51s user 2,68s system 99% cpu 50,651 total
after:
  mu find "a" --include-related  7,12s user 1,97s system 87% cpu 10,363 total
2023-08-04 00:09:02 +03:00
b795242d5a message: use html-to-text scraper for html parts
We were dumping the HTML-parts as-is in the Xapian indexer; however,
it's better to remove the html decoration first, and just pass the text.

We use the new built-in html->text scraper for that.
2023-07-25 21:26:36 +03:00
7b38f094c4 migrate some more code to mu_format / join_paths
Let's modernize a bit.
2023-07-20 23:14:29 +03:00
31f0c40893 migrate to fmt-based logging in some more places
and improve logging.
2023-07-08 10:30:36 +03:00
75a2cab3f1 message: don't check language without cld2 support
No point in checking if we do not have the support.
2023-07-06 21:49:50 +03:00
aed1395c53 lib/utils: update library paths 2023-07-05 23:14:34 +03:00
4920b56671 update to use fmt-based apis
Not complete, but a first big stab converting users of Mu::Error and
various g_warning & friends, format to the new libfmt-based APIs.
2023-07-05 23:10:13 +03:00
c5f3894374 message: double-check part-type in Multipart
Avoid exception for some messages (unsigned messages with signed
attachment).
2023-07-05 20:39:47 +03:00
c6fff6a281 all: update for API changes (config etc.)
Use the new & improved APIs.
2023-07-02 00:06:56 +03:00
0bdab5ae06 contact/display-name: quote "names" with '@'
Apparently, some mail servers want this, and gnus doesn't handle it
automatically.
2023-06-12 23:37:39 +03:00
b9026c5042 message/fields: add some helpers for combination-fields
such as "recip" and "contacts".
2023-06-04 14:56:40 +03:00
7f2eeb1010 message: try to detect body text language
Try to detect the language of the e-mail body and make it searchable.
2023-05-11 23:23:52 +03:00
36d89f400f message: remove control characters from subject
And add a unit-test.

Fixes #2477
2023-04-24 21:52:13 +03:00
026a19bcfa message: allow extracting message parts to file
And add unit-test.

Fixes #2467
2023-04-06 07:19:26 +03:00
cd23e6015d mu: allow relative message paths in mu commands 2023-04-06 07:19:26 +03:00
f3c3811818 message: fix user-after-scope in test 2023-03-24 23:24:19 +02:00