feat(api): Add SMTP over HTTP REST API endpoint#6989
Closed
tayyebi wants to merge 7 commits intomailcow:stagingfrom
Closed
feat(api): Add SMTP over HTTP REST API endpoint#6989tayyebi wants to merge 7 commits intomailcow:stagingfrom
tayyebi wants to merge 7 commits intomailcow:stagingfrom
Conversation
Collaborator
8bf6c1e to
ab42876
Compare
Collaborator
|
How this going to work with current API when API key is only used for administrative automation and not even generated per domain. This is wrong by design. |
Adds a new API endpoint POST /api/v1/send/email for sending emails programmatically via SMTP. Features: - Send emails with plain text and/or HTML body - Support for CC, BCC, and reply-to addresses - Base64 encoded file attachments - Configurable SMTP host, port, and authentication - Full validation of email addresses - Proper error handling with descriptive messages Files changed: - data/web/inc/functions.inc.php: Added smtp_api() function - data/web/json_api.php: Added 'send' action handler - data/web/api/openapi.yaml: Added endpoint documentation - data/web/lang/lang.en-gb.json: Added error/success messages
ab42876 to
1ad55dd
Compare
This reverts commit bd73812.
- Remove 400 response (use 200 with error type like other endpoints) - Add 'danger' to type enum for consistency - Add 'log' field to response schema - Update description (auth required)
4af7975 to
cb0056a
Compare
Author
|
i was trying to keep the code self-describing. and also i have updated the openapi as well to let users know that they can (and mailcow prefers them) to use app_password instead of their mailbox password. 299a815 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Contribution Guidelines
What does this PR include?
Short Description
Adds a new REST API endpoint
POST /api/v1/send/emailthat allows mailbox users to send emails programmatically via SMTP through HTTP requests.Key Features:
Request Parameters:
Example:
Affected Containers
Did you run tests?
What did you tested?
What were the final results? (Awaited, got)
All test cases passed. Emails are sent correctly when mailbox credentials are provided and sender is authorized. Unauthorized senders receive appropriate error messages.
Related