fix: change From to MailFrom

This commit is contained in:
Urko 2023-08-28 08:51:02 +02:00
parent 3e698d3f43
commit 961b68bf4e
4 changed files with 4 additions and 3 deletions

View File

@ -58,7 +58,7 @@ var Check = &cobra.Command{
Auth: smtp.PlainAuth("", cfg.MailUser, cfg.MailPassword, cfg.MailHost),
Host: cfg.MailHost,
Port: cfg.MailPort,
From: cfg.MailUser,
From: cfg.MailFrom,
},
)
logger := logrus.New()

2
go.mod
View File

@ -8,6 +8,7 @@ require (
github.com/kelseyhightower/envconfig v1.4.0
github.com/kurin/blazer v0.5.3
github.com/rclone/rclone v1.63.1
github.com/sirupsen/logrus v1.9.0
github.com/spf13/cobra v1.7.0
github.com/stretchr/testify v1.8.3
golang.org/x/sync v0.3.0
@ -41,7 +42,6 @@ require (
github.com/rfjakob/eme v1.1.2 // indirect
github.com/shirou/gopsutil/v3 v3.23.5 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/tklauser/go-sysconf v0.3.11 // indirect
github.com/tklauser/numcpus v0.6.0 // indirect

View File

@ -17,7 +17,7 @@ func Test_mailService_SendOK(t *testing.T) {
Auth: smtp.PlainAuth("", cfg.MailUser, cfg.MailPassword, cfg.MailHost),
Host: cfg.MailHost,
Port: cfg.MailPort,
From: cfg.MailUser,
From: cfg.MailFrom,
},
)
reader, err := os.Open("testdata/attachment1.txt")

View File

@ -16,6 +16,7 @@ type Config struct {
MailHost string `required:"true" split_words:"true"`
MailPort string `required:"true" split_words:"true"`
MailUser string `required:"true" split_words:"true"`
MailFrom string `required:"true" split_words:"true"`
MailPassword string `required:"true" split_words:"true"`
}