Skip to content

fix mail notifications #239

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fix mail notifications #239

wants to merge 1 commit into from

Conversation

fl0v
Copy link

@fl0v fl0v commented Jan 6, 2025

It looks like $NOTIFICATION_COMMAND is not handled as a command but as a simple string, in journal log i would see an invalid command error like:
Jan 06 15:31:57 mini log2ram[337874]: /usr/local/bin/log2ram: line 73: mail -s "Log2Ram Error on mini" root: No such file or directory

adding eval fixes this

It looks like $NOTIFICATION_COMMAND is not handled as a command but as a simple string, in journal log i would see an invalid command error like:
Jan 06 15:31:57 mini log2ram[337874]: /usr/local/bin/log2ram: line 73: mail -s "Log2Ram Error on mini" root: No such file or directory

adding eval fixes this
@scara
Copy link

scara commented Jan 6, 2025

Hi @fl0v,
thanks for your contribution but I'd avoid the usage of eval, if possible.

What about using | bash -c '"$NOTIFICATION_COMMAND"' or something like notifycmd=( '"$NOTIFICATION_COMMAND"' ) and then | "${notifycmd[@]}"?
(Both untested).

HTH,
Matteo

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

Successfully merging this pull request may close these issues.

2 participants