aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2010-11-04 18:11:04 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2010-11-04 18:11:04 +0100
commit4dbba0312b6137ac9f5d3c307759a2ed73866b18 (patch)
tree07713d5070599ad144ee0404bed40cd18983c3e7 /email_in.pl
parentBug 485418: Code and template hooks for userprefs.cgi to be able to add addit... (diff)
downloadbugzilla-4dbba0312b6137ac9f5d3c307759a2ed73866b18.tar.gz
bugzilla-4dbba0312b6137ac9f5d3c307759a2ed73866b18.tar.bz2
bugzilla-4dbba0312b6137ac9f5d3c307759a2ed73866b18.zip
Bug 596611: Add a hook to email_in.pl
r/a=mkanat
Diffstat (limited to 'email_in.pl')
-rwxr-xr-xemail_in.pl6
1 files changed, 6 insertions, 0 deletions
diff --git a/email_in.pl b/email_in.pl
index 78ac32ca6..393061cd5 100755
--- a/email_in.pl
+++ b/email_in.pl
@@ -54,6 +54,7 @@ use Bugzilla::Mailer;
use Bugzilla::Token;
use Bugzilla::User;
use Bugzilla::Util;
+use Bugzilla::Hook;
#############
# Constants #
@@ -76,6 +77,8 @@ sub parse_mail {
$input_email = Email::MIME->new($mail_text);
my %fields = %{ $switch{'default'} || {} };
+ Bugzilla::Hook::process('email_in_before_parse', { mail => $input_email,
+ fields => \%fields });
my $summary = $input_email->header('Subject');
if ($summary =~ /\[\S+ (\d+)\](.*)/i) {
@@ -394,6 +397,9 @@ Bugzilla->usage_mode(USAGE_MODE_EMAIL);
my @mail_lines = <STDIN>;
my $mail_text = join("", @mail_lines);
my $mail_fields = parse_mail($mail_text);
+
+Bugzilla::Hook::process('email_in_after_parse', { fields => $mail_fields });
+
my $attachments = delete $mail_fields->{'attachments'};
my $username = $mail_fields->{'reporter'};