From 31f06a4ecfbef425e0619d1b11d572db97abcded Mon Sep 17 00:00:00 2001 From: neil Date: Sat, 26 Sep 2026 12:14:17 +0200 Subject: [PATCH] Keep the command line account email out of account.conf's way _initpath sources account.conf (twice, counting __initHome), and the assignment overwrote the ACCOUNT_EMAIL that -m had just exported, so --update-account -m sent the saved address instead of the given one. It also short-circuited _getAccountEmail, whose first branch is meant for the live value: the saved global address then won over the per-CA CA_EMAIL as well. Save the live value before the sourcing and restore it after. The saved address is still reached, by the _readaccountconf at the end of _getAccountEmail, which is where it belongs in the order. --- acme.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/acme.sh b/acme.sh index 35f19ace..e026b9c6 100755 --- a/acme.sh +++ b/acme.sh @@ -3475,12 +3475,22 @@ _initpath() { domain="$1" _ilength="$2" + #Keep the live ACCOUNT_EMAIL, the one -m exported in _process() or the + #caller put in the environment. account.conf is sourced twice below (here + #and inside __initHome), and a sourced assignment would overwrite it with + #the saved address, so -m silently lost to whatever account.conf held. + #The saved address is not lost either way: _getAccountEmail() reads it + #with _readaccountconf as its last resort, after the per-CA CA_EMAIL. + _cli_account_email="$ACCOUNT_EMAIL" + __initHome if [ -f "$ACCOUNT_CONF_PATH" ]; then . "$ACCOUNT_CONF_PATH" fi + ACCOUNT_EMAIL="$_cli_account_email" + if [ "$_ACME_IN_CRON" ]; then if [ ! "$_USER_PATH_EXPORTED" ]; then _USER_PATH_EXPORTED=1