summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlbert Ting <altlist@gmail.com>2011-12-05 20:30:41 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2011-12-05 20:30:41 +0100
commit0489dcca3dd271c5f25f1d7bc283913263414e5f (patch)
tree4dadffd11291d102e7e013932d19ef4068c4206a
parentea02384f5c8c226c3eeea27513365f2f2f11e745 (diff)
downloadbugzilla-0489dcca3dd271c5f25f1d7bc283913263414e5f.tar.gz
bugzilla-0489dcca3dd271c5f25f1d7bc283913263414e5f.tar.xz
Bug 422256: email_in.pl should send an email if user matching fails or returns too many results
r/a=mkanat
-rwxr-xr-xemail_in.pl19
1 files changed, 14 insertions, 5 deletions
diff --git a/email_in.pl b/email_in.pl
index 55e7b119a..ed4cf9a04 100755
--- a/email_in.pl
+++ b/email_in.pl
@@ -158,22 +158,29 @@ sub parse_mail {
return \%fields;
}
-sub post_bug {
+sub check_email_fields {
my ($fields) = @_;
- debug_print('Posting a new bug...');
-
- my $user = Bugzilla->user;
my ($retval, $non_conclusive_fields) =
Bugzilla::User::match_field({
'assigned_to' => { 'type' => 'single' },
'qa_contact' => { 'type' => 'single' },
- 'cc' => { 'type' => 'multi' }
+ 'cc' => { 'type' => 'multi' },
+ 'newcc' => { 'type' => 'multi' }
}, $fields, MATCH_SKIP_CONFIRM);
if ($retval != USER_MATCH_SUCCESS) {
ThrowUserError('user_match_too_many', {fields => $non_conclusive_fields});
}
+}
+
+sub post_bug {
+ my ($fields) = @_;
+ debug_print('Posting a new bug...');
+
+ my $user = Bugzilla->user;
+
+ check_email_fields($fields);
my $bug = Bugzilla::Bug->create($fields);
debug_print("Created bug " . $bug->id);
@@ -214,6 +221,8 @@ sub process_bug {
$fields{'removecc'} = 1;
}
+ check_email_fields(\%fields);
+
my $cgi = Bugzilla->cgi;
foreach my $field (keys %fields) {
$cgi->param(-name => $field, -value => $fields{$field});