diff --git a/cmd/check.go b/cmd/check.go index 3c1a57d..93b3615 100644 --- a/cmd/check.go +++ b/cmd/check.go @@ -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() diff --git a/go.mod b/go.mod index f1b3ad0..984aef2 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/internal/services/email/email_test.go b/internal/services/email/email_test.go index 2e49f46..38ba17f 100644 --- a/internal/services/email/email_test.go +++ b/internal/services/email/email_test.go @@ -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") diff --git a/kit/config/config.go b/kit/config/config.go index bc9a6cd..bfdaa95 100644 --- a/kit/config/config.go +++ b/kit/config/config.go @@ -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"` }