Commit graph

132 commits

Author SHA1 Message Date
y0ast
dc2a2c2dfd messages: allow displaying email threads
Display threads in the message list. For now, only supported by the
notmuch backend and on IMAP when the server supports the THREAD
extension.

Setting threading-enable=true is global and will cause the message list
to be empty with maildir:// accounts.

Co-authored-by: Kevin Kuehler <keur@xcf.berkeley.edu>
Co-authored-by: Reto Brunner <reto@labrat.space>
Signed-off-by: Robin Jarry <robin@jarry.cc>
2021-11-13 15:05:59 +01:00
Robin Jarry
84146e23b3 index: add this-week-time-format
Also allow specific time format for messages received within the last
7 days.

Signed-off-by: Robin Jarry <robin@jarry.cc>
2021-11-06 17:34:20 +01:00
Robin Jarry
0d645bcebd go.mod: change base git url
I'm not sure what are the implications but it seems required.

Link: https://github.com/golang/go/issues/20883
Signed-off-by: Robin Jarry <robin@jarry.cc>
2021-11-05 10:21:45 +01:00
Robin Jarry
42b4302ba3 index: allow dynamic formatting of message dates
When a message has been sent today (or this year) allow formatting the
date differently.

For example, with:

 [ui]
 index-format=%-25.25n   %-25.25D   %s
 timestamp-format=2006 Jan 02, 15:04 GMT-0700
 this-day-time-format=Today at 15:04
 this-year-time-format=Jan 02

The message list would look like this (spaces collapsed):

 Robin Jarry        Today at 16:30             [PATCH 1/2] bindings: prepare for more modifers
 bugzilla@dpdk.org  Oct 26                     [dpdk-dev] [Bug 839] pdump: any subsequent runs of pdump_autotest fail
 Holger Levsen      2020 Mar 15, 13:44 GMT+01  +1 (Re: FTP Team -- call for volunteers)

Signed-off-by: Robin Jarry <robin@jarry.cc>
2021-10-28 16:30:59 +02:00
Reto Brunner
60c5a82a76 load config: do not overwrite the config upon error
It makes absolutely no sense to copy over the default template from aerc.conf
when the syntax is invalid and our ini parser fails.

The only valid case to do that is if the file is actually missing.
2021-04-17 18:57:19 +02:00
wagner riffel
a555343893 config: proper error handle [filters] config
Instead of panic when compiling a regular expression, return it up

Signed-off-by: wagner riffel <w@104d.net>
2021-04-12 18:21:03 +02:00
Bor Grošelj Simić
bbe8ba5b31 correct permission check on accounts.conf 2021-01-14 06:40:44 +01:00
y0ast
03650474e2 update tcell to v2 and enable TrueColor support
Also update to the tcell v2 PaletteColor api, which should keep the chosen
theme of the user intact.

Note, that if $TRUECOLOR is defined and a truecolor given, aerc will now stop
clipping the value to one of the theme colors.
Generally this is desired behaviour though.
2020-12-18 07:23:22 +01:00
Reto Brunner
20ec2c8eeb compose: use a proper header instead of a string map
Prior to this commit, the composer was based on a map[string]string.
While this approach was very versatile, it lead to a constant encoding / decoding
of addresses and other headers.

This commit switches to a different model, where the composer is based on a header.
Commands which want to interact with it can simply set some defaults they would
like to have. Users can overwrite them however they like.

In order to get access to the functions generating / getting the msgid go-message
was upgraded.
2020-11-14 15:40:13 +01:00
Andrew Jeffery
676fed9e22 Check account's from value is not empty
This leads to a nasty 'mail: no address' message for each email if left
empty so the user really should enter it.
2020-11-13 22:01:34 +01:00
Chris Vittal
f9bba3d17d Apply relevant msglist styles in order
Allow styles to be layered over a base style. The list of styles to
apply is layered over the base style in order, such that if the layer
does not differ from the base it is not used. The order that these
styles are applied in is, from first to last:

msglist_default
msglist_unread
msglist_read    (exclusive with unread, so technically the same level)
msglist_flagged
msglist_deleted
msglist_marked

So, msglist_marked style dominates.

