[GH-ISSUE #503] Feature: Send API should allow separate auth #326

Closed
opened 2026-03-15 13:53:42 +03:00 by kerem · 4 comments
Owner

Originally created by @Tigger2014 on GitHub (May 28, 2025).
Original GitHub issue: https://github.com/axllent/mailpit/issues/503

Allow the send API endpoint to use the same authentication settings as SMTP (like MP_SMTP_AUTH_ALLOW_INSECURE and MP_SMTP_AUTH_ACCEPT_ANY) while keeping Web UI access separately secured.

Use Case
Using Mailpit as an SMTP forwarder where:

SMTP relay and send API endpoint should share flexible authentication settings
Applications can send emails via HTTP API using the same permissive auth as SMTP
Web UI remains securely protected with separate credentials for viewing stored messages
Currently, the send API endpoint doesn't respect SMTP authentication settings, forcing the same auth requirements for both sending emails and viewing messages.

This would allow us to send via SMTP or HTTP with or without auth whilst still keeping the held messages passing through mailpit (I forward onto an actual mail server) secure.

Many Thanks

Originally created by @Tigger2014 on GitHub (May 28, 2025). Original GitHub issue: https://github.com/axllent/mailpit/issues/503 Allow the send API endpoint to use the same authentication settings as SMTP (like `MP_SMTP_AUTH_ALLOW_INSECURE` and `MP_SMTP_AUTH_ACCEPT_ANY`) while keeping Web UI access separately secured. Use Case Using Mailpit as an SMTP forwarder where: SMTP relay and send API endpoint should share flexible authentication settings Applications can send emails via HTTP API using the same permissive auth as SMTP Web UI remains securely protected with separate credentials for viewing stored messages Currently, the send API endpoint doesn't respect SMTP authentication settings, forcing the same auth requirements for both sending emails and viewing messages. This would allow us to send via SMTP or HTTP with or without auth whilst still keeping the held messages passing through mailpit (I forward onto an actual mail server) secure. Many Thanks
kerem 2026-03-15 13:53:42 +03:00
Author
Owner

@axllent commented on GitHub (May 29, 2025):

Thank you @Tigger2014 for the idea and very comprehensive PR. Your attention to detail is greatly appreciated, including tests and backwards compatibility.

I will try to look into this tonight, however I am about to go away for a few days tomorrow (and I still need to pack etc) so that may not happen until mid next week once I am back. There's a fair bit to review & test, not to mention that the documentation Runtime options will need the new options/descriptions, and Sending mail will need some explanation regarding the specific options (I am just noting these here to remind myself).

Thanks again, I'll be in touch.

<!-- gh-comment-id:2918223096 --> @axllent commented on GitHub (May 29, 2025): Thank you @Tigger2014 for the idea and very comprehensive PR. Your attention to detail is greatly appreciated, including tests and backwards compatibility. I will try to look into this tonight, however I am about to go away for a few days tomorrow (and I still need to pack etc) so that may not happen until mid next week once I am back. There's a fair bit to review & test, not to mention that the documentation [Runtime options](https://mailpit.axllent.org/docs/configuration/runtime-options/) will need the new options/descriptions, and [Sending mail](https://mailpit.axllent.org/docs/usage/sending-messages/) will need some explanation regarding the specific options (I am just noting these here to remind myself). Thanks again, I'll be in touch.
Author
Owner

@Tigger2014 commented on GitHub (May 29, 2025):

Ive added a PR for the website now too, feel free to tweak as needed. axllent/mailpit-website#18

<!-- gh-comment-id:2920354012 --> @Tigger2014 commented on GitHub (May 29, 2025): Ive added a PR for the website now too, feel free to tweak as needed. axllent/mailpit-website#18
Author
Owner

@axllent commented on GitHub (May 29, 2025):

I tried my best to get through it all before I needed to leave but I've sadly run out of time, so it will be next week. I've merged your PR into a feature branch and done some testing, working perfectly so far. I'm making a few cosmetic changes (not committed yet, but locally) to re-order the CLI options etc, but overall it's brilliant. Thank you very much for the documentation PR too, I will review that too next week.

<!-- gh-comment-id:2920759890 --> @axllent commented on GitHub (May 29, 2025): I tried my best to get through it all before I needed to leave but I've sadly run out of time, so it will be next week. I've merged your PR into a feature branch and done some testing, working perfectly so far. I'm making a few cosmetic changes (not committed yet, but locally) to re-order the CLI options etc, but overall it's brilliant. Thank you very much for the documentation PR too, I will review that too next week.
Author
Owner

@axllent commented on GitHub (Jun 6, 2025):

Thanks again @Tigger2014 for all of your hard work. I have just released v1.26.0 which contains your PR and a few minor fixes/changes. I'll close this now, but feel free to reopen if you have any issues.

<!-- gh-comment-id:2948341998 --> @axllent commented on GitHub (Jun 6, 2025): Thanks again @Tigger2014 for all of your hard work. I have just released [v1.26.0](https://github.com/axllent/mailpit/releases/tag/v1.26.0) which contains your PR and a few minor fixes/changes. I'll close this now, but feel free to reopen if you have any issues.
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#326
No description provided.