62 Commits

Author SHA1 Message Date
Robin Jarry
e8e953aaa8 msgstore: add index field for incremental updates
Add an Index field to MessageInfo that indicates the message's position
in the current view. This allows workers to send incremental updates
with position information, enabling the UI to insert new messages at the
correct location without requiring a full refresh.

The JMAP push handler now includes index information when sending
unsolicited message updates, allowing the message list to stay
synchronized with server-side changes in real time.

Signed-off-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Simon Martin <simon@nasilyan.com>
2026-02-09 14:46:27 +01:00
Robin Jarry
e324fa248f worker: add directory and filter metadata to response messages
Add Directory and Filter fields to DirectoryContents, DirectoryThreaded,
SearchResults, MessageInfo, and FullMessage response types. Workers now
populate these fields so the UI knows which directory and filter context
each response belongs to.

This metadata allows the message store to correctly associate incoming
messages with their source context, which is essential for the offline
worker to cache messages by directory and for proper handling of
concurrent operations across multiple folders.

Signed-off-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Simon Martin <simon@nasilyan.com>
2026-02-09 14:46:27 +01:00
Robin Jarry
8a151bac23 models: add validity identifier to Directory structs
Add a Uid field to Directory and DirectoryInfo that stores a unique
identifier which changes when the directory contents become invalid.
For IMAP, this is the UIDVALIDITY value; other backends leave it empty.

Fetch UIDVALIDITY during directory listing when LIST-STATUS is
available, otherwise fetch it during CheckMail status queries. Include
the validity in Directory messages sent to the UI.

Refactor handleListDirectories to collect all mailboxes and statuses
before sending Directory messages, allowing the validity to be included
from the status response.

Signed-off-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Simon Martin <simon@nasilyan.com>
2026-02-09 14:46:27 +01:00
Robin Jarry
e9852a2558 imap: include directory and validity in message UIDs
Change the UID format from a simple numeric string to include the
directory name and UIDVALIDITY value in the format "dir:validity:uid".
This makes UIDs globally unique across the entire account rather than
just within a single mailbox.

The new format allows the UI and offline cache to unambiguously identify
messages even when switching between directories. It also provides
automatic cache invalidation when UIDVALIDITY changes, as the UID
prefix will differ.

Move the UID conversion functions from the models package to IMAPWorker
methods since they now depend on the selected mailbox state.

Signed-off-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Simon Martin <simon@nasilyan.com>
2026-02-09 14:46:27 +01:00
Robin Jarry
f1217b88e0 templates: add missing methods to TemplateData interface
The TemplateData interface was missing HasNew, Bell, and Title methods
that are implemented by the concrete type. Add these methods to the
interface and corresponding stub implementations in dummyData used for
template validation during config parsing.

Also document the Number template field and the ThreadContext and
ThreadOrphan threading attributes that were previously undocumented.

Signed-off-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com>
2026-01-07 11:10:49 +01:00
Robin Jarry
dab1d48a25 body-structure: store parts content-id headers
In order to load message parts for rendering html emails, we need to
know the parts Content-ID header values (if any). Add this field to the
BodyStructure type and initialize it in all workers.

Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
Tested-by: Inwit <inwit@sindominio.net>
Tested-by: Matthew Phillips <matthew@matthewphillips.info>
2025-12-04 13:52:37 +01:00
Moritz Poldrack
fc5b6896ff chore: switch to using stdlib helper functions
Go has evolved significantly over the years and has introduced some
handy helper functions that make the code easier to read.

Use helper functions like slices.Contains, map.Copy, and
strings.CutPrefix, when appropriate.

Signed-off-by: Moritz Poldrack <git@moritz.sh>
Acked-by: Robin Jarry <robin@jarry.cc>
2025-08-04 12:47:05 +02:00
Robin Jarry
1c54bb3a9d models: pad message uids with zeroes
IMAP message UIDs are 32 bits unsigned integers. All other backends use
opaque strings without any specific ordering. The UIDs are used for
ordering only for IMAP.

Pad the integer uids with zeroes when converting them to strings to
ensure ASCII sorting will work as previously.

Fixes: 73dc39c6ee ("treewide: replace uint32 uids with opaque strings")
Reported-by: Fedor Pchelkin <boddah8794@gmail.com>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Jens Grassel <jens@wegtam.com>
2024-10-03 12:07:00 -05:00
Robin Jarry
73dc39c6ee treewide: replace uint32 uids with opaque strings
Add a new models.UID type (an alias to string). Replace all occurrences
of uint32 being used as message UID or thread UID with models.UID.

Update all workers to only expose models.UID values and deal with the
conversion internally. Only IMAP needs to convert these to uint32. All
other backends already use plain strings as message identifiers, in
which case no conversion is even needed.

The directory tree implementation needed to be heavily refactored in
order to accommodate thread UID not being usable as a list index.

Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Inwit <inwit@sindominio.net>
Tested-by: Tim Culverhouse <tim@timculverhouse.com>
2024-08-28 12:06:01 +02:00
inwit
930cece51d templates: add a template for forwaded messages
Add a {{.IsForwarded}} template to tell if a message has been forwarded
or not.

Changelog-added: Forwarded messages can be identified with the
 {{.IsForwarded}} template.
Signed-off-by: inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
2024-08-20 11:54:34 +02:00
inwit
b94b4c00c9 forward: allow forwarded flag to be set
Usually, a MUA sets a flag for messages that have been forwarded, but
this is currently not the case for aerc. Consider the forwarded flag
and prepare aerc to set it everytime the :forward command is called and
ends successfully.

Changelog-added: The :forward command now sets the forwarded flag.
Signed-off-by: inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
2024-08-20 11:54:34 +02:00
Koni Marti
f913070600 imap: expose extension in capabilities
Expose the supported extensions in the capabilities.

Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2024-08-04 18:24:42 +02:00
Robin Jarry
954c812d84 reply: allow copying to current folder
Add a new copy-to-replied setting in accounts.conf to copy sent replies
to the same folder than their replied message.

Requested-by: Tristan Partin <tristan@partin.io>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Tristan Partin <tristan@partin.io>
2024-08-03 20:19:37 +02:00
Bence Ferdinandy
88d5de97d6 reply: handle the Sender header
Sometimes emails will have a Sender: header, that is different from the
From: header. The only use of this in the wild I have seen to date is
when meeting invitation is forwarded by somebody. The From: header will
be the person organising the meeting, and the Sender: will be the person
forwarding. Naturally, when one replies (e.g. with on accept), it should
go to the meeting oragniser, but sometimes one would want to include the
Sender in such a reply.

When executing :reply determine the To: address in order of Reply-To:,
From:, Sender:. When executing :reply -a, include the Sender: in Cc:.

Implements: https://todo.sr.ht/~rjarry/aerc/259
Link: https://www.rfc-editor.org/rfc/rfc4021#section-2.1.3
Changelog-added: Replying to all will include the Sender in Cc.
Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com>
Reviewed-by: Tim Culverhouse <tim@timculverhouse.com>
Reviewed-by: Tristan Partin <tristan@partin.io>
Acked-by: Robin Jarry <robin@jarry.cc>
2024-08-03 20:05:29 +02:00
Bence Ferdinandy
1d4eafb011 templates: add {{.AccountFrom}} template
Add template variable to access the current account's From address.

Implements: https://todo.sr.ht/~rjarry/aerc/150
Changelog-added: New `{{.AccountFrom}}` template variable.
Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com>
Tested-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2024-08-03 17:42:11 +02:00
Koni Marti
7f66297c52 threadbuilder: show siblings even when no parent found
Show all threading associations even when not all nodes are present.
Indicate if a thread is incomplete, i.e. misses a direct parent node.

Use the `msglist_thread_orphan.fg=red` styleobject in your stylesheet to
indicate whether a messsage has a missing parent.

Also use a different thread prefix ("┬─" instead of "├─") not to confuse
them with regular threads that have a visible parent.

Signed-off-by: Koni Marti <koni.marti@gmail.com>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Matěj Cepl <mcepl@cepl.eu>
2024-06-25 15:28:11 +02:00
Bence Ferdinandy
47c2266872 templates: add .AccountBackend
It's useful to know what the current account's backend is, especially if
one has multiple configs where the same account name might use
a different backend. Add AccountBackend to templates.

Changelog-added: Added `{{.AccountBackend}}` to templates.
Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2024-06-05 08:41:13 +02:00
Jason Cox
11b035f120 flags: add support for draft flag
Support the draft flag wherever flags are used. Automatically set it
when postponing a message, and allow recalling a message without the -f
flag if it has the draft flag set, regardless of what folder it's in.

Notmuch doesn't seem to pick up on the draft flag when indexing even
though the flag is set on the maildir file. Explicitly set all tags
corresponding to set flags when appending a message in notmuch.

