[GH-ISSUE #5] key/pem handling for smtp #4

Closed
opened 2026-03-15 12:01:38 +03:00 by kerem · 3 comments
Owner

Originally created by @paulbalomiri on GitHub (Aug 6, 2022).
Original GitHub issue: https://github.com/axllent/mailpit/issues/5

trying here to configure smtps and STARTTLS (optional) for the docker image.
I can also rebuild the docker image [EDIT id nessesary ] and already have let'sencrypt the key & cert.

The wiki's smtp page mentions the config options --smtp-ssl-cert and --smtp-ssl-key

I can not set them, though & don't know if it is possible from env variables too (trying to avoid the execute docker config service option if possible.

Edit 2: The codebase's config.go also does not mention these options...

Thumbs up for the project 👍

Originally created by @paulbalomiri on GitHub (Aug 6, 2022). Original GitHub issue: https://github.com/axllent/mailpit/issues/5 trying here to configure `smtps` and `STARTTLS` (optional) for the docker image. I can also rebuild the docker image [**EDIT** id nessesary ] and already have let'sencrypt the key & cert. The [wiki's smtp page](https://github.com/axllent/mailpit/wiki/SMTP-with-STARTTLS-and-authentication) mentions the config options `--smtp-ssl-cert` and `--smtp-ssl-key` I can not set them, though & don't know if it is possible from env variables too (trying to avoid the `execute` docker config service option if possible. **Edit 2**: The codebase's config.go also does not mention these options... Thumbs up for the project 👍
kerem closed this issue 2026-03-15 12:01:43 +03:00
Author
Owner

@paulbalomiri commented on GitHub (Aug 6, 2022):

ah, now saw your commit from 2hrs ago:

github.com/axllent/mailpit@56fdaa1224

Does this mean the MP_SSL* are taken from the web UI?

github.com/axllent/mailpit@ba8c4cd2aa/cmd/root.go (L96-L103)

My usecase is served best if i can reverse proxy the UI with traefik, but expose the smtp endpoint as is on a dedicated port (no virtual hosts for smtp)

<!-- gh-comment-id:1207183245 --> @paulbalomiri commented on GitHub (Aug 6, 2022): ah, now saw your commit from 2hrs ago: https://github.com/axllent/mailpit/commit/56fdaa1224fbdb768758889fd8e18fb3bfada309 Does this mean the `MP_SSL*` are taken from the web UI? https://github.com/axllent/mailpit/blob/ba8c4cd2aa58c2add42ed1e007506a48c765768a/cmd/root.go#L96-L103 My usecase is served best if i can reverse proxy the UI with traefik, but expose the smtp endpoint as is on a dedicated port (no virtual hosts for smtp)
Author
Owner

@axllent commented on GitHub (Aug 6, 2022):

@paulbalomiri It seems there is some confusion, probably caused by me trying to edit multiple documents at the same time.

So to answer your question(s), MP_SSL_KEY & MP_SSL_CERT have been replaced with MP_UI_SSL_CERT and MP_UI_SSL_KEY - but these are for the web UI, not SMTP (and in saying that I just realized I have a typo in my code so I have just released 0.1.1). What you are looking for has now been documented in the wiki - MP_SMTP_SSL_CERT & MP_SMTP_SSL_KEY.

Hopefully this answers your questions, and thanks for the heads-up.

Edit: traefik handling HTTPS (provided you have something specific in your config to handle the websocket path api/catchall/events - or maybe traefik handles that automatically, I don't know) and direct forwarding to STARTTLS should work as expected - provided you have valid certs (or accept "insecure" (not validated) certs.

Edit 2: I haven't fully tested all those options via docker (yet), though they should work as expected provided I didn't make any more dumb typos :)

<!-- gh-comment-id:1207197879 --> @axllent commented on GitHub (Aug 6, 2022): @paulbalomiri It seems there is some confusion, probably caused by me trying to edit multiple documents at the same time. So to answer your question(s), `MP_SSL_KEY` & `MP_SSL_CERT` have been replaced with `MP_UI_SSL_CERT` and `MP_UI_SSL_KEY` - but these are for the web UI, not SMTP (and in saying that I just realized I have a typo in my code so I have just released 0.1.1). What you are looking for has now been documented in the [wiki](https://github.com/axllent/mailpit/wiki/Runtime-options) - `MP_SMTP_SSL_CERT` & `MP_SMTP_SSL_KEY`. Hopefully this answers your questions, and thanks for the heads-up. Edit: traefik handling HTTPS (provided you have something specific in your config to handle the websocket path `api/catchall/events` - or maybe traefik handles that automatically, I don't know) and direct forwarding to STARTTLS should work as expected - provided you have valid certs (or accept "insecure" (not validated) certs. Edit 2: I haven't fully tested all those options via docker (yet), though they should work as expected provided I didn't make any more dumb typos :)
Author
Owner

@paulbalomiri commented on GitHub (Aug 6, 2022):

#6 and #7 both solve a minor issue regarding this.

Thanks for this great Repo @axllent !

<!-- gh-comment-id:1207239960 --> @paulbalomiri commented on GitHub (Aug 6, 2022): #6 and #7 both solve a minor issue regarding this. Thanks for this great Repo @axllent !
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/mailpit#4
No description provided.