-
Notifications
You must be signed in to change notification settings - Fork 262
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
feat(ocs): notify of new messages and provide API endpoint to retrieve its contents #9749
feat(ocs): notify of new messages and provide API endpoint to retrieve its contents #9749
Conversation
Wrong PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the one recommendation, code works.
@ChristophWurst shall I also expose an endpoint to download the attachments? Or is there a way to add them to the JSON without doing the base64_enocde dance? We have a download in the MessageController already that I could copy. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested works good.
The Json message object just didn't have the body parameter, but all other information was there.
@miaulalala i wouldn't include attachments in the get method output... That can cause a lot of traffic for something that might not be used... on that note the attachments are already in the raw message, so I don't know if the raw message should be included unless requested that way... This was the encoded attachment in the message I pulled.
|
JSON response: {
"ocs": {
"meta": {
"status": "ok",
"statuscode": 200,
"message": "OK"
},
"data": {
"uid": 5396,
"messageId": "<kjsdflkdsjflksdkjf@geopod-ismtpd-39>",
"from": [
{
"label": "FromLabel",
"email": "[email protected]"
}
],
"to": [
{
"label": "[email protected]",
"email": "[email protected]"
}
],
"replyTo": [
{
"label": "ReplyToLabel",
"email": "[email protected]"
}
],
"cc": [],
"bcc": [],
"subject": "Subject",
"dateInt": 1719374564,
"flags": {
"seen": true,
"flagged": false,
"answered": false,
"deleted": false,
"draft": false,
"forwarded": false,
"hasAttachments": false,
"mdnsent": false,
"important": true
},
"hasHtmlBody": true,
"dispositionNotificationTo": "",
"hasDkimSignature": true,
"unsubscribeUrl": "sjfifjsdlksdjflksdjf",
"isOneClickUnsubscribe": true,
"unsubscribeMailto": null,
"scheduling": [],
"body": "Body data here",
"attachments": [],
"id": 186737,
"isSenderTrusted": false,
"smime": {
"isSigned": false,
"signatureIsValid": null,
"isEncrypted": false
}
}
}
} |
When an S/MIME encrypted message is fetched via This could be improved by catching, retrying without fetching the body and adding a field We cannot get the body but the meta information of a message (to, cc, subject etc.) could still be interesting to an API consumer. mail/lib/Controller/MessageApiController.php Lines 81 to 92 in d798904
Fetching with The thrown exception in mail/lib/Service/SmimeService.php Lines 524 to 526 in fefd2a7
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
S/MIME is handled correctly now.
…e its contents Signed-off-by: Anna Larch <[email protected]>
81c8b87
to
71dbc51
Compare
To Do