-
-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature-request] Add mailpit instance ID (MP_LABEL) to hook json. #400
Comments
That makes sense. Currently the webhook is a 1:1 "copy" of a message summary (the same as the web UI has), so I don't think it's a good idea to clone / modify the object for every message just to add a new field because there could be 100+ messages per second (wasted CPU). Would an additional HTTP header work with the webhook request? I'm thinking something like |
Great! Header should be fine, tnx. It would be nice also to somehow include info about absent html part. Hook code generates
mailpit return error code which MUST be handled on reverse proxy side, it would be better not to send link and do not call image generation API (which is really CPU hungry) at all in case there is no HTML. |
Adding the header isn't an issue (and I will do this), however your other request to add an extra field is problematic because it introduces the same problem I explained earlier: The webhook receives the same "MessageSummary" that the browser's websocket connection receives - which does not include any HTML or Text (other than a "snippet" summary). I am assuming your Telegram bot has logic built in? When it receives a webhook, can it not call the API and determine that itself?
|
Is it possible to include in header summary info on size of all attachment parts? I.e. html: 0, txt: 105, attachment1: 200, attachment2: 300 and so on? Hook will handle thousands of messages per minute, so implementing logic to track availability of HTML on HOOK side seems not practical/possible. To implement logic on BOT side it will be necessary to make it stateful instead of stateless and keep track of bot recipient messages instead of sending just one link. Anyway, in current condition problem can be solved on proxy side, if I am asking for something too hard to implement just don't mention. P.S. One more question, are IDs really unique? It looks like old plain MD5 coded to base64. Do they include timestamp before encoding? |
I think your request for all that information is too specific to your own needs, rather than beneficial to everyone and the project, so I won't add that information to the webhook. Sorry.... I am interested to hear what you are building that is going to be receiving tousands of webhook connections per minute? Obviously you have multiple Mailpit instances (instance ID in the webhook request), but what are you building (if you don't mind me asking)? I will add the label to the header in the next day or two and include it in a new Mailpit release by the end of the weekend 👍 To answer your question, yes, the IDs should be really unique. It is definitely not MD5, it uses a shortened version of UUID which is case-sensitive ( |
public SMTP to telegram gateway hosted on dozen of VPS worldwide Thanks for your time and fantastic multipurpose application. =) |
This feature has just been released in v1.21.6 👍 |
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [axllent/mailpit](https://github.com/axllent/mailpit) | patch | `v1.21.5` -> `v1.21.6` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>axllent/mailpit (axllent/mailpit)</summary> ### [`v1.21.6`](https://github.com/axllent/mailpit/blob/HEAD/CHANGELOG.md#v1216) [Compare Source](axllent/mailpit@v1.21.5...v1.21.6) ##### Feature - Include Mailpit label (if set) in webhook HTTP header ([#​400](axllent/mailpit#400)) - Add support for sending inline attachments via HTTP API ([#​399](axllent/mailpit#399)) ##### Chore - Update caniemail database - Update node dependencies - Update Go dependencies ##### Fix - Message view not updating when deleting messages from search ([#​395](axllent/mailpit#395)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Sometimes it is necessary to make API callbacks from hook processing code, for example to delete messages with unknown recipients.
Client IP is not reliable enough to determine API URL for callbacks.
The text was updated successfully, but these errors were encountered: