[ 
https://issues.apache.org/jira/browse/JAMES-2375?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tellier Benoit updated JAMES-2375:
----------------------------------
    Description: 
As reported by Craig Cudmor,

DSNBounce never position a subject on sent emails, independently from the 
"prefix" configuration option.

{code:java}
    @Test
    public void test() throws Exception {
        FakeMailetConfig mailetConfig = FakeMailetConfig.builder()
                .mailetName(MAILET_NAME)
                .mailetContext(fakeMailContext)
            .setProperty("prefix", "Re:")
                .build();
        dsnBounce.init(mailetConfig);

        MailAddress senderMailAddress = new MailAddress("sen...@domain.com");
        FakeMail mail = FakeMail.builder()
                .sender(senderMailAddress)
                .mimeMessage(MimeMessageBuilder.mimeMessageBuilder()
                    .setSubject("Toto")
                    .setText("My content"))
                .name(MAILET_NAME)
                .recipient("recipi...@domain.com")
                
.lastUpdated(DateTime.parse("2016-09-08T14:25:52.000Z").toDate())
                .build();

        dsnBounce.service(mail);

        List<SentMail> sentMails = fakeMailContext.getSentMails();
        assertThat(sentMails).hasSize(1);
        SentMail sentMail = sentMails.get(0);
        MimeMessage sentMessage = sentMail.getMsg();
        assertThat(sentMessage.getSubject()).isEqualTo("Re: Toto");
    }
{code}

will fail.

We need to use a default 'Re: ' prefix, and ensure a subject is always sent.

We need to check subjects for the RedirectNotify mailet hierarchy.

  was:
DSNBounce never position a subject on sent emails, independently from the 
"prefix" configuration option.

{code:java}
    @Test
    public void test() throws Exception {
        FakeMailetConfig mailetConfig = FakeMailetConfig.builder()
                .mailetName(MAILET_NAME)
                .mailetContext(fakeMailContext)
            .setProperty("prefix", "Re:")
                .build();
        dsnBounce.init(mailetConfig);

        MailAddress senderMailAddress = new MailAddress("sen...@domain.com");
        FakeMail mail = FakeMail.builder()
                .sender(senderMailAddress)
                .mimeMessage(MimeMessageBuilder.mimeMessageBuilder()
                    .setSubject("Toto")
                    .setText("My content"))
                .name(MAILET_NAME)
                .recipient("recipi...@domain.com")
                
.lastUpdated(DateTime.parse("2016-09-08T14:25:52.000Z").toDate())
                .build();

        dsnBounce.service(mail);

        List<SentMail> sentMails = fakeMailContext.getSentMails();
        assertThat(sentMails).hasSize(1);
        SentMail sentMail = sentMails.get(0);
        MimeMessage sentMessage = sentMail.getMsg();
        assertThat(sentMessage.getSubject()).isEqualTo("Re: Toto");
    }
{code}

will fail.

We need to use a default 'Re: ' prefix, and ensure a subject is always sent.

We need to check subjects for the RedirectNotify mailet hierarchy.


> DSNBounce mailet do not provide a subject
> -----------------------------------------
>
>                 Key: JAMES-2375
>                 URL: https://issues.apache.org/jira/browse/JAMES-2375
>             Project: James Server
>          Issue Type: Bug
>          Components: Mailet Contributions
>            Reporter: Tellier Benoit
>            Priority: Major
>              Labels: bug, easy-fix
>
> As reported by Craig Cudmor,
> DSNBounce never position a subject on sent emails, independently from the 
> "prefix" configuration option.
> {code:java}
>     @Test
>     public void test() throws Exception {
>         FakeMailetConfig mailetConfig = FakeMailetConfig.builder()
>                 .mailetName(MAILET_NAME)
>                 .mailetContext(fakeMailContext)
>             .setProperty("prefix", "Re:")
>                 .build();
>         dsnBounce.init(mailetConfig);
>         MailAddress senderMailAddress = new MailAddress("sen...@domain.com");
>         FakeMail mail = FakeMail.builder()
>                 .sender(senderMailAddress)
>                 .mimeMessage(MimeMessageBuilder.mimeMessageBuilder()
>                     .setSubject("Toto")
>                     .setText("My content"))
>                 .name(MAILET_NAME)
>                 .recipient("recipi...@domain.com")
>                 
> .lastUpdated(DateTime.parse("2016-09-08T14:25:52.000Z").toDate())
>                 .build();
>         dsnBounce.service(mail);
>         List<SentMail> sentMails = fakeMailContext.getSentMails();
>         assertThat(sentMails).hasSize(1);
>         SentMail sentMail = sentMails.get(0);
>         MimeMessage sentMessage = sentMail.getMsg();
>         assertThat(sentMessage.getSubject()).isEqualTo("Re: Toto");
>     }
> {code}
> will fail.
> We need to use a default 'Re: ' prefix, and ensure a subject is always sent.
> We need to check subjects for the RedirectNotify mailet hierarchy.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
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