Skip to content

Commit

Permalink
Merge pull request #1464 from mozilla/improve-outlook-deliverability-…
Browse files Browse the repository at this point in the history
…1153

fix #1153: use spamVerdict to automatically block spam
  • Loading branch information
say-yawn authored Jan 19, 2022
2 parents 6b17bb8 + e40ab15 commit 7a9f34a
Show file tree
Hide file tree
Showing 12 changed files with 156 additions and 77 deletions.
18 changes: 18 additions & 0 deletions emails/migrations/0039_profile_auto_block_spam.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.2.24 on 2022-01-11 21:15

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('emails', '0038_domain_address_min_length_validator_and_unique_together_user_and_address'),
]

operations = [
migrations.AddField(
model_name='profile',
name='auto_block_spam',
field=models.BooleanField(default=False),
),
]
26 changes: 18 additions & 8 deletions emails/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,18 @@


def get_domains_from_settings():
# HACK: detect if code is running in django tests
if 'testserver' in settings.ALLOWED_HOSTS:
return {
'RELAY_FIREFOX_DOMAIN': 'default.com',
'MOZMAIL_DOMAIN': 'test.com'
}
return {
'RELAY_FIREFOX_DOMAIN': settings.RELAY_FIREFOX_DOMAIN,
'MOZMAIL_DOMAIN': settings.MOZMAIL_DOMAIN
}


DOMAINS = get_domains_from_settings()
DOMAIN_CHOICES = [(1, 'RELAY_FIREFOX_DOMAIN'), (2, 'MOZMAIL_DOMAIN')]
PREMIUM_DOMAINS = ['mozilla.com', 'getpocket.com', 'mozillafoundation.org']

Expand Down Expand Up @@ -69,9 +74,10 @@ def default_server_storage():


def default_domain_numerical():
domain = DOMAINS['RELAY_FIREFOX_DOMAIN']
domains = get_domains_from_settings()
domain = domains['RELAY_FIREFOX_DOMAIN']
if datetime.now(timezone.utc) > settings.PREMIUM_RELEASE_DATE:
domain = DOMAINS['MOZMAIL_DOMAIN']
domain = domains['MOZMAIL_DOMAIN']
return get_domain_numerical(domain)


Expand Down Expand Up @@ -103,6 +109,7 @@ class Profile(models.Model):
)
server_storage = models.BooleanField(default=default_server_storage)
onboarding_state = models.PositiveIntegerField(default=0)
auto_block_spam = models.BooleanField(default=False)

def __str__(self):
return '%s Profile' % self.user
Expand Down Expand Up @@ -367,7 +374,9 @@ def copy_auth_token(sender, instance=None, created=False, **kwargs):
Token.objects.create(user=instance.user, key=instance.api_token)


