Commit Graph

1228 Commits

Author SHA1 Message Date
Dirk-Jan C. Binnema 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
Dirk-Jan C. Binnema 32bb79b316 draft: explicitly remove drafts after sending
This seems necessary in some cases.
2024-04-30 18:10:26 +03:00
Dirk-Jan C. Binnema 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
Dirk-Jan C. Binnema 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
Dirk-Jan C. Binnema 29ce96923a test-mu-utils: update parse_date_time tests
We're using ::time_t now.
2024-04-14 11:30:20 +03:00
Dirk-Jan C. Binnema 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
Dirk-Jan C. Binnema 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
Dirk-Jan C. Binnema 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
Dirk-Jan C. Binnema 4a03a30d04 utils: build test-utils when tests are not disabled
Fixes #2685
2024-04-08 18:29:57 +03:00
Dirk-Jan C. Binnema 5186264852 utils: only build mu-tests-utils when tests are enabled
This fixes a compilation failure.

Fixes #2684.
2024-04-06 10:36:18 +03:00
Dirk-Jan C. Binnema 4ddbac5d5f lib/xapian-db: improve error message 2024-04-05 19:03:42 +03:00
Dirk-Jan C. Binnema 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
Matthew Smith 45b4f60348 mu-utils: Fix build with musl
In musl, `stdout` is a macro that expands to `(stdout)`, and
`::(stdout)` is not valid C++.

../mu-1.12.2/lib/utils/mu-utils.hh:268:32: error: expected
  id-expression before '(' token
 268 |                              ::stdout);
     |                                ^~~~~~

Nothing in the Mu namespace is named stdout, so it is safe to drop
the `::`.

Bug: https://bugs.gentoo.org/928361
2024-04-01 11:23:39 +00:00
Dirk-Jan C. Binnema 5dfb4e9dd6 xapian-db: use get_msg on exception
We were using get_error_string, but that might be NULL,
which libfmt doesn't like much.
2024-03-15 22:45:37 +02:00
Dirk-Jan C. Binnema 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
Dirk-Jan C. Binnema 9fd0d2be12 clang: fix some compiler warnings
From CI.
2024-03-15 19:47:30 +02:00
Dirk-Jan C. Binnema bb5c36c658 tests: add some very basic CLD2_TEST
just to check if it works at all; no need to check cld2 at all.
2024-03-01 23:05:33 +02:00
Dirk-Jan C. Binnema df0a33b97c message: make sure HAVE_CLD2 is found
This broke the language detection code
2024-03-01 16:43:13 +02:00
Dirk-Jan C. Binnema dcbcd697f4 mu-init: insist that --maildir is absolute 2024-02-26 01:08:44 +02:00
Dirk-Jan C. Binnema 915335fd76 tests: check setlocale return value
It might fail while nl_langinfo does not.
2024-02-25 17:11:29 +02:00
Dirk-Jan C. Binnema 5a763af970 lib/mu-store: don't assume non-empty in remove_slash
HT: Arsen Arsenović

Fixes #2633.
2024-02-25 17:11:29 +02:00
Dirk-Jan C. Binnema 62f0a9a902 lib/mu-xapian-db: handle exception with dec_transaction_level
I.e., do our book-keeping beforehand.
2024-01-23 19:15:30 +02:00
Dirk-Jan C. Binnema 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
Dirk-Jan C. Binnema b4c768e6d0 mu-init: guess maildir when --maildir is missing
Re-instate the guessing that's in the manpage. Add unit tests.
Update documentation.

Fixes #2616.
2024-01-01 10:33:03 +02:00
Dirk-Jan C. Binnema 8366e009cb xapian-db: handle doc-not-found error in catch handler 2023-12-31 07:50:54 +02:00
Dirk-Jan C. Binnema bae290e718 server: perform_move: throw when message not found
Warning & continuing is not the right thing...
2023-12-31 07:49:56 +02:00
Dirk-Jan C. Binnema 1999d9e6ef compose: remove server-side handling
It's no longer needed: composition happens on the mu4e side only (until
a message is saved).
2023-12-29 23:23:13 +02:00
Dirk-Jan C. Binnema f3f4ea65ab xapian-db: improve some error messages
Correctly handle re-opening a transaction after one has finished.

