aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/compose.go9
-rw-r--r--config/accounts.go1
-rw-r--r--doc/aerc-accounts.5.scd6
3 files changed, 16 insertions, 0 deletions
diff --git a/app/compose.go b/app/compose.go
index 6cdc3458..469f3c36 100644
--- a/app/compose.go
+++ b/app/compose.go
@@ -947,6 +947,15 @@ func (c *Composer) WriteMessage(header *mail.Header, writer io.Writer) error {
if err != nil {
return err
}
+
+ if c.acct.acct.PgpSelfEncrypt {
+ signer, err := c.Signer()
+ if err != nil {
+ return err
+ }
+ rcpts = append(rcpts, signer)
+ }
+
cleartext, err = CryptoProvider().Encrypt(&buf, rcpts, signer, DecryptKeys, header)
if err != nil {
return err
diff --git a/config/accounts.go b/config/accounts.go
index b5bfbe9a..6e0d6268 100644
--- a/config/accounts.go
+++ b/config/accounts.go
@@ -107,6 +107,7 @@ type AccountConfig struct {
PgpAttachKey bool `ini:"pgp-attach-key"`
PgpOpportunisticEncrypt bool `ini:"pgp-opportunistic-encrypt"`
PgpErrorLevel int `ini:"pgp-error-level" parse:"ParsePgpErrorLevel" default:"warn"`
+ PgpSelfEncrypt bool `ini:"pgp-self-encrypt"`
// AuthRes
TrustedAuthRes []string `ini:"trusted-authres" delim:","`
diff --git a/doc/aerc-accounts.5.scd b/doc/aerc-accounts.5.scd
index 20c88b36..d735e45c 100644
--- a/doc/aerc-accounts.5.scd
+++ b/doc/aerc-accounts.5.scd
@@ -189,6 +189,12 @@ Note that many of these configuration options are written for you, such as
Default: _false_
+*pgp-self-encrypt* = _true_|_false_
+ If _true_, any outgoing encrypted email will be also encrypted for the sender
+ or the key specified in *pgp-key-id*.
+
+ Default: _false_
+
*pgp-error-level* = _none_|_warn_|_error_
The level of error to display when opportunistic encryption cannot be
performed. See *pgp-opportunistic-encryption*.