Built-in Zone MTA
Plugin for ZoneMTA for per-message DKIM keys.
This commit is contained in:
parent
d103a2cc79
commit
77c64f487d
18 changed files with 231 additions and 110 deletions
|
@ -180,22 +180,28 @@ router.postAsync('/mailgun', uploads.any(), async (req, res) => {
|
|||
|
||||
|
||||
router.postAsync('/zone-mta', async (req, res) => {
|
||||
if (typeof req.body === 'string') {
|
||||
req.body = JSON.parse(req.body);
|
||||
}
|
||||
|
||||
if (req.body.id) {
|
||||
const message = await campaigns.getMessageByCid(req.body.id);
|
||||
|
||||
if (message) {
|
||||
await campaigns.changeStatusByMessage(contextHelpers.getAdminContext(), message, SubscriptionStatus.BOUNCED, true);
|
||||
log.verbose('ZoneMTA', 'Marked message %s as bounced', req.body.id);
|
||||
try {
|
||||
if (typeof req.body === 'string') {
|
||||
req.body = JSON.parse(req.body);
|
||||
}
|
||||
}
|
||||
|
||||
res.json({
|
||||
success: true
|
||||
});
|
||||
if (req.body.id) {
|
||||
const message = await campaigns.getMessageByResponseId(req.body.id);
|
||||
console.log(message);
|
||||
|
||||
if (message) {
|
||||
await campaigns.changeStatusByMessage(contextHelpers.getAdminContext(), message, SubscriptionStatus.BOUNCED, true);
|
||||
log.verbose('ZoneMTA', 'Marked message %s as bounced', req.body.id);
|
||||
}
|
||||
}
|
||||
|
||||
res.json({
|
||||
success: true
|
||||
});
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
throw err;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue