Compare commits

...

3 Commits

Author SHA1 Message Date
Bernhard 03a02a4940 Add require_tls input to prevent STARTTLS fallback to plain text (#317)
Expose nodemailer's requireTLS option so that when secure is false
(e.g. STARTTLS on port 587), the connection aborts if the server
does not support/negotiate STARTTLS, instead of silently sending
credentials in clear text.
2026-09-10 19:57:59 +02:00
silverwind ca8dbb4d4f Take the proxy from smtp_proxy instead of HTTP_PROXY (#316)
* Take the proxy from SMTP_PROXY instead of HTTP_PROXY

HTTP_PROXY says how to reach the web, and on a self-hosted runner it is
routinely set machine-wide while the mail server has to be reached
directly. Sending SMTP through it makes such a proxy refuse the
connection, and there was no way to opt out.

Read the protocol-specific SMTP_PROXY instead, and honour NO_PROXY so a
host can be exempted from it.

Co-Authored-By: Claude (Opus 5) <noreply@anthropic.com>

* Accept smtps_proxy too, and prefer the lowercase spelling

curl reads the lowercase name first and falls back to the uppercase one,
and an implicit TLS connection is configured through smtps_proxy rather
than smtp_proxy.

Co-Authored-By: Claude (Opus 5) <noreply@anthropic.com>

---------

Co-authored-by: Claude (Opus 5) <noreply@anthropic.com>
2026-09-08 16:47:01 +02:00
dependabot[bot] 8043a5ab22 build(deps): bump nodemailer from 9.1.1 to 10.0.0 (#315)
Bumps [nodemailer](https://github.com/nodemailer/nodemailer) from 9.1.1 to 10.0.0.
- [Release notes](https://github.com/nodemailer/nodemailer/releases)
- [Changelog](https://github.com/nodemailer/nodemailer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodemailer/nodemailer/compare/v9.1.1...v10.0.0)

---
updated-dependencies:
- dependency-name: nodemailer
  dependency-version: 10.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-09-08 08:24:21 +02:00
5 changed files with 36 additions and 9 deletions
+8 -2
View File
@@ -16,8 +16,8 @@ Some features:
- name: Send mail - name: Send mail
uses: dawidd6/action-send-mail@<REF> uses: dawidd6/action-send-mail@<REF>
env: env:
# Optional http proxy: # Optional proxy, NO_PROXY is honored too:
HTTP_PROXY: http://proxy.example.test:3128 SMTP_PROXY: http://proxy.example.test:3128
with: with:
# Specify connection via URL (replaces server_address, server_port, secure, # Specify connection via URL (replaces server_address, server_port, secure,
# username and password) # username and password)
@@ -37,6 +37,12 @@ Some features:
# Optional whether this connection use TLS (default is true if server_port is 465) # Optional whether this connection use TLS (default is true if server_port is 465)
secure: true secure: true
# Optional: when secure is false (e.g. STARTTLS on port 587), abort the
# connection if the server does not support/negotiate STARTTLS, instead
# of silently falling back to a plain text connection. Recommended
# whenever secure is false and you authenticate with username/password.
require_tls: true
# Optional (recommended) mail server username: # Optional (recommended) mail server username:
username: ${{secrets.MAIL_USERNAME}} username: ${{secrets.MAIL_USERNAME}}
+3
View File
@@ -14,6 +14,9 @@ inputs:
default: "25" default: "25"
secure: secure:
description: Whether this connection use TLS (default is true if server_port is 465) description: Whether this connection use TLS (default is true if server_port is 465)
require_tls:
description: When 'secure' is false, refuse to send if the server does not support STARTTLS (prevents credentials from ever being sent in clear text)
required: false
username: username:
description: Authenticate as this user to SMTP server description: Authenticate as this user to SMTP server
password: password:
+19 -1
View File
@@ -6,6 +6,22 @@ import fs from "node:fs";
import showdown from "showdown"; import showdown from "showdown";
import path from "node:path"; import path from "node:path";
// smtp_proxy or smtps_proxy, exempted by no_proxy, each preferred lowercase like curl.
function getProxy(host) {
const env = (name) => process.env[name] || process.env[name.toUpperCase()];
const proxy = env("smtp_proxy") || env("smtps_proxy");
if (!proxy) return undefined;
host = `.${host.toLowerCase()}`;
const excluded = (env("no_proxy") || "")
.split(",")
.map((entry) => entry.trim().replace(/^\./, "").toLowerCase())
.some((entry) => entry && (entry === "*" || host.endsWith(`.${entry}`)));
return excluded ? undefined : proxy;
}
function getText(textOrFile, convertMarkdown) { function getText(textOrFile, convertMarkdown) {
let text = textOrFile; let text = textOrFile;
@@ -78,6 +94,7 @@ async function main() {
let serverAddress = core.getInput("server_address"); let serverAddress = core.getInput("server_address");
let serverPort = core.getInput("server_port"); let serverPort = core.getInput("server_port");
let secure = core.getInput("secure"); let secure = core.getInput("secure");
const requireTLS = core.getInput("require_tls", { required: false });
let username = core.getInput("username"); let username = core.getInput("username");
let password = core.getInput("password"); let password = core.getInput("password");
@@ -180,6 +197,7 @@ async function main() {
: undefined, : undefined,
port: serverPort, port: serverPort,
secure: secure === "true", secure: secure === "true",
requireTLS: requireTLS === "true",
tls: tls:
ignoreCert == "true" ignoreCert == "true"
? { ? {
@@ -188,7 +206,7 @@ async function main() {
: undefined, : undefined,
logger: nodemailerdebug == "true" ? true : nodemailerlog, logger: nodemailerdebug == "true" ? true : nodemailerlog,
debug: nodemailerdebug, debug: nodemailerdebug,
proxy: process.env.HTTP_PROXY, proxy: getProxy(serverAddress),
}); });
const messageOptions = { const messageOptions = {
+5 -5
View File
@@ -8,7 +8,7 @@
"dependencies": { "dependencies": {
"@actions/core": "^3.0.1", "@actions/core": "^3.0.1",
"@actions/glob": "^0.7.0", "@actions/glob": "^0.7.0",
"nodemailer": "^9.1.1", "nodemailer": "^10.0.0",
"showdown": "^2.1.0" "showdown": "^2.1.0"
} }
}, },
@@ -103,12 +103,12 @@
} }
}, },
"node_modules/nodemailer": { "node_modules/nodemailer": {
"version": "9.1.1", "version": "10.0.0",
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-9.1.1.tgz", "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-10.0.0.tgz",
"integrity": "sha512-izw9mVKFix6YSnC9eLgV6g1opl9DUlRio9ZNcq+Wu9Ujn2UwF+8Nl0B8nz22kEC+CTZCvinkxwJ0DeFbb6NwcQ==", "integrity": "sha512-wdv+hXBg0iIPIOf108FaZyTxqjQpCvQeAJt9pHHTooPy/y3vQtI9eiImM9AIVKR3e/0FeMA1oueNfBjFJcaK+Q==",
"license": "MIT-0", "license": "MIT-0",
"engines": { "engines": {
"node": ">=6.0.0" "node": ">=20.0.0"
} }
}, },
"node_modules/showdown": { "node_modules/showdown": {
+1 -1
View File
@@ -5,7 +5,7 @@
"dependencies": { "dependencies": {
"@actions/core": "^3.0.1", "@actions/core": "^3.0.1",
"@actions/glob": "^0.7.0", "@actions/glob": "^0.7.0",
"nodemailer": "^9.1.1", "nodemailer": "^10.0.0",
"showdown": "^2.1.0" "showdown": "^2.1.0"
} }
} }