Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
e3fd496e
Commit
e3fd496e
authored
Jun 21, 2010
by
Max Kanat-Alexander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 564082: Allow specifying defaults and overrides for incoming email
using command-line parameters to email_in.pl r=timello, a=mkanat
parent
90a16d9e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
7 deletions
+21
-7
email_in.pl
email_in.pl
+21
-7
No files found.
email_in.pl
View file @
e3fd496e
...
...
@@ -74,7 +74,7 @@ sub parse_mail {
debug_print
(
'Parsing Email'
);
$input_email
=
Email::
MIME
->
new
(
$mail_text
);
my
%
fields
;
my
%
fields
=
%
{
$switch
{
'default'
}
||
{}
}
;
my
$summary
=
$input_email
->
header
(
'Subject'
);
if
(
$summary
=~
/\[\S+ (\d+)\](.*)/i
)
{
...
...
@@ -136,6 +136,11 @@ sub parse_mail {
}
$fields
{
'comment'
}
=
$comment
;
my
%
override
=
%
{
$switch
{
'override'
}
||
{}
};
foreach
my
$key
(
keys
%
override
)
{
$fields
{
$key
}
=
$override
{
$key
};
}
debug_print
(
"Parsed Fields:\n"
.
Dumper
(
\%
fields
),
2
);
return
\%
fields
;
...
...
@@ -383,7 +388,7 @@ sub die_handler {
$SIG
{
__DIE__
}
=
\&
die_handler
;
GetOptions
(
\%
switch
,
'help|h'
,
'verbose|v+'
);
GetOptions
(
\%
switch
,
'help|h'
,
'verbose|v+'
,
'default=s%'
,
'override=s%'
);
$switch
{
'verbose'
}
||=
0
;
# Print the help message if that switch was selected.
...
...
@@ -434,13 +439,22 @@ email_in.pl - The Bugzilla Inbound Email Interface
=head1 SYNOPSIS
./email_in.pl [-vvv] < email.txt
./email_in.pl [-vvv] [--default name=value] [--override name=value] < email.txt
Reads an email on STDIN (the standard input).
Options:
--verbose (-v) - Make the script print more to STDERR.
Specify multiple times to print even more.
Reads an email on STDIN (the standard input).
--default name=value - Specify defaults for field values, like
product=TestProduct. Can be specified multiple
times to specify defaults for multiple fields.
Options:
--verbose (-v) - Make the script print more to STDERR.
Specify multiple times to print even more
.
--override name=value - Override field values specified in the email,
like product=TestProduct. Can be specified
multiple times to override multiple fields
.
=head1 DESCRIPTION
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment