[rt-users] RT 3.0, postfix, wrong outgoing address

Kirill Miazine km-lists at krot.org
Thu Apr 3 02:02:42 EST 2003


Curtis Rempel wrote:
> I'm testing my new install of RT 3.0 and having a problem with the
> outgoing email address. 
> 
> Instead of it coming from rt at mydomain.com, it is addressed from
> apache at mydomain.com
> 
> I've got the following in my /opt/rt3/etc/RT_SiteConfig.pm file:
> 
> 
> Set($CorrespondAddress , 'rt at mydomain.com');
> Set($CommentAddress , 'rt-comment at mydomain.com');
> 
> and have restarted httpd but the logs still show that the email going
> out after creating a ticket is from apache at mydomain.com
> 
> I've read the FAQ and searched the archives, but I'm not entirely sure
> what is causing this.  I am using sendmailpipe as the mail command.
> 
> I suppose I could put in a postfix rewrite rule for apache to be rt
> instead, but then what about rt-comment? (or is simply mapping apache to
> rt sufficient?)
> 
> I would have thought that the above two Set commands would do the
> trick.  What else am I missing?

It is in the archives.

You are missing the '-f sender' option when calling sendmail. -f sets
the envelope sender. The envelope sender address is apache at mydomain.com,
the address in From: should be correct, no?

You need to modify you sendmail is called in the following files:

lib/RT/Action/SendEmail.pm (line 181):

     if ( $RT::MailCommand eq 'sendmailpipe' ) {
+        my $From = $MIMEObj->head->get('From') =~
+          /([\w.-]+\@[a-z0-9][a-z0-9.-]*\.[a-z]+)/i ? "-f '$1'" : undef;
         eval {
+            open( MAIL, "|$RT::SendmailPath $From $RT::SendmailArguments" );
-            open( MAIL, "|$RT::SendmailPath $RT::SendmailArguments" );
             print MAIL $MIMEObj->as_string;
             close(MAIL);
           };

lib/RT/Interface/Email.pm (line 196):

     if ($RT::MailCommand eq 'sendmailpipe') {
+        my $From = $args{'From'} =~
+          /([\w.-]+\@[a-z0-9][a-z0-9.-]*\.[a-z]+)/i ? "-f '$1'" : undef;
+        open (MAIL, "|$RT::SendmailPath $From $RT::SendmailArguments") || return(0);
-        open (MAIL, "|$RT::SendmailPath $RT::SendmailArguments") || return(0);
         print MAIL $entity->as_string;
         close(MAIL);
     }

-- 
Kirill Miazine, Stud. Jur.
Faculty of Law, University of Oslo




More information about the rt-users mailing list