Show what command can be used to achieve the described effect so users
can add it as a binding.
Fixes: https://todo.sr.ht/~rjarry/aerc/40
Signed-off-by: kt programs <ktprograms@gmail.com>
Tested-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
This adds the option "unsafe-accounts-conf" under the section [general]
of aerc.conf. This allows an user to specify if the accounts.conf file
must be restrict to be read by the file owner (0600).
By default it is set to "false".
Signed-off-by: Victor Freire <victor@freire.dev.br>
Acked-by: Robin Jarry <robin@jarry.cc>
The left and right square brackets are inverted. Fix that.
Signed-off-by: Ivan Oleynikov <ivan.oleynikov95@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Clear filter when called with no arguments.
Fixes: https://todo.sr.ht/~rjarry/aerc/35
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Refactor statusline by clearly separating the rendering part from the
text display. Use printf-like format string for statusline
customization.
Document printf-like format string to customize the statusline.
Allow to completely mute the statusline (except for push notifications)
with a format specifier.
Provide a display mode with unicode icons for the status elements.
Implements: https://todo.sr.ht/~rjarry/aerc/34
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
This is only supported with notmuch and specific imap servers.
Signed-off-by: Kenneth Flak <kennethflak@protonmail.com>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Keep current message selected when clearing or changing filters and when
toggling threads.
Add -s flag to the clear command to also clear the selected message and
set cursor to the top of the message list.
Implements: https://todo.sr.ht/~rjarry/aerc/36
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Use contextual ui styleset for tabs and compose widgets. If no account
is selected, use default styleset as fallback.
Fixes: https://todo.sr.ht/~rjarry/aerc/3
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
If socksify (from dante) is not installed then the filter uses w3m
without it to render an html message part.
Signed-off-by: Jens Grassel <jens@wegtam.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Allow to bind to < and > by using \< and \> in binds.conf. Ensure that
the single \ can still be properly used to bind to other commands.
For example, the following binds would work now:
\< = :prev-tab<Enter>
\> = :next-tab<Enter>
\ = :filter<space>
Fixes: https://todo.sr.ht/~rjarry/aerc/37
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Tested-by: Sebastian LaVine <mail@smlavine.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Also show commands that don't have a binding.
This allows users to see what's available to bind.
Signed-off-by: kt programs <ktprograms@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Calling a method on a pointer will dereference it automatically.
Signed-off-by: Connor Kuehl <cipkuehl@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Also move binding for :delete such that the :open, :save, :pipe command
bindings are grouped together.
Signed-off-by: kt programs <ktprograms@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Allow using the command ':forward -A' without specifying an email
address inline.
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
os.Stat might return other errors aside from one stating that the file
does not exist. If it does, propagate the error down. As before, if the
file does not exist, just do nothing.
Signed-off-by: Connor Kuehl <cipkuehl@gmail.com>
Reviewed-by: Moritz Poldrack <moritz@poldrack.dev>
Tested-by: Moritz Poldrack <moritz@poldrack.dev>
There is an issue with backends, that provide dynamic folders, namely
when opening folder, that isn't defined in config file, you get empty
folder. To actually get messages listed, you need to open that folder
twice.
At first attempt only DirectoryInfo is fetched and new
MessageStore created. Second attempt populates previously created
MessageStore with list of messages.
For pre-configured folders, DirectoryInfos are fetched upon connection
to backend and, when folder is opened, MessageStore is updated with list
of messages.
Fixes: https://todo.sr.ht/~rjarry/aerc/30
Signed-off-by: Aivars Vaivods <aivars@vaivods.lv>
Acked-by: Robin Jarry <robin@jarry.cc>
Fix the "no envelope available for this message" error that can occur
when using the same imap mailbox in another mailclient (e.g.
through a webmail interface) at the same time.
Complements the fixes in commit 7fe7fe4 ("ui: fix panic in header
formatter") and commit 074b0a1 ("view,list: fix crash when viewing
incomplete imap messages").
The error is caused when a message attribute update is received by the
message store before the message list had a chance to fetch the proper
header first. In this case, an (incomplete) message info is stored in
the message store and the message list will never fetch the correct
header. To prevent this, add only messages to the store with a non-nil
envelope but make sure that message attribute updates are properly
merged.
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Make it possible to specify the color in the style sets by number in
addition to the color name. This allows using colors defined by the
terminal.
Signed-off-by: Tobias Wölfel <tobias.woelfel@mailbox.org>
Acked-by: Robin Jarry <robin@jarry.cc>
This commit fixes an out-of-bound error that happened while parsing
commands.
Signed-off-by: Moritz Poldrack <git@moritz.sh>
Acked-by: Robin Jarry <robin@jarry.cc>
With this commit trailing colons in the :header command's field are
removed to prevent double-colon-headers from being sent.
Signed-off-by: Moritz Poldrack <git@moritz.sh>
Acked-by: Robin Jarry <robin@jarry.cc>
By using :compose -H <header> a user should be able to add
arbitrary headers to an email. The existing implementation from
5b523880b4 added the headers as lines
to the beginning of the body. These lines were not interpreted as
headers anywhere and ended up as plain text in the body of the email.
Fix the code to parse and add the headers correctly.
Signed-off-by: Evan Gates <evan.gates@gmail.com>
Tested-by: Moritz Poldrack <moritz@poldrack.dev>
The LDFLAGS environment variable is usually indented for C the linker
flags which are not compatible with go -ldflags.
Use a more explicit GO_LDFLAGS variable instead. Allow adding extra
flags without overriding the default ones by specifying
GO_EXTRA_LDFLAGS.
This may break the build on some distros that rely on setting LDFLAGS to
change the default shareDir or version. They will have to switch to
GO_EXTRA_LDFLAGS.
Link: https://salsa.debian.org/go-team/packages/aerc/-/commit/e9ed90beae9f
Link: https://src.fedoraproject.org/rpms/aerc/blob/f36/f/aerc.spec#_86
Fixes: e7e22aba60 ("mk: rebuild if goflags or ldflags have changed")
Signed-off-by: Robin Jarry <robin@jarry.cc>
Ignore option flags and prepend default-save-path if the current path is
not absolute.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Moritz Poldrack <moritz@poldrack.dev>
Sort the message list even when a filter is applied according to the
sort criteria given by the sort command.
Currently, the sort command has no effect when a filter is in use.
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Keep the sort criteria applied to the selected folder until the default
sort order should be restored. Call the sort command without arguments
to restore the default sort order.
The current behavior is that the default sort order is restored as soon
as the folder reloads. This happens often and then the results of the
sort command are lost. This makes the sort command not very
user-friendly. Instead, we should keep the sort criteria applied until
the user explicitly wants to restore the default sort order again.
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Update statusline only for the selected account (to prevent other
updates from different accounts to interfere). Update status when
jumping/selecting/closing tabs.
Fixes cosmetic regressions introduced by commit feecc09b73
("statusline: make statusline folder-specific").
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
This callback is actually invoked in a goroutine by time.AfterFunc. The
panic handler must be explicitly installed.
Link: https://github.com/golang/go/blob/go1.18/src/time/sleep.go#L160-L173
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Moritz Poldrack <moritz@poldrack.dev>
Change the pattern matching into a if/elif construct because pattern
matching is not supported on python < 3.9.
Signed-off-by: Jens Grassel <jens@wegtam.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Allow saving all message parts that have the content disposition
"attachment" header to a folder.
Suggested-by: Ondřej Synáček <ondrej@synacek.org>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Koni Marti <koni.marti@gmail.com>
Tested-by: Moritz Poldrack <moritz@poldrack.dev>
If a panic occurs in one of the workers, it can happen after the UI was
initialised, but before the cleanup function has been registered. With
this the start of the worker loops is deferred until the cleanup routine
was registered.
Signed-off-by: Moritz Poldrack <git@moritz.sh>
Fix order in the references header when an in-reply-to msg-id is
erroneously added at the beginning instead of at the end. Add
description to the function that cleans up the reference headers for
threading.
Reported-by: Evan Gates <evan.gates@gmail.com>
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
This is a python script for python 3 using the vobject library to show
details about an ics file (text/calendar attachment).
Signed-off-by: Jens Grassel <jens@wegtam.com>
Tested-by: Moritz Poldrack <moritz@poldrack.dev>
Since panics still regularly "destroy" the terminal, it is hard to get a
stack trace for panics you do not anticipate. This commit adds a panic
handler that automatically creates a logfile inside the current working
directory.
It has to be added to every goroutine that is started and will repair
the terminal on a panic.
Signed-off-by: Moritz Poldrack <git@moritz.sh>
Acked-by: Robin Jarry <robin@jarry.cc>
Make statusline folder-specific. Update filter, search and threading
status when changing folders.
Commit 2512c04 ("statusline: implement per-account status") introduced
an account-specific statusline. This makes it account- and
folder-specific.
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Tested-by: Moritz Poldrack <moritz@poldrack.dev>
Focusing header editors was hardcoded as integers which only worked with
the default ui. If a user changed the UI to, for example, put CC as a
field below "to", FocusSubject would focus the CC field instead of the
subject. This commit reuses and modifies the function FocusEditor to
generalize the focusing of header editors - which can now be called by
name via FocusEditor(name string)
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Fix stack overflow from faulty headers that cause a circularity in the
threading algorithm. Remove duplicated message-ids in the references
headers. Check that the message-id itself is not part of the references.
Fixes: https://todo.sr.ht/~rjarry/aerc/32
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Tested-by: Robin Jarry <robin@jarry.cc>
Acked-by: Robin Jarry <robin@jarry.cc>
Update message counter in msglist when the filter is changed (either set or
cleared in the msgstore).
When we apply a filter, we change the number of uids in the message
store. This can unintentionally trigger the storeUpdate() function of
the msglist which checks the number of uids for new messages and
advances the pointer by the difference in the number of messages. This
can be avoided when we update the message counter upon changing the
filter.
Fixes: https://todo.sr.ht/~rjarry/aerc/23
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Update statusline only when changed to reduce cpu usage.
commit 2512c0403f ("statusline: implement per-account status") updates
the status irrespective of whether the statusline changed or not. This
can lead to high cpu usage that can be avoided.
Reported-by: Jens Grassel <jens@wegtam.com>
Reported-by: inwit <inwit@sindominio.net>
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>