-
Notifications
You must be signed in to change notification settings - Fork 570
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
Strip '\r' in notification messages to avoid 'Content-Type: application/octet-stream' #7184
Strip '\r' in notification messages to avoid 'Content-Type: application/octet-stream' #7184
Conversation
…on/octet-stream' Without this patch, an accidential `\r` in e.g. `$NOTIFICATIONCOMMENT` leads to a `Content-Type: application/octet-stream` header in e-mails. The accidential `\r` might slip in usually using Icinga/Nagios apps...
@bsdlme Does this work on FreeBSD? |
Should work on FreeBSD with
as shebang. |
@bsdlme, I'm a bit confused now: My pull request is bashism free, only my bug reproducer uses bash. |
@robert-scheck Oops, yes. Sorry. The tr -d '\015' line should also work on FreeBSD. |
Ok, thanks both 👍 |
Ah, Fedora. Hello :-) |
Is there a reason why this bugfix was reverted (c783448)? With most recent icinga-version mails once again get corrupted (on Rocky 8) is acknowledgements/notifications contain newlines. |
Thanks for the pointer. However that issues seems more like related to shell-syntax. Just the removal of carriage-returns via the additional "tr"-command in the pipe shouldn't break Debian/Dash-shell. The main culprit is, that using newlines on comments will be passed as "\r\n" in "$NOTIFICATION_MESSAGE", which aren't proper newlines on Unix. So either that should already filtered/converted by icingaweb or the icingadaemon, or just stripped out while piping to mail/mailx just like before. Maybe a light fix might be to just put the "tr -d '\015'" in (and leave the base64-encoding for the subject out, as that part of the fix seems to break on dash and isn't really needed at least for mailx I guess). |
Without this patch, an accidential
\r
in e.g.$NOTIFICATIONCOMMENT
leads to aContent-Type: application/octet-stream
header in e-mails. The accidential\r
might slip in usually using Icinga/Nagios apps...