feat(routes,email): persist system DNS routes with runtime hydration and add reusable email ops DNS helpers
This commit is contained in:
@@ -6,6 +6,7 @@ import { DomainDoc } from '../db/documents/classes.domain.doc.js';
|
||||
import { DnsRecordDoc } from '../db/documents/classes.dns-record.doc.js';
|
||||
import type { DnsManager } from '../dns/manager.dns.js';
|
||||
import type { IEmailDomain, IEmailDnsRecord, TDnsRecordStatus } from '../../ts_interfaces/data/email-domain.js';
|
||||
import { buildEmailDnsRecords } from './email-dns-records.js';
|
||||
|
||||
/**
|
||||
* EmailDomainManager — orchestrates email domain setup.
|
||||
@@ -181,34 +182,13 @@ export class EmailDomainManager {
|
||||
}
|
||||
}
|
||||
|
||||
const records: IEmailDnsRecord[] = [
|
||||
{
|
||||
type: 'MX',
|
||||
name: domain,
|
||||
value: `10 ${hostname}`,
|
||||
status: doc.dnsStatus.mx,
|
||||
},
|
||||
{
|
||||
type: 'TXT',
|
||||
name: domain,
|
||||
value: 'v=spf1 a mx ~all',
|
||||
status: doc.dnsStatus.spf,
|
||||
},
|
||||
{
|
||||
type: 'TXT',
|
||||
name: `${selector}._domainkey.${domain}`,
|
||||
value: dkimValue,
|
||||
status: doc.dnsStatus.dkim,
|
||||
},
|
||||
{
|
||||
type: 'TXT',
|
||||
name: `_dmarc.${domain}`,
|
||||
value: `v=DMARC1; p=none; rua=mailto:dmarc@${domain}`,
|
||||
status: doc.dnsStatus.dmarc,
|
||||
},
|
||||
];
|
||||
|
||||
return records;
|
||||
return buildEmailDnsRecords({
|
||||
domain,
|
||||
hostname,
|
||||
selector,
|
||||
dkimValue,
|
||||
statuses: doc.dnsStatus,
|
||||
});
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user