Opened 3 years ago

Closed 3 years ago

#1454 closed defect (fixed)

Mail is only sent one recipient from the -m list, not counting plugins (smartd), the last one.

Reported by: lockywolf Owned by: Christian Franke
Priority: major Milestone: Release 7.3
Component: smartd Version: 7.2
Keywords: smartd.conf Cc:


I have the following problem:

My smartd.conf is the following:

DEVICESCAN -d removable -n standby,15 -I 194 -I 9 -R 194 -R 180 -R 232 -R 5 -R 197 \

-a -o on -S on -s (S/../.././02|L/../../6/03) \
-m root@localhost,lockywolf@localhost,@lwf_first-try.bash -M daily -M test

lwf_first-try is a simple script that just prints the execution date into a file.

In this case, when smartd is restarted:
/usr/sbin/smartd -p /run/ --attributelog=/var/log/smartd/ --savestates=/var/log/smartd/ &

The plugin runs, and lockywolf received the message, but not root.
I tried playing with the -m list, for example, by swapping lockywolf and root, and by adding more lockywolf@localhost and root@localhost entries, and it seems that only the last address is getting the message.

The mail command is mailx from s-nail.
lockywolf@delllaptop:~$ readlink /usr/bin/mail

Change History (6)

comment:1 by lockywolf, 3 years ago

I just tried it with mailutils instead of s-nail, and it seems to behave identically.

comment:2 by Christian Franke, 3 years ago

Keywords: smartd.conf added; mail mailx s-nail notification removed
Owner: set to Christian Franke
Status: newaccepted

Thanks for reporting this longstanding bug introduced 8+ years ago in r3712.

PS: Please do not set the Milestone in future submissions.

comment:3 by Christian Franke, 3 years ago

Possible workaround:

Add this script as e.g. to smartd_warning.d:

exec mail -s "$SMARTD_SUBJECT" root@localhost lockywolf@localhost <<EOF

Then change -m in smartd.conf to: -m,@lwf_first-try.bash.

Could be tested without running smartd by:

SMARTD_ADDRESS=' @lwf_first-try.bash' /script/path/

Add --dryrun to print commands only.

See -w command line option in smartd -h output or smartd man page for the configured script path.

comment:4 by Christian Franke, 3 years ago

Possible local fix:


    old new  
    168168          fi
    169169          ;;
    170170        *)
    171           SMARTD_ADDRESS="${SMARTD_ADDRESS:+ }$ad"
    172172          ;;
    173173      esac
    174174    done

comment:5 by lockywolf, 3 years ago

The "Possible local fix" seems to work, thank you.

comment:6 by Christian Franke, 3 years ago

Resolution: fixed
Status: acceptedclosed
Note: See TracTickets for help on using tickets.