[otrs] autoresponse does not honour Reply-To

Phil Davis <EMAIL-PROTECTED>
Mon, 09 Sep 2002 12:35:56 +0100


I have just started looking at OTRS and it looks like a very good 
system. I am using Sun Solaris 5.7 but it works just fine (except that 
SetPermisions.sh fails since no bash and chown syntax is different).

One thing I found during testing was that the initial auto response from
PostMaster was always sent to the From address and ignored any Reply-To
email address.

The following patch (against 0.5BETA7) fixes this.

-- 
Phil Davis

*** CURRENT/OpenTRS/Kernel/System/PostMaster/NewTicket.pm	Mon Sep  9 
12:22:13 2002
--- orig/OpenTRS/Kernel/System/PostMaster/NewTicket.pm	Mon Aug  5 
13:29:49 2002
***************
*** 166,182 ****
           QueueID => $QueueID,
           Type => $AutoResponseType,
       );
-
-     my $Send_to = $GetParam{ReplyTo};
-     if ($Send_to eq "") {
-         $Send_to = $GetParam{From};
-     }
-
       if ($Data{Text} && $Data{Realname} && $Data{Address} && 
!$GetParam{'X-OTRS-Loop'}) {
           # --
           # check / loop protection!
           # --
!         if (!$Self->{LoopProtectionObject}->Check(To => $Send_to)) {
               # add history row
               $TicketObject->AddHistoryRow(
                   TicketID => $TicketID,
--- 166,176 ----
           QueueID => $QueueID,
           Type => $AutoResponseType,
       );
       if ($Data{Text} && $Data{Realname} && $Data{Address} && 
!$GetParam{'X-OTRS-Loop'}) {
           # --
           # check / loop protection!
           # --
!         if (!$Self->{LoopProtectionObject}->Check(To => 
$GetParam{From})) {
               # add history row
               $TicketObject->AddHistoryRow(
                   TicketID => $TicketID,
***************
*** 187,193 ****
               return;
           }
           # write log
!         if (!$Self->{LoopProtectionObject}->SendEmail(To => $Send_to)) {
               return;
           }

--- 181,187 ----
               return;
           }
           # write log
!         if (!$Self->{LoopProtectionObject}->SendEmail(To => 
$GetParam{From})) {
               return;
           }

***************
*** 239,248 ****
               TicketID => $TicketID,
               TicketObject => $TicketObject,
               HistoryType => 'SendAutoReply',
!             HistoryComment => "Sent auto response to '$Send_to'",
               From => "$Data{Realname} <$Data{Address}>",
               Email => $Data{Address},
!             To => $Send_to,
               RealName => $Data{Realname},
               Charset => $Data{Charset},
               Subject => $Subject,
--- 233,242 ----
               TicketID => $TicketID,
               TicketObject => $TicketObject,
               HistoryType => 'SendAutoReply',
!             HistoryComment => "Sent auto response to '$GetParam{From}'",
               From => "$Data{Realname} <$Data{Address}>",
               Email => $Data{Address},
!             To => $GetParam{From},
               RealName => $Data{Realname},
               Charset => $Data{Charset},
               Subject => $Subject,
***************
*** 256,267 ****
           # do log
           $LogObject->Log(
               Message => "Sent auto reply for Ticket [$NewTn] 
(TicketID=$TicketID, " .
!             "ArticleID=$ArticleID) to '$Send_to' "
           );
       }
       else {
           # do log
!         $LogObject->Log(MSG => "Sent no auto reply for Ticket [$NewTn] 
($Send_to) "
           );
       }

--- 250,261 ----
           # do log
           $LogObject->Log(
               Message => "Sent auto reply for Ticket [$NewTn] 
(TicketID=$TicketID, " .
!             "ArticleID=$ArticleID) to '$GetParam{From}' "
           );
       }
       else {
           # do log
!         $LogObject->Log(MSG => "Sent no auto reply for Ticket [$NewTn] 
($GetParam{From}) "
           );
       }