Bugzilla – Attachment 164386 Details for
Bug 36504
Run report should have an option to only send the attachment
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36504: Add a test-email option
Bug-36504-Add-a-test-email-option.patch (text/plain), 2.74 KB, created by
Nick Clemens (kidclamp)
on 2024-04-03 15:45:41 UTC
(
hide
)
Description:
Bug 36504: Add a test-email option
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-04-03 15:45:41 UTC
Size:
2.74 KB
patch
obsolete
>From 7303efd3e1c5caa14328d319be34f6fe55a2fa97 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 3 Apr 2024 15:43:51 +0000 >Subject: [PATCH] Bug 36504: Add a test-email option > >This is not necessarily for pushing, but makes testing first patch easier as it doesn't require >setting up email. Apply this patch, and add --test-email when runnign the script. >The email object will be dumped to the screen and you can verofy the content of the body/attachment >--- > misc/cronjobs/runreport.pl | 23 ++++++++++++++++++----- > 1 file changed, 18 insertions(+), 5 deletions(-) > >diff --git a/misc/cronjobs/runreport.pl b/misc/cronjobs/runreport.pl >index 1737aa0f78e..295464dde11 100755 >--- a/misc/cronjobs/runreport.pl >+++ b/misc/cronjobs/runreport.pl >@@ -63,6 +63,7 @@ runreport.pl [ -h | -m ] [ -v ] reportID [ reportID ... ] > --method method is the type of authentication. Ie. LOGIN, DIGEST-MD5, etc. > --to=s e-mail address to send report to > --from=s e-mail address to send report from >+ --test-email report email to command line, do not send > --subject=s subject for the e-mail > --param=s parameters for the report > --store-results store the result of the report >@@ -107,6 +108,10 @@ Empty string is allowed. > > Whether to use e-mail (implied by --to or --from). > >+=item B<--test-email> >+ >+Whether to only report the email, rather than sending. >+ > =item B<--attachment> > > Whether to include the results as an attachment (requires --email|--to|--from) >@@ -195,6 +200,7 @@ my $help = 0; > my $man = 0; > my $verbose = 0; > my $send_email = 0; >+my $test_email = 0; > my $send_empty = 0; > my $attachment = 0; > my $attach_only = 0; >@@ -228,6 +234,7 @@ GetOptions( > 'subject=s' => \$subject, > 'param=s' => \@params, > 'email' => \$send_email, >+ 'test-email' => \$test_email, > 'send_empty' => \$send_empty, > 'a|attachment' => \$attachment, > 'ao|attach_only' => \$attach_only, >@@ -250,6 +257,7 @@ unless ($format) { > } > > $attachment = 1 if $attach_only; >+$send_email = 1 if $test_email; > > if ($csv_separator) { > if ( $format eq 'csv' ) { >@@ -405,12 +413,17 @@ foreach my $report_id (@ARGV) { > if $username; > > $email->transport( $smtp_server->transport ); >- try { >- $email->send_or_die; >+ >+ if( $test_email ){ >+ warn Data::Dumper::Dumper( $email ); >+ } else { >+ try { >+ $email->send_or_die; >+ } >+ catch { >+ carp "Mail not sent: $_"; >+ }; > } >- catch { >- carp "Mail not sent: $_"; >- }; > } > else { > print $message; >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36504
:
164385
| 164386