summaryrefslogtreecommitdiffstats
path: root/system/libraries/Email.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2015-02-06 13:44:37 +0100
committerAndrey Andreev <narf@devilix.net>2015-02-06 13:44:37 +0100
commitacfc10868d417c49370ce0bfab977445d2590e1c (patch)
tree180956762a255f5e48718257d0a01fa3f7c43b55 /system/libraries/Email.php
parentdb00b627b83cdba8564fb7e6fbf619e6182f4aa8 (diff)
parent3245af4adc8a271e9bb2eeef991dff7e879a427f (diff)
Merge pull request #3573 from jpswade/develop
Fix HELO localhost.localdomain violates RFC standards
Diffstat (limited to 'system/libraries/Email.php')
-rw-r--r--system/libraries/Email.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/system/libraries/Email.php b/system/libraries/Email.php
index 4e0e0cd9f..43dbe28b4 100644
--- a/system/libraries/Email.php
+++ b/system/libraries/Email.php
@@ -2171,12 +2171,16 @@ class CI_Email {
/**
* Get Hostname
- *
+ *
+ * There are only two legal types of hostname either a fully qualified domain
+ * name (eg: "mail.example.com") or an "IP literal" (eg: "[1.2.3.4]").
+ *
+ * @link http://cbl.abuseat.org/namingproblems.html
* @return string
*/
protected function _get_hostname()
{
- return isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : 'localhost.localdomain';
+ return isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : '[' . $_SERVER['SERVER_ADDR'] . ']';
}
// --------------------------------------------------------------------