Skip to content

Commit 514ee55

Browse files
committed
Add secure option to email configuration and transport setup
1 parent b4483fa commit 514ee55

6 files changed

Lines changed: 14 additions & 3 deletions

File tree

Assets/schema.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,10 @@ export type Config = {
229229
* The SMTP server port to use for sending emails.
230230
*/
231231
Port: number
232+
/**
233+
* Whether to use a secure connection (TLS) when connecting to the SMTP server. This should usually be true for port 465 and false for ports 587 and 25.
234+
*/
235+
Secure: boolean
232236
/**
233237
* The username to use for authentication with the SMTP server. The corresponding password should be configured in your environment variables.
234238
*/

Site/bun.lock

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

Site/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"@biomejs/biome": "^2.4.6",
1919
"@types/bun": "^1.3.10",
2020
"@types/d3-interpolate": "^3.0.4",
21+
"@types/nodemailer": "^7.0.11",
2122
"@types/nprogress": "^0.2.3",
2223
"svelte-check": "^4.4.5",
2324
"vite-plugin-devtools-json": "^1.0.0"

Site/src/lib/server/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ const schema = type({
9696
Email: type({
9797
Host: "string >= 1",
9898
Port: "1 <= number <= 65535",
99+
Secure: "boolean",
99100
Username: "string >= 1",
100101
}),
101102

Site/src/lib/server/email.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ if (!building)
99
transport = createTransport({
1010
host: config.Email.Host,
1111
port: config.Email.Port,
12+
secure: config.Email.Secure,
1213
auth: {
1314
user: config.Email.Username,
1415
pass: process.env.EMAIL_PASSWORD,

mercury.core.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ export default {
8686

8787
Email: {
8888
Host: "smtp.example.com",
89-
Port: 587,
89+
Port: 465,
90+
Secure: true,
9091
Username: "username",
9192
},
9293

0 commit comments

Comments
 (0)