Recognize some database opening errors and give some better user hints.

Fixes #2615.
2023-12-29 22:28:10 +02:00
Dirk-Jan C. Binnema 146b80113f lib: move transaction handling to mu-xapian
Instead of handling transactions in the store, handle it in xapian-db.
Make the code a bit more natural / cleaner-out

Handle transaction automatically (with a batch-size) and add some RAII
Transaction object, which makes all database interaction transactable
for the duration. So, no more need for explicit parameters to
add_message while indexing.
2023-12-22 21:24:41 +02:00
Dirk-Jan C. Binnema 25776da557 mu-result: small tweaks 2023-12-13 21:48:43 +02:00
Dirk-Jan C. Binnema 8bdf6b42a2 lib: debug-log moving / unlinking 2023-12-06 20:29:27 +02:00
Dirk-Jan C. Binnema 6dac4423e2 mu-contacts: remove some debug logging 2023-10-30 22:55:37 +02:00
Dirk-Jan C. Binnema de302e7609 lib/tests: add one more foo-bar regexp test 2023-10-29 17:16:05 +02:00
Dirk-Jan C. Binnema 51ecf46d81 wip: xapianizer unit tests 2023-10-14 16:25:58 +03:00
Dirk-Jan C. Binnema f4a930cd19 lib: query-processor: fix handling unknown flags
Fixes #2567.
2023-10-09 23:50:08 +03:00
Dirk-Jan C. Binnema fcd89039eb expand_path: better handle paths with spaces
I.e., work around surprising behavior of wordexp

Fixes #2566.
2023-10-07 00:18:56 +03:00
Dirk-Jan C. Binnema ee18c02762 maildir: improve unit tests
And get some more info from run_command.
2023-09-24 21:33:18 +03:00
Dirk-Jan C. Binnema 4a0eba8ddf improve unit tests 2023-09-24 20:21:57 +03:00
Dirk-Jan C. Binnema e16e1f78ce command-handler: more unit tests 2023-09-24 17:29:56 +03:00
Dirk-Jan C. Binnema fa22fc28d9 error: more unit tests 2023-09-24 17:29:56 +03:00
Dirk-Jan C. Binnema abb0fb4fd5 utils/add: improve unit test coverage 2023-09-24 17:29:56 +03:00
Dirk-Jan C. Binnema b0dca49dc0 store: better handling moving messages
sort results (for testing)

with the ChangeName flag, also apply to dup messages.
2023-09-24 17:29:56 +03:00
Dirk-Jan C. Binnema 5d37c18d7d lib: use flags_maildir_file
It's a better name. And fix some typos.
2023-09-24 17:29:56 +03:00
Dirk-Jan C. Binnema 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
Dirk-Jan C. Binnema 1a3dc46866 lib: maildir/store: more tests 2023-09-23 09:28:45 +03:00
Dirk-Jan C. Binnema 655a6b0499 lib: xapian-db/config: more tests
...and xapian-db gets a small API update, update store as well.
2023-09-23 09:27:46 +03:00
Dirk-Jan C. Binnema 11003000e8 mu: log warning when exiting with error 2023-09-23 09:26:37 +03:00
Dirk-Jan C. Binnema 04e3a2f9a8 mu-utils: improve tests 2023-09-21 23:41:15 +03:00
Dirk-Jan C. Binnema 6ce94ce914 mu-utils: add to_string_view 2023-09-21 23:41:15 +03:00
Dirk-Jan C. Binnema 8ba153067b mu-maildir: use the new run_command0
And fix some docstrings.
2023-09-21 23:41:15 +03:00