{"id":"6b09417c5ce40d447918f28f","slug":"aws-ses","title":"Amazon SES w praktyce – weryfikacja domeny (DKIM, SPF, DMARC), wyjście z sandboxa, wysyłka API i SMTP, szablony, odbicia i dostarczalność (Node.js, C#, Python)","summary":"Wysyłamy e-maile pierogarni przez Amazon SES – tożsamość domeny z Easy DKIM, własna domena MAIL FROM dla SPF, wdrażanie DMARC, wyjście z sandboxa, wysyłka przez API v2 z AWS SDK v3 (tekst, szablony, załączniki) i przez SMTP/Nodemailer, configuration set z listą tłumienia, obsługa odbić i skarg przez SNS i SQS oraz zasady dostarczalności. Warianty w C# i Pythonie.","servedLang":"pl","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":24,"stats":{"views":1,"likes":0,"bookmarks":0,"comments":0},"publishedAt":"2026-11-27T08:38:20.304Z","updatedAt":"2026-11-27T10:03:41.730Z","requestedLang":"pl","theme":{"hero":"classic","heroMedia":null,"accent":"amber","background":"dots","weaveResources":true,"toc":"right"},"seoDescription":"Amazon SES krok po kroku – CreateEmailIdentity, Easy DKIM, MAIL FROM i SPF, DMARC, sandbox i PutAccountDetails, @aws-sdk/client-sesv2 SendEmail, szablony, załączniki, SMTP i Nodemailer, configuration set, suppression list, bounce i complaint przez SNS, wymagania Gmaila i Yahoo, koszty.","wordCount":4697,"doc":{"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"Link do weryfikacji konta z "},{"type":"text","text":"poradnika o uwierzytelnianiu","marks":[{"type":"link","attrs":{"href":"/pl/articles/authentication"}}]},{"type":"text","text":" musi dotrzeć do skrzynki, a nie do spamu. Potwierdzenie zamówienia pierogów – tak samo. Amazon SES wysyła pocztę tanio i niezawodnie, ale nie zrobi za ciebie tego, co decyduje o dostarczalności: uwierzytelnienia domeny, reagowania na odbicia i skargi oraz rozsądnego traktowania odbiorców. W tym poradniku przejdziesz całą drogę – od rekordów DNS po obsługę zwrotek – z kodem w Node.js, C# i Pythonie."}]},{"type":"callout","attrs":{"variant":"info","title":"W skrócie"},"content":[{"type":"bulletList","content":[{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Bez SPF, DKIM i DMARC nie ma dostarczalności.","marks":[{"type":"bold"}]},{"type":"text","text":" Easy DKIM to trzy rekordy CNAME, własna domena MAIL FROM wyrównuje SPF, a DMARC wdrażasz stopniowo: "},{"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":"Nowe konto SES jest w sandboxie","marks":[{"type":"bold"}]},{"type":"text","text":": 200 wiadomości na dobę, 1 na sekundę i tylko do zweryfikowanych adresów. Wyjście wymaga wniosku z opisem, jak dbasz o listy odbiorców."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Odbicia i skargi to dane, nie szum.","marks":[{"type":"bold"}]},{"type":"text","text":" Configuration set wysyła je przez SNS do kolejki, a aplikacja wstrzymuje wysyłkę na problematyczne adresy – inaczej SES wstrzyma wysyłkę tobie."}]}]}]}]},{"type":"callout","attrs":{"variant":"tip","title":"Co zbudujesz"},"content":[{"type":"paragraph","content":[{"type":"text","text":"Skrypt konfigurujący SES (configuration set z listą tłumienia i wymuszonym TLS, zdarzenia do SNS, tożsamość domeny z DKIM 2048-bit, MAIL FROM, szablon potwierdzenia zamówienia, wniosek o wyjście z sandboxa), adapter "},{"type":"text","text":"SesMailer","marks":[{"type":"code"}]},{"type":"text","text":" implementujący port "},{"type":"text","text":"Mailer","marks":[{"type":"code"}]},{"type":"text","text":" z poradnika o logowaniu (tekst, szablon, załącznik PDF), wysyłkę przez SMTP i Nodemailer, obsługę odbić i skarg w Lambdzie z SQS, polityki IAM i rekordy DNS. Wysyłka i obsługa zwrotek także w C# i Pythonie. Kod (21 plików) pobierzesz jako ZIP."}]}]},{"type":"paragraph","content":[{"type":"text","text":"Wymagania wstępne:","marks":[{"type":"bold"}]},{"type":"text","text":" konto AWS, domena z dostępem do DNS (Route 53 albo dowolny operator), Node.js 22+, podstawy "},{"type":"text","text":"SQS","marks":[{"type":"link","attrs":{"href":"/pl/articles/aws-sqs"}}]},{"type":"text","text":" (kolejki, DLQ, Lambda). Dla wariantów: .NET 10 SDK lub Python 3.10+."}]},{"type":"stats","attrs":{"items":[{"value":"200","label":"wiadomości na dobę w sandboxie","hint":"1 na sekundę, tylko zweryfikowani odbiorcy"},{"value":"3","label":"rekordy CNAME","hint":"Easy DKIM"},{"value":"0,1%","label":"skarg – próg przeglądu konta","hint":"przy 0,5% SES może wstrzymać wysyłkę"},{"value":"5%","label":"odbić – próg przeglądu konta","hint":"przy 10% SES może wstrzymać wysyłkę"}]}},{"type":"diagram","attrs":{"kind":"mermaid","code":"flowchart LR\n  APP[API pierogarni<br/>SesMailer] -->|SendEmail + configuration set| SES[Amazon SES]\n  SES -->|DKIM + MAIL FROM| MX[(Skrzynka klienta<br/>Gmail, Outlook, WP)]\n  MX -. odbicie / skarga .-> SES\n  SES -->|zdarzenia BOUNCE, COMPLAINT, DELIVERY| SNS{{SNS: ses-events}}\n  SNS --> Q[[SQS: ses-feedback + DLQ]]\n  Q --> L[Lambda feedback]\n  L --> DB[(Baza: adresy wstrzymane)]\n  APP -. sprawdza przed wysyłką .-> DB","caption":"Wysyłka i pętla zwrotna: od API do skrzynki i z powrotem"}},{"type":"heading","attrs":{"level":2,"id":"spf-dkim-i-dmarc-w-piec-minut"},"content":[{"type":"text","text":"SPF, DKIM i DMARC w pięć minut"}]},{"type":"table","content":[{"type":"tableRow","content":[{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Mechanizm"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Co sprawdza"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Jak to wygląda w 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":"czy serwer wysyłający może wysyłać pocztę dla domeny z koperty ("},{"type":"text","text":"MAIL FROM","marks":[{"type":"code"}]},{"type":"text","text":", adres zwrotny)"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"własna domena MAIL FROM ("},{"type":"text","text":"mail.pierogarnia.example","marks":[{"type":"code"}]},{"type":"text","text":") z rekordem "},{"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":"podpis kryptograficzny wiadomości kluczem domeny z nagłówka "},{"type":"text","text":"From","marks":[{"type":"code"}]}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Easy DKIM: SES zarządza kluczami, ty dodajesz 3 rekordy CNAME"}]}]}]},{"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":"czy SPF lub DKIM przeszły "},{"type":"text","text":"dla tej samej domeny co w ","marks":[{"type":"bold"}]},{"type":"text","text":"From","marks":[{"type":"code"}]},{"type":"text","text":" (wyrównanie, "},{"type":"text","text":"alignment","marks":[{"type":"italic"}]},{"type":"text","text":") i co zrobić, jeśli nie"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"rekord "},{"type":"text","text":"_dmarc","marks":[{"type":"code"}]},{"type":"text","text":" z polityką "},{"type":"text","text":"p=none/quarantine/reject","marks":[{"type":"code"}]},{"type":"text","text":" i adresem raportów"}]}]}]}]},{"type":"paragraph","content":[{"type":"text","text":"Domyślnie SES wysyła z koperty "},{"type":"text","text":"amazonses.com","marks":[{"type":"code"}]},{"type":"text","text":" – SPF przechodzi, ale dla domeny Amazona, więc nie jest wyrównany z twoim "},{"type":"text","text":"From","marks":[{"type":"code"}]},{"type":"text","text":". DMARC przejdzie wtedy tylko dzięki DKIM. Własna domena MAIL FROM daje wyrównanie obu mechanizmów – to szczególnie ważne przy ścisłym DMARC ("},{"type":"text","text":"aspf=s","marks":[{"type":"code"}]},{"type":"text","text":")."}]},{"type":"paragraph","content":[{"type":"text","text":"Od lutego 2024 Gmail i Yahoo wymagają od nadawców masowych (u Gmaila: powyżej 5000 wiadomości dziennie) SPF, DKIM i DMARC, wyrównania domen, jednego kliknięcia do wypisania się (RFC 8058) w wiadomościach marketingowych i wskaźnika spamu poniżej 0,3%. Microsoft wprowadził podobne zasady dla Outlook.com w 2025 roku. Nawet jeśli wysyłasz mniej – spełniaj je, bo to one decydują o skrzynce odbiorczej."}]},{"type":"heading","attrs":{"level":2,"id":"krok-1-projekt"},"content":[{"type":"text","text":"Krok 1. Projekt"}]},{"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":"Konfiguracja projektu"},"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":"Używamy API "},{"type":"text","text":"SESv2","marks":[{"type":"bold"}]},{"type":"text","text":" ("},{"type":"text","text":"@aws-sdk/client-sesv2","marks":[{"type":"code"}]},{"type":"text","text":") – nowszego i pełniejszego niż klasyczne "},{"type":"text","text":"@aws-sdk/client-ses","marks":[{"type":"code"}]},{"type":"text","text":". Nowe funkcje (listy kontaktów, zarządzanie listą tłumienia, VDM) pojawiają się w v2."}]},{"type":"heading","attrs":{"level":2,"id":"krok-2-tozsamosc-domeny-configuration-set-i-szablony"},"content":[{"type":"text","text":"Krok 2. Tożsamość domeny, configuration set i szablony"}]},{"type":"codeGroup","attrs":{"title":"Skrypt konfiguracyjny i szablony"},"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":"Kolejność w skrypcie ma sens:"}]},{"type":"orderedList","attrs":{"start":1},"content":[{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Configuration set","marks":[{"type":"bold"}]},{"type":"text","text":" zbiera ustawienia wysyłki: metryki reputacji, tłumienie adresów po odbiciu i skardze, wymuszony TLS ("},{"type":"text","text":"TlsPolicy: 'REQUIRE'","marks":[{"type":"code"}]},{"type":"text","text":" – SES nie dostarczy wiadomości do serwera bez TLS) i "},{"type":"text","text":"cel zdarzeń","marks":[{"type":"bold"}]},{"type":"text","text":" – temat SNS dla odbić, skarg, odrzuceń, dostarczeń i opóźnień."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Tożsamość domeny","marks":[{"type":"bold"}]},{"type":"text","text":" z Easy DKIM i kluczem 2048-bit. Weryfikując domenę, możesz wysyłać z dowolnego adresu w niej ("},{"type":"text","text":"zamowienia@","marks":[{"type":"code"}]},{"type":"text","text":", "},{"type":"text","text":"konto@","marks":[{"type":"code"}]},{"type":"text","text":"). Domyślny configuration set przypięty do tożsamości działa nawet wtedy, gdy ktoś zapomni podać go w "},{"type":"text","text":"SendEmail","marks":[{"type":"code"}]},{"type":"text","text":"."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Domena MAIL FROM","marks":[{"type":"bold"}]},{"type":"text","text":" – subdomena przyjmująca odbicia i uwierzytelniająca kopertę przez SPF."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Szablony","marks":[{"type":"bold"}]},{"type":"text","text":" – treść maili żyje w SES, a aplikacja przesyła tylko dane w JSON. Składnia Handlebars obsługuje "},{"type":"text","text":"{{zmienne}}","marks":[{"type":"code"}]},{"type":"text","text":", "},{"type":"text","text":"{{#each}}","marks":[{"type":"code"}]},{"type":"text","text":" i "},{"type":"text","text":"{{#if}}","marks":[{"type":"code"}]},{"type":"text","text":"."}]}]}]},{"type":"paragraph","content":[{"type":"text","text":"Skrypt jest idempotentny: "},{"type":"text","text":"AlreadyExistsException","marks":[{"type":"code"}]},{"type":"text","text":" przy ponownym uruchomieniu oznacza „już jest”. W prawdziwym projekcie te same zasoby opiszesz w Terraform lub CDK."}]},{"type":"heading","attrs":{"level":2,"id":"krok-3-rekordy-dns-i-uprawnienia"},"content":[{"type":"text","text":"Krok 3. Rekordy DNS i uprawnienia"}]},{"type":"codeGroup","attrs":{"title":"Rekordy DNS i polityka IAM nadawcy"},"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-i-dmarc-w-piec-minut","text":"SPF, DKIM i DMARC w pięć minut","level":2,"locked":false},{"id":"krok-1-projekt","text":"Krok 1. Projekt","level":2,"locked":false},{"id":"krok-2-tozsamosc-domeny-configuration-set-i-szablony","text":"Krok 2. Tożsamość domeny, configuration set i szablony","level":2,"locked":false},{"id":"krok-3-rekordy-dns-i-uprawnienia","text":"Krok 3. Rekordy DNS i uprawnienia","level":2,"locked":false},{"id":"krok-4-wyjscie-z-sandboxa","text":"Krok 4. Wyjście z sandboxa","level":2,"locked":true},{"id":"krok-5-wysylka-przez-api-v2","text":"Krok 5. Wysyłka przez API v2","level":2,"locked":true},{"id":"krok-6-smtp-i-nodemailer","text":"Krok 6. SMTP i Nodemailer","level":2,"locked":true},{"id":"krok-7-odbicia-i-skargi","text":"Krok 7. Odbicia i skargi","level":2,"locked":true},{"id":"krok-8-testy-i-symulator-skrzynek","text":"Krok 8. Testy i symulator skrzynek","level":2,"locked":true},{"id":"warianty-w-c-i-pythonie","text":"Warianty w C# i Pythonie","level":2,"locked":true},{"id":"dostarczalnosc-lista-kontrolna","text":"Dostarczalność – lista kontrolna","level":2,"locked":true},{"id":"koszty","text":"Koszty","level":2,"locked":true},{"id":"typowe-bledy","text":"Typowe błędy","level":2,"locked":true},{"id":"sprawdz-sie","text":"Sprawdź się","level":2,"locked":true},{"id":"co-dalej","text":"Co dalej","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":"Autorytet","articles":63},{"key":"dotnet","title":".NET","level":5,"levelLabel":"Autorytet","articles":53},{"key":"python","title":"Python","level":5,"levelLabel":"Autorytet","articles":52},{"key":"java","title":"Java","level":5,"levelLabel":"Autorytet","articles":38}]}}