diff options
author | Jesús Espino <jespinog@gmail.com> | 2018-03-27 10:23:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-27 10:23:33 +0200 |
commit | 9e6db178b09387e21ac19ce85369cf1ca7a443e8 (patch) | |
tree | 9e51141b285b24b00cf187204077fa8526d9183e /utils/mail_test.go | |
parent | 8491ba5740e2d9942b2612ce06aef90bb10ad4c0 (diff) | |
download | chat-9e6db178b09387e21ac19ce85369cf1ca7a443e8.tar.gz chat-9e6db178b09387e21ac19ce85369cf1ca7a443e8.tar.bz2 chat-9e6db178b09387e21ac19ce85369cf1ca7a443e8.zip |
Adding durafmt library and use it from enterprise global relay export (#8487)
* Adding durafmt library and use it from enterprise global relay export
* Allow to specify different server host and server name on smtp connections
* Fixing utils/smtp tests
Diffstat (limited to 'utils/mail_test.go')
-rw-r--r-- | utils/mail_test.go | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/utils/mail_test.go b/utils/mail_test.go index 50cf09dac..99ab395bf 100644 --- a/utils/mail_test.go +++ b/utils/mail_test.go @@ -47,7 +47,8 @@ func TestMailConnectionAdvanced(t *testing.T) { &SmtpConnectionInfo{ ConnectionSecurity: cfg.EmailSettings.ConnectionSecurity, SkipCertVerification: *cfg.EmailSettings.SkipServerCertificateVerification, - SmtpServer: cfg.EmailSettings.SMTPServer, + SmtpServerName: cfg.EmailSettings.SMTPServer, + SmtpServerHost: cfg.EmailSettings.SMTPServer, SmtpPort: cfg.EmailSettings.SMTPPort, }, ); err != nil { @@ -60,7 +61,8 @@ func TestMailConnectionAdvanced(t *testing.T) { &SmtpConnectionInfo{ ConnectionSecurity: cfg.EmailSettings.ConnectionSecurity, SkipCertVerification: *cfg.EmailSettings.SkipServerCertificateVerification, - SmtpServer: cfg.EmailSettings.SMTPServer, + SmtpServerName: cfg.EmailSettings.SMTPServer, + SmtpServerHost: cfg.EmailSettings.SMTPServer, SmtpPort: cfg.EmailSettings.SMTPPort, Auth: *cfg.EmailSettings.EnableSMTPAuth, SmtpUsername: cfg.EmailSettings.SMTPUsername, @@ -76,7 +78,8 @@ func TestMailConnectionAdvanced(t *testing.T) { &SmtpConnectionInfo{ ConnectionSecurity: cfg.EmailSettings.ConnectionSecurity, SkipCertVerification: *cfg.EmailSettings.SkipServerCertificateVerification, - SmtpServer: "wrongServer", + SmtpServerName: "wrongServer", + SmtpServerHost: "wrongServer", SmtpPort: "553", }, ); err == nil { @@ -225,10 +228,11 @@ func TestSendMailUsingConfigAdvanced(t *testing.T) { func TestAuthMethods(t *testing.T) { auth := &authChooser{ connectionInfo: &SmtpConnectionInfo{ - SmtpUsername: "test", - SmtpPassword: "fakepass", - SmtpServer: "fakeserver", - SmtpPort: "25", + SmtpUsername: "test", + SmtpPassword: "fakepass", + SmtpServerName: "fakeserver", + SmtpServerHost: "fakeserver", + SmtpPort: "25", }, } tests := []struct { |