Commit Graph

82 Commits

Author SHA1 Message Date
Robin Jarry dc6fd7c15e compose: allow setting all headers in templates
Allow setting To, Cc, Subject, Bcc in template headers.

Fixes: https://todo.sr.ht/~rjarry/aerc/19
Signed-off-by: Robin Jarry <robin@jarry.cc>
2022-02-03 09:55:20 +01:00
Robin Jarry 77b3a141a4 review: display actual bindings for commands
Parse the actual user bindings to determine what shortcuts are available
in the compose::review stage. Add a predefined list of commands for
which we want to display the keyboard shortcuts.

Fixes: https://todo.sr.ht/~rjarry/aerc/14
Signed-off-by: Robin Jarry <robin@jarry.cc>
2022-02-02 22:12:08 +01:00
Koni Marti b19b844a63 pgp: PGP/MIME encryption for outgoing emails
implements PGP/MIME encryption with go-pgpmail. The Encrypt() function of
go-pgpmail requires a list of public keys which are taken from the
keystore. The keystore is searched for the email addresses of all
recipients (to, cc, and bcc).
If you want to be able to read the encrypted email afterwards, add
yourself as a recipient in either to, cc, or bcc as well.

Public keys can be exported from gpg into aerc as follows:
$ gpg --export  >> ~/.local/share/aerc/keyring.asc

When composing a message, the encryption is enabled with the
":encrypt" command. This sets a bool flag in the Composer struct.
A reapted application of this command will toggle the flag.
The encrypted message can also be signed by using the ":sign"
command before or after ":encrypt".

References: https://todo.sr.ht/~rjarry/aerc/6
Signed-off-by: Koni Marti <koni.marti@gmail.com>
2022-01-07 13:45:34 +01:00
Koni Marti 69d4e3895f pgp: PGP/MIME signing for outgoing emails
implements PGP/MIME signing with go-pgpmail. The Sign() function of
go-pgpmail requires a private (signing) key. The signing key which matches
the senders email address (from field in email header) is looked up
in aerc's copy of the keyring.

Private keys can be exported from gpg into aerc as follows:
$ gpg --export-secret-keys  >> ~/.local/share/aerc/keyring.asc

A message is signed with the ":sign" command. The sign command sets
a bool flag in the Composer struct. Using the command repeatedly will
toggle the flag.

References: https://todo.sr.ht/~rjarry/aerc/6
Signed-off-by: Koni Marti <koni.marti@gmail.com>
2022-01-07 13:45:34 +01:00
Koni Marti 8813fadfe9 pgp: update openpgp packages (go-crypto and go-pgpmail)
Replaces golang.org/x/crypto with github.com/ProtonMail/go-crypto
consistently and updates go-pgpmail to v0.2.0

Signed-off-by: Koni Marti <koni.marti@gmail.com>
2022-01-07 13:45:34 +01:00
Dian M Fay f776fb8246 style: customize vertical and horizontal border characters
New border-char-horizontal and border-char-vertical config settings in
aerc.conf allow users to modify border appearance from the default
1-wide/tall blank space. In stylesets, border.fg now affects the
foreground color when custom characters are defined.

Signed-off-by: Robin Jarry <robin@jarry.cc>
2021-11-30 15:05:33 +01:00
Robin Jarry 20752df89c viewer: add colon after header names
Display them as standard RFC 822 headers.

Signed-off-by: Robin Jarry <robin@jarry.cc>
2021-11-05 10:45:31 +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 fc84b19bba view,compose: use border color to separate headers from body
When composing a message, there is an empty fill line between the
headers and the text editor. The line is printed with the default style
which may cause users to assume it is part of the editor.

Display the fill lines with the border color to avoid confusion.

Signed-off-by: Robin Jarry <robin@jarry.cc>
2021-10-28 16:38:23 +02:00
Eyal Sawady d344ceecfe compose: apply default style to header separator 2021-01-14 06:36:09 +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 af0a2b9a46 Use extensions for querying the mime type of attachments
This gets rid of the issue that lots of things are detected as zip files, even
though they are a more specialized format (say office files)
2020-12-15 21:48:25 +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
Reto Brunner e7d450c61d rename header to heditors 2020-11-14 15:40:13 +01: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
Jeffas 543510f5c1 Make grid sizes dynamic
The grid used static sizes which meant that changing settings didn't
have an effect on elements of the ui, notably the sidebar width. This
patch makes the `Size` parameter of a cell a function which returns the
`int`, allowing for dynamic sizes.

A `Const` function is also included for ease of use for static sizes.
2020-06-09 08:48:47 +02:00
Drew DeVault caad1b2c06 Revert "Add Style configuration"
This reverts commit 0f78f06610.
2020-05-28 10:32:42 -04:00
Drew DeVault 76a91813d8 Revert "Remove duration from the status methods"
This reverts commit f06d683688.
2020-05-28 10:32:32 -04:00
Reto Brunner f06d683688 Remove duration from the status methods
We always set 10 seconds anyhow, might as well do that without repeating ourselfs.
2020-05-27 08:11:40 +02: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
Srivathsan Murali b1eb7ad18d Set AnsweredFlag on successful reply 2020-05-25 11:29:53 -04:00
Jeffas 3102ac3680 Add recall command
This command allows recalling the selected postponed email to edit in
the composer. The command only allows recalling from the postpone
directory.
2020-04-24 12:59:21 -04: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
Reto Brunner acf69b7490 Remove ability to specify headers in the editor
Due to headers being essentially free text, we constantly run into issues
with parts of the body being interpreted as headers.

