26 lines
1.2 KiB
JavaScript
26 lines
1.2 KiB
JavaScript
import { SESv2Client, GetEmailIdentityCommand } from "@aws-sdk/client-sesv2";
|
|
|
|
const domain = process.env.MAIL_FROM_DOMAIN || "hubsport.club";
|
|
const region = process.env.AWS_REGION || "eu-west-1";
|
|
const client = new SESv2Client({ region });
|
|
const identity = await client.send(new GetEmailIdentityCommand({ EmailIdentity: domain }));
|
|
const status = identity.DkimAttributes?.Status ?? "UNKNOWN";
|
|
const tokens = identity.DkimAttributes?.Tokens ?? [];
|
|
const mailFrom = identity.MailFromAttributes?.MailFromDomain ?? `bounce.${domain}`;
|
|
|
|
console.log(`SES-Identity: ${domain} (${region})`);
|
|
console.log(`DKIM: ${status}`);
|
|
console.log(`Sending aktiv: ${identity.VerifiedForSendingStatus ? "ja" : "nein"}\n`);
|
|
|
|
console.log("Cloudflare-Records (Proxy aus):\n");
|
|
for (const token of tokens) {
|
|
console.log(`CNAME ${token}._domainkey.${domain} -> ${token}.dkim.amazonses.com`);
|
|
}
|
|
console.log(`MX ${mailFrom} -> 10 feedback-smtp.${region}.amazonses.com`);
|
|
console.log(`TXT ${mailFrom} -> "v=spf1 include:amazonses.com ~all"`);
|
|
console.log(`TXT _dmarc.${domain} -> "v=DMARC1; p=none;"\n`);
|
|
|
|
if (tokens.length === 0) {
|
|
console.log("Keine DKIM-Tokens gefunden. Ist die Identity im richtigen Account/Region angelegt?");
|
|
}
|