store queue id

This commit is contained in:
Andris Reinman 2020-05-27 13:59:23 +03:00
parent 2a24ff9331
commit 329a157f03
2 changed files with 10 additions and 3 deletions

View file

@ -11,7 +11,7 @@ const htmlToText = require('html-to-text');
const Joi = require('../joi');
const ObjectID = require('mongodb').ObjectID;
const tools = require('../tools');
const maildrop = require('../maildrop');
const Maildropper = require('../maildropper');
const roles = require('../roles');
const Transform = require('stream').Transform;
@ -30,6 +30,13 @@ class StreamCollect extends Transform {
}
module.exports = (db, server, messageHandler, userHandler) => {
let maildrop = new Maildropper({
db,
zone: config.sender.zone,
collection: config.sender.collection,
gfs: config.sender.gfs
});
function submitMessage(options, callback) {
let user = options.user;
@ -461,7 +468,7 @@ module.exports = (db, server, messageHandler, userHandler) => {
}
// push message to outbound queue
let message = maildrop(
let message = maildrop.push(
{
parentId: messageId,
reason: 'submit',

View file

@ -487,7 +487,7 @@ class MessageHandler {
ha: messageData.ha,
mailbox: mailboxData._id,
mailboxPath: mailboxData.path,
info: messageData.meta
info: Object.assign({ queueId: messageData.outbound }, messageData.meta)
});
}
};