Changelog-added: Support the `draft` flag.
Signed-off-by: Jason Cox <me@jasoncarloscox.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2024-01-26 21:36:15 +01:00
Bence Ferdinandy
b76bf1b7ee templates: move signature from compose to templates
Currently, when composing a new message, everything is read from the
template files, except the signature, which is added directly in the
compose code. Add a new template variable {{.Signature}}, by moving the
logic of reading signature from command or file from compose to
templates. Update the various default template files to preserve the
original placement of signatures. Users using the default templates
should not notice the change. Users with custom compose templates will
need to update their templates with {{.Signature}}.

Changelog-changed: Signature placement is now controlled via the
 `{{.Signature}}` template variable and not hardcoded.
Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2024-01-08 00:02:21 +01:00
Bence Ferdinandy
930e50328c templates: add full path of file(s) as Filename(s)
For the maildir and notmuch backends, add the full path of the message
as Filename to templates. In case of a notmuch message having multiple
files associated with it, it returns a random path. Also add Filenames
to templates, which is a list of all associated message paths. This is
relevant for the notmuch backend, where a single messages is shown, if
there are multiple copies of it.

Changelog-added: Add filepath to messages in templates as .Filename(s)
Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2023-12-31 11:56:48 +01:00
Koni Marti
30d28d0542 dirtree: add custom virtual directory role
Add a new directory role to indicate virtual nodes in the directory
tree. This allows to style the virtual nodes differently and apply
different behaviors in some commands (i.e. rmdir).

Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2023-11-23 00:14:54 +01:00
inwit
c13df79976 threads: add .ThreadUnread to template data
When a thread is folded, it can be useful to know how many unseen
messages lie below the root. For example, one might want to show that
count in the message list:

column-folded = {{if .ThreadFolded \
	}}{{if ne .ThreadUnread 0 \
		}}{{.ThreadUnread | printf "%s/"}}{{ \
	end}}{{ .ThreadCount | printf "%s"}}{{end}}

Add `.ThreadUnread` to the template functions.

Changelog-added: `.ThreadUnread` is now available in templates.
Signed-off-by: inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
2023-11-12 12:53:11 +01:00
Tim Culverhouse
4ec1e1a5e4 ui: enable showing of thread-context
Add a UI config value to enable showing of "thread-context", similar
to `notmuch show --entire-thread=true`. Add an associated style called
"msglist_thread_context" which can be used to style such messages.

Currently this feature is only supported by notmuch. It would be
possible for maildir to implement as well, IMAP with gmail custom
extensions, and JMAP. This patch merely implements the notmuch version
and puts the groundwork in for handling these sorts of displays.

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Tested-by: Inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
2023-09-27 23:12:41 +02:00
Koni Marti
d29c9d1a2f templates: attach directly from templates
Attach a file from templates. Add a split template function.

{{- .Attach "LICENSE" -}}

or

{{range (exec "find ./doc -type f -name *.scd" "" | split "\n") -}}
	{{with . }}
		{{- $.Attach . -}}
	{{- end}}
{{- end}}

Fixes: https://todo.sr.ht/~rjarry/aerc/109
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2023-08-03 22:31:34 +02:00
Koni Marti
b267de83e3 templates: add ThreadCount and ThreadFolded
Add the number of threads and a flag to indicated folded threads to the
template data. Use {{.ThreadCount}} and {{.ThreadFolded}} in template
expression for the message list.

column-subject = {{.ThreadPrefix}}{{if .ThreadFolded}}[{{.ThreadCount}}] {{end}}{{.Subject}}

Update default configuration accordingly.

Signed-off-by: Koni Marti <koni.marti@gmail.com>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: inwit <inwit@sindominio.net>
2023-07-16 10:13:12 +02:00
Robin Jarry
9479513ec1 templates: add map functions
Similar to switch and .StyleSwitch, add map and .StyleMap to work on
lists. An extra "exclude" item is available to filter elements out of
the list.

Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Inwit <inwit@sindominio.net>
2023-06-10 23:54:06 +02:00
Robin Jarry
02099cc6ea templates: add boolean flags
Allow accessing email flags via boolean properties instead of having to
rely on obscure regular expressions on (.Flags | join ""). With this
patch, it is now possible to do this:

