@@ -28,11 +28,12 @@ import (
2828)
2929
3030const (
31- TestSmtpUser = "admin"
32- TestSmtpPass = "admin"
33- Smtp4DevApiUrl = "http://localhost:8080/api"
34- Smtp4DevHost = "localhost"
35- Smtp4DevPort = 2525
31+ TestSmtpUser = "admin"
32+ TestSmtpPass = "admin"
33+ Smtp4DevApiUrl = "http://localhost:8080/api"
34+ Smtp4DevHost = "localhost"
35+ Smtp4DevPort = 2525
36+ Smtp4DevTlsPort = 2465
3637)
3738
3839type SmtpTestSuite struct {
@@ -89,6 +90,7 @@ func (suite *SmtpTestSuite) TestSMTPSendingService_SendTLS() {
8990 }
9091
9192 cfg := createDefaultSMTPConfig ()
93+ cfg .Port = Smtp4DevTlsPort
9294 cfg .TLS = true
9395
9496 sut := NewSMTPSendingService (cfg )
@@ -215,22 +217,22 @@ func (c *Smtp4DevClient) CountMessages() (int, error) {
215217
216218func (c * Smtp4DevClient ) SetNoTls () error {
217219 slog .Info ("[smtp4Dev] disabling tls encryption" )
218- err := c .SetConfigValue ("tlsMode " , "None" )
219- time .Sleep (2 * time .Second )
220+ err := c .SetConfigValue ("ServerOptions__TlsMode " , "None" )
221+ time .Sleep (5 * time .Second )
220222 return err
221223}
222224
223225func (c * Smtp4DevClient ) SetForcedTls () error {
224226 slog .Info ("[smtp4Dev] enabling forced tls encryption" )
225- err := c .SetConfigValue ("tlsMode " , "ImplicitTls" )
226- time .Sleep (2 * time .Second )
227+ err := c .SetConfigValue ("ServerOptions__TlsMode " , "ImplicitTls" )
228+ time .Sleep (5 * time .Second )
227229 return err
228230}
229231
230232func (c * Smtp4DevClient ) SetStartTls () error {
231233 slog .Info ("[smtp4Dev] enabling tls encryption via starttls" )
232- err := c .SetConfigValue ("tlsMode " , "StartTls" )
233- time .Sleep (2 * time .Second )
234+ err := c .SetConfigValue ("ServerOptions__TlsMode " , "StartTls" )
235+ time .Sleep (5 * time .Second )
234236 return err
235237}
236238
0 commit comments