webadmin: add single-line form for looking up a cid for a received id

This commit is contained in:
Mechiel Lukkien
2024-03-05 10:50:56 +01:00
parent 5738d9e7b8
commit a9cb6f9d0a
5 changed files with 94 additions and 1 deletions

View File

@ -265,6 +265,10 @@ const index = async () => {
let account: HTMLInputElement
let localpart: HTMLInputElement
let recvIDFieldset: HTMLFieldSetElement
let recvID: HTMLInputElement
let cidElem: HTMLSpanElement
dom._kids(page,
crumbs('Mox Admin'),
checkUpdatesEnabled ? [] : dom.p(box(yellow, 'Warning: Checking for updates has not been enabled in mox.conf (CheckUpdates: true).', dom.br(), 'Make sure you stay up to date through another mechanism!', dom.br(), 'You have a responsibility to keep the internet-connected software you run up to date and secure!', dom.br(), 'See ', link('https://updates.xmox.nl/changelog'))),
@ -329,6 +333,32 @@ const index = async () => {
dom.div(dom.a('MTA-STS policies', attr.href('#mtasts'))),
dom.div(dom.a('DMARC evaluations', attr.href('#dmarc/evaluations'))),
dom.div(dom.a('TLS connection results', attr.href('#tlsrpt/results'))),
dom.div(
style({marginTop: '.5ex'}),
dom.form(
async function submit(e: SubmitEvent) {
e.preventDefault()
e.stopPropagation()
try {
dom._kids(cidElem)
recvIDFieldset.disabled = true
const cid = await client.LookupCid(recvID.value)
dom._kids(cidElem, cid)
} catch (err) {
console.log({err})
window.alert('Error: ' + errmsg(err))
} finally {
recvIDFieldset.disabled = false
}
},
recvIDFieldset=dom.fieldset(
dom.label('Received ID', attr.title('The ID in the Received header that was added during incoming delivery.')), ' ',
recvID=dom.input(attr.required('')), ' ',
dom.submitbutton('Lookup cid', attr.title('Logging about an incoming message includes an attribute "cid", a counter identifying the transaction related to delivery of the message. The ID in the received header is an encrypted cid, which this form decrypts, after which you can look it up in the logging.')), ' ',
cidElem=dom.span(),
),
),
),
// todo: routing, globally, per domain and per account
dom.br(),
dom.h2('DNS blocklist status'),