diff --git a/include/class.mailer.php b/include/class.mailer.php index f037e083cc8ee56f4ba1b343396e9abc79903cae..0c64fa097835b3906bf61f706d095d8dc6f3c25e 100644 --- a/include/class.mailer.php +++ b/include/class.mailer.php @@ -148,7 +148,19 @@ class Mailer { } } - $mime = new Mail_mime(); + // The Suhosin patch will muck up the line endings in some + // cases + // + // References: + // https://github.com/osTicket/osTicket-1.8/issues/202 + // http://pear.php.net/bugs/bug.php?id=12032 + // http://us2.php.net/manual/en/function.mail.php#97680 + if ((extension_loaded('suhosin') || constant("SUHOSIN_PATCH")) + && !$this->getSMTPInfo()) + $mime = new Mail_mime("\n"); + else + // Use defaults + $mime = new Mail_mime(); // If the message is not explicitly declared to be a text message, // then assume that it needs html processing to create a valid text