[ui]
index-columns = star:1,name<15%,reply:1,subject,size>=,date>=
column-star = {{if .IsFlagged}}★{{end}}
column-name = {{if eq .Role "sent"}}{{.To | names | join ", "}}{{else}}{{.From | names | join ", "}}{{end}}
column-reply = {{if .IsReplied}}{{end}}
column-subject = {{.ThreadPrefix}}{{.Subject}}
column-size = {{if .HasAttachment}}📎 {{end}}{{humanReadable .Size}}
column-date = {{.DateAutoFormat .Date.Local}}

Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Koni Marti <koni.marti@gmail.com>
2023-05-20 22:08:21 +02:00
Koni Marti
30c1a30168 templates: use template interface consistently
Use the template interface consistently. Before, we have exported the
state.TemplateData struct and used it in most places instead of the
models.TemplateData interface. This lead to some inconsistencies, i.e.
Role() has been defined on the exported struct but not on the interface.

Unexport the state.TemplateData struct, add a DataSetter interface to
set the data needed for the template data and call the Data() method
which returns a models.TemplateData interface when the template data is
needed.

Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
2023-05-16 17:12:00 +02:00
Tim Culverhouse
669431702f directory: add IANA mailbox roles
Add IANA registered mailbox role, and a custom aerc role "query". This
will be used in subsequent commits which add the Role field to
templates, allowing users to style mailbox by IANA role, or style
notmuch queries differently than maildir dirs when using the notmuch
worker + maildir option.

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry<robin@jarry.cc>
2023-04-22 22:40:12 +02:00
Tim Culverhouse
5b0a98b8c9 directory: use directory to store rue counts
Store the Directory RUE counts on the Directory data model. Use
DirectoryInfo messages to update the Directory model. Access Directories
via the dirlist instead of via the msgstore. Remove unused fields on
DirectoryInfo, all backends now give accurate counts.

Move refetch logic into dirlist

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry<robin@jarry.cc>
2023-04-22 22:40:12 +02:00
Tim Culverhouse
2ed7a741ff directory: remove attributes field
Remove the unused field Attributes

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2023-04-22 22:40:12 +02:00
Tim Culverhouse
87765f93de capabilities: report capabilities from backend
Use the Backend interface to report Backend capabilities. Previously,
these were reported via a DirectoryInfo message, however they have
nothing to do with a directory and should be reported directly by the
backend. Add Capabilities method to Backend interface, satisfy this in
each backend, and use it on the UI side.

Remove Caps field from DirectoryInfo

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry<robin@jarry.cc>
2023-04-22 22:40:12 +02:00
Nguyễn Gia Phong
94a763920f parse msg-id lists more liberally
Some user agents deliberately generate non-standard
message identifier lists in In-Reply-To and References headers.

Instead of failing silently, aerc now falls back to a desperate parser
scavaging whatever looking like <id-left@id-right>.

As the more liberal parser being substituted with, References header
are now stored for IMAP not only when there's a parsing error.

Fixes: 31d2f5be3c ("message-info: add explicit References field")
Signed-off-by: Nguyễn Gia Phong <mcsinyx@disroot.org>
Acked-by: Robin Jarry <robin@jarry.cc>
2023-03-26 21:02:18 +02:00
Robin Jarry
41ae363905 templates: add conditional style method
Add .StyleSwitch that takes a string and an arbitrary number of cases
(regexp, style). Reuse some of the constructs introduced by previous
commit.

The style of the first regular expression that matches will be applied.
If the string does not match any of the expressions, it will be left
as-is.

Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
2023-03-08 00:43:08 +01:00
Robin Jarry
c477d83f24 templates: add switch/case functions
This allows much shorter templates.

Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
2023-03-08 00:43:05 +01:00
Robin Jarry
66c532f859 templates: make SubjectBase official api
Document .SubjectBase. Fix its value along the way. Do not reuse
d.Subject() which may be empty if d.threadSameSubject is true.

Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
2023-03-08 00:42:58 +01:00
Robin Jarry
35040bec99 templates: separate thread prefix from subject
Extract {{.ThreadPrefix}} from {{.Subject}} so that the prefix can be
styled in a different color.

Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
2023-03-08 00:42:56 +01:00
Tim Culverhouse
d9a8edd8e9 templates: allow inline user styles
Allow custom user-defined styles in a styleset. The styles can take any
name, and must be under the [user] ini section. All attributes apply to
user defined styles.

Example:

	[user]
	red.fg=red
	red.bold=true

Add a .Style function which accepts the name of a user-defined style and
applies it to the string.

	{{.Style "red" "foo"}}

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2023-03-02 23:04:35 +01:00
Robin Jarry
6cfbc87d8a dirlist: use templates instead of % mini language
Replace dirlist-format with two settings: dirlist-left & dirlist-right.
These two settings take aerc-templates(7) and may be left empty.

