summaryrefslogtreecommitdiff
path: root/program/include/rcube_config.php
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2008-06-14 12:23:08 +0000
committerthomascube <thomas@roundcube.net>2008-06-14 12:23:08 +0000
commit83a7636872d58f044d1fac444268dd2e7c7ebaee (patch)
treef22bb7491d67ee0f5f509b70625b48d963a7e9eb /program/include/rcube_config.php
parentf0d4b72a4e1d4292fe99e04836274b52f30c5cf4 (diff)
More code cleanup
Diffstat (limited to 'program/include/rcube_config.php')
-rw-r--r--program/include/rcube_config.php41
1 files changed, 41 insertions, 0 deletions
diff --git a/program/include/rcube_config.php b/program/include/rcube_config.php
index 8e956de1e..5c744ba53 100644
--- a/program/include/rcube_config.php
+++ b/program/include/rcube_config.php
@@ -177,5 +177,46 @@ class rcube_config
}
+ /**
+ * Try to autodetect operating system and find the correct line endings
+ *
+ * @return string The appropriate mail header delimiter
+ */
+ public function header_delimiter()
+ {
+ // use the configured delimiter for headers
+ if (!empty($this->prop['mail_header_delimiter']))
+ return $this->prop['mail_header_delimiter'];
+ else if (strtolower(substr(PHP_OS, 0, 3) == 'win'))
+ return "\r\n";
+ else if (strtolower(substr(PHP_OS, 0, 3) == 'mac'))
+ return "\r\n";
+ else
+ return "\n";
+ }
+
+
+
+ /**
+ * Return the mail domain configured for the given host
+ *
+ * @param string IMAP host
+ * @return string Resolved SMTP host
+ */
+ public function mail_domain($host)
+ {
+ $domain = $host;
+
+ if (is_array($this->prop['mail_domain'])) {
+ if (isset($this->prop['mail_domain'][$host]))
+ $domain = $this->prop['mail_domain'][$host];
+ }
+ else if (!empty($this->prop['mail_domain']))
+ $domain = $this->prop['mail_domain'];
+
+ return $domain;
+ }
+
+
}