ttionya/vaultwarden-backup

Using `s-nail` instead of `heirloom-mailx` to send emails

ttionya opened this issue · 3 comments

The tool for sending emails, heirloom-mailx, has been removed in Alpine v3.18.

Please refer to the issue (https://gitlab.alpinelinux.org/alpine/aports/-/issues/14791) and commit (https://gitlab.alpinelinux.org/alpine/aports/-/commit/8f375abf662d2f84ff9b132e8710d6e25eeaf80f) in the Alpine/aports repository for more details.

Although it is possible to lock the Alpine version at 3.17, it is not an ideal solution. I prefer to continue using rclone as the base image, so we need to replace the email sending tool.

I plan to replace heirloom-mailx with s-nail because heirloom-mailx is a stub for s-nail. s-nail maintains a high degree of compatibility, although there may be some incompatible parts, the main options are compatible.

This change will take effect in the next version, and I am currently testing it.

The changes have taken effect in v1.19.0. Here is the s-nail documentation.

To avoid introducing disruptive changes to the backup tool, I will lock the s-nail version to v14.9.x. If in the future Alpine cannot provide an APK package for v14.9, we will compile and install s-nail ourselves.

Starting from v14.10 and future v15 versions, s-nail will adopt a new MTA (Mail-Transfer-Agent) credential, and users will be alerted to switch to the new credential promptly. As we will maintain s-nail v14.9, users can DISREGARD warning messages similar to the following.

mail: Warning: variable superseded or obsoleted: smtp
mail: Warning: variable superseded or obsoleted: smtp-auth-user
mail: Warning: variable superseded or obsoleted: smtp-auth-password
mail: Obsoletion warning: please do not use *smtp*, instead assign a smtp:// URL to *mta*!
mail: Obsoletion warning: Use of old-style credentials, which will vanish in v15!
mail:   Please read the manual section "On URL syntax and credential lookup"

Of course, you can switch to using MTA credentials on your own to eliminate the warning messages. Here's a simple conversion example:

# For Zoho
-S smtp-use-starttls \
-S smtp=smtp://smtp.zoho.com:587 \
-S smtp-auth=login \
-S smtp-auth-user=abc@example.com \
-S smtp-auth-password=mypassword \
-S from=abc@example.com

# Convert to MTA
-S v15-compat
-S smtp-use-starttls
# @ => %40
-S mta=smtp://abc%40example.com:mypassword@smtp.zoho.com:587
-S smtp-auth=login
-S from=abc@example.com