Check account's from value is not empty

This leads to a nasty 'mail: no address' message for each email if left
empty so the user really should enter it.
This commit is contained in:
Andrew Jeffery 2020-11-12 21:58:02 +00:00 committed by Reto Brunner
parent a9ae91c2d8
commit 676fed9e22
1 changed files with 3 additions and 0 deletions

View File

@ -216,6 +216,9 @@ func loadAccountConfig(path string) ([]AccountConfig, error) {
if account.Source == "" { if account.Source == "" {
return nil, fmt.Errorf("Expected source for account %s", _sec) return nil, fmt.Errorf("Expected source for account %s", _sec)
} }
if account.From == "" {
return nil, fmt.Errorf("Expected from for account %s", _sec)
}
source, err := parseCredential(account.Source, account.SourceCredCmd) source, err := parseCredential(account.Source, account.SourceCredCmd)
if err != nil { if err != nil {