tweedegolf / mailcrab

Email test server for development, written in Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fail to send an email when TLS is enabled

Stygmates opened this issue · comments

Hi,
Thank you for the tool.
With the latest version, I can't seem to send an email when TLS is enabled, the sending loops indefinitely, this wasn't the case with previous versions.

Steps to reproduce:

  • Run the docker container:
docker run --rm --env ENABLE_TLS_AUTH=true -p 1080:1080 -p 1025:1025 marlonb/mailcrab:latest
  • Send the email:
curl smtp://127.0.0.1:1025 --mail-from myself@example.com --mail-rcpt receiver@example.com --upload-file samples/normal.email --user 'user:pass'

It does work when using:

docker run --rm --env ENABLE_TLS_AUTH=true -p 1080:1080 -p 1025:1025 marlonb/mailcrab:latest

Thank you @Stygmates.

When TLS is enabled curl should also send the message over TLS. Try using something like this:

curl -k --ssl-reqd smtps://127.0.0.1:1025 --mail-from myself@example.com --mail-rcpt receiver@example.com --upload-file samples/normal.email --user 'user:pass'

The --ssl-reqd parameter makes sure the SMTP connection is tunneled over TLS. The -k parameter makes curl accept self-signed certificates (which you probably use in a development setting).