-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
12 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,8 +31,8 @@ func (cfg *SMTPConfig) verify() error { | |
/* | ||
Example Config File: | ||
mail: | ||
smtp: | ||
mail: # base-0 | ||
smtp: # base-1 | ||
default: # profile | ||
host: 127.0.0.1 | ||
port: 25 | ||
|
@@ -41,9 +41,18 @@ Example Config File: | |
pass: "your-password" # empty for no authorization | ||
option: | ||
insecure_skip_verify: true | ||
nightly: # profile | ||
host: 127.0.0.1 | ||
port: 25 | ||
sender: Alice Ez | ||
user: "[email protected]" | ||
pass: "your-password" # empty for no authorization | ||
option: | ||
insecure_skip_verify: true | ||
*/ | ||
func LoadSMTPConfig(profile string) (cfg *SMTPConfig, err error) { | ||
ckb := NewKeyBuilder(KeyMailBase, KeyMailSMTPBase).SubViper(profile) | ||
ckb := NewKeyBuilder(KeyMailBase, KeyMailSMTPBase).WithProfile(profile).SubViper("") | ||
|
||
cfg = &SMTPConfig{} | ||
if err = ckb.Unmarshal(cfg); err == nil { | ||
|