aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/accounts.go7
-rw-r--r--doc/aerc-accounts.5.scd9
2 files changed, 13 insertions, 3 deletions
diff --git a/config/accounts.go b/config/accounts.go
index 6e0d6268..f0853ee6 100644
--- a/config/accounts.go
+++ b/config/accounts.go
@@ -132,14 +132,21 @@ func parseAccountsFromFile(root string, accts []string, filename string) error {
}
starttls_warned := false
+ var globals *ini.Section
for _, _sec := range file.SectionStrings() {
if _sec == "DEFAULT" {
+ globals = file.Section(_sec)
continue
}
if len(accts) > 0 && !contains(accts, _sec) {
continue
}
sec := file.Section(_sec)
+ for key, val := range globals.KeysHash() {
+ if !sec.HasKey(key) {
+ _, _ = sec.NewKey(key, val)
+ }
+ }
account, err := ParseAccountConfig(_sec, sec)
if err != nil {
diff --git a/doc/aerc-accounts.5.scd b/doc/aerc-accounts.5.scd
index d735e45c..14502409 100644
--- a/doc/aerc-accounts.5.scd
+++ b/doc/aerc-accounts.5.scd
@@ -17,9 +17,12 @@ be executed automatically on first startup.
This file is written in the ini format where each *[section]* is the name of an
account you want to configure, and the keys & values in that section specify
-details of that account's configuration. In addition to the options documented
-here, specific transports for incoming and outgoing emails may have additional
-configuration parameters, documented on their respective man pages.
+details of that account's configuration. Global options may be configured by
+placing them at the top of the file, before any account-specific sections. These
+can be overridden for an account by specifying them again in the account
+section. In addition to the options documented here, specific transports for
+incoming and outgoing emails may have additional configuration parameters,
+documented on their respective man pages.
# CONFIGURATION