Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using s-nail instead of heirloom-mailx to send emails #117

Open
ttionya opened this issue Jul 2, 2023 · 3 comments
Open

Using s-nail instead of heirloom-mailx to send emails #117

ttionya opened this issue Jul 2, 2023 · 3 comments

Comments

@ttionya
Copy link
Owner

ttionya commented Jul 2, 2023

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.

@ttionya
Copy link
Owner Author

ttionya commented Jul 3, 2023

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.

@ttionya ttionya changed the title Switch to alternative tools for sending emails Using s-nail instead of heirloom-mailx to send emails Jul 4, 2023
@ttionya
Copy link
Owner Author

ttionya commented Aug 24, 2023

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 [email protected] \
-S smtp-auth-password=mypassword \
-S [email protected]

# Convert to MTA
-S v15-compat
-S smtp-use-starttls
# @ => %40
-S mta=smtp://abc%40example.com:[email protected]:587
-S smtp-auth=login
-S [email protected]

@kevdogg
Copy link

kevdogg commented Nov 16, 2024

Hey I just wanted to chime in here a give another example for those that might want to avoid errors in the logs. I'm using arch linux as the client. SSL CA certs are located in /etc/ssl/certs (which I think is pretty standard for most linux distributions (although tls-ca-file could be used as an alternative to tls-ca-dir). The configuration below only used TLS 1.3 which nowadays seems to be the default with most mailers. TLS 1.2 could also be configured if needbe. I used this reference to configure s-nail for version 15: https://manpages.ubuntu.com/manpages/focal/en/man1/s-nail.1.html

-S v15-compat
-S mta=smtps://<user>:<password>@smtp.<domain>.com:465
-r bitwarden@<domain>.com(Bitwarden-Backup@archbw)
-S smtp-auth=login
-S tls-ca-dir=/etc/ssl/certs
-S tls-verify=strict
-S tls-config-pairs=Protocol=-ALL\,+TLSv1.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants