Skip to content

Commit

Permalink
fix: make tls_client configuration work in target.smtp block
Browse files Browse the repository at this point in the history
  • Loading branch information
mlipscombe committed Feb 10, 2025
1 parent 01c65cf commit 0e953a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions internal/target/smtp/smtp_downstream.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ type Downstream struct {
hostname string
endpoints []config.Endpoint
saslFactory saslClientFactory
tlsConfig tls.Config
tlsConfig *tls.Config

connectTimeout time.Duration
commandTimeout time.Duration
Expand Down Expand Up @@ -229,9 +229,9 @@ func (d *delivery) connect(ctx context.Context) error {
for _, endp := range d.u.endpoints {
var err error
if d.u.lmtp {
_, err = conn.ConnectLMTP(ctx, endp, d.u.starttls, &d.u.tlsConfig)
_, err = conn.ConnectLMTP(ctx, endp, d.u.starttls, d.u.tlsConfig)
} else {
_, err = conn.Connect(ctx, endp, d.u.starttls, &d.u.tlsConfig)
_, err = conn.Connect(ctx, endp, d.u.starttls, d.u.tlsConfig)
}
if err != nil {
if len(d.u.endpoints) != 1 {
Expand Down
2 changes: 1 addition & 1 deletion internal/target/smtp/smtp_downstream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func TestDownstreamDelivery_StartTLS(t *testing.T) {
Port: testPort,
},
},
tlsConfig: *clientCfg.Clone(),
tlsConfig: clientCfg.Clone(),
starttls: true,
log: testutils.Logger(t, "target.smtp"),
}
Expand Down

0 comments on commit 0e953a8

Please sign in to comment.