From bb400c7d88a08bc29fd635486dffbbad10f1835d Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Thu, 5 May 2022 12:53:14 -0500 Subject: pgp: add options auto-sign & opportunistic-encrypt Add account level config options for auto-sign and opportunistic encryption. Signed-off-by: Tim Culverhouse Tested-by: Koni Marti --- config/config.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'config/config.go') diff --git a/config/config.go b/config/config.go index 8480f10..80f7f75 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 } -- cgit v1.2.3