diff --git a/include/class.ticket.php b/include/class.ticket.php
index e7546870eba255341c0819fc8d2af7d98ac5c4eb..35e624753593d62554eab9d6b46afd2e555676fa 100644
--- a/include/class.ticket.php
+++ b/include/class.ticket.php
@@ -1823,6 +1823,9 @@ class Ticket {
         if(!$vars['staffId'] && $thisstaff)
             $vars['staffId'] = $thisstaff->getId();
 
+        if (!$vars['ip_address'] && $_SERVER['REMOTE_ADDR'])
+            $vars['ip_address'] = $_SERVER['REMOTE_ADDR'];
+
         if(!($response = $this->getThread()->addResponse($vars, $errors)))
             return null;
 
@@ -1942,6 +1945,8 @@ class Ticket {
         }elseif($poster) { //string
             $vars['poster'] = $poster;
         }
+        if (!$vars['ip_address'] && $_SERVER['REMOTE_ADDR'])
+            $vars['ip_address'] = $_SERVER['REMOTE_ADDR'];
 
         if(!($note=$this->getThread()->addNote($vars, $errors)))
             return null;