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

@ -2217,3 +2217,10 @@ func (Admin) TLSRPTSuppressExtend(ctx context.Context, id int64, until time.Time
err := tlsrptdb.SuppressUpdate(ctx, id, until)
xcheckf(ctx, err, "updating reporting address in suppresslist")
}
// LookupCid turns an ID from a Received header into a cid as used in logging.
func (Admin) LookupCid(ctx context.Context, recvID string) (cid string) {
v, err := mox.ReceivedToCid(recvID)
xcheckf(ctx, err, "received id to cid")
return fmt.Sprintf("%x", v)
}