diff options
author | 2015-10-23 15:25:19 +0200 | |
---|---|---|
committer | 2015-10-23 15:25:19 +0200 | |
commit | 948b58060560b15982da3078ce0595227aef723e (patch) | |
tree | d84217f333e5013ade8530765d459a51be92a10d /whine.pl | |
parent | The correct name of the parameter is cookiepath, not cookiebase (diff) | |
download | bugzilla-948b58060560b15982da3078ce0595227aef723e.tar.gz bugzilla-948b58060560b15982da3078ce0595227aef723e.tar.bz2 bugzilla-948b58060560b15982da3078ce0595227aef723e.zip |
Bug 714724: Correctly encode emails as quoted-printable
r=dkl a=sgreen
Diffstat (limited to 'whine.pl')
-rwxr-xr-x | whine.pl | 51 |
1 files changed, 9 insertions, 42 deletions
@@ -346,53 +346,20 @@ while (my $event = get_next_event) { # - subject Subject line for the message # - recipient user object for the recipient # - author user object of the person who created the whine event -# -# In addition, mail adds two more fields to $args: -# - alternatives array of hashes defining mime multipart types and contents -# - boundary a MIME boundary generated using the process id and time -# sub mail { my $args = shift; - my $addressee = $args->{recipient}; # Don't send mail to someone whose bugmail notification is disabled. - return if $addressee->email_disabled; - - my $template = Bugzilla->template_inner($addressee->setting('lang')); - my $msg = ''; # it's a temporary variable to hold the template output - $args->{'alternatives'} ||= []; - - # put together the different multipart mime segments + return if $args->{recipient}->email_disabled; - $template->process("whine/mail.txt.tmpl", $args, \$msg) - or die($template->error()); - push @{$args->{'alternatives'}}, + $args->{to_user} = $args->{recipient}; + MessageToMTA(generate_email( + $args, { - 'content' => $msg, - 'type' => 'text/plain', - }; - $msg = ''; - - $template->process("whine/mail.html.tmpl", $args, \$msg) - or die($template->error()); - push @{$args->{'alternatives'}}, - { - 'content' => $msg, - 'type' => 'text/html', - }; - $msg = ''; - - # now produce a ready-to-mail mime-encoded message - - $args->{'boundary'} = "----------" . $$ . "--" . time() . "-----"; - - $template->process("whine/multipart-mime.txt.tmpl", $args, \$msg) - or die($template->error()); - - MessageToMTA($msg); - - delete $args->{'boundary'}; - delete $args->{'alternatives'}; - + header => 'whine/header.txt.tmpl', + text => 'whine/mail.txt.tmpl', + html => 'whine/mail.html.tmpl', + } + )); } # run_queries runs all of the queries associated with a schedule ID, adding |