Add automatic translation of dirlist-format to these new settings.
Display a warning on startup if dirlist-format has been converted.

Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
2023-02-20 14:48:42 +01:00
Robin Jarry
d2e74cdb91 statusline: add column based render format
In the spirit of commit 535300cfdb ("config: add columns based index
format"), reuse the column definitions and table widget.

Add automatic translation of render-format to column definitions. Allow
empty columns to be compatible with the %m (mute) flag.

Rename the State object to AccountState to be more precise. Reuse that
object in state.TempateData to expose account state info. Move actual
status line rendering in StatusLine.Draw().

Add new template fields for status specific data:

{{.ConnectionInfo}}
	Connection state.
{{.ContentInfo}}
	General status information (e.g. filter, search)
{{.StatusInfo}}
	Combination of {{.ConnectionInfo}} and {{.StatusInfo}}
{{.TrayInfo}}
	General on/off information (e.g. passthrough, threading,
	sorting)
{{.PendingKeys}}
	Currently pressed key sequence that does not match any key
	binding and/or is incomplete.

Display a warning on startup if render-format has been converted to
status-columns.

Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
2023-02-20 14:48:42 +01:00
Robin Jarry
87e3d4bafa templates: add message counts for specific folders
Change the {{.Recent}}, {{.Unread}} and {{.Exists}} template fields to
take an arbitrary number of folder names as arguments. If no folder name
is specified, these return the counts for all folders.

Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
2023-02-20 14:44:37 +01:00
Robin Jarry
9fa296fb76 templates: unify data interface
Require that all aerc template data objects implement the same
TemplateData interface.

Implement that interface in two different places:

1) state.TemplateData (renamed/moved from templates.TemplateData).
   This structure (along with all its methods) needs to be decoupled
   from the templates package to break the import cycle with the config
   package. This allows much simpler construction of this object and
   ensure that values are calculated only when requested.

2) config.dummyData (extracted from templates).
   This is only used in the config package to validate user templates.
   Putting it here allows also to break an import cycle.

Use state.TemplateData everywhere (including for account tabs title
rendering).

Signed-off-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Moritz Poldrack <moritz@poldrack.dev>
2023-02-20 14:40:59 +01:00
Robin Jarry
5677f93ff8 model: change flags array to bitmask
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>
2023-01-04 22:57:31 +01:00
Tim Culverhouse
31d2f5be3c message-info: add explicit References field
Add an explicit References field to message info. This is useful for
storing information needed for threading without storing all of the
header values, keeping system RAM usage lower.

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Tested-by: Inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-11-09 21:26:45 +01:00
Tim Culverhouse
ca903d4228 envelope: add InReplyTo field
A standard IMAP envelope response includes the In-Reply-To header field.
Add this field to the aerc model of Envelope. Update envelope parser to
set this value. Update imap worker to set this value.

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Tested-by: Inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-11-09 21:26:34 +01:00
Robin Jarry
9bd2e0c84f msgpart: factorize mime type and filename construction
Reduce code duplication.

Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Moritz Poldrack <moritz@poldrack.dev>
2022-10-16 11:35:24 +02:00
Moritz Poldrack
aaf0a0c656 lint: apply new formatting rules
Run `make fmt`.

Signed-off-by: Moritz Poldrack <git@moritz.sh>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-08-01 10:44:52 +02:00
Tim Culverhouse
f0c76fad72 threading: add backend capabilities to workers
This patch provides a method to report backend capabilities to the UI.
The intial capabilities included in the report are Sort and Thread.
Having these available to the UI enables the client to better handle
server side threading.

Signed-off-by: Koni Marti <koni.marti@gmail.com>
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-07-10 21:15:12 +02:00
Tim Culverhouse
d09636ee0b refactor: refactor pgp implementation
This commit refactors the internal PGP implementation to make way for
GPG integration.

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-04-27 09:46:11 +02:00
Koni Marti
7811620eb8 threading: implement on-the-fly message threading
implement message threading on the message store level using the
jwz algorithm. Build threads on-the-fly when new message headers arrive.

Use the references header to create the threads and the in-reply-to
header as a fall-back option in case no references header is present.

Does not run when the worker provides its own threading (e.g. imap
server threads).

Include only those message headers that have been fetched and are
stored in the message store.

References: https://www.jwz.org/doc/threading.html
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Tested-by: Inwit <inwit@sindominio.net>
Tested-by: akspecs <akspecs@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-02-24 13:00:12 +01:00