From 6755b5579a96f29ab87e5318558c142ff5d49047 Mon Sep 17 00:00:00 2001 From: Alejandro Torrado Date: Tue, 5 Mar 2024 08:38:02 -0300 Subject: [PATCH] Fixes dot-stuffing This commit fixes the RegEx that handles dot-stuffing, adding the "global" flag so that it processes the whole input, not just the first occurrence. --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index a9c0ad7..2bd69fd 100644 --- a/src/index.js +++ b/src/index.js @@ -297,7 +297,7 @@ exports.SMTPClient = class extends SMTPChannel { } else { lines = []; - return this.write(`${source.replace(/^\./m,'..')}\r\n.\r\n`, {timeout, handler}); + return this.write(`${source.replace(/^\./mg,'..')}\r\n.\r\n`, {timeout, handler}); } }).then((code) => { if (code.charAt(0) === '2') {