[
https://issues.apache.org/jira/browse/MAILET-162?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Craig Cudmore updated MAILET-162:
---------------------------------
Description:
If the <notice> parameter of a Mailet contains multi-byte characters in the
text the multibyte characters are not processed properly in the resulting
message.
Example text:
<notice>Votre message a été rejeté</notice>
or
<notice>Votre message a été rejeté</notice>
This impacts the following mailets: Bounce, Forward, NotifyPostmaster,
NotifySender, Redirect, Resend.
Also an issue with DSNBounce.
Diff to fix this problem is attached
was:
If the <notice> parameter of a Mailet contains multi-byte characters in the
text the multibyte characters are not processed properly in the resulting
message.
Example text:
<notice>Votre message a été rejeté</notice>
or
<notice>Votre message a été rejeté</notice>
This impacts the following mailets: Bounce, Forward, NotifyPostmaster,
NotifySender, Redirect, Resend.
Code to fix this is as follows:
org.apache.james.transport.mailets.redirect.MailMessageAlteringUtils.java
Add imports:
import javax.activation.DataHandler;
import javax.mail.util.ByteArrayDataSource;
Modify method getBodyPart to:
private BodyPart getBodyPart(Mail originalMail, MimeMessage originalMessage,
String head) throws MessagingException, Exception
{ MimeBodyPart part = new MimeBodyPart(); part.setDataHandler( new DataHandler(
new ByteArrayDataSource( getText(originalMail, originalMessage, head),
"text/plain; charset=UTF-8"))); part.setDisposition(javax.mail.Part.INLINE);
return part; }
> Mailets (Bounce, Forward, etc) do not handle multi-byte characters in the
> notice parameter
> ------------------------------------------------------------------------------------------
>
> Key: MAILET-162
> URL: https://issues.apache.org/jira/browse/MAILET-162
> Project: James Mailet
> Issue Type: Improvement
> Components: Base Mailets
> Affects Versions: master
> Reporter: Craig Cudmore
> Priority: Minor
> Fix For: master
>
> Attachments: MailMessageAlteringUtils.diff
>
>
> If the <notice> parameter of a Mailet contains multi-byte characters in the
> text the multibyte characters are not processed properly in the resulting
> message.
> Example text:
> <notice>Votre message a été rejeté</notice>
> or
> <notice>Votre message a été rejeté</notice>
>
> This impacts the following mailets: Bounce, Forward, NotifyPostmaster,
> NotifySender, Redirect, Resend.
> Also an issue with DSNBounce.
> Diff to fix this problem is attached
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)