Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(workflows): report the mail no named provider accounts for (#94781)

Daniel Marchukc494c6c53d5a
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index 712bb5d9e994..f89d93922f6d 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -5669,17 +5669,17 @@ snapshots:
products-workflows-reputation--no-provider-data--light:
hash: v1.k794b7964.dd0d5b8e28e1b9da35ac9aa7c0995b196e75006f4701c5ce2e32450e46b99359.vJQb1izatw_Q0naM9-YnUKg2ei7iujSXmDWR_DMOq00
products-workflows-reputation--one-provider-filtering--dark:
- hash: v1.k794b7964.92b02e7b495e49fe4144e7460353bfe8d5796d20d9dd8cf48616072a535a89db.dWt1D72wV2hkJ8fmeTdQLYyM1BOykBmwO6HXykizg-E
+ hash: v1.k794b7964.3284d7f1546ff422b89ee95222f0f3a39d0a3aecb17c22e0f8c9df41519b4c93.2KT_f33QvvlMvor3uncuvDEM-mgdKTJUOBu9OsiI5sA
products-workflows-reputation--one-provider-filtering--light:
- hash: v1.k794b7964.3a0e798862115615854952e8305e9d560c2101e008ae3ae2facc0565a06019ce.ss-Ct9nK4UYLm-ZE7u9-T_NPIVLemYu_oJraUMjOczA
+ hash: v1.k794b7964.a03a3a802b51ef3fffa0fc5cd66cee08207dc823b59ce287004796ba005afbd6.hxIVovENYvSv4p5ctxC9s6BWVIn37AogagUs1jFx7cM
products-workflows-reputation--provider-data-without-workflow-rates--dark:
- hash: v1.k794b7964.cc1ca040344e8041180a40b570f65d87f0528f74d08a4b8c7b41309efe404fc8.Niki9f84ric2-PTt-cjcgUIg0pIGS9KLodvHLAD6Pkc
+ hash: v1.k794b7964.26ad11c3a2c8b9856c325756bf26b12d4205aafc6b664999815c206eff24782f.ZYTZXXKw3jnFcpZPvYfph2q5SjUjQ2ZquVuBTbVE5Ro
products-workflows-reputation--provider-data-without-workflow-rates--light:
- hash: v1.k794b7964.e111b58bcf61a72f106c04b7fd9085b9655b158f1ad3b7b022dbf18532b25858.zGZM4bwaoK7UN9LTuA-k9Vwv9DNrp0da9IytJTQCeeY
+ hash: v1.k794b7964.e2f2ecbc2b3c2d9ed27d0aff39baf68ed264a6d976f943c4c1965a497fc6d018.XTD4bmHAQ2D4WVYmWuLNd25JFYhbt9R2-gN64gUXkQo
products-workflows-reputation--shared-sending-domain--dark:
- hash: v1.k794b7964.08d8d17e823645bb6ebf7e2a6cb2cbb104a9f9048e8d99c01c134ce6b40306ae.MJQg25tB-WNOTBHJMyC7HVyPdzp1rgBB6YZz51ISpzU
+ hash: v1.k794b7964.908aa54619e9e4669005bebc9ed7166052200b1613a2f36900bb18af7c74b2ba.PAhdvkGE9vb64e93_Ap6KJohFsSBjwa8BsPKVRT-IXE
products-workflows-reputation--shared-sending-domain--light:
- hash: v1.k794b7964.d2215990d8282ab50a609d06cd15a1fb1de67cea1bc7a8acebef9b524c21b76d.0MlLPljZzWeXjETyXzX4JvaDP1ckpC-eXIjMQS43Dmg
+ hash: v1.k794b7964.95181ed4e0a17456b9e62c3e467ddc605b1a733c81ea6f7c6e0c61928aa3f22d.ZMctRK-G6wUmjfa2paqyxhRtmF0TG_WVyOPLWhFWXyU
products-workflows-steps-delay--date-not-chosen-yet--dark:
hash: v1.k794b7964.ec9c913ba6edb54c2b521e3b1913e45fe914dcd4fc5b45febacd543038865cd0.khqeV0deGQR_Ows3heRrRyvzw8fUBJ6KUNQbhb1asas
products-workflows-steps-delay--date-not-chosen-yet--light:
diff --git a/posthog/settings/ses.py b/posthog/settings/ses.py
index 7b606c760f8b..9ed5dafc0df0 100644
--- a/posthog/settings/ses.py
+++ b/posthog/settings/ses.py
@@ -36,17 +36,25 @@ WORKFLOWS_SES_EVENTS_SNS_TOPIC_ARNS: list[str] = [
# SES ISP dimension values to break sending health down by. The only API that names providers is
# GetDomainStatisticsReport, which needs the Deliverability dashboard subscription, so the list
-# comes from us, and SES gives no way to check a name up front: it validates the format only, and
-# accepts any well-formed word, inventions included. Two consequences.
+# comes from us. These names are read off the VDM dashboard's ISP table, which reports the same
+# dimension SES matches queries on, so each one is known to exist rather than guessed.
#
-# A name SES has no data for is harmless. It costs one query set and yields no row, because
-# providers with zero sends are dropped. That is why both spellings are listed for the two
-# families whose SES name is unconfirmed, Microsoft and Apple: the right one wins and the other
-# disappears. Prune the losers once VDM has collected.
+# SES validates the format only and accepts any well-formed word, inventions included. A name it
+# has no data for is therefore harmless: it costs one query set and yields no row, because
+# providers with zero sends are dropped. A name holding "." or "&" is not harmless. SES rejects
+# "Mail.ru", "Web.de" and "AT&T" with BadRequestException, which fails every query sent in the
+# same request, not just the one holding the name. So check a new value against the API before
+# adding it: query SEND for the name over a window VDM has data for, and treat volume as the only
+# proof the name is real.
#
-# A name holding "." or "&" is not harmless. SES rejects "Mail.ru", "Web.de" and "AT&T" with
-# BadRequestException, which fails the whole BatchGetMetricData request and hides the entire
-# breakdown rather than one row. Those are plausible providers to reach for, so check a new value
-# against the API before adding it: query SEND for the name over a window VDM has data for, and
-# treat volume as the only proof the name is real.
-SES_ISP_DIMENSIONS: list[str] = ["Gmail", "Yahoo", "Outlook", "Hotmail", "Apple", "iCloud"]
+# Each name also adds one query per metric per domain to a fan-out that runs inside a web request
+# under METRIC_QUERY_BUDGET_SECONDS, so weigh a new provider against that budget.
+SES_ISP_DIMENSIONS: list[str] = [
+ "Gmail",
+ "Hotmail",
+ "Yahoo",
+ "Icloud",
+ "Aol",
+ "Gmx",
+ "Tencent",
+]
diff --git a/products/workflows/backend/providers/ses.py b/products/workflows/backend/providers/ses.py
index 219ee450a324..547e8b373026 100644
--- a/products/workflows/backend/providers/ses.py
+++ b/products/workflows/backend/providers/ses.py
@@ -30,6 +30,15 @@ logger = logging.getLogger(__name__)
# deliveries excluding recipients at ISPs it has no feedback-loop agreement with.
ISP_METRICS: tuple[str, ...] = ("SEND", "DELIVERY", "PERMANENT_BOUNCE", "COMPLAINT", "DELIVERY_COMPLAINT")
+# Subject for the identity-wide queries, which carry no ISP dimension. They give the denominator
+# the per-provider rows are subtracted from.
+ISP_IDENTITY_TOTAL = "__identity_total__"
+
+# Reported provider name for that subtraction. SES has a catch-all bucket for recipients it cannot
+# attribute, and rejects its name ("Unknown ISP") as a dimension value with BadRequestException, so
+# the only way to show that volume is to derive it.
+ISP_OTHER = "__other__"
+
# SES caps a BatchGetMetricData request at ten queries.
METRIC_QUERY_BATCH_SIZE = 10
@@ -90,6 +99,14 @@ class IspQueryPlan:
subjects: dict[str, IspMetric]
+@frozen
+class IspBatchAnswer:
+ """What one batch produced: the responses SES returned, and the subjects it refused outright."""
+
+ responses: tuple[Mapping[str, Any], ...]
+ rejected: frozenset[IspMetric]
+
+
@frozen
class IspMetricSeries:
"""Daily counts per provider and metric, and the subjects SES returned no answer for."""
@@ -109,7 +126,7 @@ def _build_isp_queries(domains: Sequence[str], isps: Sequence[str], start: datet
queries: list[dict[str, Any]] = []
subjects: dict[str, IspMetric] = {}
for domain in domains:
- for isp in isps:
+ for isp in (*isps, ISP_IDENTITY_TOTAL):
for metric in ISP_METRICS:
query_id = f"q{len(queries)}"
subjects[query_id] = IspMetric(isp=isp, metric=metric)
@@ -118,7 +135,11 @@ def _build_isp_queries(domains: Sequence[str], isps: Sequence[str], start: datet
"Id": query_id,
"Namespace": "VDM",
"Metric": metric,
- "Dimensions": {"EMAIL_IDENTITY": domain, "ISP": isp},
+ "Dimensions": (
+ {"EMAIL_IDENTITY": domain}
+ if isp == ISP_IDENTITY_TOTAL
+ else {"EMAIL_IDENTITY": domain, "ISP": isp}
+ ),
"StartDate": start,
"EndDate": end,
}
@@ -191,10 +212,69 @@ def _isp_rows_from_series(isps: Sequence[str], series: IspMetricSeries) -> list[
)
)
+ other = _other_provider_row(isps, series)
+ if other is not None:
+ rows.append(other)
+
rows.sort(key=lambda row: -row.emails_sent)
return rows
+def _other_provider_row(isps: Sequence[str], series: IspMetricSeries) -> IspSendingMetrics | None:
+ """
+ The volume a domain sent that no named provider accounts for.
+
+ Named providers rarely cover everything a domain sends. The rest lands in a bucket SES will not
+ let us query by name, so the row is the identity-wide total minus the named providers. Without
+ it the table drops that volume without saying so, and on some domains it is most of the mail.
+
+ Returns None when the subtraction would be unsound. A named provider whose SEND query failed
+ has no counts to subtract, so its volume would surface here as unattributed.
+ """
+ if any(
+ IspMetric(isp=isp, metric=metric) in series.failed
+ for metric in ISP_METRICS
+ for isp in (*isps, ISP_IDENTITY_TOTAL)
+ ):
+ return None
+
+ def remainder(metric: str) -> dict[str, int]:
+ left = dict(series.buckets.get(IspMetric(isp=ISP_IDENTITY_TOTAL, metric=metric), {}))
+ for isp in isps:
+ for date, value in series.buckets.get(IspMetric(isp=isp, metric=metric), {}).items():
+ left[date] = left.get(date, 0) - value
+ # A negative remainder means the named rows already cover the day, so there is nothing left
+ # to report. Feedback arriving late can also push one past its own total.
+ return {date: value for date, value in left.items() if value > 0}
+
+ sent_by_date = remainder("SEND")
+ emails_sent = sum(sent_by_date.values())
+ if emails_sent == 0:
+ return None
+
+ delivered_by_date = remainder("DELIVERY")
+ bounced_by_date = remainder("PERMANENT_BOUNCE")
+ complaint_base = sum(remainder("DELIVERY_COMPLAINT").values())
+ return IspSendingMetrics(
+ isp=ISP_OTHER,
+ emails_sent=emails_sent,
+ delivery_rate=min(1.0, sum(delivered_by_date.values()) / emails_sent),
+ bounce_rate=min(1.0, sum(bounced_by_date.values()) / emails_sent),
+ complaint_rate=(
+ None if not complaint_base else min(1.0, sum(remainder("COMPLAINT").values()) / complaint_base)
+ ),
+ daily=tuple(
+ IspDailyPoint(
+ date=date,
+ emails_sent=sent,
+ delivery_rate=min(1.0, delivered_by_date.get(date, 0) / sent),
+ bounce_rate=min(1.0, bounced_by_date.get(date, 0) / sent),
+ )
+ for date, sent in sorted(sent_by_date.items())
+ ),
+ )
+
+
class SESProvider:
ses_client: "SESClient"
ses_v2_client: "SESV2Client"
@@ -764,30 +844,84 @@ class SESProvider:
raise TimeoutError(
f"SES metric queries exceeded {METRIC_QUERY_BUDGET_SECONDS}s for {domain_count} domain(s)"
)
- response = self.ses_v2_metrics_client.batch_get_metric_data(Queries=list(batch)) # type: ignore[arg-type]
- for result in response.get("Results", []):
- buckets = buckets_by_subject[plan.subjects[result["Id"]]]
- # AWS documents Values as "cumulative / sum" without saying which, so this reads
- # them as per-bucket counts. If they are running totals, summed deliveries overshoot
- # sends and every provider pins to a 100% delivery rate against the clamp.
- for timestamp, value in zip(result.get("Timestamps", []), result.get("Values", []), strict=False):
- buckets[timestamp.date().isoformat()] += value
- for error in response.get("Errors", []):
- subject = plan.subjects.get(error.get("Id", ""))
- if subject is not None:
- failed.add(subject)
- # A per-query failure leaves that metric at zero, which understates a rate rather
- # than breaking the panel. Log it so a systematic failure stays visible. A
- # malformed ISP name is different: SES fails the whole request, which the caller
- # turns into an absent breakdown.
- # "message" is reserved: LogRecord already has one, and passing it in `extra`
- # raises KeyError inside makeRecord, turning a logged warning into a lost breakdown.
+ answer = self._answer_metric_batch(batch, plan, deadline)
+ failed.update(answer.rejected)
+ for response in answer.responses:
+ self._absorb_metric_response(response, plan, buckets_by_subject, failed)
+ return IspMetricSeries(buckets=buckets_by_subject, failed=frozenset(failed))
+
+ def _answer_metric_batch(
+ self, batch: Sequence[dict[str, Any]], plan: IspQueryPlan, deadline: float
+ ) -> IspBatchAnswer:
+ """
+ Run one batch, reissuing it per provider if SES refuses the whole request.
+
+ SES validates dimension values per request, so one name it will not accept fails every
+ query sent alongside it. Almost every batch carries two providers, and a subject is keyed
+ by provider and metric with no domain, so failing the batch would drop a provider SES does
+ accept from the whole breakdown rather than from this request. Reissuing keeps it, and
+ costs the extra calls only when a name is bad. A provider is never split across two
+ groups, because ISP_METRICS divides METRIC_QUERY_BATCH_SIZE.
+ """
+ try:
+ return IspBatchAnswer(
+ responses=(self.ses_v2_metrics_client.batch_get_metric_data(Queries=list(batch)),), # type: ignore[arg-type]
+ rejected=frozenset(),
+ )
+ except ClientError as rejection:
+ if rejection.response.get("Error", {}).get("Code") != "BadRequestException":
+ raise
+
+ responses: list[Mapping[str, Any]] = []
+ rejected: set[IspMetric] = set()
+ for group in batched(batch, len(ISP_METRICS), strict=False):
+ if monotonic() + METRIC_CALL_WORST_CASE_SECONDS > deadline:
+ raise TimeoutError(
+ f"SES metric queries exceeded {METRIC_QUERY_BUDGET_SECONDS}s splitting a rejected batch"
+ )
+ subjects = [plan.subjects[query["Id"]] for query in group]
+ try:
+ responses.append(self.ses_v2_metrics_client.batch_get_metric_data(Queries=list(group))) # type: ignore[arg-type]
+ except ClientError as rejection:
+ if rejection.response.get("Error", {}).get("Code") != "BadRequestException":
+ raise
+ rejected.update(subjects)
logger.warning(
- "SES metric query failed",
- extra={
- "query": subject,
- "code": error.get("Code"),
- "error_message": error.get("Message"),
- },
+ "SES rejected a metric query; dropping the provider",
+ extra={"provider": subjects[0].isp},
)
- return IspMetricSeries(buckets=buckets_by_subject, failed=frozenset(failed))
+ return IspBatchAnswer(responses=tuple(responses), rejected=frozenset(rejected))
+
+ def _absorb_metric_response(
+ self,
+ response: Mapping[str, Any],
+ plan: IspQueryPlan,
+ buckets_by_subject: dict[IspMetric, dict[str, int]],
+ failed: set[IspMetric],
+ ) -> None:
+ """Fold one response into the running series, recording the queries it could not answer."""
+ for result in response.get("Results", []):
+ buckets = buckets_by_subject[plan.subjects[result["Id"]]]
+ # AWS documents Values as "cumulative / sum" without saying which, so this reads
+ # them as per-bucket counts. If they are running totals, summed deliveries overshoot
+ # sends and every provider pins to a 100% delivery rate against the clamp.
+ for timestamp, value in zip(result.get("Timestamps", []), result.get("Values", []), strict=False):
+ buckets[timestamp.date().isoformat()] += value
+ for error in response.get("Errors", []):
+ subject = plan.subjects.get(error.get("Id", ""))
+ if subject is not None:
+ failed.add(subject)
+ # A per-query failure leaves that metric at zero, which understates a rate rather
+ # than breaking the panel. Log it so a systematic failure stays visible. A malformed
+ # ISP name is different: SES rejects the request rather than the query, which
+ # _answer_metric_batch narrows down to the one provider it names.
+ # "message" is reserved: LogRecord already has one, and passing it in `extra`
+ # raises KeyError inside makeRecord, turning a logged warning into a lost breakdown.
+ logger.warning(
+ "SES metric query failed",
+ extra={
+ "query": subject,
+ "code": error.get("Code"),
+ "error_message": error.get("Message"),
+ },
+ )
diff --git a/products/workflows/backend/test/test_ses_provider.py b/products/workflows/backend/test/test_ses_provider.py
index b464d97c2310..60de53a18223 100644
--- a/products/workflows/backend/test/test_ses_provider.py
+++ b/products/workflows/backend/test/test_ses_provider.py
@@ -14,7 +14,12 @@ import dns.resolver
from botocore.exceptions import ClientError
from parameterized import parameterized
-from products.workflows.backend.providers.ses import METRIC_QUERY_BUDGET_SECONDS, SESProvider
+from products.workflows.backend.providers.ses import (
+ ISP_IDENTITY_TOTAL,
+ ISP_OTHER,
+ METRIC_QUERY_BUDGET_SECONDS,
+ SESProvider,
+)
TEST_DOMAIN = "test.posthog.com"
@@ -588,6 +593,10 @@ class TestGetAccountReputation(TestCase):
self.provider.get_account_reputation()
+def _isp_of(query) -> str:
+ return query["Dimensions"].get("ISP", ISP_IDENTITY_TOTAL)
+
+
class TestGetIdentityIspMetrics(TestCase):
def setUp(self):
patcher = patch("products.workflows.backend.providers.ses.boto3.client")
@@ -605,7 +614,7 @@ class TestGetIdentityIspMetrics(TestCase):
{
"Id": query["Id"],
"Timestamps": [datetime(2026, 8, 1, tzinfo=UTC)],
- "Values": [values_by_subject.get((query["Dimensions"]["ISP"], query["Metric"]), 0)],
+ "Values": [values_by_subject.get((_isp_of(query), query["Metric"]), 0)],
}
for query in Queries
]
@@ -619,7 +628,7 @@ class TestGetIdentityIspMetrics(TestCase):
def respond(Queries):
results = []
for query in Queries:
- buckets = values_by_subject.get((query["Dimensions"]["ISP"], query["Metric"]), {})
+ buckets = values_by_subject.get((_isp_of(query), query["Metric"]), {})
results.append(
{
"Id": query["Id"],
@@ -689,6 +698,32 @@ class TestGetIdentityIspMetrics(TestCase):
# No delivery series means no trend to draw, rather than a line flat at zero.
assert rows[0].daily == ()
+ def test_a_provider_ses_rejects_does_not_take_its_batch_mates_with_it(self):
+ # SES validates dimension values per request, so a name it will not accept fails every
+ # query sent with it. Five metrics per provider means a ten-query batch carries two, and a
+ # subject is keyed by provider and metric with no domain, so failing the batch dropped a
+ # good provider from every domain rather than from the one request.
+ def respond(Queries):
+ if any(_isp_of(query) == "Mail.ru" for query in Queries):
+ raise ClientError({"Error": {"Code": "BadRequestException"}}, "BatchGetMetricData")
+ return {
+ "Results": [
+ {"Id": query["Id"], "Timestamps": [datetime(2026, 8, 1, tzinfo=UTC)], "Values": [100]}
+ for query in Queries
+ ]
+ }
+
+ self.mock_client.batch_get_metric_data.side_effect = lambda Queries: respond(Queries)
+
+ with self.assertLogs("products.workflows.backend.providers.ses", level="WARNING") as logs:
+ # Gmail shares the first batch with the name SES refuses; Yahoo sits in the second.
+ rows = self.provider.get_identity_isp_metrics(
+ [TEST_DOMAIN], window_days=30, isps=["Gmail", "Mail.ru", "Yahoo"]
+ )
+
+ assert any("SES rejected a metric query" in line for line in logs.output)
+ assert [row.isp for row in rows] == ["Gmail", "Yahoo"]
+
def test_daily_series_skips_buckets_with_no_sends(self):
self._serve_series(
{
@@ -747,10 +782,11 @@ class TestGetIdentityIspMetrics(TestCase):
self.provider.get_identity_isp_metrics([TEST_DOMAIN], window_days=30, isps=["Gmail", "Yahoo", "Outlook"])
batches = [kwargs["Queries"] for _, kwargs in self.mock_client.batch_get_metric_data.call_args_list]
- # 3 providers x 5 metrics = 15 queries, and SES rejects a batch of more than ten.
- assert [len(batch) for batch in batches] == [10, 5]
- sent = {(query["Dimensions"]["ISP"], query["Metric"]) for batch in batches for query in batch}
- assert len(sent) == 15
+ # 3 providers plus the identity-wide totals, times 5 metrics, is 20 queries. SES rejects a
+ # batch of more than ten.
+ assert [len(batch) for batch in batches] == [10, 10]
+ sent = {(_isp_of(query), query["Metric"]) for batch in batches for query in batch}
+ assert len(sent) == 20
def test_the_domain_cap_keeps_the_domains_that_actually_sent(self):
# The cap used to take the first few domains in id order, which is the order they were
@@ -843,6 +879,44 @@ class TestGetIdentityIspMetrics(TestCase):
assert [row.isp for row in rows] == ["Gmail"]
+ def test_volume_no_named_provider_accounts_for_is_reported(self):
+ # SES rejects the name of its own catch-all bucket, so the unnamed remainder can only be
+ # derived. On posthog.com it was 91 of 108 sends, and the table dropped every one of them
+ # without saying so.
+ self._serve(
+ {
+ (ISP_IDENTITY_TOTAL, "SEND"): 108,
+ (ISP_IDENTITY_TOTAL, "DELIVERY"): 100,
+ ("Gmail", "SEND"): 16,
+ ("Gmail", "DELIVERY"): 16,
+ }
+ )
+
+ rows = self.provider.get_identity_isp_metrics([TEST_DOMAIN], window_days=30, isps=["Gmail"])
+
+ assert [(row.isp, row.emails_sent) for row in rows] == [(ISP_OTHER, 92), ("Gmail", 16)]
+ assert rows[0].delivery_rate == pytest.approx(84 / 92)
+
+ def test_no_remainder_row_when_a_named_provider_did_not_answer(self):
+ # A provider whose SEND query failed has no counts to subtract, so its volume would show up
+ # as unattributed. Reporting nothing beats moving one provider's mail into another row.
+ def respond(Queries):
+ return {
+ "Results": [
+ {"Id": q["Id"], "Timestamps": [datetime(2026, 8, 1, tzinfo=UTC)], "Values": [108]}
+ for q in Queries
+ if _isp_of(q) == ISP_IDENTITY_TOTAL
+ ],
+ "Errors": [{"Id": q["Id"], "Code": "X", "Message": "y"} for q in Queries if _isp_of(q) == "Gmail"],
+ }
+
+ self.mock_client.batch_get_metric_data.side_effect = lambda Queries: respond(Queries)
+
+ with self.assertLogs("products.workflows.backend.providers.ses", level="WARNING"):
+ rows = self.provider.get_identity_isp_metrics([TEST_DOMAIN], window_days=30, isps=["Gmail"])
+
+ assert [row.isp for row in rows] == []
+
def test_busiest_provider_is_reported_first(self):
self._serve({("Gmail", "SEND"): 10, ("Yahoo", "SEND"): 90})
diff --git a/products/workflows/frontend/Workflows/Reputation/WorkflowsReputation.stories.tsx b/products/workflows/frontend/Workflows/Reputation/WorkflowsReputation.stories.tsx
index d83c0432289a..b7ba55366ff8 100644
--- a/products/workflows/frontend/Workflows/Reputation/WorkflowsReputation.stories.tsx
+++ b/products/workflows/frontend/Workflows/Reputation/WorkflowsReputation.stories.tsx
@@ -49,7 +49,7 @@ const baseResponse: TeamEmailReputationResponseApi = {
daily: gmailSeries(),
},
{
- isp: 'Outlook',
+ isp: 'ExchangeOnline',
emails_sent: 12600,
delivery_rate: 0.98,
bounce_rate: 0.004,
@@ -58,7 +58,7 @@ const baseResponse: TeamEmailReputationResponseApi = {
daily: steadySeries(0.98),
},
{
- isp: 'Apple',
+ isp: 'Icloud',
emails_sent: 8100,
// Steady, but steadily poor: the case an auto-scaled axis would draw as a flat line
// indistinguishable from a healthy provider.
diff --git a/products/workflows/frontend/Workflows/Reputation/WorkflowsReputation.tsx b/products/workflows/frontend/Workflows/Reputation/WorkflowsReputation.tsx
index f02fa8278555..ec8e89e310fe 100644
--- a/products/workflows/frontend/Workflows/Reputation/WorkflowsReputation.tsx
+++ b/products/workflows/frontend/Workflows/Reputation/WorkflowsReputation.tsx
@@ -175,6 +175,21 @@ function AwsFindings({ aws }: { aws: AwsTenantReputationApi }): JSX.Element | nu
// A single point is a reading, not a trend, so the column stays empty until there are two.
const MIN_TREND_POINTS = 2
+// SES names providers as one capitalized word, which is not how people write most of them. Only
+// the names that read wrong are listed; anything absent is shown as SES reports it, so a provider
+// added to SES_ISP_DIMENSIONS still renders without a matching entry here. `__other__` is the
+// backend's name for the volume it could not attribute to any of them.
+const ISP_DISPLAY_NAMES: Record<string, string> = {
+ Aol: 'AOL',
+ Gmx: 'GMX',
+ Icloud: 'Apple iCloud',
+ __other__: 'Other providers',
+}
+
+function ispDisplayName(isp: string): string {
+ return ISP_DISPLAY_NAMES[isp] ?? isp
+}
+
// Every row is drawn against the same dates: the days any provider sent on. A provider only appears
// on its own send days, so without this each row stretches its own handful of dates across the full
// width — a provider whose last send was two weeks ago ends level with one that sent yesterday, and
@@ -200,7 +215,7 @@ function DeliveryTrend({ isp, dates }: { isp: IspSendingHealthApi; dates: string
<Sparkline
data={alignToDates(isp, dates)}
labels={dates}
- name={`${isp.isp} delivery rate (%)`}
+ name={`${ispDisplayName(isp.isp)} delivery rate (%)`}
type="line"
renderTooltipValue={(value) => `${value.toFixed(1)}%`}
// Fixed 0-100 rather than auto-scaled per row: these are read against each other, and
@@ -244,7 +259,14 @@ function IspBreakdown({
{
title: 'Provider',
key: 'isp',
- render: (_, row: IspSendingHealthApi) => <span className="font-semibold">{row.isp}</span>,
+ render: (_, row: IspSendingHealthApi) =>
+ row.isp === '__other__' ? (
+ <Tooltip title="Mail to providers this table does not list individually.">
+ <span className="font-semibold cursor-default">{ispDisplayName(row.isp)}</span>
+ </Tooltip>
+ ) : (
+ <span className="font-semibold">{ispDisplayName(row.isp)}</span>
+ ),
},
{
title: 'Delivery rate',