From 390ee7502fc882f50be7e3807d87529379d31eb5 Mon Sep 17 00:00:00 2001 From: Guilhem Poy Date: Mon, 12 Jan 2026 08:28:33 +0100 Subject: [PATCH] Add support for EMAIL_SMTP_PASS_FILE Small feature to provide the email password from a file rather than directly from the env variable OVERLEAF_EMAIL_SMTP_PASS. Useful when used in conjunction with Docker Compose secrets. --- server-ce/config/settings.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/server-ce/config/settings.js b/server-ce/config/settings.js index 7d9fd7702e..59f4688f12 100644 --- a/server-ce/config/settings.js +++ b/server-ce/config/settings.js @@ -383,7 +383,16 @@ if (process.env.OVERLEAF_EMAIL_FROM_ADDRESS != null) { } if ( - process.env.OVERLEAF_EMAIL_SMTP_USER != null || + process.env.OVERLEAF_EMAIL_SMTP_USER != null && + process.env.OVERLEAF_EMAIL_SMTP_PASS_FILE != null + ) { + settings.email.parameters.auth = { + user: process.env.OVERLEAF_EMAIL_SMTP_USER, + pass: require("fs").readFileSync(process.env.OVERLEAF_EMAIL_SMTP_PASS_FILE, "utf8") + } + } + else if ( + process.env.OVERLEAF_EMAIL_SMTP_USER != null && process.env.OVERLEAF_EMAIL_SMTP_PASS != null ) { settings.email.parameters.auth = {