Skip to content

Commit

Permalink
fix(api): added endpoint to list locked domains
Browse files Browse the repository at this point in the history
  • Loading branch information
andris9 committed Feb 1, 2024
1 parent 5a81ce8 commit 25102ca
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
17 changes: 17 additions & 0 deletions lib/api-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,23 @@ class APIServer {
return next();
});

// list skipped domains for a zone
this.server.get('/skipdomains/:zone', (req, res, next) => {
if (!this.queue) {
res.json(500, {
error: 'Service not yet started'
});
return next();
}

let skipDomains = this.queue.locks.listSkipDomains(req.params.zone);

res.json({
skipDomains
});
next();
});

// list queued recipients for a zone
this.server.get('/suppressionlist', (req, res, next) => {
if (!this.queue) {
Expand Down
10 changes: 6 additions & 4 deletions lib/sender.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ const base32 = require('base32.js');
// handle DNS resolving
require('./ip-tools');

const DEFAULT_DEFER_TIMES = [
5 /* 5 */, 7 /* 12 */, 8 /* 20 */, 25 /* 45 */, 75 /* 2h */, 120 /* 4h */, 240 /* 8h */, 240 /* 12h */, 240 /* 16h */, 240 /* 20h */, 240 /* 24h */,
240 /* 28h */, 240 /* 32h */, 240 /* 36h */, 240 /* 40h */, 240 /* 44h */, 240 /* 48h */
].map(v => v * 60 * 1000);
const DEFAULT_DEFER_TIMES =
config.queue.deferTimes ||
[
5 /* 5 */, 7 /* 12 */, 8 /* 20 */, 25 /* 45 */, 75 /* 2h */, 120 /* 4h */, 240 /* 8h */, 240 /* 12h */, 240 /* 16h */, 240 /* 20h */, 240 /* 24h */,
240 /* 28h */, 240 /* 32h */, 240 /* 36h */, 240 /* 40h */, 240 /* 44h */, 240 /* 48h */
].map(v => v * 60 * 1000);

const POLICY_RESPONSE = 'Failed to establish a TLS connection to the MX server as requested by policy';

Expand Down

0 comments on commit 25102ca

Please sign in to comment.