| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
Initialize info in SearchMessage irregardless of the message parts
flags otherwise it will crash when we attempt to read it in the next
switch statement.
Fixes: 8464b3738 ("search: use a common api for all workers")
Signed-off-by: jp39 <jp39@gmx.com>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
| |
This has nothing to do at the root of the source tree.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Bence Ferdinandy <bence@ferdinandy.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Allow the backend workers to combine the filter terms. Currently, the
consecutive filters are joined in the message store with a space (" ").
This works well for most backends, but makes the filter combination for
notmuch confusing.
Example:
Issuing two consecutive filter commands in notmuch
:filter not tag:list
:filter tag:list
would create the following filter query
'not tag:list tag:list'
This is not what users would expect; they expect:
'(not tag:list) and (tag:list)'
Note that the notmuch backend works correctly for the given query, but
produced a query that does not match the user's expectation. This patch
fixes this.
The combination of filter terms in other backends remains the same.
Reported-by: Ángel Castañeda <angel@acsq.me>
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Tested-by: Inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
| |
Add recipients fields (from, to, cc) to the header for filtering and
searching for the maildir and mbox backends.
Fixes: commit 8464b373 ("search: use a common api for all workers")
Reported-by: Vitaly Ovchinnikov <v@ovch.ru>
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Tested-by: Vitaly Ovchinnikov <v@ovch.ru>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Define a SearchCriteria structure. Update the FetchDirectoryContents,
FetchDirectoryThreaded and SearchDirectory worker messages to include
this SearchCriteria structure instead of a []string slice.
Parse the search arguments in a single place into a SearchCriteria
structure and use it to search/filter via the message store.
Update all workers to use that new API. Clarify the man page indicating
that notmuch supports searching with aerc's syntax and also with notmuch
specific syntax.
getopt is no longer needed, remove it from go.mod.
NB: to support more complex search filters in JMAP, we need to use an
email.Filter interface. Since GOB does not support encoding/decoding
interfaces, store the raw SearchCriteria and []SortCriterion values in
the cached FolderContents. Translate them to JMAP API objects when
sending an email.Query request to the server.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Koni Marti <koni.marti@gmail.com>
Tested-by: Moritz Poldrack <moritz@poldrack.dev>
Tested-by: Inwit <inwit@sindominio.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Avoid importing code from worker/lib into lib. It should only be the
other way around. Move the message parsing code used by maildir,
notmuch, mbox and the eml viewer into a lib/rfc822 package.
Adapt imports accordingly.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Koni Marti <koni.marti@gmail.com>
Tested-by: Moritz Poldrack <moritz@poldrack.dev>
Tested-by: Inwit <inwit@sindominio.net>
|
|
|
|
|
|
|
|
|
| |
Handle headers in the search and filter commands, for searching and
filtering based on the Headers specified by the -H parameter, the syntax
for the -H parameter should be `Header: Key`.
Signed-off-by: Julian Marcos <jmjl@tilde.green>
Acked-by: Robin Jarry<robin@jarry.cc>
|
|
|
|
|
|
|
| |
Using a list of integers is not optimal. Use a bit mask instead.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Handle date ranges in the filter and search commands for searching and
filtering based on the Date: header. Implement a flag (-d) that accepts
a date range <start[..end]> where the start date is included in the
range but the end date is not, i.e. [start,end).
The start or end date can be omitted: "start", "start..", "..end", or
"start..end" are all valid inputs.
An example filter query would look like this: :filter -d 2022-11-09..
The dates should be in the YYYY-MM-DD format.
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
| |
Since the minimum required version of Go has been bumped to 1.16, the
deprecation of io/ioutil can now be acted upon. This Commit removes the
remaining dependencies on ioutil and replaces them with their io or os
counterparts.
Signed-off-by: Moritz Poldrack <git@moritz.sh>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Apply GoDoc comment policy (comments for humans should have a space
after the //; machine-readable comments shouldn't)
Use strings.ReplaceAll instead of strings.Replace when appropriate
Remove if/else chains by replacing them with switches
Use short assignment/increment notation
Replace single case switches with if statements
Combine else and if when appropriate
Signed-off-by: Moritz Poldrack <moritz@poldrack.dev>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
| |
Run `make fmt`.
Signed-off-by: Moritz Poldrack <git@moritz.sh>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
Implement an mbox backend worker. Worker can be used for testing and
development by mocking a backend for the message store. Worker does not
modify the actual mbox file on disk; all operations are performed in
memory.
To use the mbox backend, create an mbox account in the accounts.conf
where the source uses the "mbox://" scheme, such as
source = mbox://~/mbox/
or
source = mbox://~/mbox/file.mbox
If the mbox source points to a directory, all files in this directory
with the .mbox suffix will be opened as folders.
If an outgoing smtp server is defined for the mbox account, replies can
be sent to emails that are stored in the mbox file.
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
|