From 41dbe5cf6cbd9939da1423a5000808814bb5979e Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Mon, 2 Feb 2009 02:58:12 +0000 Subject: Changed the Sendmail library to allow the separator between mail headers to be specified as a parameter. The documents say that it should be "\r\n". Some sendmail programs seem to violate the specification and get confused. In these cases the header separator is just "\n". This change allows the header separator to be set by the a configuration parameter. --- core/config/sendmail.php | 1 + core/libraries/Sendmail.php | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/config/sendmail.php b/core/config/sendmail.php index 5da84abf..fd9c81dc 100644 --- a/core/config/sendmail.php +++ b/core/config/sendmail.php @@ -26,3 +26,4 @@ $config["from"] = "admin@gallery3.com"; $config["line_length"] = 70; $config["reply_to"] = "public@gallery3.com"; +$config["header_separator"] = "\n"; diff --git a/core/libraries/Sendmail.php b/core/libraries/Sendmail.php index 3da641ed..e634a7a3 100644 --- a/core/libraries/Sendmail.php +++ b/core/libraries/Sendmail.php @@ -23,6 +23,7 @@ class Sendmail_Core { protected $message; protected $headers; protected $line_length = 70; + protected $header_separator = "\r\n"; /** * In test mode this gets the message that would have been set @@ -85,7 +86,12 @@ class Sendmail_Core { $key = ucfirst($key); $headers[] = "$key: $value"; } - $headers = implode("\r\n", $headers); + + /* + * The docs say headers should be separated by \r\n, but occasionaly that doesn't work and you + * need to use a single \n. This can be set in config/sendmail.php + */ + $headers = implode($this->header_separator, $headers); $message = wordwrap($this->message, $this->line_length, "\n"); if (!TEST_MODE) { -- cgit v1.2.3