diff options
author | Tom Smeding <tom@tomsmeding.com> | 2024-03-01 22:19:02 +0100 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2024-03-01 22:19:02 +0100 |
commit | 1bab845f16d2fc6e07ea97a9a59e21d6a8390ff7 (patch) | |
tree | a5d08dcecd26b19a6aba2d2989d8e552ace88b32 /modules/email | |
parent | a246f40d5de04c1c7fcc7385d36bc593bcee6ce6 (diff) |
sendmail -> msmtp
Diffstat (limited to 'modules/email')
-rw-r--r-- | modules/email/email.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/modules/email/email.js b/modules/email/email.js index 15a35f5..e4d342b 100644 --- a/modules/email/email.js +++ b/modules/email/email.js @@ -20,21 +20,20 @@ function sendEmail(recip, text) { var opts = { stdio: ["pipe", "inherit", "inherit"] }; - var proc = child_process.spawn("sendmail", [recip], opts); + var proc = child_process.spawn("msmtp", ["--read-recipients"], opts); // Make sure it doesn't run indefinitely var timeout = setTimeout(() => {proc.kill();}, 5000); proc.on("exit", () => clearTimeout(timeout)); proc.on("error", err => { - console.log("email: Failed to start sendmail:", err); + console.log("email: Failed to start msmtp:", err); clearTimeout(timeout); }); proc.stdin.on("error", err => { - console.log("email: Failed to write to sendmail:", err); + console.log("email: Failed to write to msmtp:", err); clearTimeout(timeout); }); proc.stdin.end( - "From: email-module@tomsmeding.com\n" + "To: " + recip + "\n" + "Subject: Mail from email module\n\n" + text |