Skip to content

Commit

Permalink
bug fix: base path
Browse files Browse the repository at this point in the history
  • Loading branch information
yuikns committed Jan 25, 2019
1 parent 31db516 commit d80c72e
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions config/mail.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down

0 comments on commit d80c72e

Please sign in to comment.