This fixes an issue where the msglist_deleted style was not being applied.
2020-11-01 09:50:58 +01:00
y0ast
6a1c0f60af Add account alias configuration and correctly set From field
We infer the correct From using the To: and Cc: field of the email that
we reply to.
2020-08-20 21:54:31 +02:00
Kalyan Sriram
905cb9dfd3 Implement style configuration.
Introduce the ability to configure stylesets, allowing customization of
aerc's look (color scheme, font weight, etc). Default styleset is
installed to /path/to/aerc/stylesets/default.
2020-08-06 21:42:06 +02:00
Reto Brunner
3d784c5d8c Revert "Implement style configuration."
This reverts commit 1ff687ca2b.
2020-07-30 23:22:32 +02:00
Kalyan Sriram
1ff687ca2b Implement style configuration.
Introduce the ability to configure stylesets, allowing customization of
aerc's look (color scheme, font weight, etc). Default styleset is
installed to /path/to/aerc/stylesets/default.
2020-07-30 19:35:59 +02:00
Reto Brunner
8446d48664 run go fmt 2020-07-17 17:50:24 +02:00
ARaspiK
e1c2b596dc Add a 'folders-exclude' option
Added a 'folders-exclude' option that allows removing selected folders
from the directory list sidebar. My motivating example was that removing
a single folder from the list using Golang regexes seemed pretty hard,
so this is a better way to do it. The excluded folders list is included
in the man page.
2020-07-02 09:13:14 +02:00
Drew DeVault
caad1b2c06 Revert "Add Style configuration"
This reverts commit 0f78f06610.
2020-05-28 10:32:42 -04:00
Reto Brunner
0f78f06610 Add Style configuration
The following functionalities are added to configure aerc ui styles.
- Read stylesets from file with very basic fnmatch wildcard matching
- Add default styleset
- Support different stylesets as part of UiConfig allowing contextual
  styles.
