[rt-users] Autoreply by nobody

Kirill Miazine lists at krot.org
Fri Sep 13 09:47:16 EDT 2002


* Nicolas Mailhot [2002-09-13 15:31]:
> > > 	We've been playing with rt 2 lately, and found to our great sorrow
> > > request tracker insists on autoreplying as nobody at localdomain to new
> > > requests. This setting do not seem to be configurable anywhere
> > 
> > I've modified the mail sending bit of my lib/RT/Interface/Email.pm to
> > look like this:
> > 
> >     if ($RT::MailCommand eq 'sendmailpipe') {
> >         my $From =
> >             $args{From} =~ /([\w.-]+\@[a-z0-9][a-z0-9.-]*\.[a-z]{2,})/i
> >                 ? "-f $1"
> >                 : undef;
> >         open (MAIL, "|$RT::SendmailPath $From $RT::SendmailArguments")
> >             or return(0);
> >         print MAIL $entity->as_string;
> >         close(MAIL);
> >     }
> 
> Well, I've tried :
>        
>          my $From =
>              $args{From} =~ /([\w.-]+\@[a-z0-9][a-z0-9.-]*\.[a-z]{2,})/i
>                  ? "-F $1"
>                  : undef;
>                      
> [ End of patch ]
>                                                                                     if ($RT::MailCommand eq 'sendmailpipe') {
> 
> [ ... ]
> 
> and this does not seem to work. MTA logs show mail is sent as unix user
> nobody, and the MTA then tries to come up with nobody's mail address
> (nobody at localdomain) by itself

1) small "f" in "-f $1" (not "-F $1")
2) missing $From in:
     open(MAIL, "|$RT::SendmailPath $From $RT::SendmailArguments")
                                     ^^^^^ <- this is -f sender at you.hoo

> Could you please enlighten me on what your code should do (seems I'm
> good for a perl crash course anyway:()

It takes address matching a quite simplre regex from From: header field
and tells sendmail to use it as the envelope sender address (-f option).

-- 
Kirill




More information about the rt-users mailing list