znc-push
znc-push copied to clipboard
Add generic support for sending notifications via email
Python will make it easy: https://docs.python.org/2/library/email.html#module-email
Wouldn't it be much easier to allow arbitrary commands? The user then could hook sendmail into there, or something else.
I went ahead and added basic support for this on https://github.com/jdb8/znc-push/tree/arbitrary-command-notifications - I don't normally work with C++ so it's not great. Wanted to post this here if anyone else wants to use it/improve on it. I can open a pull request if you like, too.
Disclaimer: this was created very quickly so please treat it as experimental! Especially until someone else verifies that running "; rm -rf /; " won't blow up your server!
Definitely would be something worth having as a pull request, but I think it would also make sense to have a way to disable this at compile time for security reasons. Eg, certain users run znc-push on bouncers available to the public, and probably don't want people able to execute arbitrary code.
That makes sense, I didn't consider the public bouncer use-case. I'll create the PR in any case to start with.
Maybe we should special-case the arbitrary-command support: Read the command from a file that must be chowned by znc's user and don't allow configuration through the IRC client.
I just implemented sending emails in the python branch in this Pull request