[Rt-commit] rt branch, 4.0/ip-in-rest-headers, created. rt-4.0.4-139-g1385174

Jason May jasonmay at bestpractical.com
Tue Dec 20 09:49:42 EST 2011


The branch, 4.0/ip-in-rest-headers has been created
        at  1385174690f2acd13d0070cccd0514fb2add85bc (commit)

- Log -----------------------------------------------------------------
commit 4a6c99016542a1f1dd9609b902460922464e4824
Author: Jason May <jasonmay at bestpractical.com>
Date:   Mon Dec 19 18:04:27 2011 -0500

    Put client's remote IP in the MIME headers for new tickets via REST
    
    Putting X-RT-Received-IP in the MIME header for the initial ticket
    action makes the sender's source easier to track than digging through
    access logs.

diff --git a/share/html/REST/1.0/Forms/ticket/default b/share/html/REST/1.0/Forms/ticket/default
index 0e953cb..7b7982a 100755
--- a/share/html/REST/1.0/Forms/ticket/default
+++ b/share/html/REST/1.0/Forms/ticket/default
@@ -171,7 +171,8 @@ else {
                 MIME::Entity->build(
                     From => $session{CurrentUser}->EmailAddress,
                     Subject => $v{Subject},
-                    Data => $text
+                    Data => $text,
+                    'X-RT-Received-IP' => $ENV{REMOTE_ADDR},
                 );
         }
 

commit 1385174690f2acd13d0070cccd0514fb2add85bc
Author: Jason May <jasonmay at bestpractical.com>
Date:   Mon Dec 19 18:51:33 2011 -0500

    Include X-RT-Received-IP in headers for ticket actions via REST
    
    See 4a6c990 for rationale.

diff --git a/share/html/REST/1.0/Forms/ticket/comment b/share/html/REST/1.0/Forms/ticket/comment
index 5b8b26c..a0c57e9 100755
--- a/share/html/REST/1.0/Forms/ticket/comment
+++ b/share/html/REST/1.0/Forms/ticket/comment
@@ -89,7 +89,10 @@ if (!$changes{Text} && @atts == 0) {
 }
 
 my $cgi = $m->cgi_object;
-my $ent = MIME::Entity->build(Type => "multipart/mixed");
+my $ent = MIME::Entity->build(
+    Type => "multipart/mixed",
+    'X-RT-Received-IP' => $ENV{REMOTE_ADDR},
+);
 $ent->attach(Data => $changes{Text}) if $changes{Text};
 
 my $i = 1;
diff --git a/share/html/REST/1.0/ticket/comment b/share/html/REST/1.0/ticket/comment
index c03c768..4ece4df 100755
--- a/share/html/REST/1.0/ticket/comment
+++ b/share/html/REST/1.0/ticket/comment
@@ -106,7 +106,10 @@ if (!$k->{Text} && @atts == 0) {
 }
 
 my $cgi = $m->cgi_object;
-my $ent = MIME::Entity->build(Type => "multipart/mixed");
+my $ent = MIME::Entity->build(
+    Type => "multipart/mixed",
+    'X-RT-Received-IP' => $ENV{REMOTE_ADDR},
+);
 $ent->attach(Data => $k->{Text}) if $k->{Text};
 
 my $i = 1;

-----------------------------------------------------------------------


More information about the Rt-commit mailing list