summaryrefslogtreecommitdiff
path: root/config/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'config/config.go')
-rw-r--r--config/config.go20
1 files changed, 14 insertions, 6 deletions
diff --git a/config/config.go b/config/config.go
index 8eeea10..048dd23 100644
--- a/config/config.go
+++ b/config/config.go
@@ -26,7 +26,8 @@ import (
)
type GeneralConfig struct {
- DefaultSavePath string `ini:"default-save-path"`
+ DefaultSavePath string `ini:"default-save-path"`
+ UnsafeAccountsConf bool `ini:"unsafe-accounts-conf"`
}
type UIConfig struct {
@@ -583,11 +584,7 @@ func LoadConfigFromFile(root *string, logger *log.Logger) (*AercConfig, error) {
_root := path.Join(xdg.ConfigHome(), "aerc")
root = &_root
}
- filename := path.Join(*root, "accounts.conf")
- if err := checkConfigPerms(filename); err != nil {
- return nil, err
- }
- filename = path.Join(*root, "aerc.conf")
+ filename := path.Join(*root, "aerc.conf")
// if it doesn't exist copy over the template, then load
if _, err := os.Stat(filename); errors.Is(err, os.ErrNotExist) {
@@ -620,6 +617,10 @@ func LoadConfigFromFile(root *string, logger *log.Logger) (*AercConfig, error) {
Ini: file,
+ General: GeneralConfig{
+ UnsafeAccountsConf: false,
+ },
+
Ui: UIConfig{
IndexFormat: "%D %-17.17n %s",
TimestampFormat: "2006-01-02 03:04 PM",
@@ -705,6 +706,13 @@ func LoadConfigFromFile(root *string, logger *log.Logger) (*AercConfig, error) {
}
}
+ filename = path.Join(*root, "accounts.conf")
+ if !config.General.UnsafeAccountsConf {
+ if err := checkConfigPerms(filename); err != nil {
+ return nil, err
+ }
+ }
+
accountsPath := path.Join(*root, "accounts.conf")
if accounts, err := loadAccountConfig(accountsPath); err != nil {
return nil, err