Skip to content

Commit fbe7ff3

Browse files
committed
fix(smtp): Improved Message-ID rewriting detection for AWS SES
1 parent a57e06c commit fbe7ff3

File tree

8 files changed

+67
-30
lines changed

8 files changed

+67
-30
lines changed

data/google-crawlers.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"creationTime": "2025-07-02T14:45:59.000000",
2+
"creationTime": "2025-07-04T14:46:02.000000",
33
"prefixes": [
44
{
55
"ipv6Prefix": "2001:4860:4801:2008::/64"
@@ -148,9 +148,6 @@
148148
{
149149
"ipv6Prefix": "2001:4860:4801:203d::/64"
150150
},
151-
{
152-
"ipv6Prefix": "2001:4860:4801:203e::/64"
153-
},
154151
{
155152
"ipv6Prefix": "2001:4860:4801:203f::/64"
156153
},
@@ -679,9 +676,6 @@
679676
{
680677
"ipv4Prefix": "74.125.151.192/27"
681678
},
682-
{
683-
"ipv4Prefix": "74.125.151.224/27"
684-
},
685679
{
686680
"ipv4Prefix": "74.125.151.32/27"
687681
},

lib/email-client/base-client.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2764,6 +2764,21 @@ class BaseClient {
27642764
info.messageId = hotmailMessageIdMatch[1];
27652765
}
27662766

2767+
// AWS SES
2768+
let awsSesHostMatch = (smtpSettings.host || '').toString().match(/\.([^\.]+)\.amazonaws.com$/i);
2769+
let awsSesMessageIdMatch = (info.response || '').toString().match(/^250 Ok ([0-9a-f\-]+)$/);
2770+
if (awsSesHostMatch && awsSesMessageIdMatch) {
2771+
let region = awsSesHostMatch[1].toLowerCase().trim();
2772+
let messageId = awsSesMessageIdMatch[1].toLowerCase().trim();
2773+
if (region === 'us-east-1') {
2774+
region = 'email';
2775+
}
2776+
2777+
// MessageId was overridden
2778+
originalMessageId = info.messageId;
2779+
info.messageId = '<' + messageId + (!/@/.test(messageId) ? '@' + region + '.amazonses.com' : '') + '>';
2780+
}
2781+
27672782
// done
27682783

27692784
try {

package-lock.json

Lines changed: 28 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
"msgpack5": "6.0.2",
9292
"murmurhash": "2.0.1",
9393
"nanoid": "3.3.8",
94-
"nodemailer": "7.0.4",
94+
"nodemailer": "7.0.5",
9595
"pino": "9.7.0",
9696
"popper.js": "1.16.1",
9797
"prom-client": "15.1.3",

sbom.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

static/licenses.html

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!doctype html><html><head><meta charset="utf-8"><title>EmailEngine Licenses</title><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-zCbKRCUGaJDkqS1kPbPd7TveP5iyJE0EjAuZQTgFLD2ylzuqKfdKlfG/eSrtxUkn" crossorigin="anonymous"></head><body>
22
<div class="container-fluid">
3-
<h1>EmailEngine v2.53.0</h1><p>EmailEngine includes code from the following software packages:</p>
3+
<h1>EmailEngine v2.53.1</h1><p>EmailEngine includes code from the following software packages:</p>
44
<table class="table table-sm">
55
<tr><thead class="thead-dark"><th>Package</th><th>Version</th><th>License</th><th>Publisher</th><th>Publisher's Email</th><th>Package URL</th></tr>
66
<tbody>
@@ -1876,7 +1876,7 @@ <h1>EmailEngine v2.53.0</h1><p>EmailEngine includes code from the following soft
18761876
</tr>
18771877
<tr>
18781878
<td><a href="https://npmjs.com/package/decimal.js">decimal.js</a></td>
1879-
<td>10.5.0</td>
1879+
<td>10.6.0</td>
18801880
<td>MIT</td>
18811881
<td>Michael Mclaughlin</td>
18821882
@@ -4424,6 +4424,16 @@ <h1>EmailEngine v2.53.0</h1><p>EmailEngine includes code from the following soft
44244424
</td
44254425
</tr>
44264426
<tr>
4427+
<td><a href="https://npmjs.com/package/nodemailer">nodemailer</a></td>
4428+
<td>7.0.5</td>
4429+
<td>MIT-0</td>
4430+
<td>Andris Reinman</td>
4431+
<td></td>
4432+
<td>
4433+
<a href="https://github.com/nodemailer/nodemailer">github.com/nodemailer/nodemailer</a>
4434+
</td
4435+
</tr>
4436+
<tr>
44274437
<td><a href="https://npmjs.com/package/nopt">nopt</a></td>
44284438
<td>3.0.6</td>
44294439
<td>ISC</td>
@@ -5885,7 +5895,7 @@ <h1>EmailEngine v2.53.0</h1><p>EmailEngine includes code from the following soft
58855895
</tr>
58865896
<tr>
58875897
<td><a href="https://npmjs.com/package/swagger-ui-dist">swagger-ui-dist</a></td>
5888-
<td>5.26.0</td>
5898+
<td>5.26.2</td>
58895899
<td>Apache-2.0</td>
58905900
<td></td>
58915901
<td></td>

translations/messages.pot

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
msgid ""
22
msgstr ""
33
"Content-Type: text/plain; charset=ascii\n"
4-
"POT-Creation-Date: 2025-07-04 12:19+0000\n"
4+
"POT-Creation-Date: 2025-07-07 10:46+0000\n"
55

66
#: views/config/license.hbs:49
77
msgid "%d day"
88
msgid_plural "%d days"
99
msgstr[0] ""
1010
msgstr[1] ""
1111

12-
#: views/redirect.hbs:1
13-
msgid "Click <a href=\"%s\">here</a> to continue&mldr;"
14-
msgstr ""
15-
1612
#: views/unsubscribe.hbs:3
1713
#: views/unsubscribe.hbs:62
1814
#: views/unsubscribe.hbs:85
@@ -62,6 +58,10 @@ msgstr ""
6258
msgid "Enter your email address"
6359
msgstr ""
6460

61+
#: views/redirect.hbs:1
62+
msgid "Click <a href=\"%s\">here</a> to continue&mldr;"
63+
msgstr ""
64+
6565
#: views/accounts/register/imap.hbs:11
6666
msgid "Your name"
6767
msgstr ""

views/partials/gateway_js.hbs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
resolver: 'custom',
1616
events: {
1717
search: function (query, callback) {
18-
let matches = wellKnownServices.filter(a => a.key.toLowerCase().indexOf(query.toLowerCase().trim()) >= 0);
19-
callback(matches.map(entry => entry.key))
18+
let matches = wellKnownServices.filter(entry => (`${entry.key} / ${entry.description}`).toLowerCase().indexOf(query.toLowerCase().trim()) >= 0);
19+
callback(matches.map(entry => `${entry.key} / ${entry.description}`))
2020
},
2121
typed: function (newValue, origJQElement) {
2222
return newValue
@@ -27,7 +27,7 @@
2727
}).on('change', function (a) {
2828
}).on('autocomplete.select', function (e) {
2929
if (e && e.type === 'autocomplete') {
30-
let selectedValue = e.currentTarget && e.currentTarget.value || '';
30+
let selectedValue = (e.currentTarget && e.currentTarget.value || '').split(' / ').shift().trim();
3131
if (selectedValue) {
3232
let entry = wellKnownServices.find(a => a.key.toLowerCase().trim() === selectedValue.toLowerCase().trim())
3333
if (entry) {

0 commit comments

Comments
 (0)