Commit Graph

168 Commits

Author SHA1 Message Date
19b2bdd6e4 mu-priority: make to_string inline
And remove some dead code.
2026-08-20 15:05:31 -07:00
91ad1c4478 cld2: fix HAVE_CLD2 test
It _is_ defined (as 0) when there is no CLD2.
2026-08-20 15:05:30 -07:00
d24347bad6 lib: rename support-ngrams => ngrams-enabled
For consistency.
2026-08-20 15:05:30 -07:00
86464cd083 modernization: tweaks for c++20
Update various places for what we can do with C++20:

- ends_with / starts_with
- std::to_array
- using instead of typedef
- designated initializers
- "[[maybe_unused]]" instead of G_GNUC_UNUSED

Also remove some unnecessary 'static'
2026-08-20 15:05:30 -07:00
502c9cd67b lib: use ascii ctype utils
Use the new ascii ctype utils.
2026-08-20 15:05:30 -07:00
01c07d8bcc Fix mu tag parsing from Keywords header
Split tags in the Keywords field on commas instead of spaces

https://datatracker.ietf.org/doc/html/rfc5322#section-3.6.5

Fixes #2932
2026-08-20 15:05:30 -07:00
f353e2dacf message: improve attachment heuristics
Do not consider calender-invitations "attachments"; do mark as
"calendar". Do recognize application/ics as calendar messages.

Update mime-object to expose a message part's disposition.

Change the "is-attachment" heuristic to include inline parts if they
have a filename parameter in their content-disposition.

Note that this doesn't change things radically; the delta is +69 and
-202 for ~6500 attachments.
2026-08-20 15:05:29 -07:00
5e9cdc6654 message: fix some error paths 2026-08-20 15:05:28 -07:00
dc5bbd9884 labels: improve logging for import
Clear up the code a bit using the new logging functions.

Don't log a failure for "plan A" as an error, it just scares user unnecessarily.
2026-08-20 15:04:27 -07:00
9b3e21081e test-mu-message: use join_path for test-path
We were not doing that correctly, missing a "/" between dirname and filename.
2026-08-20 15:04:27 -07:00
976b6210fc message: ensure message text is valid utf8
Seems this is not guaranteed, so convert if needed.
2026-08-20 15:04:27 -07:00
652b5ccbea labels: tighten labels regexp 2026-08-20 15:04:26 -07:00
c547cde73e store: remove some _unlocked functions, update clear_labels
They don't add much value, let's remove.

Rework clear_labels in terms of update_labels.
2026-08-20 15:04:26 -07:00
c074c138f8 store: improve label handling
In particular, clear_labels

And some cosmetics
2026-08-20 15:04:26 -07:00
2fa973ec90 mu-label: allow more characters
reduce the number of "taboo" characters in labels.

update docs.
2026-08-20 15:04:26 -07:00
76b9000588 mu-document: improve sexp updating
Ensure the cached message sexp gets updated in all cases where it's necessary.
2026-08-20 15:04:26 -07:00
d07a5bc2c1 labels: implement parse_delta_labels
Convenience function for parsing a series of delta labels; add tests as well.
2026-08-20 15:04:26 -07:00
543c43f078 Replace "the the " with "the " 2026-08-20 15:04:26 -07:00
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