@@ -15,7 +15,7 @@ const Transform = require('stream').Transform;
15
15
const { sessSchema, sessIPSchema, booleanSchema, metaDataSchema } = require ( '../schemas' ) ;
16
16
const { preprocessAttachments } = require ( '../data-url' ) ;
17
17
const { userId, mailboxId } = require ( '../schemas/request/general-schemas' ) ;
18
- const { AddressOptionalName, AddressOptionalNameArray, Header, Attachment , ReferenceWithAttachments } = require ( '../schemas/request/messages-schemas' ) ;
18
+ const { AddressOptionalName, AddressOptionalNameArray, Header, ReferenceWithoutAttachments } = require ( '../schemas/request/messages-schemas' ) ;
19
19
const { successRes } = require ( '../schemas/response/general-schemas' ) ;
20
20
21
21
class StreamCollect extends Transform {
@@ -631,7 +631,7 @@ module.exports = (db, server, messageHandler, userHandler, settingsHandler) => {
631
631
description : 'Use this method to send emails from a user account' ,
632
632
validationObjs : {
633
633
requestBody : {
634
- mailbox : mailboxId ,
634
+ mailbox : Joi . string ( ) . hex ( ) . lowercase ( ) . length ( 24 ) . description ( 'ID of the Mailbox' ) ,
635
635
from : AddressOptionalName . description ( 'Addres for the From: header' ) ,
636
636
replyTo : AddressOptionalName . description ( 'Address for the Reply-To: header' ) ,
637
637
to : Joi . array ( )
@@ -664,12 +664,27 @@ module.exports = (db, server, messageHandler, userHandler, settingsHandler) => {
664
664
. empty ( '' )
665
665
. max ( 1024 * 1024 )
666
666
. description ( 'HTML formatted message' ) ,
667
- attachments : Joi . array ( ) . items ( Attachment ) . description ( 'Attachments for the message' ) ,
667
+ attachments : Joi . array ( )
668
+ . items (
669
+ Joi . object ( {
670
+ filename : Joi . string ( ) . empty ( '' ) . max ( 255 ) . description ( 'Attachment filename' ) ,
671
+ contentType : Joi . string ( ) . empty ( '' ) . max ( 255 ) . description ( 'MIME type for the attachment file' ) ,
672
+ encoding : Joi . string ( ) . empty ( '' ) . default ( 'base64' ) . description ( 'Encoding to use to store the attachments' ) ,
673
+ contentTransferEncoding : Joi . string ( ) . empty ( '' ) . description ( 'Transfer encoding' ) ,
674
+ contentDisposition : Joi . string ( ) . empty ( '' ) . trim ( ) . lowercase ( ) . valid ( 'inline' , 'attachment' ) . description ( 'Content Disposition' ) ,
675
+ content : Joi . string ( ) . required ( ) . description ( 'Base64 encoded attachment content' ) ,
676
+ cid : Joi . string ( )
677
+ . empty ( '' )
678
+ . max ( 255 )
679
+ . description ( 'Content-ID value if you want to reference to this attachment from HTML formatted message' )
680
+ } )
681
+ )
682
+ . description ( 'Attachments for the message' ) ,
668
683
669
684
meta : metaDataSchema . label ( 'metaData' ) . description ( 'Optional metadata, must be an object or JSON formatted string' ) ,
670
685
sess : sessSchema ,
671
686
ip : sessIPSchema ,
672
- reference : ReferenceWithAttachments . description (
687
+ reference : ReferenceWithoutAttachments . description (
673
688
'Optional referenced email. If uploaded message is a reply draft and relevant fields are not provided then these are resolved from the message to be replied to'
674
689
) ,
675
690
// if true then treat this message as a draft
0 commit comments