2017-04-25 03:59:38 +08:00
|
|
|
'use strict';
|
|
|
|
|
2017-07-16 19:37:33 +08:00
|
|
|
const config = require('wild-config');
|
2017-04-25 03:59:38 +08:00
|
|
|
const db = require('./db');
|
2017-12-21 18:45:15 +08:00
|
|
|
const Maildropper = require('./maildropper');
|
2017-04-25 03:59:38 +08:00
|
|
|
|
2017-12-21 18:43:15 +08:00
|
|
|
let maildropper;
|
2017-05-07 20:09:14 +08:00
|
|
|
|
2017-04-25 03:59:38 +08:00
|
|
|
module.exports = (options, callback) => {
|
2017-12-21 18:43:15 +08:00
|
|
|
maildropper =
|
|
|
|
maildropper ||
|
|
|
|
new Maildropper({
|
|
|
|
db,
|
|
|
|
zone: config.sender.zone,
|
|
|
|
collection: config.sender.collection,
|
|
|
|
gfs: config.sender.gfs
|
2017-10-26 19:57:19 +08:00
|
|
|
});
|
2017-04-25 03:59:38 +08:00
|
|
|
|
2017-12-21 18:56:49 +08:00
|
|
|
return maildropper.push(options, callback);
|
2017-04-25 03:59:38 +08:00
|
|
|
};
|