diff options
-rw-r--r-- | config/config.go | 10 | ||||
-rw-r--r-- | doc/aerc-config.5.scd | 13 | ||||
-rw-r--r-- | widgets/compose.go | 7 |
3 files changed, 29 insertions, 1 deletions
diff --git a/config/config.go b/config/config.go index 8480f10a..80f7f751 100644 --- a/config/config.go +++ b/config/config.go @@ -104,7 +104,11 @@ type AccountConfig struct { SignatureCmd string EnableFoldersSort bool `ini:"enable-folders-sort"` FoldersSort []string `ini:"folders-sort" delim:","` - PgpKeyId string `ini:"pgp-key-id"` + + // PGP Config + PgpKeyId string `ini:"pgp-key-id"` + PgpAutoSign bool `ini:"pgp-auto-sign"` + PgpOpportunisticEncrypt bool `ini:"pgp-opportunistic-encrypt"` } type BindingConfig struct { @@ -251,6 +255,10 @@ func loadAccountConfig(path string) ([]AccountConfig, error) { account.EnableFoldersSort, _ = strconv.ParseBool(val) } else if key == "pgp-key-id" { account.PgpKeyId = val + } else if key == "pgp-auto-sign" { + account.PgpAutoSign, _ = strconv.ParseBool(val) + } else if key == "pgp-opportunistic-encrypt" { + account.PgpOpportunisticEncrypt, _ = strconv.ParseBool(val) } else if key != "name" { account.Params[key] = val } diff --git a/doc/aerc-config.5.scd b/doc/aerc-config.5.scd index 314aa572..79025508 100644 --- a/doc/aerc-config.5.scd +++ b/doc/aerc-config.5.scd @@ -588,10 +588,23 @@ Note that many of these configuration options are written for you, such as Default: none +*pgp-auto-sign* + If true, all outgoing emails from this account will be signed (if a signing + key is available) + + Default: false + *pgp-key-id* Specify the key id to use when signing a message. Can be either short or long key id. If unset, aerc will look up the key by email +*pgp-opportunistic-encrypt* + If true, any outgoing email from this account will be encrypted when all + recipients (including "cc" and "bcc" field) have a public key available in + the keyring + + Default: false + *postpone* Specifies the folder to save postponed messages to. diff --git a/widgets/compose.go b/widgets/compose.go index 6fbc23a6..5dab4294 100644 --- a/widgets/compose.go +++ b/widgets/compose.go @@ -118,6 +118,13 @@ func NewComposer(aerc *Aerc, acct *AccountView, conf *config.AercConfig, c.updateCrypto() c.ShowTerminal() + if c.acctConfig.PgpAutoSign { + c.SetSign(true) + } + if c.acctConfig.PgpOpportunisticEncrypt { + c.SetEncrypt(true) + } + return c, nil } |