If we use the IP as the RHS of the Message-ID, we need to enclose it in brackets
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 3 Aug 2004 11:29:07 +0000 (11:29 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 3 Aug 2004 11:29:07 +0000 (11:29 +0000)
(RFC 822). And if we have the hostname available, we might as well use that.
Spotted by Andreas M. Kirchwitz, closes #1001295

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@7821 7612ce4b-ef26-0410-bec9-ea0150e637f0

ChangeLog
class/deliver/Deliver.class.php

index ee7291b101a1d3e503d0128da56f74fa94a87169..6140c0642e6407f2f638a5451f281628da0399e6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -82,6 +82,7 @@ Version 1.5.1 -- CVS
     Bieliauskas for spotting big signature "option".
   - Make SquirrelSpell work with safe_mode enabled, if using PHP >=4.3.0.
     Patch by Ray Ferguson.
+  - Make IP-address in Message-ID RFC822 compliant.
 
 Version 1.5.0
 --------------------
index 81b04b0c35d47c86ec5bf96f955b91415d4fda18..55c6a959ffc51767486ed542f43804b11ff32960 100644 (file)
@@ -379,7 +379,7 @@ class Deliver {
         $date = date('D, j M Y H:i:s ', mktime()) . $this->timezone();
         /* Create a message-id */
         $message_id = '<' . $REMOTE_PORT . '.' . $REMOTE_ADDR . '.';
-        $message_id .= time() . '.squirrel@' . $REMOTE_ADDR .'>';
+        $message_id .= time() . '.squirrel@' . (isset($REMOTE_HOST) ? $REMOTE_HOST : "[$REMOTE_ADDR]") .'>';
         /* Make an RFC822 Received: line */
         if (isset($REMOTE_HOST)) {
             $received_from = "$REMOTE_HOST ([$REMOTE_ADDR])";