Skip to content

Commit f322c38

Browse files
committed
replaced escaped single quotes with unescaped ones
1 parent 90b3e24 commit f322c38

7 files changed

Lines changed: 24 additions & 21 deletions

File tree

‎.gitignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ npm-debug.log
55
test/dkim/cache/message.*
66
.npmrc
77
examples/test-send.js
8+
*.patch
9+
.claude
10+
CLAUDE.md

‎lib/mime-funcs/index.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ module.exports = {
269269

270270
// first line includes the charset and language info and needs to be encoded
271271
// even if it does not contain any unicode characters
272-
line = 'utf-8\x27\x27';
272+
line = "utf-8''";
273273
let encoded = true;
274274
startPos = 0;
275275

‎lib/smtp-connection/index.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,7 +1619,7 @@ class SMTPConnection extends EventEmitter {
16191619
}
16201620

16211621
if (!this._envelope.rcptQueue.length) {
1622-
return callback(this._formatError('Can\x27t send mail - no recipients defined', 'EENVELOPE', false, 'API'));
1622+
return callback(this._formatError("Can't send mail - no recipients defined", 'EENVELOPE', false, 'API'));
16231623
} else {
16241624
this._recipientQueue = [];
16251625

@@ -1675,7 +1675,7 @@ class SMTPConnection extends EventEmitter {
16751675
});
16761676
this._sendCommand('DATA');
16771677
} else {
1678-
err = this._formatError('Can\x27t send mail - all recipients were rejected', 'EENVELOPE', str, 'RCPT TO');
1678+
err = this._formatError("Can't send mail - all recipients were rejected", 'EENVELOPE', str, 'RCPT TO');
16791679
err.rejected = this._envelope.rejected;
16801680
err.rejectedErrors = this._envelope.rejectedErrors;
16811681
return callback(err);

‎lib/well-known/services.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@
7777
"Disroot": {
7878
"description": "Disroot (privacy-focused provider)",
7979
"domains": ["disroot.org"],
80-
"host": "smtp.disroot.org",
80+
"host": "disroot.org",
8181
"port": 587,
82-
"secure": true,
82+
"secure": false,
8383
"authMethod": "LOGIN"
8484
},
8585

‎lib/xoauth2/index.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class XOAuth2 extends Stream {
120120
'Cannot renew access token for %s: No refresh mechanism available',
121121
this.options.user
122122
);
123-
return callback(new Error('Can\x27t create new access token for user'));
123+
return callback(new Error("Can't create new access token for user"));
124124
}
125125

