Commit Graph

1283 Commits

Author SHA1 Message Date
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
4a03a30d04 utils: build test-utils when tests are not disabled
Fixes #2685
2024-04-08 18:29:57 +03:00
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
4ddbac5d5f lib/xapian-db: improve error message 2024-04-05 19:03:42 +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
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
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
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
9fd0d2be12 clang: fix some compiler warnings
From CI.
2024-03-15 19:47:30 +02:00
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
df0a33b97c message: make sure HAVE_CLD2 is found
This broke the language detection code
2024-03-01 16:43:13 +02:00
dcbcd697f4 mu-init: insist that --maildir is absolute 2024-02-26 01:08:44 +02:00
915335fd76 tests: check setlocale return value
It might fail while nl_langinfo does not.
2024-02-25 17:11:29 +02:00
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
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
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
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
8366e009cb xapian-db: handle doc-not-found error in catch handler 2023-12-31 07:50:54 +02:00
bae290e718 server: perform_move: throw when message not found
Warning & continuing is not the right thing...
2023-12-31 07:49:56 +02:00
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
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
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
25776da557 mu-result: small tweaks 2023-12-13 21:48:43 +02:00
8bdf6b42a2 lib: debug-log moving / unlinking 2023-12-06 20:29:27 +02:00
6dac4423e2 mu-contacts: remove some debug logging 2023-10-30 22:55:37 +02:00
de302e7609 lib/tests: add one more foo-bar regexp test 2023-10-29 17:16:05 +02:00
51ecf46d81 wip: xapianizer unit tests 2023-10-14 16:25:58 +03:00
f4a930cd19 lib: query-processor: fix handling unknown flags
Fixes #2567.
2023-10-09 23:50:08 +03:00
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
ee18c02762 maildir: improve unit tests
And get some more info from run_command.
2023-09-24 21:33:18 +03:00
4a0eba8ddf improve unit tests 2023-09-24 20:21:57 +03:00
e16e1f78ce command-handler: more unit tests 2023-09-24 17:29:56 +03:00
fa22fc28d9 error: more unit tests 2023-09-24 17:29:56 +03:00
abb0fb4fd5 utils/add: improve unit test coverage 2023-09-24 17:29:56 +03:00
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
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
1a3dc46866 lib: maildir/store: more tests 2023-09-23 09:28:45 +03:00