summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-02-02 02:58:12 +0000
committerTim Almdal <tnalmdal@shaw.ca>2009-02-02 02:58:12 +0000
commit41dbe5cf6cbd9939da1423a5000808814bb5979e (patch)
tree3b5b769d0136d47bdc0c68b5156874f9d71039c4 /core
parent51f13f0ca2e36dc50db1ce5782d6a0b8135a158d (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')
-rw-r--r--core/config/sendmail.php1
-rw-r--r--core/libraries/Sendmail.php8
2 files changed, 8 insertions, 1 deletions
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) {