smtprelay icon indicating copy to clipboard operation
smtprelay copied to clipboard

Client certificate authentication (Office 365 connector)

Open JadRho opened this issue 10 months ago • 1 comments

Could client certificate authentication be used for the remote smtp server ?

The use case is for Office 365 with the connector enabled for subject name in the certificate.

local_cert and local_key are used only for the local part not with the upstream connection to the smtp server.

JadRho avatar Feb 18 '25 10:02 JadRho

It's definitely not possible at the moment but I can check if our SMTP client code can support it in the future.

decke avatar Feb 22 '25 07:02 decke

This feature would be useful to me too!

I looked into the code and it looks like the tls.Config struct could be configured with "Certificates" (https://pkg.go.dev/crypto/tls#Config). If my deduction is correct, then this feature (luckily) requires some plumbing to complete. I'll make an attempt, but don't hold your breath because my Go is bad.

https://github.com/decke/smtprelay/blob/780ac71f7420d19b7d6c0a37e6f62f9a85116577/smtp.go#L338-L343 https://github.com/decke/smtprelay/blob/780ac71f7420d19b7d6c0a37e6f62f9a85116577/smtp.go#L364-L372

Bert-Proesmans avatar Dec 13 '25 20:12 Bert-Proesmans