Remove the ability to overwrite headers to avoid that, while keeping the ability
to specify headers in the template files.

Fixes #383
2020-04-24 12:59:21 -04:00
Drew DeVault 403b6af379 compose: add space between headers and editor
Until the PGP changes, this was merged into the header widget.
2020-03-03 16:57:21 -05:00
Reto Brunner f9391fe798 Correct spelling 2020-01-16 07:21:01 +01:00
Leszek Cimała 5255585b3b remove Original* check 2020-01-09 14:31:19 -05:00
Leszek Cimała bf28e23933 create OriginalMail struct 2020-01-09 14:31:19 -05: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
Drew DeVault 0ef4b6f9e2 Composer: fix EOF errors
PrepareHeaders generated a fresh message ID and Date header every time.
This instead generates those headers in advance.
2019-12-12 10:22:28 -05:00
Leszek Cimała 2559ebfac5 remove garbage headers in reply message
Very important fix. Remove garbage from reply message headers. Till
now all Original fields were send in reply, which we do not want and could
lead to uncorrect email message.
2019-12-08 14:40:36 -05:00
Robert Günzler e88cc08d79 Parse headers from template
This patch parses the processed template for headers and populates
matching header editors.
Those are then stripped from the template body before prepending the template
and remaining header fields to the composer content.

The main motivation for this is keeping receiver, sender and subject
lines in the template file and generating the message subject from the
date.
2019-12-07 14:29:48 -05:00
Drew DeVault eef662c606 Revert "Parse headers from template"
This reverts commit 31e3e9f56e.
2019-12-04 09:49:53 -05:00
Robert Günzler 31e3e9f56e Parse headers from template
Parse the processed template for headers and populates matching header
editors accordingly.
Those are then stripped from the template body before prepending it
and remaining header fields to the composer content.

The motivation for this is keeping receiver, sender and subject
lines in the template file and generating the message subject with the
date functions.
2019-12-04 09:37:52 -05:00
Greg Anders 3338dce8a1 Allow fields in compose widget to be clicked
When the mouse is enabled, clicking on a header field switches focus to
that field (likewise for the terminal).
2019-11-17 13:19:47 -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
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 f6216bb621 Add Mouseable
This adds the Mouseable interface. When this is implemented for a
component that item can accept and process mouseevents.

At the top level when a mouse event is received it is passed to the
grid's handler and then it trickles down until it reaches a component
that can actually handle it, such as the tablist, dirlist or msglist.

A mouse event is passed so that components can handle other things such
as scrolling with the mousewheel. The components themselves then perform
the necessary actions.

Clicking emails in the messagelist opens them in a new tab.

Textinputs can be clicked to position the cursor inside them.

Mouseevents are not forwarded to the terminal at the moment.

Elements which do not handle mouse events are not required to implement
the Mouseable interface.
2019-09-11 11:41:34 -04:00
Wagner Riffel 1d04c2a292 widgets: rewrite references to os.SET_SEEK to io.SeekStart
Os.SET_SEEK is deprecated, it's recommended to use contants from io
package

Signed-off-by: Wagner Riffel <wgrriffel@gmail.com>
2019-09-04 16:30:57 -10:00
Jelle Besseling 1f5293931a Add forwarding as attachment feature
This allows a single message to be forward as attachment with the
:forward -a command
2019-08-20 10:05:51 +09:00
Jelle Besseling 36c6030e81 Add addresses argument to forward command 2019-08-20 10:04:29 +09:00
Daniel Bridges 0a52124102 Allow cc/bcc command to receive no arguments 2019-08-07 14:07:48 +09:00
Kevin Kuehler 0ceea02720 cc/bcc: Append to existing headers if called twice
Signed-off-by: Kevin Kuehler <keur@ocf.berkeley.edu>
2019-08-07 14:07:22 +09:00
Daniel Bridges f4b7741463 Add cc and bcc commands 2019-08-03 10:43:55 -04:00
Ben Burwell c9a909fee3 Fix sending attachments with less than 512 bytes 2019-08-02 09:34:10 -04:00
Ben Burwell bb620e0900 Include body MIME terminator in multipart messages
Before, the text/plain part of the multipart MIME message was not being
correctly terminated with its boundary. The multipart writer writes the
terminator when its Close is called, but since the call to Close() was
deferred, it was not being called until after the attachments were being
written resulting in the boundary not being included at all.
2019-08-02 09:34:08 -04:00
Galen Abell 0ee7d30187 Add :detach command
Add a command for removing attachments from a composed message. Syntax
is :detach [path], with path being an optional argument specifying the
path of one existing attachment. If no path is specified, the first
attachment is removed.
2019-07-27 12:37:55 -04:00