aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/compose.go10
-rw-r--r--config/accounts.go1
-rw-r--r--doc/aerc-accounts.5.scd5
3 files changed, 16 insertions, 0 deletions
diff --git a/app/compose.go b/app/compose.go
index a54f534b..56b8f350 100644
--- a/app/compose.go
+++ b/app/compose.go
@@ -326,6 +326,11 @@ func (c *Composer) Archive() string {
}
func (c *Composer) SetAttachKey(attach bool) error {
+ if c.crypto == nil {
+ if err := c.updateCrypto(); err != nil {
+ return err
+ }
+ }
if !attach {
name := c.crypto.signKey + ".asc"
found := false
@@ -397,6 +402,11 @@ func (c *Composer) SetSign(sign bool) error {
c.sign = !sign
return fmt.Errorf("Cannot sign message: %w", err)
}
+ if c.acct.acct.PgpAttachKey {
+ if err := c.SetAttachKey(sign); err != nil {
+ return err
+ }
+ }
return nil
}
diff --git a/config/accounts.go b/config/accounts.go
index 413b77b1..1afa77c4 100644
--- a/config/accounts.go
+++ b/config/accounts.go
@@ -104,6 +104,7 @@ type AccountConfig struct {
// PGP Config
PgpKeyId string `ini:"pgp-key-id"`
PgpAutoSign bool `ini:"pgp-auto-sign"`
+ PgpAttachKey bool `ini:"pgp-attach-key"`
PgpOpportunisticEncrypt bool `ini:"pgp-opportunistic-encrypt"`
PgpErrorLevel int `ini:"pgp-error-level" parse:"ParsePgpErrorLevel" default:"warn"`
diff --git a/doc/aerc-accounts.5.scd b/doc/aerc-accounts.5.scd
index 5f89033a..20c88b36 100644
--- a/doc/aerc-accounts.5.scd
+++ b/doc/aerc-accounts.5.scd
@@ -184,6 +184,11 @@ Note that many of these configuration options are written for you, such as
Default: _false_
+*pgp-attach-key* = _true_|_false_
+ If _true_, attach the public signing key to signed outgoing emails.
+
+ Default: _false_
+
*pgp-error-level* = _none_|_warn_|_error_
The level of error to display when opportunistic encryption cannot be
performed. See *pgp-opportunistic-encryption*.