Bug 493198 - [AUDIT] extensions/issuetracker/lib/IssueTracker.pm is not using standard Bugzilla mailer code
[AUDIT] extensions/issuetracker/lib/IssueTracker.pm is not using standard Bug...
Status: CLOSED NEXTRELEASE
Product: Bugzilla
Classification: Community
Component: Creating/Changing Bugs (Show other bugs)
3.2
All Linux
low Severity medium (vote)
: ---
: ---
Assigned To: David Lawrence
:
Depends On:
Blocks: 493184
  Show dependency treegraph
 
Reported: 2009-03-31 17:45 EDT by David Lawrence
Modified: 2009-04-08 12:44 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-04-08 12:44:10 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch to convert IssueTracker.pm to use Bugzilla/Mailer.pm (v1) (949 bytes, patch)
2009-04-06 16:37 EDT, David Lawrence
nelhawar: review+
Details | Diff
Patch to convert IssueTracker.pm to use Bugzilla/Mailer.pm (v2) (715 bytes, patch)
2009-04-07 16:54 EDT, David Lawrence
nelhawar: review+
Details | Diff

  None (edit)
Description David Lawrence 2009-03-31 17:45:33 EDT
mailError:

Why note use the same mail code as the rest of BZ why make your own as mailError? extensions/issuetracker/lib/IssueTracker.pm:

sub mailError {
    my ( $it_id, $error, $extra ) = @_;

    my $host = eval { require Sys::Hostname; Sys::Hostname::hostname() }
        || 'undefined';
    my $stack = eval { require Carp; Carp::longmess("stack backtrace") }
        || 'undefined';
    my $user
        = eval { require Bugzilla; Bugzilla->user->identity } || 'undefined';

    warn "Error communicating with IssueTracker ID(s): $it_id: $error";

    # Send email to bugzilla owner about the problem
    my $err_msg = "To: " . Bugzilla->params->{maintainer} . "\n";
    $err_msg .= "From: bugzilla\@redhat.com\n";
    $err_msg
        .= "Subject: Error communicating with IssueTracker ID(s): $it_id\n\n";
    $err_msg .= "Error communicating with IssueTracker ID(s): $it_id\n";
    $err_msg .= "Error \$\@: $error\n\n";
    $err_msg .= "Host: $host\n";
    $err_msg .= "Pid:  $$\n";
    $err_msg .= "User: $user\n";
    $err_msg .= "Remote Address: $ENV{REMOTE_ADDR}\n";
    $err_msg .= "Stack Trace:\n$stack\n";
    $err_msg .= "Extra Data:\n$extra\n" if $extra;

    open( SENDMAIL, "|/usr/lib/sendmail -t -i" )
        || warn "Can't open sendmail";
    print SENDMAIL $err_msg;
    close SENDMAIL || warn "Can't close sendmail";
}



Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 David Lawrence 2009-04-06 16:37:08 EDT
Created attachment 338392 [details]
Patch to convert IssueTracker.pm to use Bugzilla/Mailer.pm (v1)
Comment 2 Noura El hawary 2009-04-07 08:11:09 EDT
Comment on attachment 338392 [details]
Patch to convert IssueTracker.pm to use Bugzilla/Mailer.pm (v1)

Hi Dave,

I tested the patch and it seems to be working fine as far as sending mail using MessageToMTA is the concern, but i am getting an error of undefined subroutine Bugzilla::CGI::remote_address from the code below

>+    $err_msg .= "Remote Address: " . Bugzilla->cgi->remote_address() . "\n";


so is the patch missing that subroutine? or am i missing some info?

Thanks,
Noura
Comment 3 Noura El hawary 2009-04-07 08:19:38 EDT
Comment on attachment 338392 [details]
Patch to convert IssueTracker.pm to use Bugzilla/Mailer.pm (v1)

Hey Dave,

I saw this patch before the other patch the creates the remote_address subroutine for this patch, Please ignore my previous comment.

Thanks,
Noura
Comment 4 David Lawrence 2009-04-07 16:54:55 EDT
Created attachment 338607 [details]
Patch to convert IssueTracker.pm to use Bugzilla/Mailer.pm (v2)

Oops. That extra change was part of the other patch I submitted for Bugzilla::CGI::remote_address() so I removed that for now. The other patch will fix this file when I commit it later.

New simplified patch for review.

Dave
Comment 5 Noura El hawary 2009-04-08 07:55:52 EDT
Comment on attachment 338607 [details]
Patch to convert IssueTracker.pm to use Bugzilla/Mailer.pm (v2)

Patch Looks good Dave.

Thanks,
Noura
Comment 6 David Lawrence 2009-04-08 12:44:10 EDT
Committed.

Dave

Note You need to log in before you can comment on or make changes to this bug.