Skip to content

Commit

Permalink
fix: switch to port 465
Browse files Browse the repository at this point in the history
  • Loading branch information
akurilov committed Oct 9, 2024
1 parent eae7310 commit 5c7df4f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
8 changes: 1 addition & 7 deletions api/smtp/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ func NewBackend(svcWriter writer.Service, rcpts map[string]bool, dataLimit int64
}

func (b backend) NewSession(c *smtp.Conn) (s smtp.Session, err error) {
connState, tlsOk := c.TLSConnectionState()
switch {
case tlsOk && connState.Version != 0:
s = newSession(b.svcWriter, b.rcpts, b.dataLimit)
default:
err = smtp.ErrAuthRequired
}
s = newSession(b.svcWriter, b.rcpts, b.dataLimit)
return
}
2 changes: 1 addition & 1 deletion helm/int-email/values-awakari-com.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ingress:
- path: /
pathType: ImplementationSpecific
tls:
- secretName: int-email-tls-server
- secretName: int-email-tls-secret
hosts:
- email.awakari.com

Expand Down
4 changes: 2 additions & 2 deletions helm/int-email/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ securityContext: {}

service:
type: LoadBalancer
port: 587
port: 465

ingress:
enabled: false
Expand All @@ -47,7 +47,7 @@ ingress:
- path: /
pathType: ImplementationSpecific
tls:
- secretName: int-email-tls-server
- secretName: int-email-tls-secret
hosts:
- int-email.local

Expand Down
10 changes: 7 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,16 @@ func main() {
cert,
},
Renegotiation: tls.RenegotiateNever,
ClientAuth: tls.NoClientCert,
ClientAuth: tls.RequireAndVerifyClientCert,
MinVersion: tls.VersionTLS12,
}
srv.TLSConfig = tlsConfig
l, err := tls.Listen("tcp", srv.Addr, tlsConfig)
if err != nil {
panic(err)
}

log.Info("starting to listen for emails...")
if err = srv.ListenAndServe(); err != nil {
if err = srv.Serve(l); err != nil {
panic(err)
}
}

0 comments on commit 5c7df4f

Please sign in to comment.