Updated install script to bundle ZoneMTA
This commit is contained in:
parent
0c0942cf64
commit
d2f0d16980
4 changed files with 164 additions and 9 deletions
|
@ -257,4 +257,33 @@ router.post('/mailgun', uploads.any(), (req, res) => {
|
|||
});
|
||||
});
|
||||
|
||||
router.post('/zone-mta', (req, res, next) => {
|
||||
if (typeof req.body === 'string') {
|
||||
try {
|
||||
req.body = JSON.parse(req.body);
|
||||
} catch (E) {
|
||||
return next(new Error('Could not parse input'));
|
||||
}
|
||||
}
|
||||
|
||||
if (req.body.id) {
|
||||
campaigns.findMailByResponse(req.body.id, (err, message) => {
|
||||
if (err || !message) {
|
||||
return;
|
||||
}
|
||||
campaigns.updateMessage(message, 'bounced', true, (err, updated) => {
|
||||
if (err) {
|
||||
log.error('ZoneMTA', 'Failed updating message: %s', err.stack);
|
||||
} else if (updated) {
|
||||
log.verbose('ZoneMTA', 'Marked message %s as bounced', req.body.id);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
res.json({
|
||||
success: true
|
||||
});
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue