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:
Created attachment 338392 [details] Patch to convert IssueTracker.pm to use Bugzilla/Mailer.pm (v1)
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 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
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 on attachment 338607 [details] Patch to convert IssueTracker.pm to use Bugzilla/Mailer.pm (v2) Patch Looks good Dave. Thanks, Noura
Committed. Dave