[ 
https://issues.apache.org/jira/browse/JAMES-2253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16294585#comment-16294585
 ] 

ASF GitHub Bot commented on JAMES-2253:
---------------------------------------

Github user chibenwa commented on a diff in the pull request:

    https://github.com/apache/james-project/pull/88#discussion_r157411809
  
    --- Diff: 
mailet/standard/src/main/java/org/apache/james/transport/mailets/AddFooter.java 
---
    @@ -94,11 +94,18 @@ private boolean attachFooter(MimePart part) throws 
MessagingException, IOExcepti
             if (part.isMimeType("multipart/mixed")
                     || part.isMimeType("multipart/related")) {
                 MimeMultipart multipart = (MimeMultipart) part.getContent();
    -            return attachFooterToFirstPart(multipart);
    +            boolean added = attachFooterToFirstPart(multipart);
    +            if (added) {
    +                   part.setContent(multipart);
    +            }
    +            return added;
     
             } else if (part.isMimeType("multipart/alternative")) {
                 MimeMultipart multipart = (MimeMultipart) part.getContent();
    -            return attachFooterToAllSubparts(multipart);
    +            boolean added = attachFooterToAllSubparts(multipart);
    +            if (added) {
    +                   part.setContent(multipart);
    +            }
    --- End diff --
    
    I guess you forgot the `return added` stuff here...
    
    That would cause `multipart/alternative` to not be well handled anymore...
    
    By the way forgetting this return breaks tests.


> addFooter mailet doesn't work for multipart mail
> ------------------------------------------------
>
>                 Key: JAMES-2253
>                 URL: https://issues.apache.org/jira/browse/JAMES-2253
>             Project: James Server
>          Issue Type: Bug
>    Affects Versions: 3.0.0-beta5
>            Reporter: Taro App
>         Attachments: AddFooter.patch
>
>
> The addFooter mailet doesn't work for multipart mail, though It works for 
> text mail. (Tested with 3.0.1.)
> The addFooterTest ends successfully but the mailet doesn't work on the real 
> James server.
> The addFooterTest uses javax.mail.internet.MimeMessage, but the real mailet 
> uses org.apache.james.server.core.MimeMessageCopyOnWriteProxy which extends 
> MimeMessage.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org

Reply via email to