summaryrefslogtreecommitdiff
path: root/internal/configuration/validator/notifier_test.go
diff options
context:
space:
mode:
authorJames Elliott <james-d-elliott@users.noreply.github.com>2022-07-18 10:56:09 +1000
committerGitHub <noreply@github.com>2022-07-18 10:56:09 +1000
commitdf016be29ea155c030d419937bf4bf8757ae3bf0 (patch)
tree1e086c07392b209094033c9146a234b3de25b336 /internal/configuration/validator/notifier_test.go
parent38e3f741b72957997d1691b53507f1c353cc6886 (diff)
fix(notification): incorrect date header format (#3684)
* fix(notification): incorrect date header format The date header in the email envelopes was incorrectly formatted missing a space between the `Date:` header and the value of this header. This also refactors the notification templates system allowing people to manually override the envelope itself. * test: fix tests and linting issues * fix: misc issues * refactor: misc refactoring * docs: add example for envelope with message id * refactor: organize smtp notifier * refactor: move subject interpolation * refactor: include additional placeholders * docs: fix missing link * docs: gravity * fix: rcpt to command * refactor: remove mid * refactor: apply suggestions Co-authored-by: Amir Zarrinkafsh <nightah@me.com> * refactor: include pid Co-authored-by: Amir Zarrinkafsh <nightah@me.com>
Diffstat (limited to 'internal/configuration/validator/notifier_test.go')
-rw-r--r--internal/configuration/validator/notifier_test.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/internal/configuration/validator/notifier_test.go b/internal/configuration/validator/notifier_test.go
index 3316e0633..dbecbf4d8 100644
--- a/internal/configuration/validator/notifier_test.go
+++ b/internal/configuration/validator/notifier_test.go
@@ -82,6 +82,17 @@ func (suite *NotifierSuite) TestSMTPShouldSetTLSDefaults() {
suite.Assert().False(suite.config.SMTP.TLS.SkipVerify)
}
+func (suite *NotifierSuite) TestSMTPShouldDefaultStartupCheckAddress() {
+ suite.Assert().Equal(mail.Address{Name: "", Address: ""}, suite.config.SMTP.StartupCheckAddress)
+
+ ValidateNotifier(&suite.config, suite.validator)
+
+ suite.Assert().Len(suite.validator.Warnings(), 0)
+ suite.Assert().Len(suite.validator.Errors(), 0)
+
+ suite.Assert().Equal(mail.Address{Name: "Authelia Test", Address: "test@authelia.com"}, suite.config.SMTP.StartupCheckAddress)
+}
+
func (suite *NotifierSuite) TestSMTPShouldDefaultTLSServerNameToHost() {
suite.config.SMTP.Host = "google.com"
suite.config.SMTP.TLS = &schema.TLSConfig{