- Move widgets/ui elements to use the stylesets.
- Add configuration manual for the styleset
2020-05-27 07:57:10 +02:00
Ben Cohen
63fb2b2006 Changing aerc.conf delimiter parsing to use only =, and not : as well 2020-04-29 09:45:34 +02:00
Jeffas
7f033278eb Add postpone command
This command uses the Postpone folder from the account config to save
messages to. Messages are saved as though they were sent so have a valid
'to' recipient address and should be able to be read back in for later
editing.
2020-04-24 12:59:21 -04:00
Jeffas
3156d481fe Add pinned tabs
This adds the commands pin-tab and unpin-tab. Once pinned a tab lives on
the left of the tabstrip and has a configurable marker, defaulting to `
before its name.
2020-03-09 09:31:02 -04:00
Reto Brunner
e78b7b85e4 config: Strongly type context type
The go compiler can't help much with untyped int constants.
Even though the only valid constants are 0-3 it will happily accept 4 as input.

Let's let the go compiler worry about correctness here. This also allows people
not very familiar with the code to use it properly via auto completion.
2020-01-24 12:25:59 -05:00
Srivathsan Murali
b2fa5a16f5 Contextual UI Configuration
+ Adds parsing of contextual ui sections to aerc config.
+ Add GetUiConfig method for AercConfig that is used to get the
  specialized UI config.
+ Add UiConfig method to AccountView to get specialized UI Config.
+ Modifies Aerc codebase to use specialized UIConfig instead.
+ Adds documentation for Contextual UI Configuration
2020-01-24 10:50:21 -05:00
Ben Burwell
aa967682bc Fix handling of multiple template-dirs
Before, while the docs stated that template-dirs was a colon-separated
list, a delimiter was not specified in the struct tag, so it was falling
back to the default for the ini library (a comma). Also added a note to
the docs to clarify that templates are configured in the [templates]
section.
2020-01-24 12:11:03 +01:00
Ben Burwell
fad375c673 Add address book completion in composer
Complete email address fields in the message composer with an external
address book command, compatible with mutt's query_cmd.
2019-12-21 09:23:22 -05:00
Ben Burwell
7160f98a90 Show textinput completions in popovers
Rather than showing completions inline in the text input, show them in a
popover which can be scrolled by repeatedly pressing the tab key. The
selected completion can be executed by pressing enter.
2019-12-21 09:23:21 -05:00
Michele Finotto
dfe58842b9 Add custom sorting for folders
A new config options for accounts.conf (folders-sort) was added to
allow a user to choose which folders should be shown on top.
My use case was to avoid stepping into heavy, but rarely viewed folders
when cycling through other often accessed ones.

To test add this to your account.conf:

folders-sort  = INBOX,Sent,Archive

INBOX, Sent and Archive should then show at the top of your dirlist,
and all other folders should come next in alphabetical order.
2019-12-09 12:42:40 -05:00
Drew DeVault
cb7d7a0438 Add some defaults for template options 2019-11-10 11:00:21 -05:00
Srivathsan Murali
3ba69edab5 Add Templates with Parsing
+ Changes NewComposer to return error.
+ Add lib to handle templates using "text/template".
+ Add -T option to following commands
    - compose.
    - reply
    - forward
+ Quoted replies using templates.
+ Forwards as body using templates
+ Default templates are installed similar to filters.
+ Templates Config in aerc.conf.
    - Required templates are parsed while loading config.
+ Add aerc-templates.7 manual for using template data.
2019-11-10 10:15:49 -05:00
Srivathsan Murali
1bedb8fe06 Config for deleting message from message viewer
As suggested in #268, this adds a behaviour setting for
deleting message from message viewer.
2019-09-20 15:23:45 -04:00
Jeffas
90d26da58a Add sorting functionality
There is a command and config option. The criteria are a list of the
sort criterion and each can be individually reversed.

This only includes support for sorting in the maildir backend currently.
The other backends are not supported in this patch.
2019-09-20 14:56:02 -04:00
Jeffas
e2d5c456dc Add signatures
This adds the ability for per-account signatures in the accounts.conf
config file. The signature is added to emails in the editor at the
bottom of the email. This includes when forwarding, replying to, and
composing emails.

There are two config options: signature-file and signature-cmd. The
former allows a signature to be read from a file and the latter allows
an arbitrary command to be executed to return the signature.

The config options have been documented in aerc-config
2019-09-12 16:18:34 -04:00
Jeffas
618a500341 Add display of unread messages in dirlist
Add an onUpdateDirs handler. This is used to invalidate the dirlist and
redraw with the correct number of recent/unread/total messages is shown.

A config option and formatting options are provided.
2019-09-11 12:37:43 -04:00
Paul Spooren
e4104a8674 Allow custom spinner via config file
Allows to set `ui.spinner=` to a string which is then split by
`ui.spinner-delimiter=` (Default: comma) instead of having a hard coded
animation.

This implementation doesn't use INIs capabilities to split strings as
it trims whitespaces breaking the default animation.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2019-08-30 10:32:28 +09:00
Jonas Mueller
f6df46d319 Pass os stdin to credential command
This is neccessary for `gpg-agent` to display a prompt and get the key
to unlock a given password. See https://todo.sr.ht/~sircmpwn/aerc2/250.
2019-08-12 08:59:40 +09:00
Ben Burwell
152f8c9519 Ring bell when new messages arrive
Add a "new-message-bell" option to the UI section of aerc.conf. A new
hook into the message store allows the msglist widget to detect new
messages being added to the displayed list. When new messages are
delivered, and the new-message-bell option is enabled (as it is by
default), the terminal will beep.
2019-07-29 15:01:49 -04:00
Reto Brunner
b812257ba9 Print errors from config load issues.
Currently we /dev/null stdout, if it is a tty.
The checkConfigPerms function, as well as the error print were incorrectly
writing to stdout and therefore weren't visible to most users.
2019-07-29 14:51:16 -04:00
Daniel Bridges
67fb0938a6 Support configurable header layout in compose widget 2019-07-26 14:22:04 -04:00
Jeffas
dc4c36adbf Add new-email trigger
This patch sets up the trigger config section of aerc.conf.

Each trigger has its own function which is called from the place where
it is triggered. Currently only the new-email trigger is implemented.

The triggers make use of format strings. For instance, in the new-email
trigger this allows the user to select the trigger command and also the
information extracted from the command and placed into their command.

To actually execute the trigger commands the keypresses are simulated.

Further triggers can be implemented in the future.

Formatting of the command is moved to a new package.
2019-07-26 14:00:24 -04:00
Drew DeVault
fe7230bb9a Add :cp alias for :copy 2019-07-17 18:42:03 -04:00
Jeffas
fb124139f3 Add option to always show mimetype in viewer
A user may want to be able to see what mimetype they are viewing, so
that they can determine what program it may be opened in or for some
other reason.

The config option is under the [viewer] section and is called
'always-show-mime'. It defaults to false to preserve the current
behaviour.
2019-07-17 17:34:43 -04:00
Daniel Bridges
dfc048fe28 Display user specified headers in viewer if present 2019-07-17 17:26:43 -04:00
Jeffas
06af5391a3 Add MouseEnabled config setting
This patch adds the ability to control whether aerc captures mouseevents
or not. By default it will be set to not capture events.
2019-07-17 16:00:44 -04:00
Pedro L. Ramos
d85f671bdf 71: Allow user to change config options at runtime
There is a LoadConf and a LoadConfFromFile.
LoadConfFromFile reads the iniFile into memory and and calls
LoadConf, which executes the old parsing commands from
LoadConf (old func).

The remaining of the LoadConfFromFile is the same as the old OldConf.
2019-07-15 09:42:03 -04:00
Eyal Sawady
4c7f81d20d Don't bind $noinherit
Fixes #112

Signed-off-by: Eyal Sawady <eyalsawady@gmail.com>
2019-07-11 19:44:07 -04:00
Reto Brunner
ee242a3d0f add DefaultSavePath config 2019-06-25 10:38:52 -04:00
Reto Brunner
99c363b724 Set empty message in dirlist if no folder exist. 2019-06-14 10:42:26 -04:00
Robert Günzler
acfe7d7625 Add archive command
Adds an archive command that moves the current message into the folder
specified in the account config entry.

Supports three layouts at this point:

- flat: puts all messages next to each other
- year: creates a folder per year
- month: same as above, plus folders per month

This also adds a "-p" argument to "cp" and "mv" that works like
"--parents" on mkdir(1). We use this to auto-create the directories
for the archive layout.
2019-06-09 11:33:50 -04:00
Yash Srivastav
fca7321639 Message list: implement index-format option 2019-06-07 16:22:01 -04:00
Yash Srivastav
b83e7c9fa6 implements ability to view headers in message view 2019-06-07 09:20:24 -04:00
Chris Kinniburgh
6c6bb4c893 config: sort account folders
directory list depends on these being sorted
2019-06-05 13:48:24 -04:00
Drew DeVault
f42724caf3 Install default configs to XDG config if not found 2019-05-22 12:35:44 -04:00
Drew DeVault
9b19e3ad05 Show account wizard if no accounts configured 2019-05-22 11:35:55 -04:00
Drew DeVault
6811143925 New account wizard, part one 2019-05-21 16:53:50 -04:00
Drew DeVault
176245208d Use kebab-case for cred-cmds 2019-05-21 14:31:14 -04:00
Galen Abell
b8208509f4 Implement loading passwords from external commands
* Resolves #80
2019-05-18 15:31:38 -04:00
Drew DeVault
89ffd8653d Implement ui.empty-message config option
Also removes some options that aren't going to be supported any time
soon.
2019-05-17 11:42:34 -04:00
Reto Brunner
b275a394e2 Abort if accounts.conf is world readable
Fixes #32
2019-05-16 17:26:35 -04:00
Drew DeVault
fb3826cee5 Revert "Abort if accounts.conf is world readable"
This reverts commit a755608ef9.
2019-05-16 16:40:29 -04:00
Drew DeVault
ff51625513 Revert "s/aerc.conf/address.conf/ in permission check"
This reverts commit 66ba099ca0.
2019-05-16 16:40:06 -04:00
Cole Helbling
66ba099ca0 s/aerc.conf/address.conf/ in permission check
Small typo in a recent commit: should abort if accounts.conf is world
readable, not aerc.conf.
2019-05-16 16:28:49 -04:00
Reto Brunner
a755608ef9 Abort if accounts.conf is world readable
Fixes #32
2019-05-16 15:02:13 -04:00
Drew DeVault
b0bf09b98f Copy sent emails to the Sent folder
Or rather, to a user-specified folder
2019-05-15 19:41:21 -04:00
Drew DeVault
065da5e372 Add $EDITOR, internal config for compose 2019-05-14 15:25:30 -04:00
Drew DeVault
f77d7c2c3d Add distinct keybindings for each compose view 2019-05-14 14:27:28 -04:00
Drew DeVault
17bd2dc4db Populate "From" header from config for new emails 2019-05-13 16:04:01 -04:00
Drew DeVault
bda74452a8 Add outgoing account configuration 2019-05-12 23:35:36 -04:00
Drew DeVault
36419d85aa Use shell to execute filters, fix non-determinism 2019-03-31 15:21:04 -04:00
Drew DeVault
958328427a Improve plaintext.py 2019-03-31 14:43:46 -04:00
Drew DeVault
8e5ed2a161 Implement header-regex-match filters 2019-03-31 14:42:18 -04:00
Drew DeVault
bbdf9df75e Add basic filter implementation 2019-03-31 14:24:53 -04:00
Julian P Samaroo
45b4c8a724 Handle no configured accounts gracefully
Instead of throwing a runtime error, when no accounts are configured in
accounts.conf, we provide an informative error message.
2019-03-30 16:26:55 -04:00
Drew DeVault
f5bf4a9324 Add context-specific keybindings 2019-03-21 17:37:19 -04:00
Drew DeVault
77c76ba462 Implement default in accounts.conf 2019-03-15 21:33:08 -04:00
Drew DeVault
b181e0449d Remove extra debug log statement 2019-03-15 21:29:52 -04:00
Drew DeVault
a729179f9f Implement sidebar-width config option 2019-03-15 20:40:28 -04:00
Drew DeVault
8d20e9218e Implement key bindings subsystem
Which is not yet rigged up
2019-03-15 01:31:23 -04:00
emersion
a0be5e8025 Misc idiomatic fixes 2018-01-10 11:20:41 -05:00
Drew DeVault
b5d5e0dbed Parse account configuration 2018-01-09 21:31:36 -05:00
Drew DeVault
6394e386c2 Initial pass on worker/UI message passing 2018-01-09 20:39:00 -05:00
Drew DeVault
39c93d2897 Load UI configuration 2018-01-09 19:28:43 -05:00