-
Notifications
You must be signed in to change notification settings - Fork 578
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
Acknowledgement comments with newlines break emails using default notify scripts. #7510
Comments
Thanks, we'll look into this after 2.11 has been released. |
We had similar problems with non-us-ascii characters and there are solutions tested in #6369. Can you @BuildTheRobots have a look into this and test if this also solves your problem? If so it would be a good reason to move this approach forward. |
I've tested with the new mail-host-noficiation.sh script as linked in #6369 and it seems to make the situation significantly worse. The standard host down notifications now include half the headers inside the email body (though all in ascii) and the multi-line ack now has ascii headers and a base64 encoded blob. This is still on centos-7. The only change made is swapping out the host notify script. Screenshots are from thunderbird, same display issues in Evolution and on iPhone. |
I'll be back in the office middle of next week and will test the fix in #7184 then. Thank you :) |
Can confirm that the updated scripts in #7184 (which also seem to have mainlined into centos) seem to have fixed the newline issue. |
Unfortunately the bugfix got reverted in c783448 and the issue reappears on recent versions. |
Task
|
Describe the bug
Acknowledging a service or host problem with a comment containing a newline causes the notification email to be blank with an unnamed attachment.
If the comment contains a newline, the email seems to be encoded as base64 which breaks rendering in thunderbird, evolution and also iPhone. On the desktop it's possible to download the attachment and view in a text editor, however on iphone I'm not able to view the attachment so is impossible to read the ACK message.
To Reproduce
Provide a link to a live example, or an unambiguous set of steps to reproduce this issue. Include configuration, logs, etc. to reproduce, if relevant.
Evolution calls the attachment "attachment.dat", thunderbird shows it as an unnamed file. iPhone shows it as "mime-attachment".
Expected behaviour
Contents of the message to be part of the email body text (as it does when there's no newlines).
Screenshots
If applicable, add screenshots to help explain your problem.
Your Environment
Include as many relevant details about the environment you experienced the problem in
Icinga Web 2 Version: 2.7.1
Git commit
b0bf9c4b0637f6113adb788e78c2bcf619225dd8
PHP Version
7.1.8```
icinga2 --version
): r2.10.5-1Centos 7 64bit (latest).
user-agent: Heirloom mailx 12.5 7/5/10
Additional context
debug logs
No newline:
[2019-09-18 14:59:37 +0100] notice/Process: Running command '/etc/icinga2/scripts/mail-host-notification.sh' '-4' '192.168.17.198' '-6' '' '-b' 'icingauser' '-c' 'host problem - no newline.' '-d' '2019-09-18 14:59:37 +0100' '-f' 'Icinga <icinga@mydomain.com>' '-l' 'df-testhost' '-n' 'df-testhost' '-o' 'CRITICAL - Plugin timed out' '-r' 'user@mydomain.com' '-s' 'DOWN' '-t' 'ACKNOWLEDGEMENT' '-v' 'false': PID 13656
With newline:
[2019-09-18 14:50:44 +0100] notice/Process: Running command '/etc/icinga2/scripts/mail-host-notification.sh' '-4' '192.168.17.198' '-6' '' '-b' 'icingauser' '-c' 'host problem\r\nwith newline' '-d' '2019-09-18 14:50:44 +0100' '-f' 'Icinga <icinga@mydomain.com>' '-l' 'df-testhost' '-n' 'df-testhost' '-o' 'CRITICAL - Plugin timed out' '-r' 'user@mydomain.com' '-s' 'DOWN' '-t' 'ACKNOWLEDGEMENT' '-v' 'false': PID 29353
Email source
No newline:
with newline:
Hopefully my attempts to redact the information haven't caused any confusion
The text was updated successfully, but these errors were encountered: