Skip to content

High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.

Refactor and improve bounce processing (#3278)

Kailash Nadh64987e32e39b
diff --git a/internal/bounce/mailbox/pop.go b/internal/bounce/mailbox/pop.go
index d38fa6cb..ec943f32 100644
--- a/internal/bounce/mailbox/pop.go
+++ b/internal/bounce/mailbox/pop.go
@@ -1,16 +1,20 @@
package mailbox
import (
+ "bufio"
+ "bytes"
"encoding/json"
"fmt"
"io"
"log"
+ "net/mail"
"regexp"
"strings"
"time"
"github.com/emersion/go-message"
_ "github.com/emersion/go-message/charset"
+ "github.com/emersion/go-message/textproto"
"github.com/knadh/go-pop3"
"github.com/knadh/listmonk/models"
)
@@ -34,24 +38,25 @@ type bounceMeta struct {
DeliveredTo string `json:"delivered_to"`
Received []string `json:"received"`
ClassifyReason string `json:"classify_reason"`
+ DiagnosticCode string `json:"diagnostic_code,omitempty"`
}
var (
// List of header to look for in the e-mail body, regexp to fall back to if the header is empty.
headerLookups = []bounceHeaders{
- {models.EmailHeaderCampaignUUID, regexp.MustCompile(`(?m)(?:^` + models.EmailHeaderCampaignUUID + `:\s+?)([a-z0-9\-]{36})`)},
- {models.EmailHeaderSubscriberUUID, regexp.MustCompile(`(?m)(?:^` + models.EmailHeaderSubscriberUUID + `:\s+?)([a-z0-9\-]{36})`)},
- {models.EmailHeaderDate, regexp.MustCompile(`(?m)(?:^` + models.EmailHeaderDate + `:\s+?)([\w,\,\ ,:,+,-]*(?:\(?:\w*\))?)`)},
- {models.EmailHeaderFrom, regexp.MustCompile(`(?m)(?:^` + models.EmailHeaderFrom + `:\s+?)(.*)`)},
- {models.EmailHeaderSubject, regexp.MustCompile(`(?m)(?:^` + models.EmailHeaderSubject + `:\s+?)(.*)`)},
- {models.EmailHeaderMessageId, regexp.MustCompile(`(?m)(?:^` + models.EmailHeaderMessageId + `:\s+?)(.*)`)},
- {models.EmailHeaderDeliveredTo, regexp.MustCompile(`(?m)(?:^` + models.EmailHeaderDeliveredTo + `:\s+?)(.*)`)},
+ {models.EmailHeaderCampaignUUID, regexp.MustCompile(`(?mi)(?:^` + models.EmailHeaderCampaignUUID + `:\s+?)([a-z0-9\-]{36})`)},
+ {models.EmailHeaderSubscriberUUID, regexp.MustCompile(`(?mi)(?:^` + models.EmailHeaderSubscriberUUID + `:\s+?)([a-z0-9\-]{36})`)},
+ {models.EmailHeaderDate, regexp.MustCompile(`(?mi)(?:^` + models.EmailHeaderDate + `:\s+?)([\w,\,\ ,:,+,-]*(?:\(?:\w*\))?)`)},
+ {models.EmailHeaderFrom, regexp.MustCompile(`(?mi)(?:^` + models.EmailHeaderFrom + `:\s+?)(.*)`)},
+ {models.EmailHeaderSubject, regexp.MustCompile(`(?mi)(?:^` + models.EmailHeaderSubject + `:\s+?)(.*)`)},
+ {models.EmailHeaderMessageId, regexp.MustCompile(`(?mi)(?:^` + models.EmailHeaderMessageId + `:\s+?)(.*)`)},
+ {models.EmailHeaderDeliveredTo, regexp.MustCompile(`(?mi)(?:^` + models.EmailHeaderDeliveredTo + `:\s+?)(.*)`)},
}
- reHdrReceived = regexp.MustCompile(`(?m)(?:^` + models.EmailHeaderReceived + `:\s+?)(.*)`)
+ reHdrReceived = regexp.MustCompile(`(?mi)(?:^` + models.EmailHeaderReceived + `:[ \t]*)([^\r\n]*(?:\r?\n[ \t]+[^\r\n]*)*)`)
// SMTP status code (5.x.x or 4.x.x) to classify hard/soft bounces.
- reSMTPStatus = regexp.MustCompile(`(?m)(?i)^(?:Status:\s*)?(?:\d{3}\s+)?([45]\.\d+\.\d+)`)
+ reSMTPStatus = regexp.MustCompile(`(?m)(?i)^(?:Status(?:\s+code)?:\s*)?(?:\d{3}\s+)?([45]\.\d+\.\d+)`)
// List of (conventional) strings to guess hard bounces.
reHardBounce = regexp.MustCompile(`(?i)(NXDOMAIN|user unknown|address not found|mailbox not found|address.*reject|does not exist|` +
@@ -74,8 +79,8 @@ func NewPOP(opt Opt, lo *log.Logger) *POP {
}
// Scan scans the mailbox and pushes the downloaded messages into the given channel.
-// The messages that are downloaded are deleted from the server. If limit > 0,
-// all messages on the server are downloaded and deleted.
+// The scanned messages are deleted from the server. A positive limit caps the
+// number of messages scanned.
func (p *POP) Scan(limit int, ch chan models.Bounce) error {
c, err := p.client.NewConn()
if err != nil {
@@ -114,97 +119,237 @@ func (p *POP) Scan(limit int, ch chan models.Bounce) error {
continue
}
- // Parse the message.
- m, err := message.Read(b)
- if err != nil && !message.IsUnknownCharset(err) {
+ bounces, err := parseBounce(b.Bytes())
+ if err != nil {
p.lo.Printf("error parsing bounce message %d: %v", id, err)
continue
}
+ for _, bounce := range bounces {
+ bounce.Source = p.opt.Host
+ ch <- bounce
+ }
+ }
+
+ // Delete the downloaded messages.
+ for id := 1; id <= count; id++ {
+ if err := c.Dele(id); err != nil {
+ return err
+ }
+ }
+
+ return nil
+}
+
+// parseBounce uses MIME headers and delivery status fields to extract bounce messages.
+// When standard headers aren't available, regex heuristics are used to try and extract info.
+func parseBounce(raw []byte) ([]models.Bounce, error) {
+ m, err := message.Read(bytes.NewReader(bytes.TrimPrefix(raw, []byte{0xef, 0xbb, 0xbf})))
+ if err != nil && !message.IsUnknownCharset(err) {
+ // Even if the message has an unknown charset, headers can still be parsed.
+ return nil, err
+ }
+
+ h := m.Header
+ var (
+ original bool
+ dsn bool
+ feedback *textproto.Header
+ recipients []textproto.Header
+ )
+
+ // Walk through nested multipart messages.
+ if err := m.Walk(func(_ []int, part *message.Entity, err error) error {
+ if err != nil && !message.IsUnknownCharset(err) {
+ return err
+ }
+
+ if !original {
+ h = part.Header
+ }
+
+ ct, _, _ := part.Header.ContentType()
+ switch ct {
+ case "message/feedback-report":
+ hdr, err := textproto.ReadHeader(bufio.NewReader(part.Body))
+ if err != nil && err != io.EOF {
+ return err
+ }
- h := m
+ feedback = &hdr
+ case "message/rfc822", "message/global", "text/rfc822-headers":
+ hdr, err := textproto.ReadHeader(bufio.NewReader(part.Body))
+ if err != nil && err != io.EOF {
+ return err
+ }
+
+ h = message.Header{Header: hdr}
+ original = true
+ case "message/delivery-status", "message/global-delivery-status":
+ dsn = true
+ r := bufio.NewReader(part.Body)
+
+ // Skip the first block that describes the reporting server and not the subscriber / email recipient.
+ if _, err := textproto.ReadHeader(r); err != nil {
+ return err
+ }
- // If this is a multipart message, find the last part.
- if mr := m.MultipartReader(); mr != nil {
for {
- part, err := mr.NextPart()
+ hdr, err := textproto.ReadHeader(r)
+ if err != nil && err != io.EOF {
+ return err
+ }
+
+ if hdr.Len() == 0 {
+ break
+ }
+
+ // Found recipients.
+ recipients = append(recipients, hdr)
if err == io.EOF {
break
- } else if err != nil && !message.IsUnknownCharset(err) {
- p.lo.Printf("error reading multipart bounce message %d: %v", id, err)
- continue
}
- h = part
}
}
- // Reset the "unread portion" pointer of the message buffer.
- // If you don't do this, you can't read the entire body because the pointer will not point to the beginning.
- b, _ = c.RetrRaw(id)
-
- // Lookup headers in the e-mail. If a header isn't found, fall back to regexp lookups.
- hdr := make(map[string]string, 7)
- for _, l := range headerLookups {
- v := h.Header.Get(l.Header)
+ return nil
+ }); err != nil {
+ return nil, err
+ }
- // Not in the header. Try regexp.
- if v == "" {
- if m := l.Regexp.FindAllSubmatch(b.Bytes(), -1); m != nil {
- v = string(m[len(m)-1][1])
- }
+ // Try regex heuristics.
+ hdr := make(map[string]string, len(headerLookups))
+ for _, l := range headerLookups {
+ v := h.Get(l.Header)
+ if v == "" {
+ if matches := l.Regexp.FindAllSubmatch(raw, -1); len(matches) > 0 {
+ v = string(matches[len(matches)-1][1])
}
+ }
+
+ hdr[l.Header] = strings.TrimSpace(v)
+ }
+
+ var received []string
+ for fields := h.FieldsByKey(models.EmailHeaderReceived); fields.Next(); {
+ received = append(received, fields.Value())
+ }
- hdr[l.Header] = strings.TrimSpace(v)
+ if len(received) == 0 {
+ for _, match := range reHdrReceived.FindAllSubmatch(raw, -1) {
+ received = append(received, strings.Join(strings.Fields(string(match[1])), " "))
}
+ }
- // Received is a []string header.
- msgReceived := h.Header.Map()[models.EmailHeaderReceived]
- if len(msgReceived) == 0 {
- if u := reHdrReceived.FindAllSubmatch(b.Bytes(), -1); u != nil {
- for i := range u {
- msgReceived = append(msgReceived, string(u[i][1]))
- }
+ date, _ := mail.ParseDate(hdr[models.EmailHeaderDate])
+ if date.IsZero() {
+ date = time.Now()
+ }
+
+ bounceType, reason := classifyBounce(raw)
+ base := models.Bounce{
+ Type: bounceType,
+ CampaignUUID: hdr[models.EmailHeaderCampaignUUID],
+ SubscriberUUID: hdr[models.EmailHeaderSubscriberUUID],
+ CreatedAt: date,
+ }
+
+ meta := bounceMeta{
+ From: hdr[models.EmailHeaderFrom],
+ Subject: hdr[models.EmailHeaderSubject],
+ MessageID: hdr[models.EmailHeaderMessageId],
+ DeliveredTo: hdr[models.EmailHeaderDeliveredTo],
+ Received: received,
+ ClassifyReason: reason,
+ }
+
+ // There are ARF/feedback headers.
+ if feedback != nil {
+ if !strings.EqualFold(strings.TrimSpace(feedback.Get("Feedback-Type")), "abuse") {
+ return nil, nil
+ }
+
+ base.Type = models.BounceTypeComplaint
+ meta.ClassifyReason = "feedback_type=abuse"
+ base.Meta, _ = json.Marshal(meta)
+ if base.SubscriberUUID != "" {
+ return []models.Bounce{base}, nil
+ }
+
+ var out []models.Bounce
+ for fields := feedback.FieldsByKey("Original-Rcpt-To"); fields.Next(); {
+ a, err := mail.ParseAddress(strings.TrimSpace(fields.Value()))
+ if err != nil {
+ return nil, fmt.Errorf("invalid original recipient: %w", err)
}
+
+ b := base
+ b.Email = strings.ToLower(a.Address)
+ out = append(out, b)
+ }
+ if len(out) == 0 {
+ return nil, fmt.Errorf("missing subscriber UUID or original recipient")
}
- date, _ := time.Parse("Mon, 02 Jan 2006 15:04:05 -0700", hdr[models.EmailHeaderDate])
- if date.IsZero() {
- date = time.Now()
- }
-
- // Classify the bounce type based on message content.
- bounceType, bounceReason := classifyBounce(b.Bytes())
-
- // Additional bounce e-mail metadata.
- meta, _ := json.Marshal(bounceMeta{
- From: hdr[models.EmailHeaderFrom],
- Subject: hdr[models.EmailHeaderSubject],
- MessageID: hdr[models.EmailHeaderMessageId],
- DeliveredTo: hdr[models.EmailHeaderDeliveredTo],
- Received: msgReceived,
- ClassifyReason: bounceReason,
- })
-
- select {
- case ch <- models.Bounce{
- Type: bounceType,
- CampaignUUID: hdr[models.EmailHeaderCampaignUUID],
- SubscriberUUID: hdr[models.EmailHeaderSubscriberUUID],
- Source: p.opt.Host,
- CreatedAt: date,
- Meta: meta,
- }:
- default:
+ return out, nil
+ }
+
+ if !dsn {
+ base.Meta, _ = json.Marshal(meta)
+ if base.SubscriberUUID == "" {
+ return nil, fmt.Errorf("missing subscriber UUID")
}
+
+ return []models.Bounce{base}, nil
}
- // Delete the downloaded messages.
- for id := 1; id <= count; id++ {
- if err := c.Dele(id); err != nil {
- return err
+ var out []models.Bounce
+ for _, recipient := range recipients {
+ b := base
+ status := strings.TrimSpace(recipient.Get("Status"))
+ // Some servers append an explanatory comment after the status code.
+ if fields := strings.Fields(status); len(fields) > 0 {
+ status = fields[0]
+ }
+ action := strings.ToLower(strings.TrimSpace(recipient.Get("Action")))
+
+ switch {
+ case strings.HasPrefix(status, "2."), action == "delivered", action == "relayed", action == "expanded":
+ continue
+ case strings.HasPrefix(status, "5."):
+ b.Type = models.BounceTypeHard
+ case strings.HasPrefix(status, "4."):
+ b.Type = models.BounceTypeSoft
+ default:
+ return nil, fmt.Errorf("invalid delivery status %q", status)
+ }
+
+ if len(recipients) > 1 {
+ b.SubscriberUUID = ""
+ }
+
+ // No sub UUID, try to extract the email address from the final recipient header.
+ if b.SubscriberUUID == "" {
+ kind, address, _ := strings.Cut(recipient.Get("Final-Recipient"), ";")
+ if !strings.EqualFold(strings.TrimSpace(kind), "rfc822") && !strings.EqualFold(strings.TrimSpace(kind), "utf-8") {
+ return nil, fmt.Errorf("invalid final recipient")
+ }
+
+ a, err := mail.ParseAddress(strings.TrimSpace(address))
+ if err != nil {
+ return nil, fmt.Errorf("invalid final recipient: %w", err)
+ }
+
+ b.Email = strings.ToLower(a.Address)
}
+
+ meta.ClassifyReason = "smtp_status=" + status
+ meta.DiagnosticCode = recipient.Get("Diagnostic-Code")
+ b.Meta, _ = json.Marshal(meta)
+
+ out = append(out, b)
}
- return nil
+ return out, nil
}
// classifyBounce analyzes the bounce message content and determines if it's a hard or soft bounce.
diff --git a/internal/bounce/mailbox/testdata/arf1.eml b/internal/bounce/mailbox/testdata/arf1.eml
new file mode 100644
index 00000000..a98efa49
--- /dev/null
+++ b/internal/bounce/mailbox/testdata/arf1.eml
@@ -0,0 +1,101 @@
+Return-Path: <[email protected]>
+Authentication-Results: example.com;
+ iprev=pass (without dnssec) policy.iprev=23.249.218.243;
+ dkim=pass (1024 bit rsa, without dnssec) header.d=amazonses.com
+ header.s=smjs5bczbyxi6u2ua6eveuxqal7joyry header.a=rsa-sha256
+ header.b=qRZJiYBTyHKL;
+ spf=pass (without dnssec) smtp.mailfrom=amazonses.com;
+ dmarc=pass (without dnssec) header.from=eu-west-2.email-abuse.amazonses.com
+Received-SPF: pass (domain amazonses.com) client-ip=23.249.218.243;
+ envelope-from="[email protected]";
+ helo=d218-243.smtp-out.eu-west-2.amazonses.com;
+ mechanism="ip4:23.249.208.0/20"; receiver=example.com;
+ identity=mailfrom
+Received: from d218-243.smtp-out.eu-west-2.amazonses.com ([23.249.218.243])
+ by example.com ([172.30.0.3]) via tcp with ESMTPS id
+ YLPJ694dQ0YfrbsQtp_BZQ (TLS1.3 TLS_AES_128_GCM_SHA256) for
+ <[email protected]>; 5 Oct 2026 11:32:29 +0000
+DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple;
+ s=smjs5bczbyxi6u2ua6eveuxqal7joyry; d=amazonses.com; t=1791199948;
+ h=Date:From:To:Message-ID:Subject:MIME-Version:Content-Type:Feedback-ID;
+ bh=oPog1Np1RsMp6QGqmjGVx91ulX5e6tRpEzcwOPRkA2w=;
+ b=qRZJiYBTyHKLmAoZ7bhHP2LdlIQRhzg2ERzyfRa5SKTjuBbMdWiqQbheXGIjHrwB
+ n+/si9H4xQLCwsyWuTfiscje/ekzHU9fOqJQXXCp9NqJUpaRZhqPeCeyMLYDRF24H3H
+ vltAiYb3OI6GOcIXHYvaWVGik/o+xdXa0NP1QdWU=
+Date: Mon, 5 Oct 2026 11:32:28 +0000
+To: Bounce Test <[email protected]>
+Message-ID: <010b01a10bd62e99-67c5dd8c-4b1a-4b00-8095-94426eaca9ee-000000@eu-west-2.amazonses.com>
+Subject: FW:Test Message
+MIME-Version: 1.0
+Content-Type: multipart/report;
+ boundary="----=_Part_61506_10144811.1791199947129";
+ report-type=feedback-report
+Feedback-ID: ::1.eu-west-2.xt7WMhTko9T30pmfpYXYpWY4KSstOlp/P5M0f0u9GXk=:AmazonSES
+X-SES-Outgoing: 2026.10.05-23.249.218.243
+
+------=_Part_61506_10144811.1791199947129
+Content-Type: text/plain; charset=us-ascii
+Content-Transfer-Encoding: 7bit
+
+Hello,
+
+This is an example of a complaint email response.
+
+Thank you,
+
+-Amazon SES Mailbox Simulator
+
+------=_Part_61506_10144811.1791199947129
+Content-Type: message/feedback-report
+Content-Transfer-Encoding: 7bit
+
+Feedback-Type: abuse
+User-Agent: Amazon SES Mailbox Simulator
+Version: 3.0
+Original-Envelope-Id: <010b01a10bd62800-41b17c07-f21d-44fe-8e92-7d52e2484de7-000000@eu-west-2.amazonses.com>
+Original-Mail-From: 010b01a10bd62800-41b17c07-f21d-44fe-8e92-7d52e2484de7-000000@example.com
+Original-Rcpt-to: [email protected]
+Source-IP: 10.0.80.40
+
+------=_Part_61506_10144811.1791199947129
+Content-Type: message/rfc822
+
+Received: from d218-16.smtp-out.eu-west-2.amazonses.com (ip-10-0-80-40.eu-west-1.compute.internal [10.0.80.40])
+ by ip-10-0-61-199.eu-west-1.compute.internal
+ with SMTP (Amazon SES Mailbox Simulator) id 6YUvyUTg3xyPX18uJ6mX
+ Mon, 05 Oct 2026 11:32:27 +0000 (UTC)
+DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple;
+ s=smjs5bczbyxi6u2ua6eveuxqal7joyry; d=amazonses.com; t=1791199946;
+ h=Subject:Message-Id:From:Date:Mime-Version:Content-Type:Content-Transfer-Encoding:To:Feedback-ID;
+ bh=W/mwWYwHzZM9xtNLiz/77cOwHrHY1eMyX3qhZdPQiuw=;
+ b=jNd6AyCc9trxDnYPyB/2fmSge1HXWQhWSZoqfbXnmULgDiW4dyXsev9BYJoTUOSk
+ 0l8ENtFqhWfaCWpxxmnDBM9tIomQs6nh/u8eFKALoby7BmnTYoJLGQUkHyq7GeKtjoI
+ CZ+Gc4Wa2gRlAEUTbqD67KyCAMJyHNgFTHcrNkSA=
+Subject: Test Message
+Message-ID: <010b01a10bd62800-41b17c07-f21d-44fe-8e92-7d52e2484de7-000000@eu-west-2.amazonses.com>
+From: Bounce Test <[email protected]>
+Date: Mon, 5 Oct 2026 11:32:26 +0000
+Mime-Version: 1.0
+Content-Type: text/html; charset=UTF-8
+Content-Transfer-Encoding: quoted-printable
+Feedback-ID: ::1.eu-west-2.p+G9B50gElGkmucCAKrfW47y8iCzC7R4mmrpa1ptpJ8=:AmazonSES
+X-SES-Outgoing: 2026.10.05-23.249.218.16
+
+<!doctype html>
+<html>
+ <head>
+ <meta charset=3D"utf-8" />
+ <meta
+ name=3D"viewport"
+ content=3D"width=3Ddevice-width,initial-scale=3D1,minimum-scale=3D1"
+ />
+ <base target=3D"_blank" />
+ </head>
+ <body>
+ </body>
+</html>
+
+------=_Part_61506_10144811.1791199947129--
\ No newline at end of file
diff --git a/internal/bounce/mailbox/testdata/dsn1.eml b/internal/bounce/mailbox/testdata/dsn1.eml
new file mode 100644
index 00000000..5211bbf0
--- /dev/null
+++ b/internal/bounce/mailbox/testdata/dsn1.eml
@@ -0,0 +1,732 @@
+Return-Path: <>
+Received: from CWXP265CU008.outbound.protection.outlook.com (mail-ukwestazhn15010017.outbound.protection.outlook.com [52.102.166.17])
+ (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
+ key-exchange ECDHE (secp384r1) server-signature RSA-PSS (2048 bits) server-digest SHA256)
+ (No client certificate requested)
+ by phl-mx-08.messagingengine.com (Postfix) with ESMTPS id 9CE88150020C
+ for <[email protected]>; Wed, 23 Sep 2026 05:15:54 -0400 (EDT)
+MIME-Version: 1.0
+Date: Wed, 23 Sep 2026 09:15:51 +0000
+Content-Type: multipart/report; report-type=delivery-status;
+ boundary="2502fa2e-2051-48e3-b87b-b04e02faddb4"
+Content-Language: en-US
+Message-ID:
+ <b40e34f0-9c1a-42bb-a9fd-f6e0ef0521be@LOVP265MB8674.GBRP265.PROD.OUTLOOK.COM>
+In-Reply-To: <[email protected]>
+References: <[email protected]>
+Subject: Undeliverable: Confirm your email address
+Auto-Submitted: auto-replied
+
+--2502fa2e-2051-48e3-b87b-b04e02faddb4
+Content-Type: multipart/alternative; differences=Content-Type;
+ boundary="51e17011-43a1-412f-80ac-295ed1fba71e"
+
+--51e17011-43a1-412f-80ac-295ed1fba71e
+Content-Type: text/plain; charset="us-ascii"
+Content-Transfer-Encoding: quoted-printable
+
+[https://products.office.com/en-us/CMSImages/Office365Logo_Orange.png]
+Your message to [email protected] couldn't be delivered.
+Security or policy settings at icloud.com have rejected your message.
+hello Office 365 icloud.com
+Sender Action Required
+Security or policy violation
+
+How to Fix It
+The recipient's email server won't accept your message because it appears t=
+o violate their security or policy settings. Check the Reported error below=
+ to see if you can determine why it was blocked. Then try one or more of th=
+e following:
+
+ * If the error mentions SPF, DKIM, or DMARC issues, forward this messag=
+e to your email admin for assistance.
+ * The recipient's email server might suspect that your message is spam.=
+ Follow the guidance in this article: E-mailing Best Practices for Senders<=
+https://aka.ms/EmailingBestPractices>. Then resend your message.
+ * If the error suggests your message is too large, try to reduce the si=
+ze of your attachment. If that isn't possible, place the file on a publicly=
+ accessible cloud storage location, like OneDrive. Then add a link to the f=
+ile in your message, and resend the message.
+ * Contact the recipient (by phone, for example) and tell them to ask th=
+eir email admin to add you or your email domain to their allowed senders li=
+st.
+
+If the problem continues, forward this message to your email admin. If you'=
+re an email admin, refer to the More Info for Email Admins section below.
+
+Was this helpful? Send feedback to Microsoft<https://go.microsoft.com/fwlin=
+k/?LinkId=3D525928>.
+________________________________
+
+More Info for Email Admins
+Status code: 550 5.7.1
+
+This error occurs when the recipient's domain has security or policy settin=
+gs that reject the sender's message. However, we were unable to determine t=
+he specific setting that's causing this rejection. Usually the error is rep=
+orted by an email server outside of Office 365. Common issues include the f=
+ollowing: the receiving server suspects the message is malicious or spam; t=
+he Sender Policy Framework (SPF) record for example.com is incorrectly c=
+onfigured or doesn't exist; or the message includes an attachment larger th=
+an the receiving server will accept. Try one or more of the following:
+
+Review the reported error - Check the Reported error shown below to help de=
+termine what the issue might be. For example, if the issue is related to an=
+ SPF failure, the reported error will usually include the acronym "SPF" or =
+the phrase "Sender Policy Framework."
+
+Correctly configure your SPF records - If you're the sender's email admin, =
+make sure your domain's SPF records at your domain registrar are properly c=
+onfigured. Office 365 supports only one SPF record (a TXT record that defin=
+es SPF) for your domain. Include the following domain name: spf.protection.=
+outlook.com. If you have a hybrid configuration (some mailboxes in the clou=
+d and some mailboxes on premises) or if you're an Exchange Online Protectio=
+n standalone customer, add the outbound IP address of your on-premises serv=
+ers to the TXT record. To learn how, see Customize an SPF record to validat=
+e outbound email sent from your domain<https://technet.microsoft.com/librar=
+y/dn789058(v=3Dexchg.150).aspx> and External Domain Name System records for=
+ Office 365<https://support.office.com/article/External-Domain-Name-System-=
+records-for-Office-365-c0531a6f-9e25-4f2d-ad0e-a70bfef09ac0#BKMK_SPFrecords=
+>.
+
+Unable to relay - If the Reported error indicates a problem with relaying (=
+e.g. "unable to relay"), then the email server that reported the error like=
+ly isn't set up correctly to receive and relay messages from the sender's d=
+omain. This server will usually be one of your on-premises servers in a hyb=
+rid environment, a smart host email service that you're trying to route mes=
+sages through, or possibly even an email hosting service you used in the pa=
+st yet still have mail flow settings pointing to (e.g. your MX record at yo=
+ur domain registrar still points to your previous email service provider). =
+Check Error reported by shown below to determine what domain, service, or s=
+erver is reporting the error. The email server needs to be configured to ei=
+ther accept messages from anonymous users or to include the sending domain =
+or IP in its list of authenticated senders. On an Exchange server, you can =
+set this up in the server's receive connector. If it's a smart host managed=
+ by another service or partner, contact the service or partner to configure=
+ their servers to accept and relay messages from your senders. Also, work w=
+ith your domain registrar to make sure your MX records are properly configu=
+red.
+
+Contact the recipient's email admin - For some scenarios, you can fix the i=
+ssue by contacting the email admin at the recipient domain to ask them to a=
+dd the sender's email address or your domain to their allowed senders list,=
+ or to relax the setting that's causing the rejection.
+
+For more information and tips for fixing this issue, see Fix email delivery=
+ issues for error code 5.7.1 in Office 365<https://go.microsoft.com/fwlink/=
+?LinkId=3D389365>.
+
+Original Message Details
+Created Date: 9/23/2026 9:15:36 AM
+Sender Address: [email protected]
+Recipient Address: [email protected]
+Subject: Confirm your email address
+
+Error Details
+Error: 554 5.7.1 [CS01] Message rejected due to local policy. Please visit=
+ https://support.apple.com/en-us/HT204137. Txn ID 00000000-0000-0000-0000-b=
+00000000000
+Message rejected by: p00-iscream-smtp-7b95d6f6c9-64bmv
+
+Notification Details
+Sent by: LOVP265MB8674.GBRP265.PROD.OUTLOOK.COM
+
+Message Hops
+HOP TIME (UTC) FROM TO WITH RELAY TIME
+1 9/23/2026
+9:15:43 AM substrate.office.com LOVP265MB8674.GBRP265.PROD.OUTLOOK.=
+COM HTTP 7 sec
+
+Original Message Headers
+
+Received: from substrate.office.com (2603:10a6:600:37c::19) by
+ LOVP265MB8674.GBRP265.PROD.OUTLOOK.COM with HTTP via
+ LO4P265CA0257.GBRP265.PROD.OUTLOOK.COM; Wed, 23 Sep 2026 09:15:43 +0000
+Message-ID: <[email protected]>
+Subject: Confirm your email address
+Date: Wed, 23 Sep 2026 10:15:36 +0100
+MIME-Version: 1.0
+X-Listmonk-Subscriber: a4eec08a-4c6e-4c49-ba0b-54bb2a96d768
+Content-Type: text/html; charset=3DUTF-8
+Content-Transfer-Encoding: quoted-printable
+Reply-To: Test <[email protected]>
+From: Test <[email protected]>
+Sender: Test <[email protected]>
+Return-Path: [email protected]
+
+
+--51e17011-43a1-412f-80ac-295ed1fba71e
+Content-Type: text/html; charset="us-ascii"
+Content-Transfer-Encoding: quoted-printable
+
+<html>
+ <meta name=3D"viewport" content=3D"width=3Ddevice-width, initial-scale=3D=
+1" />
+ <head>
+ <title>
+ DSN
+ </title>
+ </head>
+ <body style=3D" background-color: white; ">
+ <table style=3D" background-color: white; max-width: 548=
+px; color: black; border-spacing: 0px 0px; padding-=
+top: 0px; padding-bottom: 0px; border-collapse: collapse; =
+ " width=3D"548" cellspacing=3D"0" cellpadding=3D"0">
+ <tbody>
+ <tr>
+ <td style=3D" text-align: left; padding-bottom: 20p=
+x; ">
+ <img height=3D"28" width=3D"126" style=3D" max-width: 10=
+0%; " src=3D"https://products.office.com/en-us/CMSImages/Office365Logo=
+_Orange.png" />
+ </td>
+ </tr>
+ <tr>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, Arial, sa=
+ns-serif; font-size: 16px; padding-bottom: 10px; -ms=
+-text-size-adjust: 100%; text-align: left; ">Your message to <s=
+pan style=3D" color: #0072c6; ">[email protected]</span> co=
+uldn't be delivered.<br /></td>
+ </tr>
+ <tr>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, Arial, sa=
+ns-serif; font-size: 24px; padding-top: 0px; paddin=
+g-bottom: 20px; text-align: center; -ms-text-size-adjust: 1=
+00%; ">Security or policy settings at <span style=3D" color: #0=
+072c6; ">icloud.com</span> have rejected your message.<br /></td>
+ </tr>
+ <tr>
+ <td style=3D" padding-bottom: 15px; padding-left: =
+0px; padding-right: 0px; border-spacing: 0px 0px; ">
+ <table style=3D" max-width: 548px; font-weight: =
+600; border-spacing: 0px 0px; padding-top: 0px; padd=
+ing-bottom: 0px; border-collapse: collapse; ">
+ <tbody>
+ <tr>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; font-size: 15px; font-weight: 600; t=
+ext-align: left; width: 181px; -ms-text-size-adjust: 100%; =
+ vertical-align: bottom; ">
+ <font color=3D"#ffffff">
+ <span style=3D"color:#000000">hello</span>
+ </font>
+ </td>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; font-size: 15px; font-weight: 600; t=
+ext-align: center; width: 186px; -ms-text-size-adjust: 100%; =
+ vertical-align: bottom; ">
+ <font color=3D"#ffffff">
+ <span style=3D"color:#000000">Office 365</span>
+ </font>
+ </td>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; -ms-text-size-adjust: 100%; font-size: 15=
+px; font-weight: 600; text-align: right; width: 181p=
+x; vertical-align: bottom; ">
+ <font color=3D"#ffffff">
+ <span style=3D"color:#000000">icloud.com</span>
+ </font>
+ </td>
+ </tr>
+ <tr>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; -ms-text-size-adjust: 100%; font-size: 14px=
+; font-weight: 400; text-align: left; padding-top: 0px=
+; padding-bottom: 0px; vertical-align: middle; width: =
+181px; ">
+ <font color=3D"#ffffff">
+ <span style=3D"color:#000000">Sender</span>
+ </font>
+ </td>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; -ms-text-size-adjust: 100%; font-size: 14px=
+; font-weight: 400; text-align: center; padding-top: 0=
+px; padding-bottom: 0px; vertical-align: middle; width=
+: 186px; " />
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; -ms-text-size-adjust: 100%; font-size: 14px=
+; font-weight: 400; text-align: right; padding-top: 0p=
+x; padding-bottom: 0px; vertical-align: middle; width:=
+ 181px; ">
+ <font color=3D"#ffffff">
+ <span style=3D" color: #c00000; ">
+ <b>Action Required</b>
+ </span>
+ </font>
+ </td>
+ </tr>
+ <tr>
+ <td colspan=3D"3" style=3D" padding-top:0; =
+padding-bottom:0; padding-left:0; padding-right:0 ">
+ <table cellspacing=3D"0" cellpadding=3D"0" style=3D" =
+ border-spacing: 0px 0px; padding-top: 0px; padding-botto=
+m: 0px; padding-left: 0px; padding-right: 0px; border-=
+collapse: collapse; ">
+ <tbody>
+ <tr height=3D"10">
+ <td width=3D"180" height=3D"10" bgcolor=3D"#ccccc=
+c" style=3D" width: 180px; line-height: 10px; height: =
+10px; font-size: 6px; padding-top: 0; padding-bottom: =
+0; padding-left: 0; padding-right: 0; "><!--[if gte mso =
+15]>&nbsp;<![endif]--></td>
+ <td width=3D"4" height=3D"10" bgcolor=3D"#ffffff"=
+ style=3D" width: 4px; line-height: 10px; height: 10px=
+; font-size: 6px; padding-top: 0; padding-bottom: 0; =
+ padding-left: 0; padding-right: 0; "><!--[if gte mso 15]>=
+&nbsp;<![endif]--></td>
+ <td width=3D"180" height=3D"10" bgcolor=3D"#ccccc=
+c" style=3D" width: 180px; line-height: 10px; height: =
+10px; font-size: 6px; padding-top: 0; padding-bottom: =
+0; padding-left: 0; padding-right: 0; "><!--[if gte mso =
+15]>&nbsp;<![endif]--></td>
+ <td width=3D"4" height=3D"10" bgcolor=3D"#ffffff"=
+ style=3D" width: 4px; line-height: 10px; height: 10px=
+; font-size: 6px; padding-top: 0; padding-bottom: 0; =
+ padding-left: 0; padding-right: 0; "><!--[if gte mso 15]>=
+&nbsp;<![endif]--></td>
+ <td width=3D"180" height=3D"10" bgcolor=3D"#c0000=
+0" style=3D" width: 180px; line-height: 10px; height: =
+10px; font-size: 6px; padding-top: 0; padding-bottom: =
+0; padding-left: 0; padding-right: 0; "><!--[if gte mso =
+15]>&nbsp;<![endif]--></td>
+ </tr>
+ </tbody>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; -ms-text-size-adjust: 100%; font-size: 14px=
+; text-align: left; width: 181px; line-height: 20px; =
+ font-weight: 400; padding-top: 0px; padding-left: 0px; =
+ padding-right: 0px; padding-bottom: 0px; " />
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; -ms-text-size-adjust: 100%; font-size: 14px=
+; text-align: center; width: 186px; line-height: 20px;=
+ font-weight: 400; padding-top: 0px; padding-left: 0px=
+; padding-right: 0px; padding-bottom: 0px; " />
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; -ms-text-size-adjust: 100%; font-size: 14px=
+; text-align: right; width: 181px; line-height: 20px; =
+ font-weight: 400; padding-top: 0px; padding-left: 0px;=
+ padding-right: 0px; padding-bottom: 0px; ">
+ <font color=3D"#ffffff">
+ <span style=3D" color: #c00000; ">Securit=
+y or policy violation</span>
+ </font>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td style=3D" width: 100%; padding-top: 0px; =
+ padding-right: 10px; padding-left: 10px; ">
+ <br />
+ <table style=3D" width: 100%; padding-right: 0px;=
+ padding-left: 0px; padding-top: 0px; padding-bottom: =
+0px; background-color: #f2f5fa; margin-left: 0px; ">
+ <tbody>
+ <tr>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; -ms-text-size-adjust: 100%; font-size: 21px=
+; font-weight: 500; background-color: #f2f5fa; padding=
+-top: 0px; padding-bottom: 0px; padding-left: 10px; pa=
+dding-right: 10px; ">How to Fix It</td>
+ </tr>
+ <tr>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; -ms-text-size-adjust: 100%; font-size: 16px=
+; font-weight: 400; padding-top: 0px; padding-bottom: =
+6px; padding-left: 10px; padding-right: 10px; backgrou=
+nd-color: #f2f5fa; ">The recipient's email server won't accept your me=
+ssage because it appears to violate their security or policy settings. Chec=
+k the <b>Reported error</b> below to see if you can determine why it was bl=
+ocked. Then try one or more of the following:</td>
+ </tr>
+ <tr>
+ <td style=3D" padding-top: 0px; padding-b=
+ottom: 0px; padding-left: 0px; padding-right: 0px; b=
+order-spacing: 0px 0px; ">
+ <ul style=3D" font-family: 'Segoe UI', Frutiger,=
+ Arial, sans-serif; -ms-text-size-adjust: 100%; font-size: 16=
+px; font-weight: 400; margin-left: 40px; margin-bottom=
+: 5px; background-color: #f2f5fa; padding-top: 0px; pa=
+dding-bottom: 0px; padding-left: 6px; padding-right: 6px; =
+ ">
+ <li>If the error mentions SPF, DKIM, or DMARC issues,=
+ forward this message to your email admin for assistance.</li>
+ <li>The recipient's email server might suspect that y=
+our message is spam. Follow the guidance in this article: <a href=3D"https:=
+//aka.ms/EmailingBestPractices">E-mailing Best Practices for Senders</a>. T=
+hen resend your message.</li>
+ <li>If the error suggests your message is too large, =
+try to reduce the size of your attachment. If that isn't possible, place th=
+e file on a publicly accessible cloud storage location, like OneDrive. Then=
+ add a link to the file in your message, and resend the message.</li>
+ <li>Contact the recipient (by phone, for example) and=
+ tell them to ask their email admin to add you or your email domain to thei=
+r allowed senders list.</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; -ms-text-size-adjust: 100%; font-size: 16px=
+; font-weight: 400; padding-top: 0px; padding-bottom: =
+6px; padding-left: 10px; padding-right: 10px; backgrou=
+nd-color: #f2f5fa; ">If the problem continues, forward this message to=
+ your email admin. If you're an email admin, refer to the <b>More Info for =
+Email Admins</b> section below.</td>
+ </tr>
+ </tbody>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, Arial, sa=
+ns-serif; -ms-text-size-adjust: 100%; font-size: 14px; =
+ font-weight: 400; padding-top: 10px; padding-bottom: 0px; =
+ padding-bottom: 4px; ">
+ <br />
+ <em>Was this helpful? <a href=3D"https://go.microsoft.com/fwlin=
+k/?LinkId=3D525928">Send feedback to Microsoft</a>.</em>
+ </td>
+ </tr>
+ <tr>
+ <td style=3D" -ms-text-size-adjust: 100%; font-size=
+: 0px; line-height: 0px; padding-top: 0px; padding-bot=
+tom: 0px; ">
+ <hr />
+ </td>
+ </tr>
+ <tr>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, Arial, sa=
+ns-serif; -ms-text-size-adjust: 100%; font-size: 21px; =
+ font-weight: 500; ">
+ <br />More Info for Email Admins</td>
+ </tr>
+ <tr>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, Arial, sa=
+ns-serif; -ms-text-size-adjust: 100%; font-size: 14px; "=
+>
+ <em>Status code: 550 5.7.1</em>
+ <br />
+ <br />This error occurs when the recipient's domain has securit=
+y or policy settings that reject the sender's message. However, we were una=
+ble to determine the specific setting that's causing this rejection. Usuall=
+y the error is reported by an email server outside of Office 365. Common is=
+sues include the following: the receiving server suspects the message is ma=
+licious or spam; the Sender Policy Framework (SPF) record for nhshackday.co=
+m is incorrectly configured or doesn't exist; or the message includes an at=
+tachment larger than the receiving server will accept. Try one or more of t=
+he following:<br /><br /><b>Review the reported error</b> - Check the <b>Re=
+ported error</b> shown below to help determine what the issue might be. For=
+ example, if the issue is related to an SPF failure, the reported error wil=
+l usually include the acronym "SPF" or the phrase "Sender Policy Framework.=
+"<br /><br /><b>Correctly configure your SPF records</b> - If you're the se=
+nder's email admin, make sure your domain's SPF records at your domain regi=
+strar are properly configured. Office 365 supports only one SPF record (a T=
+XT record that defines SPF) for your domain. Include the following domain n=
+ame: <b>spf.protection.outlook.com</b>. If you have a hybrid configuration =
+(some mailboxes in the cloud and some mailboxes on premises) or if you're a=
+n Exchange Online Protection standalone customer, add the outbound IP addre=
+ss of your on-premises servers to the TXT record. To learn how, see <a href=
+=3D"https://technet.microsoft.com/library/dn789058(v=3Dexchg.150).aspx">Cus=
+tomize an SPF record to validate outbound email sent from your domain</a> a=
+nd <a href=3D"https://support.office.com/article/External-Domain-Name-Syste=
+m-records-for-Office-365-c0531a6f-9e25-4f2d-ad0e-a70bfef09ac0#BKMK_SPFrecor=
+ds">External Domain Name System records for Office 365</a>.<br /><br /><b>U=
+nable to relay</b> - If the <b>Reported error</b> indicates a problem with =
+relaying (e.g. "unable to relay"), then the email server that reported the =
+error likely isn't set up correctly to receive and relay messages from the =
+sender's domain. This server will usually be one of your on-premises server=
+s in a hybrid environment, a smart host email service that you're trying to=
+ route messages through, or possibly even an email hosting service you used=
+ in the past yet still have mail flow settings pointing to (e.g. your MX re=
+cord at your domain registrar still points to your previous email service p=
+rovider). Check <b>Error reported by</b> shown below to determine what doma=
+in, service, or server is reporting the error. The email server needs to be=
+ configured to either accept messages from anonymous users or to include th=
+e sending domain or IP in its list of authenticated senders. On an Exchange=
+ server, you can set this up in the server's receive connector. If it's a s=
+mart host managed by another service or partner, contact the service or par=
+tner to configure their servers to accept and relay messages from your send=
+ers. Also, work with your domain registrar to make sure your MX records are=
+ properly configured.<br /><br /><b>Contact the recipient's email admin</b>=
+ - For some scenarios, you can fix the issue by contacting the email admin =
+at the recipient domain to ask them to add the sender's email address or yo=
+ur domain to their allowed senders list, or to relax the setting that's cau=
+sing the rejection.<br /><br />For more information and tips for fixing thi=
+s issue, see <a href=3D"https://go.microsoft.com/fwlink/?LinkId=3D389365">F=
+ix email delivery issues for error code 5.7.1 in Office 365</a>.<br /><br /=
+></td>
+ </tr>
+ <tr>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, Arial, sa=
+ns-serif; -ms-text-size-adjust: 100%; font-size: 17px; =
+ font-weight: 500; ">Original Message Details</td>
+ </tr>
+ <tr>
+ <td style=3D" font-size: 14px; line-height: 20px; =
+ font-family: 'Segoe UI', Frutiger, Arial, sans-serif; -ms-text=
+-size-adjust: 100%; font-weight: 500; ">
+ <table style=3D" width: 100%; border-collapse: co=
+llapse; margin-left: 10px; ">
+ <tbody>
+ <tr>
+ <td valign=3D"top" style=3D" font-family: 'Segoe U=
+I', Frutiger, Arial, sans-serif; font-size: 14px; -ms-text-si=
+ze-adjust: 100%; white-space: nowrap; font-weight: 500; =
+ width: 140px; ">Created Date:</td>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; -ms-text-size-adjust: 100%; font-size: 14px=
+; font-weight: 400; ">9/23/2026 9:15:36 AM</td>
+ </tr>
+ <tr>
+ <td valign=3D"top" style=3D" font-family: 'Segoe U=
+I', Frutiger, Arial, sans-serif; font-size: 14px; -ms-text-si=
+ze-adjust: 100%; white-space: nowrap; font-weight: 500; =
+ width: 140px; ">Sender Address:</td>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; -ms-text-size-adjust: 100%; font-size: 14px=
+; font-weight: 400; ">[email protected]</td>
+ </tr>
+ <tr>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; font-size: 14px; -ms-text-size-adjust: 100%=
+; white-space: nowrap; font-weight: 500; width: 140px;=
+ ">Recipient Address:</td>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; -ms-text-size-adjust: 100%; font-size: 14px=
+; font-weight: 400; ">[email protected]</td>
+ </tr>
+ <tr>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; font-size: 14px; -ms-text-size-adjust: 100%=
+; white-space: nowrap; font-weight: 500; width: 140px;=
+ ">Subject:</td>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; -ms-text-size-adjust: 100%; font-size: 14px=
+; font-weight: 400; ">Confirm your email address</td>
+ </tr>
+ </tbody>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, Arial, sa=
+ns-serif; -ms-text-size-adjust: 100%; font-size: 17px; =
+ font-weight: 500; ">
+ <br />Error Details</td>
+ </tr>
+ <tr>
+ <td style=3D" font-size: 14px; line-height: 20px; =
+ font-family: 'Segoe UI', Frutiger, Arial, sans-serif; -ms-text=
+-size-adjust: 100%; font-weight: 500; ">
+ <table style=3D" width: 100%; border-collapse: co=
+llapse; margin-left: 10px; ">
+ <tbody>
+ <tr>
+ <td valign=3D"top" style=3D" font-family: 'Segoe U=
+I', Frutiger, Arial, sans-serif; font-size: 14px; -ms-text-si=
+ze-adjust: 100%; white-space: nowrap; font-weight: 500; =
+ width: 140px; ">Error:</td>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; -ms-text-size-adjust: 100%; font-size: 14px=
+; font-weight: 400; ">
+ <em>554 5.7.1 [CS01] Message rejected due to local poli=
+cy. Please visit https://support.apple.com/en-us/HT204137. Txn ID 00000000-=
+0000-0000-0000-000000000000</em>
+ </td>
+ </tr>
+ <tr>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; font-size: 14px; -ms-text-size-adjust: 100%=
+; white-space: nowrap; font-weight: 500; width: 140px;=
+ ">Message rejected by:</td>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; -ms-text-size-adjust: 100%; font-size: 14px=
+; font-weight: 400; ">p00-iscream-smtp-7b95d6f6c9-64bmv</td>
+ </tr>
+ </tbody>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, Arial, sa=
+ns-serif; -ms-text-size-adjust: 100%; font-size: 17px; =
+ font-weight: 500; ">
+ <br />Notification Details</td>
+ </tr>
+ <tr>
+ <td style=3D" font-size: 14px; line-height: 20px; =
+ font-family: 'Segoe UI', Frutiger, Arial, sans-serif; -ms-text=
+-size-adjust: 100%; font-weight: 500; ">
+ <table style=3D" width: 100%; border-collapse: co=
+llapse; margin-left: 10px; ">
+ <tbody>
+ <tr>
+ <td valign=3D"top" style=3D" font-family: 'Segoe U=
+I', Frutiger, Arial, sans-serif; font-size: 14px; -ms-text-si=
+ze-adjust: 100%; white-space: nowrap; font-weight: 500; =
+ width: 140px; ">Sent by:</td>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; -ms-text-size-adjust: 100%; font-size: 14px=
+; font-weight: 400; ">
+ <em>LOVP265MB8674.GBRP265.PROD.OUTLOOK.COM</em>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <br />
+ <table style=3D"width: 880px;" cellspacing=3D"0">
+ <tr>
+ <td colspan=3D"6" style=3D" padding-top: 4px; border-=
+bottom: 1px solid #999999; padding-bottom: 4px; line-height: =
+120%; font-size: 17px; font-family: 'Segoe UI', Frutiger, Ari=
+al, sans-serif; -ms-text-size-adjust: 100%; font-weight: 500;=
+ ">Message Hops</td>
+ </tr>
+ <tr>
+ <td style=3D" font-size: 12px; font-family: 'Segoe UI=
+', Frutiger, Arial, sans-serif; -ms-text-size-adjust: 100%; f=
+ont-weight: 500; background-color: #f2f5fa; border-bottom: 1p=
+x solid #999999; white-space: nowrap; padding: 8px; ">HO=
+P</td>
+ <td style=3D" font-size: 12px; font-family: 'Segoe UI=
+', Frutiger, Arial, sans-serif; -ms-text-size-adjust: 100%; f=
+ont-weight: 500; background-color: #f2f5fa; border-bottom: 1p=
+x solid #999999; white-space: nowrap; padding: 8px; wi=
+dth: 80px; ">TIME (UTC)</td>
+ <td style=3D" font-size: 12px; font-family: 'Segoe UI=
+', Frutiger, Arial, sans-serif; -ms-text-size-adjust: 100%; f=
+ont-weight: 500; background-color: #f2f5fa; border-bottom: 1p=
+x solid #999999; white-space: nowrap; padding: 8px; ">FR=
+OM</td>
+ <td style=3D" font-size: 12px; font-family: 'Segoe UI=
+', Frutiger, Arial, sans-serif; -ms-text-size-adjust: 100%; f=
+ont-weight: 500; background-color: #f2f5fa; border-bottom: 1p=
+x solid #999999; white-space: nowrap; padding: 8px; ">TO=
+</td>
+ <td style=3D" font-size: 12px; font-family: 'Segoe UI=
+', Frutiger, Arial, sans-serif; -ms-text-size-adjust: 100%; f=
+ont-weight: 500; background-color: #f2f5fa; border-bottom: 1p=
+x solid #999999; white-space: nowrap; padding: 8px; ">WI=
+TH</td>
+ <td style=3D" font-size: 12px; font-family: 'Segoe UI=
+', Frutiger, Arial, sans-serif; -ms-text-size-adjust: 100%; f=
+ont-weight: 500; background-color: #f2f5fa; border-bottom: 1p=
+x solid #999999; white-space: nowrap; padding: 8px; ">RE=
+LAY TIME</td>
+ </tr>
+ <tr>
+ <td style=3D" font-size: 12px; font-family: 'Segoe UI=
+', Frutiger, Arial, sans-serif; -ms-text-size-adjust: 100%; f=
+ont-weight: 500; border-bottom: 1px solid #999999; padding: 8=
+px; text-align: center; ">1</td>
+ <td style=3D" font-size: 12px; font-family: 'Segoe UI=
+', Frutiger, Arial, sans-serif; -ms-text-size-adjust: 100%; f=
+ont-weight: 500; border-bottom: 1px solid #999999; padding: 8=
+px; text-align: left; width: 80px; ">9/23/2026<br />9:15=
+:43 AM</td>
+ <td style=3D" font-size: 12px; font-family: 'Segoe UI=
+', Frutiger, Arial, sans-serif; -ms-text-size-adjust: 100%; f=
+ont-weight: 500; border-bottom: 1px solid #999999; padding: 8=
+px; text-align: left; ">substrate.office.com</td>
+ <td style=3D" font-size: 12px; font-family: 'Segoe UI=
+', Frutiger, Arial, sans-serif; -ms-text-size-adjust: 100%; f=
+ont-weight: 500; border-bottom: 1px solid #999999; padding: 8=
+px; text-align: left; ">LOVP265MB8674.GBRP265.PROD.OUTLOOK.COM<=
+/td>
+ <td style=3D" font-size: 12px; font-family: 'Segoe UI=
+', Frutiger, Arial, sans-serif; -ms-text-size-adjust: 100%; f=
+ont-weight: 500; border-bottom: 1px solid #999999; padding: 8=
+px; text-align: left; ">HTTP</td>
+ <td style=3D" font-size: 12px; font-family: 'Segoe UI=
+', Frutiger, Arial, sans-serif; -ms-text-size-adjust: 100%; f=
+ont-weight: 500; border-bottom: 1px solid #999999; padding: 8=
+px; text-align: left; ">7&nbsp;sec</td>
+ </tr>
+ </table>
+ <p style=3D" font-family: 'Segoe UI', Frutiger, Arial, sans-seri=
+f; -ms-text-size-adjust: 100%; font-size: 17px; font-w=
+eight: 500; padding-top: 4px; padding-bottom: 0; margi=
+n-top: 19px; margin-bottom: 5px; ">Original Message Headers</p>
+ <pre style=3D" color: gray; white-space: pre; padd=
+ing-top: 0; margin-top: 5px; ">
+Received: from substrate.office.com (2603:10a6:600:37c::19) by
+ LOVP265MB8674.GBRP265.PROD.OUTLOOK.COM with HTTP via
+ LO4P265CA0257.GBRP265.PROD.OUTLOOK.COM; Wed, 23 Sep 2026 09:15:43 +0000
+Message-ID: &lt;[email protected]&gt;
+Subject: Confirm your email address
+Date: Wed, 23 Sep 2026 10:15:36 +0100
+MIME-Version: 1.0
+X-Listmonk-Subscriber: a4eec08a-4c6e-4c49-ba0b-54bb2a96d768
+Content-Type: text/html; charset=3DUTF-8
+Content-Transfer-Encoding: quoted-printable
+Reply-To: Test &lt;[email protected]&gt;
+From: Test &lt;[email protected]&gt;
+Sender: Test &lt;[email protected]&gt;
+Return-Path: [email protected]
+
+</pre>
+ </body>
+</html>=
+
+--51e17011-43a1-412f-80ac-295ed1fba71e--
+
+--2502fa2e-2051-48e3-b87b-b04e02faddb4
+Content-Type: message/delivery-status
+
+Reporting-MTA: dns;LOVP265MB8674.GBRP265.PROD.OUTLOOK.COM
+Arrival-Date: Wed, 23 Sep 2026 09:15:43 +0000
+
+Final-Recipient: rfc822;[email protected]
+Action: failed
+Status: 5.7.1
+Diagnostic-Code: smtp;554 5.7.1 [CS01] Message rejected due to local policy. Please visit https://support.apple.com/en-us/HT204137. Txn ID 00000000-0000-0000-0000-000000000000
+Remote-MTA: dns;p00-iscream-smtp-7b95d6f6c9-64bmv
+
+
+--2502fa2e-2051-48e3-b87b-b04e02faddb4
+Content-Type: message/rfc822
+
+Received: from substrate.office.com (2603:10a6:600:37c::19) by
+ LOVP265MB8674.GBRP265.PROD.OUTLOOK.COM with HTTP via
+ LO4P265CA0257.GBRP265.PROD.OUTLOOK.COM; Wed, 23 Sep 2026 09:15:43 +0000
+Message-ID: <[email protected]>
+Subject: Confirm your email address
+Date: Wed, 23 Sep 2026 10:15:36 +0100
+MIME-Version: 1.0
+X-Listmonk-Subscriber: a4eec08a-4c6e-4c49-ba0b-54bb2a96d768
+Content-Type: text/html; charset=UTF-8
+Content-Transfer-Encoding: quoted-printable
+Reply-To: Test <[email protected]>
+From: Test <[email protected]>
+Sender: Test <[email protected]>
+Return-Path: [email protected]
+
+<!doctype html>
+<html>
+ <head>
+ <meta charset=3D"utf-8" />
+ <meta name=3D"viewport" content=3D"width=3Ddevice-width,initial-scale=
+=3D1,minimum-scale=3D1" />
+ </head>
+<body style=3D"background-color: #F0F1F3;">
+</body>
+</html>
+
+
+--2502fa2e-2051-48e3-b87b-b04e02faddb4--
diff --git a/internal/bounce/mailbox/testdata/dsn2.eml b/internal/bounce/mailbox/testdata/dsn2.eml
new file mode 100644
index 00000000..fea2d6e1
--- /dev/null
+++ b/internal/bounce/mailbox/testdata/dsn2.eml
@@ -0,0 +1,104 @@
+Return-Path: <>
+Delivered-To: [email protected]
+Received: from mail.example.com
+ by edu3 with LMTP id gMXBJZH21mE9RAAApul+Lg
+ for <[email protected]>; Thu, 06 Jan 2022 15:02:57 +0100
+Received: by mail.example.com (Postfix)
+ id 7B7811A086CF; Thu, 6 Jan 2022 15:02:57 +0100 (CET)
+Date: Thu, 6 Jan 2022 15:02:57 +0100 (CET)
+From: [email protected] (Mail Delivery System)
+Subject: Undelivered Mail Returned to Sender
+Auto-Submitted: auto-replied
+MIME-Version: 1.0
+Content-Type: multipart/report; report-type=delivery-status;
+ boundary="41FE61A09C01.1641477777/mail.example.com"
+Content-Transfer-Encoding: 8bit
+Message-Id: <[email protected]>
+
+This is a MIME-encapsulated message.
+
+--41FE61A09C01.1641477777/mail.example.com
+Content-Description: Notification
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 8bit
+
+This is the mail system at host mail.example.com.
+
+I'm sorry to have to inform you that your message could not
+be delivered to one or more recipients. It's attached below.
+
+For further assistance, please send mail to postmaster.
+
+If you do so, please include this problem report. You can
+delete your own text from the attached returned message.
+
+ The mail system
+
+<[email protected]>: Host or domain name not found. Name
+ service error for name=example.com type=A: Host not found
+
+--41FE61A09C01.1641477777/mail.example.com
+Content-Description: Delivery report
+Content-Type: message/global-delivery-status
+Content-Transfer-Encoding: 8bit
+
+Reporting-MTA: dns; mail.example.com
+X-Postfix-Queue-ID: 41FE61A09C01
+X-Postfix-Sender: rfc822; [email protected]
+Arrival-Date: Thu, 6 Jan 2022 15:02:57 +0100 (CET)
+
+Final-Recipient: rfc822; [email protected]
+Original-Recipient: rfc822;[email protected]
+Action: failed
+Status: 5.4.4
+Diagnostic-Code: X-Postfix; Host or domain name not found. Name service error
+ for name=example.com type=A: Host not found
+
+--41FE61A09C01.1641477777/mail.example.com
+Content-Description: Undelivered Message
+Content-Type: message/global
+Content-Transfer-Encoding: 8bit
+
+Return-Path: <[email protected]>
+Received: from localhost (localhost [127.0.0.1])
+ by mail.example.com (Postfix) with UTF8SMTP id 41FE61A09C01
+ for <[email protected]>; Thu, 6 Jan 2022 15:02:57 +0100 (CET)
+X-Virus-Scanned: Debian amavisd-new at mail.hers.hu
+Received: from mail.example.com ([127.0.0.1])
+ by localhost (mail.example.com [127.0.0.1]) (amavisd-new, port 10026)
+ with UTF8LMTP id P55Eyi_KKrPe for <[email protected]>;
+ Thu, 6 Jan 2022 15:02:57 +0100 (CET)
+Received: from localhost (mail.example.com [127.0.0.1])
+ (Authenticated sender: [email protected])
+ by mail.example.com (Postfix) with UTF8SMTPSA id AE0231A086CF
+ for <[email protected]>; Thu, 6 Jan 2022 15:02:56 +0100 (CET)
+Content-Type: text/html; charset=UTF-8
+Message-Id: <1641477776713090833.30240.5322564447204887968@edu3>
+X-Listmonk-Subscriber: a1c7a976-ad38-44f2-84de-55b0dc375352
+List-Unsubscribe-Post: List-Unsubscribe=One-Click
+List-Unsubscribe: <https://hirlevel.example.com/subscription/d9510e30-b4e7-4548-b75d-810cb2d03578/a1c7a976-ad38-44f2-84de-55b0dc375352>
+Content-Transfer-Encoding: quoted-printable
+Subject: =?UTF-8?q?Bojler_Elad=C3=B3!?=
+Date: Thu, 06 Jan 2022 15:02:56 +0100
+Mime-Version: 1.0
+X-Listmonk-Campaign: d9510e30-b4e7-4548-b75d-810cb2d03578
+
+<!doctype html>
+<html>
+ <head>
+ <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Du=
+tf-8">
+ <meta name=3D"viewport" content=3D"width=3Ddevice-width, initial-sc=
+ale=3D1, minimum-scale=3D1">
+ <base target=3D"_blank">
+ </head>
+<body style=3D"background-color: #F0F1F3;font-family: 'Helvetica Neue', 'Se=
+goe UI', Helvetica, sans-serif;font-size: 15px;line-height: 26px;margin: 0;=
+color: #444;">
+</body>
+</html>
+
+--41FE61A09C01.1641477777/mail.example.com--
diff --git a/internal/bounce/mailbox/testdata/dsn3.eml b/internal/bounce/mailbox/testdata/dsn3.eml
new file mode 100644
index 00000000..1e3165b4
--- /dev/null
+++ b/internal/bounce/mailbox/testdata/dsn3.eml
@@ -0,0 +1,105 @@
+Return-Path: <>
+Delivered-To: [email protected]
+Received: from mail.example.com
+ by edu3 with LMTP id aKKEEZH21mEnRAAApul+Lg
+ for <[email protected]>; Thu, 06 Jan 2022 15:02:57 +0100
+Received: by mail.example.com (Postfix)
+ id 37DFB1A084BB; Thu, 6 Jan 2022 15:02:57 +0100 (CET)
+Date: Thu, 6 Jan 2022 15:02:57 +0100 (CET)
+From: [email protected] (Mail Delivery System)
+Subject: Undelivered Mail Returned to Sender
+Auto-Submitted: auto-replied
+MIME-Version: 1.0
+Content-Type: multipart/report; report-type=delivery-status;
+ boundary="00E2B1A094C3.1641477777/mail.example.com"
+Content-Transfer-Encoding: 8bit
+Message-Id: <[email protected]>
+
+This is a MIME-encapsulated message.
+
+--00E2B1A094C3.1641477777/mail.example.com
+Content-Description: Notification
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 8bit
+
+This is the mail system at host mail.example.com.
+
+I'm sorry to have to inform you that your message could not
+be delivered to one or more recipients. It's attached below.
+
+For further assistance, please send mail to postmaster.
+
+If you do so, please include this problem report. You can
+delete your own text from the attached returned message.
+
+ The mail system
+
+<[email protected]>: Host or domain name not found. Name
+ service error for name=example.com type=A: Host not found
+
+--00E2B1A094C3.1641477777/mail.example.com
+Content-Description: Delivery report
+Content-Type: message/global-delivery-status
+Content-Transfer-Encoding: 8bit
+
+Reporting-MTA: dns; mail.example.com
+X-Postfix-Queue-ID: 00E2B1A094C3
+X-Postfix-Sender: rfc822; [email protected]
+Arrival-Date: Thu, 6 Jan 2022 15:02:57 +0100 (CET)
+
+Final-Recipient: rfc822; [email protected]
+Original-Recipient: rfc822;[email protected]
+Action: failed
+Status: 5.4.4
+Diagnostic-Code: X-Postfix; Host or domain name not found. Name service error
+ for name=example.com type=A: Host not found
+
+--00E2B1A094C3.1641477777/mail.example.com
+Content-Description: Undelivered Message
+Content-Type: message/global
+Content-Transfer-Encoding: 8bit
+
+Return-Path: <[email protected]>
+Received: from localhost (localhost [127.0.0.1])
+ by mail.example.com (Postfix) with UTF8SMTP id 00E2B1A094C3
+ for <[email protected]>; Thu, 6 Jan 2022 15:02:57 +0100 (CET)
+X-Virus-Scanned: Debian amavisd-new at mail.example.com
+Received: from mail.example.com ([127.0.0.1])
+ by localhost (mail.example.com [127.0.0.1]) (amavisd-new, port 10026)
+ with UTF8LMTP id mbyVwqnv5y7G
+ Thu, 6 Jan 2022 15:02:56 +0100 (CET)
+Received: from localhost (mail.example.com [127.0.0.1])
+ (Authenticated sender: [email protected])
+ by mail.example.com (Postfix) with UTF8SMTPSA id 8FA301A036EA
+ for <[email protected]>; Thu, 6 Jan 2022 15:02:56 +0100 (CET)
+Subject: =?UTF-8?q?Bojler_Elad=C3=B3!?=
+Date: Thu, 06 Jan 2022 15:02:56 +0100
+Mime-Version: 1.0
+List-Unsubscribe-Post: List-Unsubscribe=One-Click
+X-Listmonk-Campaign: d9510e30-b4e7-4548-b75d-810cb2d03578
+X-Listmonk-Subscriber: f43f40bf-bcbd-4bd0-b793-2aa9b9a6961d
+List-Unsubscribe: <https://hirlevel.example.com/subscription/d9510e30-b4e7-4548-b75d-810cb2d03578/f43f40bf-bcbd-4bd0-b793-2aa9b9a6961d>
+Content-Type: text/html; charset=UTF-8
+Content-Transfer-Encoding: quoted-printable
+Message-Id: <1641477776588637040.30240.3828675836904473490@edu3>
+
+<!doctype html>
+<html>
+ <head>
+ <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Du=
+tf-8">
+ <meta name=3D"viewport" content=3D"width=3Ddevice-width, initial-sc=
+ale=3D1, minimum-scale=3D1">
+ <base target=3D"_blank">
+ </head>
+<body style=3D"background-color: #F0F1F3;font-family: 'Helvetica Neue', 'Se=
+goe UI', Helvetica, sans-serif;font-size: 15px;line-height: 26px;margin: 0;=
+color: #444;">
+</body>
+</html>
+
+--00E2B1A094C3.1641477777/mail.example.com--
diff --git a/internal/bounce/mailbox/testdata/dsn4.eml b/internal/bounce/mailbox/testdata/dsn4.eml
new file mode 100644
index 00000000..45f116cc
--- /dev/null
+++ b/internal/bounce/mailbox/testdata/dsn4.eml
@@ -0,0 +1,61 @@
+Return-Path: <>
+Received: from mail.example.com (mail.example.com [10.1.2.101])
+ by mailstore.example.com with LMTPA;
+ Wed, 29 Sep 2021 08:20:33 +0000
+Date: Wed, 29 Sep 2021 08:20:34 GMT
+From: Mail Delivery Subsystem <[email protected]>
+Message-Id: <[email protected]>
+MIME-Version: 1.0
+Content-Type: multipart/report; report-type=delivery-status;
+ boundary="18T8KYXY004619.1632903634/mail.example.com"
+Subject: Returned mail: see transcript for details
+Auto-Submitted: auto-generated (failure)
+
+This is a MIME-encapsulated message
+
+--18T8KYXY004619.1632903634/mail.example.com
+
+The original message was received at Wed, 29 Sep 2021 08:20:33 GMT
+from mail.example.com [10.1.2.101]
+
+* Sendmail is experiencing difficulty in delivering your message.
+
+ ----- The following addresses had permanent fatal errors -----
+ (reason: 550 Host unknown)
+
+ ----- Transcript of session follows -----
+550 5.1.2 <[email protected]>... Host unknown (Name server: example.ch.
+: host not found)
+
+--18T8KYXY004619.1632903634/mail.example.com
+Content-Type: message/delivery-status
+
+Reporting-MTA: dns; mail.example.com
+Received-From-MTA: DNS; mail.example.com
+Arrival-Date: Wed, 29 Sep 2021 08:20:33 GMT
+
+Final-Recipient: RFC822; [email protected]
+Action: failed
+Status: 5.1.2
+Remote-MTA: DNS; example.ch
+Diagnostic-Code: SMTP; 550 Host unknown
+Last-Attempt-Date: Wed, 29 Sep 2021 08:20:34 GMT
+
+--18T8KYXY004619.1632903634/mail.example.com
+Content-Type: text/rfc822-headers
+
+Return-Path: <[email protected]>
+Received: from mail.example.com (mail.example.com [10.1.2.101])
+ by mail.example.com with ESMTP id 18T8KXXY004617
+ for <[email protected]>; Wed, 29 Sep 2021 08:20:33 GMT
+X-Listmonk-Subscriber: 73d11b6b-3da2-47d5-9dd6-7b3c96a8e15b
+Message-Id: <1632903633748563659.927.5595426720521411472@examplece>
+Mime-Version: 1.0
+From: "Test Test" <[email protected]>
+Date: Wed, 29 Sep 2021 08:20:33 +0000
+X-Listmonk-Campaign: 730438ad-a86a-424d-8604-288f6f6f1831
+List-Unsubscribe-Post: List-Unsubscribe=One-Click
+
+--18T8KYXY004619.1632903634/mail.example.com--
\ No newline at end of file
diff --git a/internal/bounce/mailbox/testdata/dsn5.eml b/internal/bounce/mailbox/testdata/dsn5.eml
new file mode 100644
index 00000000..1aca963a
--- /dev/null
+++ b/internal/bounce/mailbox/testdata/dsn5.eml
@@ -0,0 +1,61 @@
+Subject: mail delivery failed
+Message-Id: <[email protected]>
+References: <[email protected]>
+Date: 30 Sep 2026 15:03:07 +0000
+MIME-Version: 1.0
+Content-Type: multipart/report; report-type="delivery-status"; boundary="43d715581a33a00c5a9126d941ca57b30657bfbf2777f83dd5082fc15f24"
+
+--43d715581a33a00c5a9126d941ca57b30657bfbf2777f83dd5082fc15f24
+Content-Transfer-Encoding: 7BIT
+Content-Type: text/plain
+
+
+Delivery has failed permanently for your email to:
+
+
+No further deliveries will be attempted.
+
+Error during the last delivery attempt:
+
+ remote smtp server sent unexpected response status code: got 554, expected 2xx, permanent: 554 5.7.1 [CS01] Message rejected due to local policy. Please visit https://support.apple.com/en-us/HT204137. Txn ID 00000000-0000-0000-0000-000000000000
+
+Full SMTP response:
+
+ 554 5.7.1 [CS01] Message rejected due to local policy. Please visit https://support.apple.com/en-us/HT204137. Txn ID 00000000-0000-0000-0000-000000000000
+
+--43d715581a33a00c5a9126d941ca57b30657bfbf2777f83dd5082fc15f24
+Content-Transfer-Encoding: 7BIT
+Content-Type: message/delivery-status
+
+Reporting-MTA: dns; list.example.com
+Arrival-Date: 30 Sep 2026 15:02:58 +0000
+
+Final-Recipient: rfc822;[email protected]
+Action: failed
+Status: 5.7.1 (remote smtp server sent unexpected response status code: got 554, expected 2xx, permanent: 554 5.7.1 [CS01] Message rejected due to local policy. Please visit https://support.apple.com/en-us/HT204137. Txn ID 00000000-0000-0000-0000-000000000000)
+Remote-MTA: dns;mx01.mail.icloud.com
+Diagnostic-Code: smtp; 554 5.7.1 [CS01] Message rejected due to local policy. Please visit https://support.apple.com/en-us/HT204137. Txn ID 00000000-0000-0000-0000-000000000000
+Last-Attempt-Date: 30 Sep 2026 15:02:58 +0000
+
+--43d715581a33a00c5a9126d941ca57b30657bfbf2777f83dd5082fc15f24
+Content-Transfer-Encoding: 7BIT
+Content-Type: text/rfc822-headers
+
+Received: from list.example.com by
+ list.example.com ([172.30.0.3]) via tcp with ESMTPSA id
+ flM-mvBoUb3HgCXYACQp7w (TLS1.3 TLS_AES_128_GCM_SHA256) for
+ <[email protected]>; 30 Sep 2026 15:02:58 +0000
+Message-Id: <[email protected]>
+Subject: Confirm your email address
+From: "Test" <[email protected]>
+Date: Wed, 30 Sep 2026 16:02:58 +0100
+Mime-Version: 1.0
+X-Listmonk-Subscriber: a4eec08a-4c6e-4c49-ba0b-54bb2a96d768
+Content-Type: multipart/alternative;
+ boundary=ddbb07ef3c669acf960d7710113df3a8b954aac6756beb62ccc8d1982639
+
+--43d715581a33a00c5a9126d941ca57b30657bfbf2777f83dd5082fc15f24--
diff --git a/internal/bounce/mailbox/testdata/dsn6.eml b/internal/bounce/mailbox/testdata/dsn6.eml
new file mode 100644
index 00000000..63d94d31
--- /dev/null
+++ b/internal/bounce/mailbox/testdata/dsn6.eml
@@ -0,0 +1,39 @@
+Subject: mail delivery failed
+Message-Id: <[email protected]>
+References: <[email protected]>
+Date: 30 Sep 2026 15:03:07 +0000
+MIME-Version: 1.0
+Content-Type: multipart/report; report-type="delivery-status"; boundary="43d715581a33a00c5a9126d941ca57b30657bfbf2777f83dd5082fc15f24"
+
+--43d715581a33a00c5a9126d941ca57b30657bfbf2777f83dd5082fc15f24
+Content-Transfer-Encoding: 7BIT
+Content-Type: text/plain
+
+
+Delivery has failed permanently for your email to:
+
+
+No further deliveries will be attempted.
+
+Error during the last delivery attempt:
+
+ remote smtp server sent unexpected response status code: got 554, expected 2xx, permanent: 554 5.7.1
+
+--43d715581a33a00c5a9126d941ca57b30657bfbf2777f83dd5082fc15f24
+Content-Transfer-Encoding: 7BIT
+Content-Type: message/delivery-status
+
+Reporting-MTA: dns; list.example.com
+Arrival-Date: 30 Sep 2026 15:02:58 +0000
+
+Final-Recipient: rfc822;[email protected]
+Action: failed
+Status: 5.7.1
+Remote-MTA: dns;mx01.mail.icloud.com
+Diagnostic-Code: smtp; 554 5.7.1
+Last-Attempt-Date: 30 Sep 2026 15:02:58 +0000
+
+--43d715581a33a00c5a9126d941ca57b30657bfbf2777f83dd5082fc15f24--
diff --git a/internal/bounce/mailbox/testdata/dsn7.eml b/internal/bounce/mailbox/testdata/dsn7.eml
new file mode 100644
index 00000000..03d56021
--- /dev/null
+++ b/internal/bounce/mailbox/testdata/dsn7.eml
@@ -0,0 +1,94 @@
+Return-Path: <>
+Authentication-Results: example.com;
+ iprev=pass (without dnssec) policy.iprev=23.249.218.244;
+ dkim=pass (1024 bit rsa, without dnssec) header.d=amazonses.com
+ header.s=smjs5bczbyxi6u2ua6eveuxqal7joyry header.a=rsa-sha256
+ header.b=jcnua0Ew7lKA;
+ spf=pass (without dnssec)
+ smtp.helo=d218-244.smtp-out.eu-west-2.amazonses.com;
+ dmarc=pass (without dnssec) header.from=eu-west-2.amazonses.com
+Received-SPF: pass
+ (domain d218-244.smtp-out.eu-west-2.amazonses.com, from ehlo because mailfrom is empty)
+ client-ip=23.249.218.244;
+ envelope-from="[email protected]";
+ helo=d218-244.smtp-out.eu-west-2.amazonses.com;
+ mechanism="ip4:23.249.218.244"; receiver=example.com;
+ identity=helo
+Received: from d218-244.smtp-out.eu-west-2.amazonses.com ([23.249.218.244])
+ by example.com ([172.30.0.3]) via tcp with ESMTPS id
+ LMjE7k0fPNNIp8bKR04uZA (TLS1.3 TLS_AES_128_GCM_SHA256) for
+ <[email protected]>; 5 Oct 2026 11:31:51 +0000
+DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple;
+ s=smjs5bczbyxi6u2ua6eveuxqal7joyry; d=amazonses.com; t=1791199910;
+ h=Date:From:To:Message-ID:Subject:MIME-Version:Content-Type:Feedback-ID;
+ bh=tWrXq4sfQ4tvNLlX3ifr8mUDBdiUYESKoy4JsCizWmo=;
+ b=jcnua0Ew7lKAs6HmM9v4ocZAWwBGw5Id0ewdi4L2YIKpaW40igsLdZ8cs+YHUtju
+ tnu/1nID0MELXg4aC3+edPQbQaOqlPnVMnzpWnQ53/JlMQTJKk5oNdmk6MWktZOhSdN
+ /eKaWB80VcFysftBGvydcCJqlGFGzW1l4SZXZb+U=
+Date: Mon, 5 Oct 2026 11:31:50 +0000
+To: Test Bounces <[email protected]>
+Message-ID: <010b01a10bd59ab4-0816c2f1-77d0-41a1-8edb-92df76e92a3b-000000@eu-west-2.amazonses.com>
+Subject: Delivery Status Notification (Failure)
+MIME-Version: 1.0
+Content-Type: multipart/report;
+ boundary="----=_Part_94187_1779699454.1791199910604";
+ report-type=delivery-status
+Feedback-ID: ::1.eu-west-2.xt7WMhTko9T30pmfpYXYpWY4KSstOlp/P5M0f0u9GXk=:AmazonSES
+X-SES-Outgoing: 2026.10.05-23.249.218.244
+
+------=_Part_94187_1779699454.1791199910604
+Content-Type: text/plain; charset=us-ascii
+Content-Transfer-Encoding: 7bit
+Content-Description: Notification
+
+An error occurred while trying to deliver the mail to the following recipients:
+------=_Part_94187_1779699454.1791199910604
+Content-Type: message/delivery-status
+Content-Transfer-Encoding: 7bit
+Content-Description: Delivery Status Notification
+
+Reporting-MTA: dns; d218-15.smtp-out.eu-west-2.amazonses.com
+
+Action: failed
+Final-Recipient: rfc822; [email protected]
+Diagnostic-Code: smtp; 550 5.1.1 As requested: user unknown <[email protected]>
+Status: 5.1.1
+
+
+------=_Part_94187_1779699454.1791199910604
+Content-Type: message/rfc822
+Content-Description: Undelivered Message
+
+Subject: Test Message
+Message-Id: <010b01a10bd5988a-600e3591-2708-4a3c-8c35-f0825c9ab130-000000@eu-west-2.amazonses.com>
+From: Test Bounces <[email protected]>
+Date: Mon, 5 Oct 2026 11:31:50 +0000
+Mime-Version: 1.0
+Content-Type: text/html; charset=UTF-8
+Content-Transfer-Encoding: quoted-printable
+Feedback-ID: ::1.eu-west-2.p+G9B50gElGkmucCAKrfW47y8iCzC7R4mmrpa1ptpJ8=:AmazonSES
+DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple;
+ s=smjs5bczbyxi6u2ua6eveuxqal7joyry; d=amazonses.com; t=1791199910;
+ h=Subject:Message-Id:From:Date:Mime-Version:Content-Type:Content-Transfer-Encoding:To:Feedback-ID;
+ bh=W/mwWYwHzZM9xtNLiz/77cOwHrHY1eMyX3qhZdPQiuw=;
+ b=XvTVJeEHM+c1HY3Vlip8adyxTI2lFvnKPRyecrnfVAcBu3Ne2QTQQmJfMHqDEoj+
+ UbV/ZQbA7wBUWuqFVrCscIrVCIHLHSRcKN50iFXOzxdA+yqB+9PBqrEf9s/1sNcEwsD
+ /FlHP2N949Q9lN7MjXzLoDBkqUeJDt+hqxxy07d4=
+
+<!doctype html>
+<html>
+ <head>
+ <meta charset=3D"utf-8" />
+ <meta
+ name=3D"viewport"
+ content=3D"width=3Ddevice-width,initial-scale=3D1,minimum-scale=3D1"
+ />
+ <base target=3D"_blank" />
+ </head>
+ <body>
+ </body>
+</html>
+------=_Part_94187_1779699454.1791199910604--
\ No newline at end of file
diff --git a/internal/bounce/mailbox/testdata/dsn8.eml b/internal/bounce/mailbox/testdata/dsn8.eml
new file mode 100644
index 00000000..bd5a879f
--- /dev/null
+++ b/internal/bounce/mailbox/testdata/dsn8.eml
@@ -0,0 +1,682 @@
+Return-Path: <>
+Received: from CWXP265CU008.outbound.protection.outlook.com (mail-ukwestazhn15010017.outbound.protection.outlook.com [52.102.166.17])
+ (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
+ key-exchange ECDHE (secp384r1) server-signature RSA-PSS (2048 bits) server-digest SHA256)
+ (No client certificate requested)
+ by example.com (Postfix) with ESMTPS id 9CE88150020C
+ for <[email protected]>; Wed, 23 Sep 2026 05:15:54 -0400 (EDT)
+MIME-Version: 1.0
+Date: Wed, 23 Sep 2026 09:15:51 +0000
+Content-Type: multipart/alternative; differences=Content-Type;
+ boundary="51e17011-43a1-412f-80ac-295ed1fba71e"
+Content-Language: en-US
+Message-ID:
+ <b40e34f0-9c1a-42bb-a9fd-f6e0ef0521be@LOVP265MB8674.GBRP265.PROD.OUTLOOK.COM>
+In-Reply-To: <[email protected]>
+References: <[email protected]>
+Subject: Undeliverable: Confirm your email address
+Auto-Submitted: auto-replied
+
+--51e17011-43a1-412f-80ac-295ed1fba71e
+Content-Type: text/plain; charset="us-ascii"
+Content-Transfer-Encoding: quoted-printable
+
+[https://products.office.com/en-us/CMSImages/Office365Logo_Orange.png]
+Your message to [email protected] couldn't be delivered.
+Security or policy settings at icloud.com have rejected your message.
+hello Office 365 icloud.com
+Sender Action Required
+Security or policy violation
+
+How to Fix It
+The recipient's email server won't accept your message because it appears t=
+o violate their security or policy settings. Check the Reported error below=
+ to see if you can determine why it was blocked. Then try one or more of th=
+e following:
+
+ * If the error mentions SPF, DKIM, or DMARC issues, forward this messag=
+e to your email admin for assistance.
+ * The recipient's email server might suspect that your message is spam.=
+ Follow the guidance in this article: E-mailing Best Practices for Senders<=
+https://aka.ms/EmailingBestPractices>. Then resend your message.
+ * If the error suggests your message is too large, try to reduce the si=
+ze of your attachment. If that isn't possible, place the file on a publicly=
+ accessible cloud storage location, like OneDrive. Then add a link to the f=
+ile in your message, and resend the message.
+ * Contact the recipient (by phone, for example) and tell them to ask th=
+eir email admin to add you or your email domain to their allowed senders li=
+st.
+
+If the problem continues, forward this message to your email admin. If you'=
+re an email admin, refer to the More Info for Email Admins section below.
+
+Was this helpful? Send feedback to Microsoft<https://go.microsoft.com/fwlin=
+k/?LinkId=3D525928>.
+________________________________
+
+More Info for Email Admins
+Status code: 550 5.7.1
+
+This error occurs when the recipient's domain has security or policy settin=
+gs that reject the sender's message. However, we were unable to determine t=
+he specific setting that's causing this rejection. Usually the error is rep=
+orted by an email server outside of Office 365. Common issues include the f=
+ollowing: the receiving server suspects the message is malicious or spam; t=
+he Sender Policy Framework (SPF) record for example.com is incorrectly c=
+onfigured or doesn't exist; or the message includes an attachment larger th=
+an the receiving server will accept. Try one or more of the following:
+
+Review the reported error - Check the Reported error shown below to help de=
+termine what the issue might be. For example, if the issue is related to an=
+ SPF failure, the reported error will usually include the acronym "SPF" or =
+the phrase "Sender Policy Framework."
+
+Correctly configure your SPF records - If you're the sender's email admin, =
+make sure your domain's SPF records at your domain registrar are properly c=
+onfigured. Office 365 supports only one SPF record (a TXT record that defin=
+es SPF) for your domain. Include the following domain name: spf.protection.=
+outlook.com. If you have a hybrid configuration (some mailboxes in the clou=
+d and some mailboxes on premises) or if you're an Exchange Online Protectio=
+n standalone customer, add the outbound IP address of your on-premises serv=
+ers to the TXT record. To learn how, see Customize an SPF record to validat=
+e outbound email sent from your domain<https://technet.microsoft.com/librar=
+y/dn789058(v=3Dexchg.150).aspx> and External Domain Name System records for=
+ Office 365<https://support.office.com/article/External-Domain-Name-System-=
+records-for-Office-365-c0531a6f-9e25-4f2d-ad0e-a70bfef09ac0#BKMK_SPFrecords=
+>.
+
+Unable to relay - If the Reported error indicates a problem with relaying (=
+e.g. "unable to relay"), then the email server that reported the error like=
+ly isn't set up correctly to receive and relay messages from the sender's d=
+omain. This server will usually be one of your on-premises servers in a hyb=
+rid environment, a smart host email service that you're trying to route mes=
+sages through, or possibly even an email hosting service you used in the pa=
+st yet still have mail flow settings pointing to (e.g. your MX record at yo=
+ur domain registrar still points to your previous email service provider). =
+Check Error reported by shown below to determine what domain, service, or s=
+erver is reporting the error. The email server needs to be configured to ei=
+ther accept messages from anonymous users or to include the sending domain =
+or IP in its list of authenticated senders. On an Exchange server, you can =
+set this up in the server's receive connector. If it's a smart host managed=
+ by another service or partner, contact the service or partner to configure=
+ their servers to accept and relay messages from your senders. Also, work w=
+ith your domain registrar to make sure your MX records are properly configu=
+red.
+
+Contact the recipient's email admin - For some scenarios, you can fix the i=
+ssue by contacting the email admin at the recipient domain to ask them to a=
+dd the sender's email address or your domain to their allowed senders list,=
+ or to relax the setting that's causing the rejection.
+
+For more information and tips for fixing this issue, see Fix email delivery=
+ issues for error code 5.7.1 in Office 365<https://go.microsoft.com/fwlink/=
+?LinkId=3D389365>.
+
+Original Message Details
+Created Date: 9/23/2026 9:15:36 AM
+Sender Address: [email protected]
+Recipient Address: [email protected]
+Subject: Confirm your email address
+
+Error Details
+Error: 554 5.7.1 [CS01] Message rejected due to local policy. Please visit=
+ https://support.apple.com/en-us/HT204137. Txn ID 00000000-0000-0000-0000-b=
+00000000000
+Message rejected by: p00-iscream-smtp-7b95d6f6c9-64bmv
+
+Notification Details
+Sent by: LOVP265MB8674.GBRP265.PROD.OUTLOOK.COM
+
+Message Hops
+HOP TIME (UTC) FROM TO WITH RELAY TIME
+1 9/23/2026
+9:15:43 AM substrate.office.com LOVP265MB8674.GBRP265.PROD.OUTLOOK.=
+COM HTTP 7 sec
+
+Original Message Headers
+
+Received: from substrate.office.com (2603:10a6:600:37c::19) by
+ LOVP265MB8674.GBRP265.PROD.OUTLOOK.COM with HTTP via
+ LO4P265CA0257.GBRP265.PROD.OUTLOOK.COM; Wed, 23 Sep 2026 09:15:43 +0000
+Message-ID: <[email protected]>
+Subject: Confirm your email address
+Date: Wed, 23 Sep 2026 10:15:36 +0100
+MIME-Version: 1.0
+X-Listmonk-Subscriber: a4eec08a-4c6e-4c49-ba0b-54bb2a96d768
+Content-Type: text/html; charset=3DUTF-8
+Content-Transfer-Encoding: quoted-printable
+Reply-To: Test <[email protected]>
+From: Test <[email protected]>
+Sender: Test <[email protected]>
+Return-Path: [email protected]
+
+
+--51e17011-43a1-412f-80ac-295ed1fba71e
+Content-Type: text/html; charset="us-ascii"
+Content-Transfer-Encoding: quoted-printable
+
+<html>
+ <meta name=3D"viewport" content=3D"width=3Ddevice-width, initial-scale=3D=
+1" />
+ <head>
+ <title>
+ DSN
+ </title>
+ </head>
+ <body style=3D" background-color: white; ">
+ <table style=3D" background-color: white; max-width: 548=
+px; color: black; border-spacing: 0px 0px; padding-=
+top: 0px; padding-bottom: 0px; border-collapse: collapse; =
+ " width=3D"548" cellspacing=3D"0" cellpadding=3D"0">
+ <tbody>
+ <tr>
+ <td style=3D" text-align: left; padding-bottom: 20p=
+x; ">
+ <img height=3D"28" width=3D"126" style=3D" max-width: 10=
+0%; " src=3D"https://products.office.com/en-us/CMSImages/Office365Logo=
+_Orange.png" />
+ </td>
+ </tr>
+ <tr>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, Arial, sa=
+ns-serif; font-size: 16px; padding-bottom: 10px; -ms=
+-text-size-adjust: 100%; text-align: left; ">Your message to <s=
+pan style=3D" color: #0072c6; ">[email protected]</span> co=
+uldn't be delivered.<br /></td>
+ </tr>
+ <tr>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, Arial, sa=
+ns-serif; font-size: 24px; padding-top: 0px; paddin=
+g-bottom: 20px; text-align: center; -ms-text-size-adjust: 1=
+00%; ">Security or policy settings at <span style=3D" color: #0=
+072c6; ">icloud.com</span> have rejected your message.<br /></td>
+ </tr>
+ <tr>
+ <td style=3D" padding-bottom: 15px; padding-left: =
+0px; padding-right: 0px; border-spacing: 0px 0px; ">
+ <table style=3D" max-width: 548px; font-weight: =
+600; border-spacing: 0px 0px; padding-top: 0px; padd=
+ing-bottom: 0px; border-collapse: collapse; ">
+ <tbody>
+ <tr>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; font-size: 15px; font-weight: 600; t=
+ext-align: left; width: 181px; -ms-text-size-adjust: 100%; =
+ vertical-align: bottom; ">
+ <font color=3D"#ffffff">
+ <span style=3D"color:#000000">hello</span>
+ </font>
+ </td>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; font-size: 15px; font-weight: 600; t=
+ext-align: center; width: 186px; -ms-text-size-adjust: 100%; =
+ vertical-align: bottom; ">
+ <font color=3D"#ffffff">
+ <span style=3D"color:#000000">Office 365</span>
+ </font>
+ </td>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; -ms-text-size-adjust: 100%; font-size: 15=
+px; font-weight: 600; text-align: right; width: 181p=
+x; vertical-align: bottom; ">
+ <font color=3D"#ffffff">
+ <span style=3D"color:#000000">icloud.com</span>
+ </font>
+ </td>
+ </tr>
+ <tr>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; -ms-text-size-adjust: 100%; font-size: 14px=
+; font-weight: 400; text-align: left; padding-top: 0px=
+; padding-bottom: 0px; vertical-align: middle; width: =
+181px; ">
+ <font color=3D"#ffffff">
+ <span style=3D"color:#000000">Sender</span>
+ </font>
+ </td>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; -ms-text-size-adjust: 100%; font-size: 14px=
+; font-weight: 400; text-align: center; padding-top: 0=
+px; padding-bottom: 0px; vertical-align: middle; width=
+: 186px; " />
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; -ms-text-size-adjust: 100%; font-size: 14px=
+; font-weight: 400; text-align: right; padding-top: 0p=
+x; padding-bottom: 0px; vertical-align: middle; width:=
+ 181px; ">
+ <font color=3D"#ffffff">
+ <span style=3D" color: #c00000; ">
+ <b>Action Required</b>
+ </span>
+ </font>
+ </td>
+ </tr>
+ <tr>
+ <td colspan=3D"3" style=3D" padding-top:0; =
+padding-bottom:0; padding-left:0; padding-right:0 ">
+ <table cellspacing=3D"0" cellpadding=3D"0" style=3D" =
+ border-spacing: 0px 0px; padding-top: 0px; padding-botto=
+m: 0px; padding-left: 0px; padding-right: 0px; border-=
+collapse: collapse; ">
+ <tbody>
+ <tr height=3D"10">
+ <td width=3D"180" height=3D"10" bgcolor=3D"#ccccc=
+c" style=3D" width: 180px; line-height: 10px; height: =
+10px; font-size: 6px; padding-top: 0; padding-bottom: =
+0; padding-left: 0; padding-right: 0; "><!--[if gte mso =
+15]>&nbsp;<![endif]--></td>
+ <td width=3D"4" height=3D"10" bgcolor=3D"#ffffff"=
+ style=3D" width: 4px; line-height: 10px; height: 10px=
+; font-size: 6px; padding-top: 0; padding-bottom: 0; =
+ padding-left: 0; padding-right: 0; "><!--[if gte mso 15]>=
+&nbsp;<![endif]--></td>
+ <td width=3D"180" height=3D"10" bgcolor=3D"#ccccc=
+c" style=3D" width: 180px; line-height: 10px; height: =
+10px; font-size: 6px; padding-top: 0; padding-bottom: =
+0; padding-left: 0; padding-right: 0; "><!--[if gte mso =
+15]>&nbsp;<![endif]--></td>
+ <td width=3D"4" height=3D"10" bgcolor=3D"#ffffff"=
+ style=3D" width: 4px; line-height: 10px; height: 10px=
+; font-size: 6px; padding-top: 0; padding-bottom: 0; =
+ padding-left: 0; padding-right: 0; "><!--[if gte mso 15]>=
+&nbsp;<![endif]--></td>
+ <td width=3D"180" height=3D"10" bgcolor=3D"#c0000=
+0" style=3D" width: 180px; line-height: 10px; height: =
+10px; font-size: 6px; padding-top: 0; padding-bottom: =
+0; padding-left: 0; padding-right: 0; "><!--[if gte mso =
+15]>&nbsp;<![endif]--></td>
+ </tr>
+ </tbody>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; -ms-text-size-adjust: 100%; font-size: 14px=
+; text-align: left; width: 181px; line-height: 20px; =
+ font-weight: 400; padding-top: 0px; padding-left: 0px; =
+ padding-right: 0px; padding-bottom: 0px; " />
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; -ms-text-size-adjust: 100%; font-size: 14px=
+; text-align: center; width: 186px; line-height: 20px;=
+ font-weight: 400; padding-top: 0px; padding-left: 0px=
+; padding-right: 0px; padding-bottom: 0px; " />
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; -ms-text-size-adjust: 100%; font-size: 14px=
+; text-align: right; width: 181px; line-height: 20px; =
+ font-weight: 400; padding-top: 0px; padding-left: 0px;=
+ padding-right: 0px; padding-bottom: 0px; ">
+ <font color=3D"#ffffff">
+ <span style=3D" color: #c00000; ">Securit=
+y or policy violation</span>
+ </font>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td style=3D" width: 100%; padding-top: 0px; =
+ padding-right: 10px; padding-left: 10px; ">
+ <br />
+ <table style=3D" width: 100%; padding-right: 0px;=
+ padding-left: 0px; padding-top: 0px; padding-bottom: =
+0px; background-color: #f2f5fa; margin-left: 0px; ">
+ <tbody>
+ <tr>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; -ms-text-size-adjust: 100%; font-size: 21px=
+; font-weight: 500; background-color: #f2f5fa; padding=
+-top: 0px; padding-bottom: 0px; padding-left: 10px; pa=
+dding-right: 10px; ">How to Fix It</td>
+ </tr>
+ <tr>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; -ms-text-size-adjust: 100%; font-size: 16px=
+; font-weight: 400; padding-top: 0px; padding-bottom: =
+6px; padding-left: 10px; padding-right: 10px; backgrou=
+nd-color: #f2f5fa; ">The recipient's email server won't accept your me=
+ssage because it appears to violate their security or policy settings. Chec=
+k the <b>Reported error</b> below to see if you can determine why it was bl=
+ocked. Then try one or more of the following:</td>
+ </tr>
+ <tr>
+ <td style=3D" padding-top: 0px; padding-b=
+ottom: 0px; padding-left: 0px; padding-right: 0px; b=
+order-spacing: 0px 0px; ">
+ <ul style=3D" font-family: 'Segoe UI', Frutiger,=
+ Arial, sans-serif; -ms-text-size-adjust: 100%; font-size: 16=
+px; font-weight: 400; margin-left: 40px; margin-bottom=
+: 5px; background-color: #f2f5fa; padding-top: 0px; pa=
+dding-bottom: 0px; padding-left: 6px; padding-right: 6px; =
+ ">
+ <li>If the error mentions SPF, DKIM, or DMARC issues,=
+ forward this message to your email admin for assistance.</li>
+ <li>The recipient's email server might suspect that y=
+our message is spam. Follow the guidance in this article: <a href=3D"https:=
+//aka.ms/EmailingBestPractices">E-mailing Best Practices for Senders</a>. T=
+hen resend your message.</li>
+ <li>If the error suggests your message is too large, =
+try to reduce the size of your attachment. If that isn't possible, place th=
+e file on a publicly accessible cloud storage location, like OneDrive. Then=
+ add a link to the file in your message, and resend the message.</li>
+ <li>Contact the recipient (by phone, for example) and=
+ tell them to ask their email admin to add you or your email domain to thei=
+r allowed senders list.</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; -ms-text-size-adjust: 100%; font-size: 16px=
+; font-weight: 400; padding-top: 0px; padding-bottom: =
+6px; padding-left: 10px; padding-right: 10px; backgrou=
+nd-color: #f2f5fa; ">If the problem continues, forward this message to=
+ your email admin. If you're an email admin, refer to the <b>More Info for =
+Email Admins</b> section below.</td>
+ </tr>
+ </tbody>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, Arial, sa=
+ns-serif; -ms-text-size-adjust: 100%; font-size: 14px; =
+ font-weight: 400; padding-top: 10px; padding-bottom: 0px; =
+ padding-bottom: 4px; ">
+ <br />
+ <em>Was this helpful? <a href=3D"https://go.microsoft.com/fwlin=
+k/?LinkId=3D525928">Send feedback to Microsoft</a>.</em>
+ </td>
+ </tr>
+ <tr>
+ <td style=3D" -ms-text-size-adjust: 100%; font-size=
+: 0px; line-height: 0px; padding-top: 0px; padding-bot=
+tom: 0px; ">
+ <hr />
+ </td>
+ </tr>
+ <tr>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, Arial, sa=
+ns-serif; -ms-text-size-adjust: 100%; font-size: 21px; =
+ font-weight: 500; ">
+ <br />More Info for Email Admins</td>
+ </tr>
+ <tr>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, Arial, sa=
+ns-serif; -ms-text-size-adjust: 100%; font-size: 14px; "=
+>
+ <em>Status code: 550 5.7.1</em>
+ <br />
+ <br />This error occurs when the recipient's domain has securit=
+y or policy settings that reject the sender's message. However, we were una=
+ble to determine the specific setting that's causing this rejection. Usuall=
+y the error is reported by an email server outside of Office 365. Common is=
+sues include the following: the receiving server suspects the message is ma=
+licious or spam; the Sender Policy Framework (SPF) record for nhshackday.co=
+m is incorrectly configured or doesn't exist; or the message includes an at=
+tachment larger than the receiving server will accept. Try one or more of t=
+he following:<br /><br /><b>Review the reported error</b> - Check the <b>Re=
+ported error</b> shown below to help determine what the issue might be. For=
+ example, if the issue is related to an SPF failure, the reported error wil=
+l usually include the acronym "SPF" or the phrase "Sender Policy Framework.=
+"<br /><br /><b>Correctly configure your SPF records</b> - If you're the se=
+nder's email admin, make sure your domain's SPF records at your domain regi=
+strar are properly configured. Office 365 supports only one SPF record (a T=
+XT record that defines SPF) for your domain. Include the following domain n=
+ame: <b>spf.protection.outlook.com</b>. If you have a hybrid configuration =
+(some mailboxes in the cloud and some mailboxes on premises) or if you're a=
+n Exchange Online Protection standalone customer, add the outbound IP addre=
+ss of your on-premises servers to the TXT record. To learn how, see <a href=
+=3D"https://technet.microsoft.com/library/dn789058(v=3Dexchg.150).aspx">Cus=
+tomize an SPF record to validate outbound email sent from your domain</a> a=
+nd <a href=3D"https://support.office.com/article/External-Domain-Name-Syste=
+m-records-for-Office-365-c0531a6f-9e25-4f2d-ad0e-a70bfef09ac0#BKMK_SPFrecor=
+ds">External Domain Name System records for Office 365</a>.<br /><br /><b>U=
+nable to relay</b> - If the <b>Reported error</b> indicates a problem with =
+relaying (e.g. "unable to relay"), then the email server that reported the =
+error likely isn't set up correctly to receive and relay messages from the =
+sender's domain. This server will usually be one of your on-premises server=
+s in a hybrid environment, a smart host email service that you're trying to=
+ route messages through, or possibly even an email hosting service you used=
+ in the past yet still have mail flow settings pointing to (e.g. your MX re=
+cord at your domain registrar still points to your previous email service p=
+rovider). Check <b>Error reported by</b> shown below to determine what doma=
+in, service, or server is reporting the error. The email server needs to be=
+ configured to either accept messages from anonymous users or to include th=
+e sending domain or IP in its list of authenticated senders. On an Exchange=
+ server, you can set this up in the server's receive connector. If it's a s=
+mart host managed by another service or partner, contact the service or par=
+tner to configure their servers to accept and relay messages from your send=
+ers. Also, work with your domain registrar to make sure your MX records are=
+ properly configured.<br /><br /><b>Contact the recipient's email admin</b>=
+ - For some scenarios, you can fix the issue by contacting the email admin =
+at the recipient domain to ask them to add the sender's email address or yo=
+ur domain to their allowed senders list, or to relax the setting that's cau=
+sing the rejection.<br /><br />For more information and tips for fixing thi=
+s issue, see <a href=3D"https://go.microsoft.com/fwlink/?LinkId=3D389365">F=
+ix email delivery issues for error code 5.7.1 in Office 365</a>.<br /><br /=
+></td>
+ </tr>
+ <tr>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, Arial, sa=
+ns-serif; -ms-text-size-adjust: 100%; font-size: 17px; =
+ font-weight: 500; ">Original Message Details</td>
+ </tr>
+ <tr>
+ <td style=3D" font-size: 14px; line-height: 20px; =
+ font-family: 'Segoe UI', Frutiger, Arial, sans-serif; -ms-text=
+-size-adjust: 100%; font-weight: 500; ">
+ <table style=3D" width: 100%; border-collapse: co=
+llapse; margin-left: 10px; ">
+ <tbody>
+ <tr>
+ <td valign=3D"top" style=3D" font-family: 'Segoe U=
+I', Frutiger, Arial, sans-serif; font-size: 14px; -ms-text-si=
+ze-adjust: 100%; white-space: nowrap; font-weight: 500; =
+ width: 140px; ">Created Date:</td>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; -ms-text-size-adjust: 100%; font-size: 14px=
+; font-weight: 400; ">9/23/2026 9:15:36 AM</td>
+ </tr>
+ <tr>
+ <td valign=3D"top" style=3D" font-family: 'Segoe U=
+I', Frutiger, Arial, sans-serif; font-size: 14px; -ms-text-si=
+ze-adjust: 100%; white-space: nowrap; font-weight: 500; =
+ width: 140px; ">Sender Address:</td>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; -ms-text-size-adjust: 100%; font-size: 14px=
+; font-weight: 400; ">[email protected]</td>
+ </tr>
+ <tr>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; font-size: 14px; -ms-text-size-adjust: 100%=
+; white-space: nowrap; font-weight: 500; width: 140px;=
+ ">Recipient Address:</td>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; -ms-text-size-adjust: 100%; font-size: 14px=
+; font-weight: 400; ">[email protected]</td>
+ </tr>
+ <tr>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; font-size: 14px; -ms-text-size-adjust: 100%=
+; white-space: nowrap; font-weight: 500; width: 140px;=
+ ">Subject:</td>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; -ms-text-size-adjust: 100%; font-size: 14px=
+; font-weight: 400; ">Confirm your email address</td>
+ </tr>
+ </tbody>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, Arial, sa=
+ns-serif; -ms-text-size-adjust: 100%; font-size: 17px; =
+ font-weight: 500; ">
+ <br />Error Details</td>
+ </tr>
+ <tr>
+ <td style=3D" font-size: 14px; line-height: 20px; =
+ font-family: 'Segoe UI', Frutiger, Arial, sans-serif; -ms-text=
+-size-adjust: 100%; font-weight: 500; ">
+ <table style=3D" width: 100%; border-collapse: co=
+llapse; margin-left: 10px; ">
+ <tbody>
+ <tr>
+ <td valign=3D"top" style=3D" font-family: 'Segoe U=
+I', Frutiger, Arial, sans-serif; font-size: 14px; -ms-text-si=
+ze-adjust: 100%; white-space: nowrap; font-weight: 500; =
+ width: 140px; ">Error:</td>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; -ms-text-size-adjust: 100%; font-size: 14px=
+; font-weight: 400; ">
+ <em>554 5.7.1 [CS01] Message rejected due to local poli=
+cy. Please visit https://support.apple.com/en-us/HT204137. Txn ID 00000000-=
+0000-0000-0000-000000000000</em>
+ </td>
+ </tr>
+ <tr>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; font-size: 14px; -ms-text-size-adjust: 100%=
+; white-space: nowrap; font-weight: 500; width: 140px;=
+ ">Message rejected by:</td>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; -ms-text-size-adjust: 100%; font-size: 14px=
+; font-weight: 400; ">p00-iscream-smtp-7b95d6f6c9-64bmv</td>
+ </tr>
+ </tbody>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, Arial, sa=
+ns-serif; -ms-text-size-adjust: 100%; font-size: 17px; =
+ font-weight: 500; ">
+ <br />Notification Details</td>
+ </tr>
+ <tr>
+ <td style=3D" font-size: 14px; line-height: 20px; =
+ font-family: 'Segoe UI', Frutiger, Arial, sans-serif; -ms-text=
+-size-adjust: 100%; font-weight: 500; ">
+ <table style=3D" width: 100%; border-collapse: co=
+llapse; margin-left: 10px; ">
+ <tbody>
+ <tr>
+ <td valign=3D"top" style=3D" font-family: 'Segoe U=
+I', Frutiger, Arial, sans-serif; font-size: 14px; -ms-text-si=
+ze-adjust: 100%; white-space: nowrap; font-weight: 500; =
+ width: 140px; ">Sent by:</td>
+ <td style=3D" font-family: 'Segoe UI', Frutiger, A=
+rial, sans-serif; -ms-text-size-adjust: 100%; font-size: 14px=
+; font-weight: 400; ">
+ <em>LOVP265MB8674.GBRP265.PROD.OUTLOOK.COM</em>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <br />
+ <table style=3D"width: 880px;" cellspacing=3D"0">
+ <tr>
+ <td colspan=3D"6" style=3D" padding-top: 4px; border-=
+bottom: 1px solid #999999; padding-bottom: 4px; line-height: =
+120%; font-size: 17px; font-family: 'Segoe UI', Frutiger, Ari=
+al, sans-serif; -ms-text-size-adjust: 100%; font-weight: 500;=
+ ">Message Hops</td>
+ </tr>
+ <tr>
+ <td style=3D" font-size: 12px; font-family: 'Segoe UI=
+', Frutiger, Arial, sans-serif; -ms-text-size-adjust: 100%; f=
+ont-weight: 500; background-color: #f2f5fa; border-bottom: 1p=
+x solid #999999; white-space: nowrap; padding: 8px; ">HO=
+P</td>
+ <td style=3D" font-size: 12px; font-family: 'Segoe UI=
+', Frutiger, Arial, sans-serif; -ms-text-size-adjust: 100%; f=
+ont-weight: 500; background-color: #f2f5fa; border-bottom: 1p=
+x solid #999999; white-space: nowrap; padding: 8px; wi=
+dth: 80px; ">TIME (UTC)</td>
+ <td style=3D" font-size: 12px; font-family: 'Segoe UI=
+', Frutiger, Arial, sans-serif; -ms-text-size-adjust: 100%; f=
+ont-weight: 500; background-color: #f2f5fa; border-bottom: 1p=
+x solid #999999; white-space: nowrap; padding: 8px; ">FR=
+OM</td>
+ <td style=3D" font-size: 12px; font-family: 'Segoe UI=
+', Frutiger, Arial, sans-serif; -ms-text-size-adjust: 100%; f=
+ont-weight: 500; background-color: #f2f5fa; border-bottom: 1p=
+x solid #999999; white-space: nowrap; padding: 8px; ">TO=
+</td>
+ <td style=3D" font-size: 12px; font-family: 'Segoe UI=
+', Frutiger, Arial, sans-serif; -ms-text-size-adjust: 100%; f=
+ont-weight: 500; background-color: #f2f5fa; border-bottom: 1p=
+x solid #999999; white-space: nowrap; padding: 8px; ">WI=
+TH</td>
+ <td style=3D" font-size: 12px; font-family: 'Segoe UI=
+', Frutiger, Arial, sans-serif; -ms-text-size-adjust: 100%; f=
+ont-weight: 500; background-color: #f2f5fa; border-bottom: 1p=
+x solid #999999; white-space: nowrap; padding: 8px; ">RE=
+LAY TIME</td>
+ </tr>
+ <tr>
+ <td style=3D" font-size: 12px; font-family: 'Segoe UI=
+', Frutiger, Arial, sans-serif; -ms-text-size-adjust: 100%; f=
+ont-weight: 500; border-bottom: 1px solid #999999; padding: 8=
+px; text-align: center; ">1</td>
+ <td style=3D" font-size: 12px; font-family: 'Segoe UI=
+', Frutiger, Arial, sans-serif; -ms-text-size-adjust: 100%; f=
+ont-weight: 500; border-bottom: 1px solid #999999; padding: 8=
+px; text-align: left; width: 80px; ">9/23/2026<br />9:15=
+:43 AM</td>
+ <td style=3D" font-size: 12px; font-family: 'Segoe UI=
+', Frutiger, Arial, sans-serif; -ms-text-size-adjust: 100%; f=
+ont-weight: 500; border-bottom: 1px solid #999999; padding: 8=
+px; text-align: left; ">substrate.office.com</td>
+ <td style=3D" font-size: 12px; font-family: 'Segoe UI=
+', Frutiger, Arial, sans-serif; -ms-text-size-adjust: 100%; f=
+ont-weight: 500; border-bottom: 1px solid #999999; padding: 8=
+px; text-align: left; ">LOVP265MB8674.GBRP265.PROD.OUTLOOK.COM<=
+/td>
+ <td style=3D" font-size: 12px; font-family: 'Segoe UI=
+', Frutiger, Arial, sans-serif; -ms-text-size-adjust: 100%; f=
+ont-weight: 500; border-bottom: 1px solid #999999; padding: 8=
+px; text-align: left; ">HTTP</td>
+ <td style=3D" font-size: 12px; font-family: 'Segoe UI=
+', Frutiger, Arial, sans-serif; -ms-text-size-adjust: 100%; f=
+ont-weight: 500; border-bottom: 1px solid #999999; padding: 8=
+px; text-align: left; ">7&nbsp;sec</td>
+ </tr>
+ </table>
+ <p style=3D" font-family: 'Segoe UI', Frutiger, Arial, sans-seri=
+f; -ms-text-size-adjust: 100%; font-size: 17px; font-w=
+eight: 500; padding-top: 4px; padding-bottom: 0; margi=
+n-top: 19px; margin-bottom: 5px; ">Original Message Headers</p>
+ <pre style=3D" color: gray; white-space: pre; padd=
+ing-top: 0; margin-top: 5px; ">
+Received: from substrate.office.com (2603:10a6:600:37c::19) by
+ LOVP265MB8674.GBRP265.PROD.OUTLOOK.COM with HTTP via
+ LO4P265CA0257.GBRP265.PROD.OUTLOOK.COM; Wed, 23 Sep 2026 09:15:43 +0000
+Message-ID: &lt;[email protected]&gt;
+Subject: Confirm your email address
+Date: Wed, 23 Sep 2026 10:15:36 +0100
+MIME-Version: 1.0
+X-Listmonk-Subscriber: a4eec08a-4c6e-4c49-ba0b-54bb2a96d768
+Content-Type: text/html; charset=3DUTF-8
+Content-Transfer-Encoding: quoted-printable
+Reply-To: Test &lt;[email protected]&gt;
+From: Test &lt;[email protected]&gt;
+Sender: Test &lt;[email protected]&gt;
+Return-Path: [email protected]
+
+</pre>
+ </body>
+</html>=
+
+--51e17011-43a1-412f-80ac-295ed1fba71e--