auanasgheps / snapraid-aio-script

The definitive all-in-one SnapRAID script on Linux. Diff, sync, scrub are things of the past. Manage SnapRAID and much, much more!
GNU General Public License v3.0
231 stars 37 forks source link

The meaning of the '-a' option in send_mail() will vary with the MAIL_BIN #53

Closed Izumiko closed 1 year ago

Izumiko commented 1 year ago

For default /usr/bin/mailx provided by mailutils, -a means "append given header", which is the expected behavior.
But if I set MAIL_BIN=/usr/bin/s-nail, -a means "attach file", so sending mail will fail. The equivalent option is -M 'text/html'.

So, is it necessary to add an option to customize arguments of MAIL_BIN in the config file?

auanasgheps commented 1 year ago

Hi,

For this scenario, you should not use change MAIL_BIN, but use HOOK_NOTIFICATION instead.

# Custom notification service
# Set this to a script/service to be used instead of the default email 
# notification. You may want to use a service not natively supported by this 
# script or a mail service with custom formatting. 
# If you don't want to use this option, don't make changes to this.
# $CURRENT_DIR can be used to get the running directory of the script.
# This script will pass the following parameters to HOOK_NOTIFICATION:
# 1st parameter will be the subject
# 2nd parameter will be the body
Izumiko commented 1 year ago

I see, thank you for your explanation