This commit is contained in:
Andris Reinman 2019-01-08 23:27:03 +02:00
parent eac64a3533
commit 027b0a67b9
3 changed files with 17 additions and 5 deletions

View file

@ -2630,19 +2630,26 @@ module.exports = (db, server, messageHandler, userHandler) => {
*
* @apiSuccess {Boolean} success Indicates successful response
* @apiSuccess {String} queueId Message ID in outbound queue
* @apiSuccess {Object} [message] Information about submitted Message
* @apiSuccess {String} message.mailbox Mailbox ID the draft was moved to (usually Sent mail)
* @apiSuccess {Number} message.id Message ID in Mailbox
*
* @apiError error Description of the error
*
* @apiExample {curl} Forward a Message:
* @apiExample {curl} Submit a Message:
* curl -i -XPOST "http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a13e54454869460e57/messages/1/submit" \
* -H 'Content-type: application/json' \
* -d '{}'
*
* @apiSuccessExample {json} Forward Response:
* @apiSuccessExample {json} Submit Response:
* HTTP/1.1 200 OK
* {
* "success": true,
* "id": "1600d2f36470008b72"
* "queueId": "1682f5a712f000dfb6",
* "message": {
* "id": 3,
* "mailbox": "5c279b4e17abae166446f968"
* }
* }
*
* @apiErrorExample {json} Error-Response:
@ -2807,7 +2814,11 @@ module.exports = (db, server, messageHandler, userHandler) => {
},
messageQuery: messageData.uid
});
response.sent = moved.info;
response.message = {
id: moved.info && moved.info.destinationUid && moved.info.destinationUid[0],
mailbox: moved.info && moved.info.target
};
}
if (messageData.meta.reference) {

View file

@ -691,6 +691,7 @@ class MessageHandler {
sourceUid,
destinationUid,
mailbox: mailboxData._id,
target: targetData._id,
status: 'moved'
});
};

View file

@ -1,6 +1,6 @@
{
"name": "wildduck",
"version": "1.12.2",
"version": "1.12.3",
"description": "IMAP/POP3 server built with Node.js and MongoDB",
"main": "server.js",
"scripts": {