Bug 493198 - [AUDIT] extensions/issuetracker/lib/IssueTracker.pm is not using standard Bugzilla mailer code
Summary: [AUDIT] extensions/issuetracker/lib/IssueTracker.pm is not using standard Bug...
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Bugzilla
Classification: Community
Component: Creating/Changing Bugs
Version: 3.2
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: David Lawrence
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 493184
TreeView+ depends on / blocked
 
Reported: 2009-03-31 21:45 UTC by David Lawrence
Modified: 2009-04-08 16:44 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-04-08 16:44:10 UTC
Embargoed:


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

Description David Lawrence 2009-03-31 21:45:33 UTC
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 20:37:08 UTC
Created attachment 338392 [details]
Patch to convert IssueTracker.pm to use Bugzilla/Mailer.pm (v1)

Comment 2 Noura El hawary 2009-04-07 12:11:09 UTC
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 12:19:38 UTC
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 20:54:55 UTC
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 11:55:52 UTC
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 16:44:10 UTC
Committed.

Dave


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