diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-02-02 02:58:12 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-02-02 02:58:12 +0000 |
commit | 41dbe5cf6cbd9939da1423a5000808814bb5979e (patch) | |
tree | 3b5b769d0136d47bdc0c68b5156874f9d71039c4 /core/libraries | |
parent | 51f13f0ca2e36dc50db1ce5782d6a0b8135a158d (diff) |
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.
Diffstat (limited to 'core/libraries')
-rw-r--r-- | core/libraries/Sendmail.php | 8 |
1 files changed, 7 insertions, 1 deletions
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) { |