{"id":"6b09417c5ce40d447918f28f","slug":"aws-ses","title":"Amazon SES in practice – domain verification (DKIM, SPF, DMARC), leaving the sandbox, sending via API and SMTP, templates, bounces and deliverability (Node.js, C#, Python)","summary":"We send the pierogi shop's e-mails with Amazon SES – a domain identity with Easy DKIM, a custom MAIL FROM domain for SPF, rolling out DMARC, leaving the sandbox, sending via the v2 API with AWS SDK v3 (text, templates, attachments) and via SMTP/Nodemailer, a configuration set with suppression, handling bounces and complaints through SNS and SQS, and deliverability rules. Variants in C# and Python.","servedLang":"en","availableLangs":["pl","en"],"topics":["aws-ses","authentication"],"techs":["node","typescript","dotnet","python"],"tags":["aws","ses","email","dkim","spf","dmarc","deliverability","nodemailer","sns","aws-sdk-v3","boto3"],"level":"intermediate","kind":"tutorial","access":"members","status":"published","cover":null,"author":{"id":"6b08bd2e80884893657cc8cf","name":"Redakcja Art of Devs","avatar":null,"handle":"redakcja","community":false},"readingMinutes":25,"stats":{"views":2,"likes":0,"bookmarks":0,"comments":0},"publishedAt":"2026-11-27T08:38:20.304Z","updatedAt":"2026-11-27T13:02:17.068Z","requestedLang":"en","theme":{"hero":"classic","heroMedia":null,"accent":"amber","background":"dots","weaveResources":true,"toc":"right"},"seoDescription":"Amazon SES step by step – CreateEmailIdentity, Easy DKIM, MAIL FROM and SPF, DMARC, sandbox and PutAccountDetails, @aws-sdk/client-sesv2 SendEmail, templates, attachments, SMTP and Nodemailer, configuration sets, suppression list, bounces and complaints via SNS, Gmail and Yahoo requirements, costs.","wordCount":4945,"doc":{"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"The verification link from the "},{"type":"text","text":"authentication tutorial","marks":[{"type":"link","attrs":{"href":"/en/articles/authentication"}}]},{"type":"text","text":" has to reach the inbox, not the spam folder. So does the pierogi order confirmation. Amazon SES sends mail cheaply and reliably, but it will not do for you what decides deliverability: authenticating the domain, reacting to bounces and complaints, and treating recipients sensibly. In this tutorial you go the whole way – from DNS records to handling feedback – with code in Node.js, C# and Python."}]},{"type":"callout","attrs":{"variant":"info","title":"In a nutshell"},"content":[{"type":"bulletList","content":[{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"No SPF, DKIM and DMARC – no deliverability.","marks":[{"type":"bold"}]},{"type":"text","text":" Easy DKIM is three CNAME records, a custom MAIL FROM domain aligns SPF, and DMARC is rolled out gradually: "},{"type":"text","text":"p=none","marks":[{"type":"code"}]},{"type":"text","text":" → "},{"type":"text","text":"quarantine","marks":[{"type":"code"}]},{"type":"text","text":" → "},{"type":"text","text":"reject","marks":[{"type":"code"}]},{"type":"text","text":"."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"A new SES account starts in the sandbox","marks":[{"type":"bold"}]},{"type":"text","text":": 200 messages per day, 1 per second and only to verified addresses. Leaving it requires a request describing how you look after your recipient lists."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Bounces and complaints are data, not noise.","marks":[{"type":"bold"}]},{"type":"text","text":" A configuration set sends them through SNS to a queue, and the app stops sending to problematic addresses – otherwise SES will stop sending for you."}]}]}]}]},{"type":"callout","attrs":{"variant":"tip","title":"What you will build"},"content":[{"type":"paragraph","content":[{"type":"text","text":"A script that configures SES (a configuration set with suppression and enforced TLS, events to SNS, a domain identity with 2048-bit DKIM, MAIL FROM, an order confirmation template, a request to leave the sandbox), a "},{"type":"text","text":"SesMailer","marks":[{"type":"code"}]},{"type":"text","text":" adapter implementing the "},{"type":"text","text":"Mailer","marks":[{"type":"code"}]},{"type":"text","text":" port from the authentication tutorial (text, template, PDF attachment), sending via SMTP and Nodemailer, bounce and complaint handling in a Lambda fed by SQS, IAM policies and DNS records. Sending and feedback handling in C# and Python too. Download the code (21 files) as a ZIP."}]}]},{"type":"paragraph","content":[{"type":"text","text":"Prerequisites:","marks":[{"type":"bold"}]},{"type":"text","text":" an AWS account, a domain with DNS access (Route 53 or any provider), Node.js 22+, the basics of "},{"type":"text","text":"SQS","marks":[{"type":"link","attrs":{"href":"/en/articles/aws-sqs"}}]},{"type":"text","text":" (queues, DLQ, Lambda). For the variants: .NET 10 SDK or Python 3.10+."}]},{"type":"stats","attrs":{"items":[{"value":"200","label":"messages per day in the sandbox","hint":"1 per second, verified recipients only"},{"value":"3","label":"CNAME records","hint":"Easy DKIM"},{"value":"0.1%","label":"complaints – account review threshold","hint":"at 0.5% SES may pause sending"},{"value":"5%","label":"bounces – account review threshold","hint":"at 10% SES may pause sending"}]}},{"type":"diagram","attrs":{"kind":"mermaid","code":"flowchart LR\n  APP[Pierogi API<br/>SesMailer] -->|SendEmail + configuration set| SES[Amazon SES]\n  SES -->|DKIM + MAIL FROM| MX[(Customer mailbox<br/>Gmail, Outlook, WP)]\n  MX -. bounce / complaint .-> SES\n  SES -->|BOUNCE, COMPLAINT, DELIVERY events| SNS{{SNS: ses-events}}\n  SNS --> Q[[SQS: ses-feedback + DLQ]]\n  Q --> L[Feedback Lambda]\n  L --> DB[(Database: suppressed addresses)]\n  APP -. checks before sending .-> DB","caption":"Sending and the feedback loop: from the API to the inbox and back"}},{"type":"heading","attrs":{"level":2,"id":"spf-dkim-and-dmarc-in-five-minutes"},"content":[{"type":"text","text":"SPF, DKIM and DMARC in five minutes"}]},{"type":"table","content":[{"type":"tableRow","content":[{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Mechanism"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"What it checks"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"How it looks in SES"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"SPF","marks":[{"type":"bold"}]}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"whether the sending server may send mail for the envelope domain ("},{"type":"text","text":"MAIL FROM","marks":[{"type":"code"}]},{"type":"text","text":", the return path)"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"a custom MAIL FROM domain ("},{"type":"text","text":"mail.pierogarnia.example","marks":[{"type":"code"}]},{"type":"text","text":") with "},{"type":"text","text":"v=spf1 include:amazonses.com ~all","marks":[{"type":"code"}]}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"DKIM","marks":[{"type":"bold"}]}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"a cryptographic signature of the message with the key of the "},{"type":"text","text":"From","marks":[{"type":"code"}]},{"type":"text","text":" header's domain"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Easy DKIM: SES manages the keys, you add 3 CNAME records"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"DMARC","marks":[{"type":"bold"}]}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"whether SPF or DKIM passed "},{"type":"text","text":"for the same domain as in ","marks":[{"type":"bold"}]},{"type":"text","text":"From","marks":[{"type":"code"}]},{"type":"text","text":" (alignment) and what to do if not"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"a "},{"type":"text","text":"_dmarc","marks":[{"type":"code"}]},{"type":"text","text":" record with a "},{"type":"text","text":"p=none/quarantine/reject","marks":[{"type":"code"}]},{"type":"text","text":" policy and a report address"}]}]}]}]},{"type":"paragraph","content":[{"type":"text","text":"By default SES sends with an "},{"type":"text","text":"amazonses.com","marks":[{"type":"code"}]},{"type":"text","text":" envelope – SPF passes, but for Amazon's domain, so it is not aligned with your "},{"type":"text","text":"From","marks":[{"type":"code"}]},{"type":"text","text":". DMARC then passes only thanks to DKIM. A custom MAIL FROM domain aligns both mechanisms – especially important with strict DMARC ("},{"type":"text","text":"aspf=s","marks":[{"type":"code"}]},{"type":"text","text":")."}]},{"type":"paragraph","content":[{"type":"text","text":"Since February 2024 Gmail and Yahoo require bulk senders (for Gmail: more than 5,000 messages a day) to have SPF, DKIM and DMARC, domain alignment, one-click unsubscribe (RFC 8058) in marketing messages and a spam rate below 0.3%. Microsoft introduced similar rules for Outlook.com in 2025. Even if you send less – meet them, because they decide whether you land in the inbox."}]},{"type":"heading","attrs":{"level":2,"id":"step-1-the-project"},"content":[{"type":"text","text":"Step 1. The project"}]},{"type":"codeBlock","attrs":{"language":"bash"},"content":[{"type":"text","text":"npm install @aws-sdk/client-sesv2 nodemailer zod\nnpm install -D typescript tsx vitest @types/node @types/nodemailer @types/aws-lambda"}]},{"type":"codeGroup","attrs":{"title":"Project configuration"},"content":[{"type":"codeBlock","attrs":{"language":"json","filename":"package.json"},"content":[{"type":"text","text":"{\n  \"name\": \"pierogi-ses\",\n  \"version\": \"1.0.0\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"engines\": { \"node\": \">=22.12\" },\n  \"scripts\": {\n    \"ses:setup\": \"tsx --env-file-if-exists=.env src/setup.ts\",\n    \"send:demo\": \"tsx --env-file-if-exists=.env src/send-demo.ts\",\n    \"build\": \"tsc -p tsconfig.build.json\",\n    \"typecheck\": \"tsc --noEmit\",\n    \"test\": \"vitest run\"\n  },\n  \"dependencies\": {\n    \"@aws-sdk/client-sesv2\": \"^3.1178.0\",\n    \"nodemailer\": \"^10.6.1\",\n    \"zod\": \"^4.6.7\"\n  },\n  \"devDependencies\": {\n    \"@types/aws-lambda\": \"^8.10.164\",\n    \"@types/node\": \"^24.19.4\",\n    \"@types/nodemailer\": \"^8.0.2\",\n    \"tsx\": \"^4.23.15\",\n    \"typescript\": \"^7.0.2\",\n    \"vitest\": \"^5.1.2\"\n  }\n}"}]},{"type":"codeBlock","attrs":{"language":"json","filename":"tsconfig.json"},"content":[{"type":"text","text":"{\n  \"compilerOptions\": {\n    \"target\": \"ES2024\",\n    \"module\": \"nodenext\",\n    \"strict\": true,\n    \"noUncheckedIndexedAccess\": true,\n    \"verbatimModuleSyntax\": true,\n    \"skipLibCheck\": true,\n    \"sourceMap\": true,\n    \"noEmit\": true,\n    \"types\": [\"node\"]\n  },\n  \"include\": [\"src\", \"test\"]\n}"}]},{"type":"codeBlock","attrs":{"language":"json","filename":"tsconfig.build.json"},"content":[{"type":"text","text":"{\n  \"extends\": \"./tsconfig.json\",\n  \"compilerOptions\": { \"noEmit\": false, \"rootDir\": \"src\", \"outDir\": \"dist\" },\n  \"include\": [\"src\"]\n}"}]},{"type":"codeBlock","attrs":{"language":"plaintext","filename":".env.example"},"content":[{"type":"text","text":"AWS_REGION=eu-central-1\nMAIL_DOMAIN=pierogarnia.example\nMAIL_FROM=\"Pierogarnia Haliny <zamowienia@pierogarnia.example>\"\nMAIL_REPLY_TO=kontakt@pierogarnia.example\nSES_CONFIGURATION_SET=pierogi-transactional\nSES_EVENTS_TOPIC_ARN=arn:aws:sns:eu-central-1:123456789012:ses-events\n# Only for the SMTP variant – generated in the SES console (not your IAM secret key!)\nSMTP_USER=\nSMTP_PASSWORD="}]},{"type":"codeBlock","attrs":{"language":"typescript","filename":"src/config.ts"},"content":[{"type":"text","text":"import { z } from 'zod';\n\nconst EnvSchema = z.object({\n  AWS_REGION: z.string().default('eu-central-1'),\n  MAIL_DOMAIN: z.string().min(3),\n  MAIL_FROM: z.string().min(3), // \"Display Name <address@verified-domain>\"\n  MAIL_REPLY_TO: z.email().optional(),\n  SES_CONFIGURATION_SET: z.string().default('pierogi-transactional'),\n  SES_EVENTS_TOPIC_ARN: z.string().startsWith('arn:aws:sns:').optional(),\n  SMTP_USER: z.string().optional(),\n  SMTP_PASSWORD: z.string().optional(),\n});\n\nexport type Config = z.infer<typeof EnvSchema>;\nexport const loadConfig = (env: NodeJS.ProcessEnv = process.env): Config => EnvSchema.parse(env);"}]}]},{"type":"paragraph","content":[{"type":"text","text":"We use the "},{"type":"text","text":"SESv2","marks":[{"type":"bold"}]},{"type":"text","text":" API ("},{"type":"text","text":"@aws-sdk/client-sesv2","marks":[{"type":"code"}]},{"type":"text","text":") – newer and more complete than the classic "},{"type":"text","text":"@aws-sdk/client-ses","marks":[{"type":"code"}]},{"type":"text","text":". New features (contact lists, suppression list management, VDM) appear in v2."}]},{"type":"heading","attrs":{"level":2,"id":"step-2-domain-identity-configuration-set-and-templates"},"content":[{"type":"text","text":"Step 2. Domain identity, configuration set and templates"}]},{"type":"codeGroup","attrs":{"title":"Setup script and templates"},"content":[{"type":"codeBlock","attrs":{"language":"typescript","filename":"src/setup.ts"},"content":[{"type":"text","text":"import {\n  AlreadyExistsException,\n  CreateConfigurationSetCommand,\n  CreateConfigurationSetEventDestinationCommand,\n  CreateEmailIdentityCommand,\n  CreateEmailTemplateCommand,\n  PutAccountDetailsCommand,\n  PutEmailIdentityMailFromAttributesCommand,\n  SESv2Client,\n} from '@aws-sdk/client-sesv2';\nimport { loadConfig } from './config.js';\nimport { TEMPLATES } from './templates.js';\n\nconst config = loadConfig();\nconst ses = new SESv2Client({ region: config.AWS_REGION });\nconst domain = config.MAIL_DOMAIN;\nconst mailFrom = `mail.${domain}`;\n\n// Re-runnable: \"already exists\" is fine.\nasync function ignoreExisting(step: string, action: () => Promise<unknown>) {\n  try {\n    await action();\n    console.info(`✓ ${step}`);\n  } catch (err) {\n    if (err instanceof AlreadyExistsException) console.info(`= ${step} (already exists)`);\n    else throw err;\n  }\n}\n\n// 1. Configuration set: reputation metrics, suppression, TLS required, events to SNS.\nawait ignoreExisting('configuration set', () =>\n  ses.send(\n    new CreateConfigurationSetCommand({\n      ConfigurationSetName: config.SES_CONFIGURATION_SET,\n      ReputationOptions: { ReputationMetricsEnabled: true },\n      SuppressionOptions: { SuppressedReasons: ['BOUNCE', 'COMPLAINT'] },\n      DeliveryOptions: { TlsPolicy: 'REQUIRE' },\n    }),\n  ),\n);\nif (config.SES_EVENTS_TOPIC_ARN) {\n  await ignoreExisting('event destination -> SNS', () =>\n    ses.send(\n      new CreateConfigurationSetEventDestinationCommand({\n        ConfigurationSetName: config.SES_CONFIGURATION_SET,\n        EventDestinationName: 'feedback-to-sns',\n        EventDestination: {\n          Enabled: true,\n          MatchingEventTypes: ['BOUNCE', 'COMPLAINT', 'REJECT', 'DELIVERY', 'DELIVERY_DELAY', 'RENDERING_FAILURE'],\n          SnsDestination: { TopicArn: config.SES_EVENTS_TOPIC_ARN },\n        },\n      }),\n    ),\n  );\n}\n\n// 2. Domain identity with Easy DKIM: SES generates and manages the 2048-bit keys.\nlet dkimTokens: string[] = [];\nawait ignoreExisting('domain identity', async () => {\n  const res = await ses.send(\n    new CreateEmailIdentityCommand({\n      EmailIdentity: domain,\n      DkimSigningAttributes: { NextSigningKeyLength: 'RSA_2048_BIT' },\n      ConfigurationSetName: config.SES_CONFIGURATION_SET, // default set for this identity\n    }),\n  );\n  dkimTokens = res.DkimAttributes?.Tokens ?? [];\n});\n\n// 3. Custom MAIL FROM domain: SPF aligned with our domain (needed for strict DMARC).\nawait ses.send(\n  new PutEmailIdentityMailFromAttributesCommand({\n    EmailIdentity: domain,\n    MailFromDomain: mailFrom,\n    BehaviorOnMxFailure: 'USE_DEFAULT_VALUE',\n  }),\n);\n\n// 4. Templates.\nfor (const [name, content] of Object.entries(TEMPLATES)) {\n  await ignoreExisting(`template ${name}`, () =>\n    ses.send(new CreateEmailTemplateCommand({ TemplateName: name, TemplateContent: content })),\n  );\n}\n\nconsole.info('\\nAdd these DNS records:');\nfor (const token of dkimTokens) console.info(`${token}._domainkey.${domain}  CNAME  ${token}.dkim.amazonses.com`);\nconsole.info(`${mailFrom}  MX  10 feedback-smtp.${config.AWS_REGION}.amazonses.com`);\nconsole.info(`${mailFrom}  TXT  \"v=spf1 include:amazonses.com ~all\"`);\nconsole.info(`_dmarc.${domain}  TXT  \"v=DMARC1; p=none; rua=mailto:dmarc@${domain}\"`);\n\n// 5. Leaving the sandbox (run once, after DNS is verified). AWS reviews the request.\nexport async function requestProductionAccess(): Promise<void> {\n  await ses.send(\n    new PutAccountDetailsCommand({\n      MailType: 'TRANSACTIONAL',\n      WebsiteURL: `https://${domain}`,\n      ContactLanguage: 'EN',\n      UseCaseDescription:\n        'Order confirmations, invoices, e-mail verification and password reset for customers of an online pierogi shop. ' +\n        'Recipients sign up themselves; bounces and complaints are processed automatically via SNS and suppressed.',\n      ProductionAccessEnabled: true,\n    }),\n  );\n}"}]},{"type":"codeBlock","attrs":{"language":"typescript","filename":"src/templates.ts"},"content":[{"type":"text","text":"import type { EmailTemplateContent } from '@aws-sdk/client-sesv2';\n\n// SES templates use Handlebars-style placeholders, including {{#each}} and {{#if}}.\nexport const TEMPLATES: Record<string, EmailTemplateContent> = {\n  'order-confirmation': {\n    Subject: 'Order {{orderId}} is in the kitchen',\n    Text: [\n      'Hi {{customerName}},',\n      '',\n      'we have your order {{orderId}}:',\n      '{{#each items}}- {{quantity}} x {{dish}}',\n      '{{/each}}',\n      'Total: {{total}} PLN. We will text you when it is ready.',\n      '',\n      \"Halina's pierogi shop\",\n    ].join('\\n'),\n    Html: [\n      '<p>Hi {{customerName}},</p>',\n      '<p>we have your order <strong>{{orderId}}</strong>:</p>',\n      '<ul>{{#each items}}<li>{{quantity}} &times; {{dish}}</li>{{/each}}</ul>',\n      '<p>Total: <strong>{{total}} PLN</strong>. We will text you when it is ready.</p>',\n      \"<p>Halina's pierogi shop</p>\",\n    ].join(''),\n  },\n};"}]}]},{"type":"paragraph","content":[{"type":"text","text":"The order in the script makes sense:"}]},{"type":"orderedList","attrs":{"start":1},"content":[{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"The configuration set","marks":[{"type":"bold"}]},{"type":"text","text":" groups sending settings: reputation metrics, suppressing addresses after bounces and complaints, enforced TLS ("},{"type":"text","text":"TlsPolicy: 'REQUIRE'","marks":[{"type":"code"}]},{"type":"text","text":" – SES will not deliver to a server without TLS) and the "},{"type":"text","text":"event destination","marks":[{"type":"bold"}]},{"type":"text","text":" – an SNS topic for bounces, complaints, rejects, deliveries, delays and rendering failures."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"The domain identity","marks":[{"type":"bold"}]},{"type":"text","text":" with Easy DKIM and a 2048-bit key. With a verified domain you can send from any address in it ("},{"type":"text","text":"orders@","marks":[{"type":"code"}]},{"type":"text","text":", "},{"type":"text","text":"account@","marks":[{"type":"code"}]},{"type":"text","text":"). A default configuration set attached to the identity applies even when someone forgets to pass it to "},{"type":"text","text":"SendEmail","marks":[{"type":"code"}]},{"type":"text","text":"."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"The MAIL FROM domain","marks":[{"type":"bold"}]},{"type":"text","text":" – a subdomain that receives bounces and authenticates the envelope with SPF."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Templates","marks":[{"type":"bold"}]},{"type":"text","text":" – the e-mail copy lives in SES, and the app only sends JSON data. The Handlebars syntax supports "},{"type":"text","text":"{{variables}}","marks":[{"type":"code"}]},{"type":"text","text":", "},{"type":"text","text":"{{#each}}","marks":[{"type":"code"}]},{"type":"text","text":" and "},{"type":"text","text":"{{#if}}","marks":[{"type":"code"}]},{"type":"text","text":"."}]}]}]},{"type":"paragraph","content":[{"type":"text","text":"The script is idempotent: an "},{"type":"text","text":"AlreadyExistsException","marks":[{"type":"code"}]},{"type":"text","text":" on a re-run means \"already there\". In a real project you describe the same resources in Terraform or CDK."}]},{"type":"heading","attrs":{"level":2,"id":"step-3-dns-records-and-permissions"},"content":[{"type":"text","text":"Step 3. DNS records and permissions"}]},{"type":"codeGroup","attrs":{"title":"DNS records and the sender IAM policy"},"content":[{"type":"codeBlock","attrs":{"language":"plaintext","filename":"infra/dns-records.txt"},"content":[{"type":"text","text":"; DNS records for pierogarnia.example (values printed by `npm run ses:setup`)\n\n; Easy DKIM: three CNAMEs pointing at keys managed by SES, which signs every message\ntok1abc._domainkey.pierogarnia.example.   CNAME  tok1abc.dkim.amazonses.com.\ntok2def._domainkey.pierogarnia.example.   CNAME  tok2def.dkim.amazonses.com.\ntok3ghi._domainkey.pierogarnia.example.   CNAME  tok3ghi.dkim.amazonses.com.\n\n; Custom MAIL FROM: bounces go to SES, SPF passes for OUR domain (alignment for DMARC)\nmail.pierogarnia.example.   MX   10 feedback-smtp.eu-central-1.amazonses.com.\nmail.pierogarnia.example.   TXT  \"v=spf1 include:amazonses.com ~all\"\n\n; DMARC: start with p=none and reports, move to quarantine/reject once reports are clean\n_dmarc.pierogarnia.example. TXT  \"v=DMARC1; p=none; rua=mailto:dmarc-reports@pierogarnia.example; adkim=s; aspf=s\"\n\n; If the root domain also sends from Google Workspace / Microsoft 365, keep ONE SPF record there:\n; pierogarnia.example.  TXT  \"v=spf1 include:_spf.google.com ~all\""}]},{"type":"codeBlock","attrs":{"language":"json","filename":"infra/iam-sender-policy.json"},"content":[{"type":"text","text":"{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Sid\": \"SendTransactionalMailOnly\",\n      \"Effect\": \"Allow\",\n      \"Action\": \"ses:SendEmail\",\n      \"Resource\": [\n        \"arn:aws:ses:eu-central-1:123456789012:identity/pierogarnia.example\",\n        \"arn:aws:ses:eu-central-1:123456789012:configuration-set/pierogi-transactional\",\n        \"arn:aws:ses:eu-central-1:123456789012:template/order-confirmation\"\n      ],\n      \"Condition\": {\n        \"StringLike\": { \"ses:FromAddress\": \"*@pierogarnia.example\" }\n      }\n    }\n  ]\n}"}]}]}]},"toc":[{"id":"spf-dkim-and-dmarc-in-five-minutes","text":"SPF, DKIM and DMARC in five minutes","level":2,"locked":false},{"id":"step-1-the-project","text":"Step 1. The project","level":2,"locked":false},{"id":"step-2-domain-identity-configuration-set-and-templates","text":"Step 2. Domain identity, configuration set and templates","level":2,"locked":false},{"id":"step-3-dns-records-and-permissions","text":"Step 3. DNS records and permissions","level":2,"locked":false},{"id":"step-4-leaving-the-sandbox","text":"Step 4. Leaving the sandbox","level":2,"locked":true},{"id":"step-5-sending-via-the-v2-api","text":"Step 5. Sending via the v2 API","level":2,"locked":true},{"id":"step-6-smtp-and-nodemailer","text":"Step 6. SMTP and Nodemailer","level":2,"locked":true},{"id":"step-7-bounces-and-complaints","text":"Step 7. Bounces and complaints","level":2,"locked":true},{"id":"step-8-tests-and-the-mailbox-simulator","text":"Step 8. Tests and the mailbox simulator","level":2,"locked":true},{"id":"c-and-python-variants","text":"C# and Python variants","level":2,"locked":true},{"id":"deliverability-a-checklist","text":"Deliverability – a checklist","level":2,"locked":true},{"id":"costs","text":"Costs","level":2,"locked":true},{"id":"common-mistakes","text":"Common mistakes","level":2,"locked":true},{"id":"check-yourself","text":"Check yourself","level":2,"locked":true},{"id":"what-s-next","text":"What's next","level":2,"locked":true}],"locked":true,"paywall":null,"previewRatio":0.3,"totalBlocks":65,"visibleBlocks":21,"resources":[{"id":"6b0857c73c96f2d34d0b4952","type":"video","provider":"youtube","url":"https://www.youtube.com/watch?v=KtCjH-1iCIk","embedUrl":"https://www.youtube-nocookie.com/embed/KtCjH-1iCIk","title":"Easy Email Verification in .NET: FluentEmail + Papercut","description":"Want to master Clean Architecture? Go here: https://bit.ly/3PupkOJ Want to unlock Modular Monoliths? Go here: https://bit.ly/3SXlzSt Join a community of 1000+ .NET developers: https://www.patreon.com/milanjovanovic Learn how to implement robust email verification in your .NET applications using…","author":"Milan Jovanović","thumbnailUrl":"https://i.ytimg.com/vi/KtCjH-1iCIk/hqdefault.jpg","durationSec":null,"lang":"en","topics":["modular-monolith","clean-architecture"],"techs":["dotnet"],"tags":["testing","software-architecture"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"youtube-rss","publishedAt":"2024-08-27T11:00:28.000Z","popularity":64,"verifiedAt":"2026-11-26T10:54:07.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:10.095Z","updatedAt":"2026-11-26T16:01:10.095Z"},{"id":"6b0857bf3c96f2d34d0b42ee","type":"article","provider":"web","url":"https://learn.microsoft.com/en-us/azure/architecture/patterns/queue-based-load-leveling","embedUrl":null,"title":"Queue-Based Load Leveling Pattern","description":"Learn how to smooth intermittent heavy loads by using a queue that acts as a buffer between a task and the service that it invokes.","author":"Microsoft Azure Architecture Center","thumbnailUrl":"https://learn.microsoft.com/en-us/media/open-graph-image.png","durationSec":null,"lang":"en","topics":[],"techs":["general"],"tags":["azure","cloud"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":null,"popularity":58,"verifiedAt":"2026-11-26T11:07:58.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:02.417Z","updatedAt":"2026-11-26T16:01:02.417Z"},{"id":"6b0857bf3c96f2d34d0b4291","type":"article","provider":"web","url":"https://aws.amazon.com/builders-library/timeouts-retries-and-backoff-with-jitter","embedUrl":null,"title":"Timeouts, retries, and backoff with jitter | AWS Builder Center","description":"How Amazon uses timeouts, retries, and exponential backoff with jitter to handle transient failures without overwhelming struggling services.","author":"Amazon Builders' Library","thumbnailUrl":"https://builder.aws.com/assets/og-hiXAX-on.png","durationSec":null,"lang":"en","topics":[],"techs":["general"],"tags":["aws","distributed-systems","cloud"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":"2019-12-05T12:00:00.000Z","popularity":65,"verifiedAt":"2026-11-26T11:25:38.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:02.417Z","updatedAt":"2026-11-26T16:01:02.417Z"},{"id":"6b0857b63c96f2d34d0b3ac2","type":"podcast","provider":"apple-podcasts","url":"https://podcasts.apple.com/us/podcast/designing-for-agents-zeno-rocha-resend/id1674008350?i=1000801068808","embedUrl":"https://embed.podcasts.apple.com/us/podcast/id1674008350?i=1000801068808","title":"Designing for Agents — Zeno Rocha, Resend","description":"swyx had already connected Cloudflare email. Then a coding agent opened a pull request that quietly chose Resend for him. Zeno Rocha, Resend’s founder and CEO, explains what answer engine optimization (AEO) looks like from the receiving end of that rec...","author":"Latent Space: The AI Engineer Podcast","thumbnailUrl":"https://is1-ssl.mzstatic.com/image/thumb/Podcasts221/v4/4f/48/cf/4f48cffb-0325-8c4c-6f6a-ad24c8ada76b/mza_15263536490658829810.jpg/600x600bb.jpg","durationSec":5152,"lang":"en","topics":[],"techs":["general"],"tags":["podcast"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"itunes","publishedAt":"2026-11-10T20:06:15.000Z","popularity":80,"verifiedAt":"2026-11-26T11:03:41.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:53.924Z","updatedAt":"2026-11-26T16:00:53.924Z"}],"challenges":[],"attachments":[],"hasCode":true,"repoUrl":null,"series":[],"prev":null,"next":null,"featured":false,"authorCard":{"id":"6b08bd2e80884893657cc8cf","name":"Redakcja Art of Devs","avatar":null,"handle":"redakcja","headline":"Wzorce projektowe · Architektura · AI i LLM","community":false,"reputation":{"points":3900,"level":{"key":"mentor","label":"Mentor"}},"articles":68,"skills":[{"key":"typescript","title":"TypeScript","level":5,"levelLabel":"Authority","articles":63},{"key":"dotnet","title":".NET","level":5,"levelLabel":"Authority","articles":53},{"key":"python","title":"Python","level":5,"levelLabel":"Authority","articles":52},{"key":"java","title":"Java","level":5,"levelLabel":"Authority","articles":38}]}}