[rt-users] Strange RT-Mailgate error

Forrest Stanley fstanley at netburner.com
Mon Aug 2 15:10:58 EDT 2004


Hello,

I have been struggling with this error for about a week. I never saw this 
error running rt2, and started occurring when I updated our version of RT 
to the latest release in the past 2 weeks.  Basically, RT works perfectly 
for about 2-3 hours after each time I restart sendmail. Then, for some 
reason, I start getting escalation amounts of EX_TEMPFAIL errors stemming 
from mailgate. Sometimes new tickets are created, usually they are delayed, 
and sendmail will try again after a few minutes. This error quickly expands 
to the point of the maillog showing EX_TEMPFAIL errors almost every second. 
I can fix the problem by restarting sendmail (in fact, I set up a cron job 
to do this until I can figure out the error).

I did make a slight change to the way emails are handled via RT. This may 
be causing my errors, but honestly, I don't see how it could be causing an 
error. I had a similair hack in place in RT2, and had no problems. What I 
did was modify MailFrom.pm, specifially the GetCurrentUser function. I 
commented out the parts that allow unknown users the right to create 
tickets or even create a user. We use a registration system for RT, so I 
don't want users to be autocreated via Email. After commenting out the last 
half of GetCurrentUser, the function now looks like this:

sub GetCurrentUser {
     my %args = ( Message     => undef,
                  CurrentUser => undef,
                  AuthLevel   => undef,
                  Ticket      => undef,
                  Queue       => undef,
                  Action      => undef,
                  @_ );

     # We don't need to do any external lookups
     my ( $Address, $Name ) = ParseSenderAddressFromHead( 
$args{'Message'}->head );
     my $CurrentUser = RT::CurrentUser->new();
     $CurrentUser->LoadByEmail($Address);

     unless ( $CurrentUser->Id ) {
         $CurrentUser->LoadByName($Address);
     }

     if ( $CurrentUser->Id ) {
         return ( $CurrentUser, 1 );
     }

####### Code from this point down is what I added ########

     unless ($CurrentUser->Id) {
             my $Message = "Sender's email address was not found in the 
user database.";
             require RT::Template;
             my $template = new RT::Template($RT::Nobody);
             $template->Load('AutoRejectRequest');
             $Message = $template->Content || $Message;

             MailError( To => $ErrorsTo,
                            Subject => "ATTN: NetBurner Support Account 
Required",
                            Explanation => "$Message",
                            MIMEObj => $entity,
                            LogLevel => 'crit'
                      );
     return ( $args{'CurrentUser'}, 0 );
     }
}

I am also considering the possibility that this newer version of sendmail 
handles spam differently than the version of sendmail I had running with 
rt2. I do get a lot of spam to the account, and it may be flooding the server.

What really stumps me is the fact that the server will run perfectly for a 
few hours, then slowly degrade to nothing. If anyone has any input, it 
would be greatly appreciated.


Forrest Stanley
NetBurner Inc.
fstanley at netburner.com
858-558-0293 x204
"Networking in 1 Day!"
Find out how at http://www.netburner.com




More information about the rt-users mailing list