rnwood / smtp4dev

smtp4dev - the fake smtp email server for development and testing
BSD 3-Clause "New" or "Revised" License
3.18k stars 345 forks source link

SSL Cert - SMTP server failed to start #1565

Open williambonomo opened 3 weeks ago

williambonomo commented 3 weeks ago

Hi Everyone,

We were using SMTP4dev on an Azure Container Instance with no issues. However, I was requested to enable the SMTP TLS using our SSL cert issued by GoDaddy. Knowing that Azure Container instance has some limitations with SSL cert I decided to create an image with our SSL. When I run the container, I get the below error. I'm 100% sure the path to the key is correct.

2024-10-30 16:44:43 The SMTP server failed to start: System.IO.FileNotFoundException: Could not find file '/smtp4dev/mysslkey.key'.
2024-10-30 16:44:43 File name: '/smtp4dev/mysslkey.key'

This is how my Dockerfile looks like:

FROM rnwood/smtp4dev:latest

ENV ServerOptions__LockSettings=true
ENV ServerOptions__HostName=smtp4dev.ourdomain.io
ENV ServerOptions__Port=33
ENV ServerOptions__Urls=http://*:80
ENV ServerOptions__TlsMode=StartTls
ENV ServerOptions__TlsCertificate=myCrt.crt
ENV ServerOptions__TlsCertificatePrivateKey=mysslkey.key
ENV ServerOptions__TlsCertificatePassword=mypassword
ENV ServerOptions__SecureConnectionRequired=True
ENV ServerOptions__NumberOfMessagesToKeep=500

EXPOSE 80
EXPOSE 33
EXPOSE 143

I'm in no rush but if someone could help that would be great.

Julien-Eyraud commented 1 day ago

The docker file doesn't seem to copy the files.