Skip to content

Commit

Permalink
fix(upload): allow empty name field in the Upload message FROM: heade…
Browse files Browse the repository at this point in the history
…r ZMS-113 (#577)

* allow empty name field in the Upload message FROM: header

* allow empty name for reply-to also
  • Loading branch information
NickOvt committed Dec 15, 2023
1 parent c0ceb5a commit c1e28db
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/api/messages.js
Expand Up @@ -25,7 +25,15 @@ const { getMongoDBQuery /*, getElasticSearchQuery*/ } = require('../search-query
//const { getClient } = require('../elasticsearch');

const BimiHandler = require('../bimi-handler');
const { Address, AddressOptionalNameArray, Header, Attachment, ReferenceWithAttachments, Bimi } = require('../schemas/request/messages-schemas');
const {
Address,
AddressOptionalNameArray,
Header,
Attachment,
ReferenceWithAttachments,
Bimi,
AddressOptionalName
} = require('../schemas/request/messages-schemas');
const { userId, mailboxId, messageId } = require('../schemas/request/general-schemas');
const { MsgEnvelope } = require('../schemas/response/messages-schemas');
const { successRes } = require('../schemas/response/general-schemas');
Expand Down Expand Up @@ -1895,9 +1903,9 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti
'base64 encoded message source. Alternatively, you can provide this value as POST body by using message/rfc822 MIME type. If raw message is provided then it overrides any other mail configuration'
),

from: Address.description('Addres for the From: header'),
from: AddressOptionalName.description('Addres for the From: header'),

replyTo: Address.description('Address for the Reply-To: header'),
replyTo: AddressOptionalName.description('Address for the Reply-To: header'),

to: AddressOptionalNameArray.description('Addresses for the To: header'),

Expand Down
1 change: 1 addition & 0 deletions lib/schemas/request/messages-schemas.js
Expand Up @@ -61,6 +61,7 @@ const Bimi = Joi.object({
module.exports = {
Address,
AddressOptionalNameArray,
AddressOptionalName,
Header,
Attachment,
ReferenceWithAttachments,
Expand Down

0 comments on commit c1e28db

Please sign in to comment.