def address_hash(address, subdomain=None, domain=DOMAINS['MOZMAIL_DOMAIN']):
def address_hash(address, subdomain=None, domain=None):
if not domain:
domain = get_domains_from_settings()['MOZMAIL_DOMAIN']
if subdomain:
return sha256(
f'{address}@{subdomain}.{domain}'.encode('utf-8')
Expand Down Expand Up @@ -404,8 +413,9 @@ def is_blocklisted(value):

def get_domain_numerical(domain_address):
# get domain name from the address
domains_keys = list(DOMAINS.keys())
domains_values = list(DOMAINS.values())
domains = get_domains_from_settings()
domains_keys = list(domains.keys())
domains_values = list(domains.values())
domain_name = domains_keys[domains_values.index(domain_address)]
# get domain numerical value from domain name
choices = dict(DOMAIN_CHOICES)
Expand Down Expand Up @@ -507,7 +517,7 @@ def save(self, *args, **kwargs):

@property
def domain_value(self):
return DOMAINS.get(self.get_domain_display())
return get_domains_from_settings().get(self.get_domain_display())

@property
def full_address(self):
Expand Down Expand Up @@ -650,7 +660,7 @@ def delete(self, *args, **kwargs):

@property
def domain_value(self):
return DOMAINS.get(self.get_domain_display())
return get_domains_from_settings().get(self.get_domain_display())

@property
def full_address(self):
Expand Down
1 change: 1 addition & 0 deletions emails/tests/fixtures/hard_bounce_sns_body.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Type": "Notification", "MessageId": "adbc2384-317d-54f1-b957-79e4d266a9f8", "TopicArn": "arn:aws:sns:us-east-1:168781634622:ses-inbound-grelay", "Message": "{\"notificationType\":\"Bounce\",\"bounce\":{\"feedbackId\":\"0100017e6dde5726-6164bdc9-7da9-42f7-ba58-8f4692799d89-000000\",\"bounceType\":\"Permanent\",\"bounceSubType\":\"OnAccountSuppressionList\",\"bouncedRecipients\":[{\"emailAddress\":\"[email protected]\",\"action\":\"failed\",\"status\":\"5.1.1\",\"diagnosticCode\":\"Amazon SES did not send the message to this address because it is on the suppression list for your account. For more information about removing addresses from the suppression list, see the Amazon SES Developer Guide at https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-email-suppression-list.html\"}],\"timestamp\":\"2022-01-18T15:46:34.000Z\",\"reportingMTA\":\"dns; amazonses.com\"},\"mail\":{\"timestamp\":\"2022-01-18T15:46:34.516Z\",\"source\":\"=?utf-8?b?Imxjcm91Y2hAbW96aWxsYS5jb20gW3ZpYSBSZWxheV0i?= <[email protected]>\",\"sourceArn\":\"arn:aws:ses:us-east-1:168781634622:identity/unfck.email\",\"sourceIp\":\"193.27.13.253\",\"sendingAccountId\":\"168781634622\",\"messageId\":\"0100017e6dde5594-4912fac5-bd85-4358-98d4-7b8d8b89fc60-000000\",\"destination\":[\"[email protected]\"],\"headersTruncated\":false,\"headers\":[{\"name\":\"Content-Type\",\"value\":\"multipart/mixed; boundary=\\\"===============4469765302545884651==\\\"\"},{\"name\":\"MIME-Version\",\"value\":\"1.0\"},{\"name\":\"Subject\",\"value\":\"work gmail > local relay > disabled proton mail\"},{\"name\":\"From\",\"value\":\"\\\"[email protected] [via Relay]\\\" <[email protected]>\"},{\"name\":\"To\",\"value\":\"[email protected]\"},{\"name\":\"Reply-To\",\"value\":\"[email protected]\"}],\"commonHeaders\":{\"from\":[\"\\\"\\\\\\\"[email protected] [via Relay]\\\\\\\"\\\" <[email protected]>\"],\"replyTo\":[\"[email protected]\"],\"to\":[\"[email protected]\"],\"subject\":\"work gmail > local relay > disabled proton mail\"}}}", "Timestamp": "2022-01-18T15:46:35.135Z", "SignatureVersion": "1", "Signature": "i6sOux83LR/bqeT5E9bCs1UwNECoqwruUW/7Zs4uKDXO96Zw4pMS2PxvG+Ff4vM6N1xtsn+w+AJqH21cVu7VqMNx/tQLuI5Wn7LigZ7fzALQBUxGblGKtbqjTKu06X0VQKnCFI9pkGIZzmhdPTOYQOOidWHf/VS+8WneS5bESFomzfBS9/4PdoyfztS2ySsY1BZUaReH1kePGWYwVuBh41LY+5L53pK67+xkpZcyU00yRHHaIE72uzjVOj8kTAV9JUCgN3k3BRbaAu2+9qWnMHhDkly3FfwgI8MWemO8je9il9fiO41wUKG6ejZ99blBPCKGweRNma3eGjQA0zpt+w==", "SigningCertURL": "https://sns.us-east-1.amazonaws.com/SimpleNotificationService-7ff5318490ec183fbaddaa2a969abfda.pem", "UnsubscribeURL": "https://sns.us-east-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-1:168781634622:ses-inbound-grelay:f1e4420c-3b67-4cb2-b6db-4d22fd45916e"}
1 change: 1 addition & 0 deletions emails/tests/fixtures/single_recipient_email_sns_body.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Type": "Notification", "MessageId": "36e7bb6d-268f-5b37-8c8f-e137b33903de", "TopicArn": "arn:aws:sns:us-east-1:168781634622:ses-inbound-grelay", "Subject": "Amazon SES Email Receipt Notification", "Message": "{\"notificationType\":\"Received\",\"mail\":{\"timestamp\":\"2022-01-13T21:02:45.441Z\",\"source\":\"[email protected]\",\"messageId\":\"s08vnjngg8o82cpus2084722eiate3c6ig885f01\",\"destination\":[\"[email protected]\"],\"headersTruncated\":false,\"headers\":[{\"name\":\"Return-Path\",\"value\":\"<[email protected]>\"},{\"name\":\"Received\",\"value\":\"from mail-4324.protonmail.ch (mail-4324.protonmail.ch [185.70.43.24]) by inbound-smtp.us-east-1.amazonaws.com with SMTP id s08vnjngg8o82cpus2084722eiate3c6ig885f01 for [email protected]; Thu, 13 Jan 2022 21:02:45 +0000 (UTC)\"},{\"name\":\"X-SES-Spam-Verdict\",\"value\":\"PASS\"},{\"name\":\"X-SES-Virus-Verdict\",\"value\":\"PASS\"},{\"name\":\"Received-SPF\",\"value\":\"pass (spfCheck: domain of protonmail.com designates 185.70.43.24 as permitted sender) client-ip=185.70.43.24; [email protected]; helo=mail-4324.protonmail.ch;\"},{\"name\":\"Authentication-Results\",\"value\":\"amazonses.com; spf=pass (spfCheck: domain of protonmail.com designates 185.70.43.24 as permitted sender) client-ip=185.70.43.24; [email protected]; helo=mail-4324.protonmail.ch; dkim=pass [email protected]; dmarc=pass header.from=protonmail.com;\"},{\"name\":\"X-SES-RECEIPT\",\"value\":\"AEFBQUFBQUFBQUFHNVEvWEd4Vnc5Vk1PbjZaNXM2aU40SG5IQ1ZGTjdKSlZnN1l0aWtIRjc1UnRsWnR0ZGMxcUpkQ2swNDgvRmRSTE5KRGxpZk80TkFNWjZyMVRCZ1IydzBEcGoyTTBGeDN1dnFVK1hwZ1d5ZVNMTlNrUnI0a1hmMXpFWXozVCtPcGRrdmxJOEdHQk1RVVFmZHAwaUxvdU5sK1ZGLzNiN0tHZjN6TFN2NzRFVGM0K054Q1VWRml5MUEyWUQ3bjdudmRGZkpLRGhxU3RrUXZJUU8veHpCSFJBNHFzdkdidWxYVVlUSHBad2hvSFBseWxsSEhFa2IzY09YbU05NjVQSCttWm9RS2MxSlBVQWxxaWtBTnFDaXBsTnBNWnpRQlRyN0hhMGZBOHpnT2hKOUE9PQ==\"},{\"name\":\"X-SES-DKIM-SIGNATURE\",\"value\":\"a=rsa-sha256; q=dns/txt; b=Dl/vQpjoU8O4WazhBVlg8hboteM60cDLYyNmm8YkzHJYBVsMpVY7vYHNvwf45hN7q8r+miiDnRaOcdsyE27RjCIZ3IB69+2Spit+ZDLLxpsX3HgfHhbW+0ULpnGJW/mzIcMZOD+lBsD+Uwg/wi08Qa0nqYh3zVcQq7tzQwFQxV0=; c=relaxed/simple; s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug; d=amazonses.com; t=1642107766; v=1; bh=6aaytw5f3sf5609AJbSm6NdAf8MJLeZ89Zueo+Cyn5o=; h=From:To:Cc:Bcc:Subject:Date:Message-ID:MIME-Version:Content-Type:X-SES-RECEIPT;\"},{\"name\":\"Date\",\"value\":\"Thu, 13 Jan 2022 21:02:43 +0000\"},{\"name\":\"DKIM-Signature\",\"value\":\"v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail2; t=1642107763; bh=6aaytw5f3sf5609AJbSm6NdAf8MJLeZ89Zueo+Cyn5o=; h=Date:To:From:Reply-To:Subject:Message-ID:From:To:Cc; b=ZLcC5PqxvI8RZM1ayDZZqDnMIMj4PTc2X2Vz80p313tYJbatI7hRurerz6CBp5uI3IxQdX8SKA5eMcfsqSIV1MOxgbGUcV0q8n3V98qxdQhf+q4ylgllltc9TVRRA7Bs9K3J+bWMLUxWBxP/L4fFPDz1smoLLmEIPO1GzJ+SbfSw2fCb4PW0pSwqDtV6Cv6fagochgmwhfkV+4BQKbkAe+D19YU+7ZBw3Wt02PcOZEtlAdQZ3M3qLTCSX6dgZjr5j+2Q9PuE9wV5sCC/QiYjcTa65j9IRvmWNIKkmFVwV86n29YbJQAPtPCoQfhhXfcICfswBMqmLMZRgOIKjO4tYQ==\"},{\"name\":\"To\",\"value\":\"\\\"[email protected]\\\" <[email protected]>\"},{\"name\":\"From\",\"value\":\"fxastage <[email protected]>\"},{\"name\":\"Reply-To\",\"value\":\"fxastage <[email protected]>\"},{\"name\":\"Subject\",\"value\":\"localized email header + footer\"},{\"name\":\"Message-ID\",\"value\":\"<YQcRqVkgRtVPMmRcONFiK_YqawljgCRUfkTRngwYYI7lSsiE1IKax6R15p9gdSmKgSEXepeJTGhiwsTIJ-fWLA-Tc_lTb2BJdqAB0da4kx4=@protonmail.com>\"},{\"name\":\"MIME-Version\",\"value\":\"1.0\"},{\"name\":\"Content-Type\",\"value\":\"multipart/alternative; boundary=\\\"b1_1tMoOzirX5rNUK0QIqMdSQB8hwcBeFGHtIfEtmvEG0k\\\"\"},{\"name\":\"X-Spam-Status\",\"value\":\"No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE shortcircuit=no autolearn=disabled version=3.4.4\"},{\"name\":\"X-Spam-Checker-Version\",\"value\":\"SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch\"}],\"commonHeaders\":{\"returnPath\":\"[email protected]\",\"from\":[\"fxastage <[email protected]>\"],\"replyTo\":[\"fxastage <[email protected]>\"],\"date\":\"Thu, 13 Jan 2022 21:02:43 +0000\",\"to\":[\"\\\"[email protected]\\\" <[email protected]>\"],\"messageId\":\"<YQcRqVkgRtVPMmRcONFiK_YqawljgCRUfkTRngwYYI7lSsiE1IKax6R15p9gdSmKgSEXepeJTGhiwsTIJ-fWLA-Tc_lTb2BJdqAB0da4kx4=@protonmail.com>\",\"subject\":\"localized email header + footer\"}},\"receipt\":{\"timestamp\":\"2022-01-13T21:02:45.441Z\",\"processingTimeMillis\":1432,\"recipients\":[\"[email protected]\"],\"spamVerdict\":{\"status\":\"PASS\"},\"virusVerdict\":{\"status\":\"PASS\"},\"spfVerdict\":{\"status\":\"PASS\"},\"dkimVerdict\":{\"status\":\"PASS\"},\"dmarcVerdict\":{\"status\":\"PASS\"},\"action\":{\"type\":\"SNS\",\"topicArn\":\"arn:aws:sns:us-east-1:168781634622:ses-inbound-grelay\",\"encoding\":\"UTF8\"}},\"content\":\"Return-Path: <[email protected]>\\r\\nReceived: from mail-4324.protonmail.ch (mail-4324.protonmail.ch [185.70.43.24])\\r\\n by inbound-smtp.us-east-1.amazonaws.com with SMTP id s08vnjngg8o82cpus2084722eiate3c6ig885f01\\r\\n for [email protected];\\r\\n Thu, 13 Jan 2022 21:02:45 +0000 (UTC)\\r\\nX-SES-Spam-Verdict: PASS\\r\\nX-SES-Virus-Verdict: PASS\\r\\nReceived-SPF: pass (spfCheck: domain of protonmail.com designates 185.70.43.24 as permitted sender) client-ip=185.70.43.24; [email protected]; helo=mail-4324.protonmail.ch;\\r\\nAuthentication-Results: amazonses.com;\\r\\n spf=pass (spfCheck: domain of protonmail.com designates 185.70.43.24 as permitted sender) client-ip=185.70.43.24; [email protected]; helo=mail-4324.protonmail.ch;\\r\\n dkim=pass [email protected];\\r\\n dmarc=pass header.from=protonmail.com;\\r\\nX-SES-RECEIPT: AEFBQUFBQUFBQUFHNVEvWEd4Vnc5Vk1PbjZaNXM2aU40SG5IQ1ZGTjdKSlZnN1l0aWtIRjc1UnRsWnR0ZGMxcUpkQ2swNDgvRmRSTE5KRGxpZk80TkFNWjZyMVRCZ1IydzBEcGoyTTBGeDN1dnFVK1hwZ1d5ZVNMTlNrUnI0a1hmMXpFWXozVCtPcGRrdmxJOEdHQk1RVVFmZHAwaUxvdU5sK1ZGLzNiN0tHZjN6TFN2NzRFVGM0K054Q1VWRml5MUEyWUQ3bjdudmRGZkpLRGhxU3RrUXZJUU8veHpCSFJBNHFzdkdidWxYVVlUSHBad2hvSFBseWxsSEhFa2IzY09YbU05NjVQSCttWm9RS2MxSlBVQWxxaWtBTnFDaXBsTnBNWnpRQlRyN0hhMGZBOHpnT2hKOUE9PQ==\\r\\nX-SES-DKIM-SIGNATURE: a=rsa-sha256; q=dns/txt; b=Dl/vQpjoU8O4WazhBVlg8hboteM60cDLYyNmm8YkzHJYBVsMpVY7vYHNvwf45hN7q8r+miiDnRaOcdsyE27RjCIZ3IB69+2Spit+ZDLLxpsX3HgfHhbW+0ULpnGJW/mzIcMZOD+lBsD+Uwg/wi08Qa0nqYh3zVcQq7tzQwFQxV0=; c=relaxed/simple; s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug; d=amazonses.com; t=1642107766; v=1; bh=6aaytw5f3sf5609AJbSm6NdAf8MJLeZ89Zueo+Cyn5o=; h=From:To:Cc:Bcc:Subject:Date:Message-ID:MIME-Version:Content-Type:X-SES-RECEIPT;\\r\\nDate: Thu, 13 Jan 2022 21:02:43 +0000\\r\\nDKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;\\r\\n\\ts=protonmail2; t=1642107763;\\r\\n\\tbh=6aaytw5f3sf5609AJbSm6NdAf8MJLeZ89Zueo+Cyn5o=;\\r\\n\\th=Date:To:From:Reply-To:Subject:Message-ID:From:To:Cc;\\r\\n\\tb=ZLcC5PqxvI8RZM1ayDZZqDnMIMj4PTc2X2Vz80p313tYJbatI7hRurerz6CBp5uI3\\r\\n\\t IxQdX8SKA5eMcfsqSIV1MOxgbGUcV0q8n3V98qxdQhf+q4ylgllltc9TVRRA7Bs9K3\\r\\n\\t J+bWMLUxWBxP/L4fFPDz1smoLLmEIPO1GzJ+SbfSw2fCb4PW0pSwqDtV6Cv6fagoch\\r\\n\\t gmwhfkV+4BQKbkAe+D19YU+7ZBw3Wt02PcOZEtlAdQZ3M3qLTCSX6dgZjr5j+2Q9Pu\\r\\n\\t E9wV5sCC/QiYjcTa65j9IRvmWNIKkmFVwV86n29YbJQAPtPCoQfhhXfcICfswBMqmL\\r\\n\\t MZRgOIKjO4tYQ==\\r\\nTo: \\\"[email protected]\\\" <[email protected]>\\r\\nFrom: fxastage <[email protected]>\\r\\nReply-To: fxastage <[email protected]>\\r\\nSubject: localized email header + footer\\r\\nMessage-ID: <YQcRqVkgRtVPMmRcONFiK_YqawljgCRUfkTRngwYYI7lSsiE1IKax6R15p9gdSmKgSEXepeJTGhiwsTIJ-fWLA-Tc_lTb2BJdqAB0da4kx4=@protonmail.com>\\r\\nMIME-Version: 1.0\\r\\nContent-Type: multipart/alternative;\\r\\n boundary=\\\"b1_1tMoOzirX5rNUK0QIqMdSQB8hwcBeFGHtIfEtmvEG0k\\\"\\r\\nX-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED,\\r\\n\\tDKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE\\r\\n\\tshortcircuit=no autolearn=disabled version=3.4.4\\r\\nX-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on\\r\\n\\tmailout.protonmail.ch\\r\\n\\r\\nThis is a multi-part message in MIME format.\\r\\n\\r\\n--b1_1tMoOzirX5rNUK0QIqMdSQB8hwcBeFGHtIfEtmvEG0k\\r\\nContent-Type: text/plain; charset=utf-8\\r\\nContent-Transfer-Encoding: base64\\r\\n\\r\\nc2hvdWxkIHdvcmsKClNlbnQgd2l0aCBbUHJvdG9uTWFpbF0oaHR0cHM6Ly9wcm90b25tYWlsLmNv\\r\\nbS8pIFNlY3VyZSBFbWFpbC4=\\r\\n\\r\\n--b1_1tMoOzirX5rNUK0QIqMdSQB8hwcBeFGHtIfEtmvEG0k\\r\\nContent-Type: text/html; charset=utf-8\\r\\nContent-Transfer-Encoding: base64\\r\\n\\r\\nPGRpdiBzdHlsZT0iZm9udC1mYW1pbHk6IGFyaWFsOyBmb250LXNpemU6IDE0cHg7Ij48ZGl2IHN0\\r\\neWxlPSJmb250LWZhbWlseTogYXJpYWw7IGZvbnQtc2l6ZTogMTRweDsiPnNob3VsZCB3b3JrPGJy\\r\\nPjwvZGl2PjxkaXYgc3R5bGU9ImZvbnQtZmFtaWx5OiBhcmlhbDsgZm9udC1zaXplOiAxNHB4OyI+\\r\\nPGJyPjwvZGl2PjxkaXYgc3R5bGU9ImZvbnQtZmFtaWx5OiBhcmlhbDsgZm9udC1zaXplOiAxNHB4\\r\\nOyIgY2xhc3M9InByb3Rvbm1haWxfc2lnbmF0dXJlX2Jsb2NrIj48ZGl2IGNsYXNzPSJwcm90b25t\\r\\nYWlsX3NpZ25hdHVyZV9ibG9jay11c2VyIHByb3Rvbm1haWxfc2lnbmF0dXJlX2Jsb2NrLWVtcHR5\\r\\nIj48L2Rpdj48ZGl2IGNsYXNzPSJwcm90b25tYWlsX3NpZ25hdHVyZV9ibG9jay1wcm90b24iPlNl\\r\\nbnQgd2l0aCA8YSByZWw9Im5vb3BlbmVyIG5vcmVmZXJyZXIiIGhyZWY9Imh0dHBzOi8vcHJvdG9u\\r\\nbWFpbC5jb20vIiB0YXJnZXQ9Il9ibGFuayI+UHJvdG9uTWFpbDwvYT4gU2VjdXJlIEVtYWlsLjwv\\r\\nZGl2PjwvZGl2PjwvZGl2PjxkaXYgc3R5bGU9ImZvbnQtZmFtaWx5OiBhcmlhbDsgZm9udC1zaXpl\\r\\nOiAxNHB4OyI+PGJyPjwvZGl2Pg==\\r\\n\\r\\n\\r\\n--b1_1tMoOzirX5rNUK0QIqMdSQB8hwcBeFGHtIfEtmvEG0k--\\r\\n\\r\\n\"}", "Timestamp": "2022-01-13T21:02:46.911Z", "SignatureVersion": "1", "Signature": "BvlKJoLKcxcGsVloKnY7PKuqgY1EsSi1D5SVlHYtxRcsvuXVUDrdEvTlcWYNBiCpbaM/3kGYeXyb8uuWsdcNnT20zKLlpIP1dZhEV4o70aiM/35MxNfgAvA3NXkddRCQ2l+iplqtuRYdJ2XFkYJypECsoif9sRxB2jBW5bIz4vwjoeZdQCwMwBKQFsSGOr5Zc1pPE/5js9gZpBZlpsgRi2N4wj2sjBF0PyyO26UhGgWGwK1F7y1hpo90+PHRnD4W/XYc1flLu29hIaamgtXIbxol0xthMg0TtSfV9Q0MDJkpnsfOt/AsqvfZquIzGWyP2xpppuDLPf4MkftIbS4tpQ==", "SigningCertURL": "https://sns.us-east-1.amazonaws.com/SimpleNotificationService-7ff5318490ec183fbaddaa2a969abfda.pem", "UnsubscribeURL": "https://sns.us-east-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-1:168781634622:ses-inbound-grelay:f1e4420c-3b67-4cb2-b6db-4d22fd45916e"}
1 change: 1 addition & 0 deletions emails/tests/fixtures/soft_bounce_sns_body.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Type": "Notification", "MessageId": "adbc2384-317d-54f1-b957-79e4d266a9f8", "TopicArn": "arn:aws:sns:us-east-1:168781634622:ses-inbound-grelay", "Message": "{\"notificationType\":\"Bounce\",\"bounce\":{\"feedbackId\":\"0100017e6dde5726-6164bdc9-7da9-42f7-ba58-8f4692799d89-000000\",\"bounceType\":\"Transient\",\"bounceSubType\":\"SRETeamEatenByDinosaurs\",\"bouncedRecipients\":[{\"emailAddress\":\"[email protected]\",\"action\":\"failed\",\"status\":\"5.1.1\",\"diagnosticCode\":\"Amazon SES did not send the message to this address because a bad tropical storm hit the island where the servers are located, which knocked out the power, opening all the paddocks with carnivorous dinosaurs, who then ate the entire SRE team. Please try again later. Also, if you're looking for an SRE job, apply at careers.mozilla.org. Ask about our new hazard pay!\"}],\"timestamp\":\"2022-01-18T15:46:34.000Z\",\"reportingMTA\":\"dns; amazonses.com\"},\"mail\":{\"timestamp\":\"2022-01-18T15:46:34.516Z\",\"source\":\"=?utf-8?b?Imxjcm91Y2hAbW96aWxsYS5jb20gW3ZpYSBSZWxheV0i?= <[email protected]>\",\"sourceArn\":\"arn:aws:ses:us-east-1:168781634622:identity/unfck.email\",\"sourceIp\":\"193.27.13.253\",\"sendingAccountId\":\"168781634622\",\"messageId\":\"0100017e6dde5594-4912fac5-bd85-4358-98d4-7b8d8b89fc60-000000\",\"destination\":[\"[email protected]\"],\"headersTruncated\":false,\"headers\":[{\"name\":\"Content-Type\",\"value\":\"multipart/mixed; boundary=\\\"===============4469765302545884651==\\\"\"},{\"name\":\"MIME-Version\",\"value\":\"1.0\"},{\"name\":\"Subject\",\"value\":\"work gmail > local relay > disabled proton mail\"},{\"name\":\"From\",\"value\":\"\\\"[email protected] [via Relay]\\\" <[email protected]>\"},{\"name\":\"To\",\"value\":\"[email protected]\"},{\"name\":\"Reply-To\",\"value\":\"[email protected]\"}],\"commonHeaders\":{\"from\":[\"\\\"\\\\\\\"[email protected] [via Relay]\\\\\\\"\\\" <[email protected]>\"],\"replyTo\":[\"[email protected]\"],\"to\":[\"[email protected]\"],\"subject\":\"work gmail > local relay > disabled proton mail\"}}}", "Timestamp": "2022-01-18T15:46:35.135Z", "SignatureVersion": "1", "Signature": "i6sOux83LR/bqeT5E9bCs1UwNECoqwruUW/7Zs4uKDXO96Zw4pMS2PxvG+Ff4vM6N1xtsn+w+AJqH21cVu7VqMNx/tQLuI5Wn7LigZ7fzALQBUxGblGKtbqjTKu06X0VQKnCFI9pkGIZzmhdPTOYQOOidWHf/VS+8WneS5bESFomzfBS9/4PdoyfztS2ySsY1BZUaReH1kePGWYwVuBh41LY+5L53pK67+xkpZcyU00yRHHaIE72uzjVOj8kTAV9JUCgN3k3BRbaAu2+9qWnMHhDkly3FfwgI8MWemO8je9il9fiO41wUKG6ejZ99blBPCKGweRNma3eGjQA0zpt+w==", "SigningCertURL": "https://sns.us-east-1.amazonaws.com/SimpleNotificationService-7ff5318490ec183fbaddaa2a969abfda.pem", "UnsubscribeURL": "https://sns.us-east-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-1:168781634622:ses-inbound-grelay:f1e4420c-3b67-4cb2-b6db-4d22fd45916e"}
Loading

0 comments on commit 7a9f34a

Please sign in to comment.