allow uploading structured messages

This commit is contained in:
Andris Reinman 2018-11-12 13:31:03 +02:00
parent 436a3aaa9b
commit e12402448c

View file

@ -1849,13 +1849,12 @@ module.exports = (db, server, messageHandler) => {
);
/**
* @api {post} /users/:user/mailboxes/:mailbox/messages Upload Message Source
* @api {post} /users/:user/mailboxes/:mailbox/messages Upload Message
* @apiName UploadMessage
* @apiGroup Messages
* @apiDescription This method allows to upload an RFC822 formatted message to a mailbox. Message
* @apiDescription This method allows to upload either an RFC822 formatted message or a message structure to a mailbox. Raw message
* is stored unmodified, no headers are added or removed. If you want to generate the uploaded message
* from strucutred data fields, then see <a href="#api-Submission-PostSubmit">Submit a Message for Delivery</a>
* with <code>uploadOnly</code> option
* from strucutred data fields, then do not use the <code>raw</code> property.
* @apiHeader {String} X-Access-Token Optional access token if authentication is enabled
* @apiHeaderExample {json} Header-Example:
* {
@ -1909,6 +1908,14 @@ module.exports = (db, server, messageHandler) => {
* Subject: hello world!
*
* Example message'
* @apiExample {curl} Upload a Message Structure:
* curl -i -XPOST "http://localhost:8080/users/5a2f9ca57308fc3a6f5f811d/mailboxes/5a2f9ca57308fc3a6f5f811e/messages" \
* -H 'Content-type: message/rfc822' \
* -d 'From: sender@example.com
* To: recipient@example.com
* Subject: hello world!
*
* Example message'
*
* @apiSuccessExample {json} Forward Response:
* HTTP/1.1 200 OK