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
67aa58df
Commit
67aa58df
authored
Nov 30, 2011
by
Byron Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 696005: Fix encoding of emails after extensions have hooked the email, not before
r=dkl, a=mkanat
parent
10f62820
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
19 deletions
+19
-19
Mailer.pm
Bugzilla/Mailer.pm
+19
-19
No files found.
Bugzilla/Mailer.pm
View file @
67aa58df
...
...
@@ -87,25 +87,6 @@ sub MessageToMTA {
# thus to hopefully avoid auto replies.
$email
->
header_set
(
'Auto-Submitted'
,
'auto-generated'
);
$email
->
walk_parts
(
sub
{
my
(
$part
)
=
@_
;
return
if
$part
->
parts
>
1
;
# Top-level
my
$content_type
=
$part
->
content_type
||
''
;
if
(
$content_type
!~
/;/
)
{
my
$body
=
$part
->
body
;
if
(
Bugzilla
->
params
->
{
'utf8'
})
{
$part
->
charset_set
(
'UTF-8'
);
# encoding_set works only with bytes, not with utf8 strings.
my
$raw
=
$part
->
body_raw
;
if
(
utf8::
is_utf8
(
$raw
))
{
utf8::
encode
(
$raw
);
$part
->
body_set
(
$raw
);
}
}
$part
->
encoding_set
(
'quoted-printable'
)
if
!
is_7bit_clean
(
$body
);
}
});
# MIME-Version must be set otherwise some mailsystems ignore the charset
$email
->
header_set
(
'MIME-Version'
,
'1.0'
)
if
!
$email
->
header
(
'MIME-Version'
);
...
...
@@ -171,6 +152,25 @@ sub MessageToMTA {
Bugzilla::Hook::
process
(
'mailer_before_send'
,
{
email
=>
$email
,
mailer_args
=>
\
@args
});
$email
->
walk_parts
(
sub
{
my
(
$part
)
=
@_
;
return
if
$part
->
parts
>
1
;
# Top-level
my
$content_type
=
$part
->
content_type
||
''
;
if
(
$content_type
!~
/;/
)
{
my
$body
=
$part
->
body
;
if
(
Bugzilla
->
params
->
{
'utf8'
})
{
$part
->
charset_set
(
'UTF-8'
);
# encoding_set works only with bytes, not with utf8 strings.
my
$raw
=
$part
->
body_raw
;
if
(
utf8::
is_utf8
(
$raw
))
{
utf8::
encode
(
$raw
);
$part
->
body_set
(
$raw
);
}
}
$part
->
encoding_set
(
'quoted-printable'
)
if
!
is_7bit_clean
(
$body
);
}
});
if
(
$method
eq
"Test"
)
{
my
$filename
=
bz_locations
()
->
{
'datadir'
}
.
'/mailer.testfile'
;
open
TESTFILE
,
'>>'
,
$filename
;
...
...
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