auanasgheps/snapraid-aio-script

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

Izumiko opened this issue · 2 comments

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?

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

I see, thank you for your explanation