Hendrik Saly (JIRA | 19 Nov 23:48 2014
Picon

[jira] [Commented] (GERONIMO-6480) Wrong attachment 'Content-type' in some conditions


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

Hendrik Saly commented on GERONIMO-6480:
----------------------------------------

thanks for the testcase
will be fixed in the next (major) version

> Wrong attachment 'Content-type' in some conditions
> --------------------------------------------------
>
>                 Key: GERONIMO-6480
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-6480
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: mail
>            Reporter: Alexandre Garnier
>            Assignee: Hendrik Saly
>              Labels: JM14_1.8.5
>         Attachments: GERONIMO-6480.tar.gz
>
>
> When you set an attachment filename before having a Content-type defined, then the Content-type is set to 'text/plain'.
> {code:language=java}
> BodyPart attachmentPart = new MimeBodyPart();
> attachmentPart.setDataHandler(dh);
(Continue reading)

Hendrik Saly (JIRA | 19 Nov 23:47 2014
Picon

[jira] [Updated] (GERONIMO-6480) Wrong attachment 'Content-type' in some conditions


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

Hendrik Saly updated GERONIMO-6480:
-----------------------------------
    Labels: JM14_1.8.5  (was: )

> Wrong attachment 'Content-type' in some conditions
> --------------------------------------------------
>
>                 Key: GERONIMO-6480
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-6480
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: mail
>            Reporter: Alexandre Garnier
>            Assignee: Hendrik Saly
>              Labels: JM14_1.8.5
>         Attachments: GERONIMO-6480.tar.gz
>
>
> When you set an attachment filename before having a Content-type defined, then the Content-type is set to 'text/plain'.
> {code:language=java}
> BodyPart attachmentPart = new MimeBodyPart();
> attachmentPart.setDataHandler(dh);
> attachmentPart.setFileName("test.pdf");
> {code}
> ==> Content-type = 'text/plain'
(Continue reading)

Alexandre Garnier (JIRA | 12 Nov 16:19 2014
Picon

[jira] [Updated] (GERONIMO-6480) Wrong attachment 'Content-type' in some conditions


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

Alexandre Garnier updated GERONIMO-6480:
----------------------------------------
    Attachment:     (was: GERONIMO-6480.tar.gz)

> Wrong attachment 'Content-type' in some conditions
> --------------------------------------------------
>
>                 Key: GERONIMO-6480
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-6480
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: mail
>            Reporter: Alexandre Garnier
>            Assignee: Hendrik Saly
>         Attachments: GERONIMO-6480.tar.gz
>
>
> When you set an attachment filename before having a Content-type defined, then the Content-type is set to 'text/plain'.
> {code:language=java}
> BodyPart attachmentPart = new MimeBodyPart();
> attachmentPart.setDataHandler(dh);
> attachmentPart.setFileName("test.pdf");
> {code}
> ==> Content-type = 'text/plain'
> {code:language=java}
(Continue reading)

Alexandre Garnier (JIRA | 12 Nov 16:19 2014
Picon

[jira] [Updated] (GERONIMO-6480) Wrong attachment 'Content-type' in some conditions


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

Alexandre Garnier updated GERONIMO-6480:
----------------------------------------
    Attachment: GERONIMO-6480.tar.gz

> Wrong attachment 'Content-type' in some conditions
> --------------------------------------------------
>
>                 Key: GERONIMO-6480
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-6480
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: mail
>            Reporter: Alexandre Garnier
>            Assignee: Hendrik Saly
>         Attachments: GERONIMO-6480.tar.gz
>
>
> When you set an attachment filename before having a Content-type defined, then the Content-type is set to 'text/plain'.
> {code:language=java}
> BodyPart attachmentPart = new MimeBodyPart();
> attachmentPart.setDataHandler(dh);
> attachmentPart.setFileName("test.pdf");
> {code}
> ==> Content-type = 'text/plain'
> {code:language=java}
(Continue reading)

Alexandre Garnier (JIRA | 10 Nov 16:27 2014
Picon

[jira] [Comment Edited] (GERONIMO-6480) Wrong attachment 'Content-type' in some conditions


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

Alexandre Garnier edited comment on GERONIMO-6480 at 11/10/14 3:26 PM:
-----------------------------------------------------------------------

Here is a test-case showing the content-type at client side.
You can switch the javamail implementation between geronimo javamail and Oracle/Sun javamail by
changing the dependencies in the {{pom.xml}}.

BTW, calling {{getContentType()}} will always at least return {{text/plain}} because it's the default
value, but when the real value is {{null}}, then it's correctly set afterwards (if not forced to
'text/plain' when adding the 'name=' part)

was (Author: zigarn0):
Here is a test-case showing the content-type at client side.
You can switch the javamail implementation between geronimo javamail and Oracle/Sun javamail.

BTW, calling {{getContentType()}} will always at least return {{text/plain}} because it's the default
value, but when the real value is {{null}}, then it's correctly set afterwards (if not forced to
'text/plain' when adding the 'name=' part)

> Wrong attachment 'Content-type' in some conditions
> --------------------------------------------------
>
>                 Key: GERONIMO-6480
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-6480
>             Project: Geronimo
(Continue reading)

Alexandre Garnier (JIRA | 10 Nov 16:26 2014
Picon

[jira] [Updated] (GERONIMO-6480) Wrong attachment 'Content-type' in some conditions


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

Alexandre Garnier updated GERONIMO-6480:
----------------------------------------
    Attachment: GERONIMO-6480.tar.gz

Here is a test-case showing the content-type at client side.
You can switch the javamail implementation between geronimo javamail and Oracle/Sun javamail.

BTW, calling {{getContentType()}} will always at least return {{text/plain}} because it's the default
value, but when the real value is {{null}}, then it's correctly set afterwards (if not forced to
'text/plain' when adding the 'name=' part)

> Wrong attachment 'Content-type' in some conditions
> --------------------------------------------------
>
>                 Key: GERONIMO-6480
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-6480
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: mail
>            Reporter: Alexandre Garnier
>            Assignee: Hendrik Saly
>         Attachments: GERONIMO-6480.tar.gz
>
>
> When you set an attachment filename before having a Content-type defined, then the Content-type is set to 'text/plain'.
(Continue reading)

Alexandre Garnier (JIRA | 10 Nov 11:38 2014
Picon

[jira] [Commented] (GERONIMO-6480) Wrong attachment 'Content-type' in some conditions


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

Alexandre Garnier commented on GERONIMO-6480:
---------------------------------------------

Hmm, should have attach a test case and I don't remember well this issue.
I think that the idea was with {{mail.mime.setcontenttypefilename}} set to {{true}} to compute the
content-type from the filename ('*.pdf' => 'application/pdf') when adding the 'name=xxx' instead of
using the default 'text/plain', because when this option is not set or the {{setDataHandler}} is called
after, then the 'content-type' was right (in the final e-mail, maybe not when calling
{{getContentType()}} which will always fallback to 'text/plain')

I will try to reproduce this when I have time and post the use case.

> Wrong attachment 'Content-type' in some conditions
> --------------------------------------------------
>
>                 Key: GERONIMO-6480
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-6480
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: mail
>            Reporter: Alexandre Garnier
>            Assignee: Hendrik Saly
>
> When you set an attachment filename before having a Content-type defined, then the Content-type is set to 'text/plain'.
(Continue reading)

Hendrik Saly (JIRA | 9 Nov 21:18 2014
Picon

[jira] [Updated] (GERONIMO-4594) The javamail provider should have a way to decode attachment names


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

Hendrik Saly updated GERONIMO-4594:
-----------------------------------
    Component/s: mail

> The javamail provider should have a way to decode attachment names
> ------------------------------------------------------------------
>
>                 Key: GERONIMO-4594
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4594
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: mail
>            Reporter: Guillaume Nodet
>            Assignee: Hendrik Saly
>
> Something has been written in the api, but not for the provider.
> The IMAPMimeBodyPart code follows:
> {code}
>     public String getFileName() throws MessagingException {
>         String filename = bodyStructure.disposition.getParameter("filename");
>         if (filename == null) {
>             filename = bodyStructure.mimeType.getParameter("name");
>         }
>         return filename;
>     }
(Continue reading)

Hendrik Saly (JIRA | 9 Nov 21:09 2014
Picon

[jira] [Commented] (GERONIMO-6480) Wrong attachment 'Content-type' in some conditions


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

Hendrik Saly commented on GERONIMO-6480:
----------------------------------------

The unittests below are all green for geronimo javamail 1.8.4 (spec 1.7.1) and Oracle/Sun javamail
reference implementation 1.5.2.
I don't see here an issue.

{code}
    public void testGERONIMO6480_0() throws Exception {
        final BodyPart attachmentPart = new MimeBodyPart();
        attachmentPart.setDataHandler(new DataHandler(new FileDataSource(
                getAbsoluteFilePathFromClassPath("jmeter_distributed_testing_step_by_step.pdf"))));
        attachmentPart.setFileName("test.pdf");
        Assert.assertEquals("text/plain; name=test.pdf", attachmentPart.getContentType());
    }

    public void testGERONIMO6480_1() throws Exception {
        final MimeBodyPart attachmentPart = new MimeBodyPart();
        attachmentPart.addHeader("Content-Type", "aplication/pdf");
        attachmentPart.setDataHandler(new DataHandler(new FileDataSource(
                getAbsoluteFilePathFromClassPath("jmeter_distributed_testing_step_by_step.pdf"))));
        attachmentPart.setFileName("test.pdf");
        Assert.assertEquals("text/plain; name=test.pdf", attachmentPart.getContentType());

    }
(Continue reading)

Hendrik Saly (JIRA | 9 Nov 14:24 2014
Picon

[jira] [Assigned] (GERONIMO-5428) Supported properties don't appear to be documented anywhere


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

Hendrik Saly reassigned GERONIMO-5428:
--------------------------------------

    Assignee: Hendrik Saly

> Supported properties don't appear to be documented anywhere
> -----------------------------------------------------------
>
>                 Key: GERONIMO-5428
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-5428
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: mail
>         Environment: geronimo-javamail_1.4_mail-1.8.1.jar
>            Reporter: Sebb
>            Assignee: Hendrik Saly
>
> The properties supported by Geronimo don't appear to be documented anywhere.
> For example, geronimo-javamail_1.4_mail-1.8.1.jar supports
mail.<protocol>.socketFactory.class but I could find no documentation that it does so, nor what other
properties it supports.

--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
(Continue reading)

Hendrik Saly (JIRA | 9 Nov 14:24 2014
Picon

[jira] [Assigned] (GERONIMO-6480) Wrong attachment 'Content-type' in some conditions


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

Hendrik Saly reassigned GERONIMO-6480:
--------------------------------------

    Assignee: Hendrik Saly

> Wrong attachment 'Content-type' in some conditions
> --------------------------------------------------
>
>                 Key: GERONIMO-6480
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-6480
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: mail
>            Reporter: Alexandre Garnier
>            Assignee: Hendrik Saly
>
> When you set an attachment filename before having a Content-type defined, then the Content-type is set to 'text/plain'.
> {code:language=java}
> BodyPart attachmentPart = new MimeBodyPart();
> attachmentPart.setDataHandler(dh);
> attachmentPart.setFileName("test.pdf");
> {code}
> ==> Content-type = 'text/plain'
> {code:language=java}
> BodyPart attachmentPart = new MimeBodyPart();
(Continue reading)


Gmane