126126
// If renewal already in progress, queue this request instead of starting another
@@ -218,7 +218,7 @@ class XOAuth2 extends Stream {
218218
try {
219219
token = this.jwtSignRS256(tokenData);
220220
} catch (err) {
221-
return callback(new Error('Can\x27t generate token. Check your auth options'));
221+
return callback(new Error("Can't generate token. Check your auth options"));
222222
}
223223

224224
urlOptions = {
@@ -232,7 +232,7 @@ class XOAuth2 extends Stream {
232232
};
233233
} else {
234234
if (!this.options.refreshToken) {
235-
return callback(new Error('Can\x27t create new access token for user'));
235+
return callback(new Error("Can't create new access token for user"));
236236
}
237237

238238
// web app - https://developers.google.com/identity/protocols/OAuth2WebServer

‎test/addressparser/addressparser-test.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,10 @@ describe('#addressparser', () => {
239239
});
240240

241241
it('should handle apostrophe in name correctly', () => {
242-
let input = 'O\x27Neill';
242+
let input = "O'Neill";
243243
let expected = [
244244
{
245-
name: 'O\x27Neill',
245+
name: "O'Neill",
246246
address: ''
247247
}
248248
];

‎test/mime-funcs/mime-funcs-test.js‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ describe('Mime-Funcs Tests', () => {
4545
describe('#encodeWords', () => {
4646
it('should encode Ascii range', () => {
4747
let input1 = 'метель" вьюга',
48-
input2 = 'метель\x27вьюга',
48+
input2 = "метель'вьюга",
4949
input3 = 'Verão você vai adorar!',
5050
output1 = '=?UTF-8?Q?=D0=BC=D0=B5=D1=82=D0=B5=D0=BB=D1=8C=22_?= =?UTF-8?Q?=D0=B2=D1=8C=D1=8E=D0=B3=D0=B0?=',
5151
output2 = '=?UTF-8?Q?=D0=BC=D0=B5=D1=82=D0=B5=D0=BB=D1=8C=27?= =?UTF-8?Q?=D0=B2=D1=8C=D1=8E=D0=B3=D0=B0?=',
@@ -121,7 +121,7 @@ describe('Mime-Funcs Tests', () => {
121121
[
122122
{
123123
key: 'title*0*',
124-
value: 'utf-8\x27\x27Unicode%20title%20%F0%9F%98%8A'
124+
value: "utf-8''Unicode%20title%20%F0%9F%98%8A"
125125
}
126126
],
127127
mimeFuncs.buildHeaderParam('title', 'Unicode title 😊', 50)
@@ -133,7 +133,7 @@ describe('Mime-Funcs Tests', () => {
133133
[
134134
{
135135
key: 'title*0*',
136-
value: 'utf-8\x27\x27this%20is%20'
136+
value: "utf-8''this%20is%20"
137137
},
138138
{
139139
key: 'title*1',
@@ -157,7 +157,7 @@ describe('Mime-Funcs Tests', () => {
157157
[
158158
{
159159
key: 'filename*0*',
160-
value: 'utf-8\x27\x27%C6%94------%C6%94------%C6%94------%C6%94'
160+
value: "utf-8''%C6%94------%C6%94------%C6%94------%C6%94"
161161
},
162162
{
163163
key: 'filename*1*',
@@ -222,18 +222,18 @@ describe('Mime-Funcs Tests', () => {
222222
it('should handle multi line values', () => {
223223
let str =
224224
'text/plain; single_encoded*="UTF-8\'\'%C3%95%C3%84%C3%96%C3%9C";\n' +
225-
' multi_encoded*0*=UTF-8\x27\x27%C3%96%C3%9C;\n' +
225+
" multi_encoded*0*=UTF-8''%C3%96%C3%9C;\n" +
226226
' multi_encoded*1*=%C3%95%C3%84;\n' +
227227
' no_charset*0=OA;\n' +
228228
' no_charset*1=OU;\n' +
229-
' invalid*=utf-8\x27\x27 _?\x27=%ab',
229+
" invalid*=utf-8'' _?'=%ab",
230230
obj = {
231231
value: 'text/plain',
232232
params: {
233233
single_encoded: '=?UTF-8?Q?=C3=95=C3=84=C3=96=C3=9C?=',
234234
multi_encoded: '=?UTF-8?Q?=C3=96=C3=9C=C3=95=C3=84?=',
235235
no_charset: 'OAOU',
236-
invalid: '=?utf-8?Q?_=5f=3f\x27=3d=ab?='
236+
invalid: "=?utf-8?Q?_=5f=3f'=3d=ab?="
237237
}
238238
};
239239

@@ -310,7 +310,7 @@ describe('Mime-Funcs Tests', () => {
310310
filename: '😁😂 *\'%()<>@,;:\\"[]?=😃😄zzz😊õäöü😓.pdf'
311311
}
312312
}),
313-
'test; a=b; filename*0*=utf-8\x27\x27%F0%9F%98%81%F0%9F%98%82%20%2A%27%25%28%29; filename*1*=%3C%3E%40%2C%3B%3A%5C%22%5B%5D%3F%3D%F0%9F%98%83; filename*2*=%F0%9F%98%84zzz%F0%9F%98%8A%C3%B5%C3%A4%C3%B6; filename*3*=%C3%BC%F0%9F%98%93.pdf'
313+
"test; a=b; filename*0*=utf-8''%F0%9F%98%81%F0%9F%98%82%20%2A%27%25%28%29; filename*1*=%3C%3E%40%2C%3B%3A%5C%22%5B%5D%3F%3D%F0%9F%98%83; filename*2*=%F0%9F%98%84zzz%F0%9F%98%8A%C3%B5%C3%A4%C3%B6; filename*3*=%C3%BC%F0%9F%98%93.pdf"
314314
);
315315
});
316316

@@ -322,7 +322,7 @@ describe('Mime-Funcs Tests', () => {
322322
filename: 'Ɣ------Ɣ------Ɣ------Ɣ------Ɣ------Ɣ------Ɣ------.pdf'
323323
}
324324
}),
325-
'test; filename*0*=utf-8\x27\x27%C6%94------%C6%94------%C6%94------%C6%94; filename*1*=------%C6%94------%C6%94------%C6%94------.pdf'
325+
"test; filename*0*=utf-8''%C6%94------%C6%94------%C6%94------%C6%94; filename*1*=------%C6%94------%C6%94------%C6%94------.pdf"
326326
);
327327
});
328328

@@ -335,7 +335,7 @@ describe('Mime-Funcs Tests', () => {
335335
filename: 'Jõge-vaŽJõge-vaŽJõge-vaŽ.pdf'
336336
}
337337
}),
338-
'test; a=b; filename*0*=utf-8\x27\x27J%C3%B5ge-va%C5%BDJ%C3%B5ge-va%C5%BDJ; filename*1*=%C3%B5ge-va%C5%BD.pdf'
338+
"test; a=b; filename*0*=utf-8''J%C3%B5ge-va%C5%BDJ%C3%B5ge-va%C5%BDJ; filename*1*=%C3%B5ge-va%C5%BD.pdf"
339339
);
340340
});
341341

@@ -412,7 +412,7 @@ describe('Mime-Funcs Tests', () => {
412412
semicolon: 'x;y',
413413
colon: 'x:y',
414414
back_slash: 'x\\y',
415-
single_quote: 'x\x27y',
415+
single_quote: "x'y",
416416
double_quotes: 'x"y',
417417
forward_slash: 'x/y',
418418
big_bracket_open: 'x[y',

0 commit comments

Comments
 (0)