You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Madiba Soft <ma...@gmail.com> on 2014/07/18 09:44:19 UTC
[email] Map cid's to attachments? (Rendering html content)
Hi,
I'm trying to figure out how to display the output of
MimeMessageParser's getHtmlContent() into a dojo html widget.
Obviously the cid: links are not understood by any parser.
In my previous implementation (using javax.mail) I simply replaced all
the cid: links with url's pointing back to a web service which served
those attachtments.
But with commons-email, I cannot find a way to figure out which cid:
corresponds to which attachment (parser.getAttachmentList();) since
the DataSource only shows the attachment name.
Could anyone point me at a way to figure out which cid maps to which attachment?
Please note I am loading emails from file, not constructing them
myself, so HtmlEmail is of no use, unless there is some why perhaps to
create an HtmlEmail from a saved email - but even then, the inlineEmbeds field
is proptected, so I cannot access it.
many thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
Re: [email] Map cid's to attachments? (Rendering html content)
Posted by Madiba Soft <ma...@gmail.com>.
I just uploaded a patched file for your consideration to the feature
request ticket.
The feature seems very simple to implement.
Small change to the parse() method, and two new methods added :
public List<String> getCids();
public DataSource getDataSourceForCid(String cid);
Unfortunately I couldn't get the svn project working well in Eclipse
(Maven didn't like the parent pom entry) so I didn't add any JUnit
test to exercise this.
But hopefully this provides something you could use going forward with
a similar functionality.
On Fri, Jul 18, 2014 at 1:31 PM, Thomas Neidhart
<th...@gmail.com> wrote:
> Ok great, thanks!
>
> Thomas
>
>
> On Fri, Jul 18, 2014 at 3:25 PM, Madiba Soft <ma...@gmail.com> wrote:
>
>> Thanks Thomas,
>> https://issues.apache.org/jira/browse/EMAIL-141
>>
>> I will check out the source and see if it's feasible to try and
>> provide a patch myself for consideration.
>>
>> On Fri, Jul 18, 2014 at 8:25 AM, Thomas Neidhart
>> <th...@gmail.com> wrote:
>> > Hi,
>> >
>> > I think this is not possible right now.
>> > The MimeMessageParser does not take the Content-ID of any attachments
>> into
>> > account,
>> > but should ideally provide a translation from cid to name (or the
>> > attachment object itself) so that you can post-process the html content.
>> >
>> > Could you create a feature request for this on JIRA?
>> >
>> > Thanks,
>> >
>> > Thomas
>> >
>> >
>> >
>> > On Fri, Jul 18, 2014 at 9:44 AM, Madiba Soft <ma...@gmail.com>
>> wrote:
>> >
>> >> Hi,
>> >>
>> >> I'm trying to figure out how to display the output of
>> >> MimeMessageParser's getHtmlContent() into a dojo html widget.
>> >> Obviously the cid: links are not understood by any parser.
>> >> In my previous implementation (using javax.mail) I simply replaced all
>> >> the cid: links with url's pointing back to a web service which served
>> >> those attachtments.
>> >>
>> >> But with commons-email, I cannot find a way to figure out which cid:
>> >> corresponds to which attachment (parser.getAttachmentList();) since
>> >> the DataSource only shows the attachment name.
>> >>
>> >> Could anyone point me at a way to figure out which cid maps to which
>> >> attachment?
>> >>
>> >> Please note I am loading emails from file, not constructing them
>> >> myself, so HtmlEmail is of no use, unless there is some why perhaps to
>> >> create an HtmlEmail from a saved email - but even then, the inlineEmbeds
>> >> field
>> >> is proptected, so I cannot access it.
>> >>
>> >> many thanks
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> >> For additional commands, e-mail: user-help@commons.apache.org
>> >>
>> >>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
Re: [email] Map cid's to attachments? (Rendering html content)
Posted by Thomas Neidhart <th...@gmail.com>.
Ok great, thanks!
Thomas
On Fri, Jul 18, 2014 at 3:25 PM, Madiba Soft <ma...@gmail.com> wrote:
> Thanks Thomas,
> https://issues.apache.org/jira/browse/EMAIL-141
>
> I will check out the source and see if it's feasible to try and
> provide a patch myself for consideration.
>
> On Fri, Jul 18, 2014 at 8:25 AM, Thomas Neidhart
> <th...@gmail.com> wrote:
> > Hi,
> >
> > I think this is not possible right now.
> > The MimeMessageParser does not take the Content-ID of any attachments
> into
> > account,
> > but should ideally provide a translation from cid to name (or the
> > attachment object itself) so that you can post-process the html content.
> >
> > Could you create a feature request for this on JIRA?
> >
> > Thanks,
> >
> > Thomas
> >
> >
> >
> > On Fri, Jul 18, 2014 at 9:44 AM, Madiba Soft <ma...@gmail.com>
> wrote:
> >
> >> Hi,
> >>
> >> I'm trying to figure out how to display the output of
> >> MimeMessageParser's getHtmlContent() into a dojo html widget.
> >> Obviously the cid: links are not understood by any parser.
> >> In my previous implementation (using javax.mail) I simply replaced all
> >> the cid: links with url's pointing back to a web service which served
> >> those attachtments.
> >>
> >> But with commons-email, I cannot find a way to figure out which cid:
> >> corresponds to which attachment (parser.getAttachmentList();) since
> >> the DataSource only shows the attachment name.
> >>
> >> Could anyone point me at a way to figure out which cid maps to which
> >> attachment?
> >>
> >> Please note I am loading emails from file, not constructing them
> >> myself, so HtmlEmail is of no use, unless there is some why perhaps to
> >> create an HtmlEmail from a saved email - but even then, the inlineEmbeds
> >> field
> >> is proptected, so I cannot access it.
> >>
> >> many thanks
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> >> For additional commands, e-mail: user-help@commons.apache.org
> >>
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>
Re: [email] Map cid's to attachments? (Rendering html content)
Posted by Madiba Soft <ma...@gmail.com>.
Thanks Thomas,
https://issues.apache.org/jira/browse/EMAIL-141
I will check out the source and see if it's feasible to try and
provide a patch myself for consideration.
On Fri, Jul 18, 2014 at 8:25 AM, Thomas Neidhart
<th...@gmail.com> wrote:
> Hi,
>
> I think this is not possible right now.
> The MimeMessageParser does not take the Content-ID of any attachments into
> account,
> but should ideally provide a translation from cid to name (or the
> attachment object itself) so that you can post-process the html content.
>
> Could you create a feature request for this on JIRA?
>
> Thanks,
>
> Thomas
>
>
>
> On Fri, Jul 18, 2014 at 9:44 AM, Madiba Soft <ma...@gmail.com> wrote:
>
>> Hi,
>>
>> I'm trying to figure out how to display the output of
>> MimeMessageParser's getHtmlContent() into a dojo html widget.
>> Obviously the cid: links are not understood by any parser.
>> In my previous implementation (using javax.mail) I simply replaced all
>> the cid: links with url's pointing back to a web service which served
>> those attachtments.
>>
>> But with commons-email, I cannot find a way to figure out which cid:
>> corresponds to which attachment (parser.getAttachmentList();) since
>> the DataSource only shows the attachment name.
>>
>> Could anyone point me at a way to figure out which cid maps to which
>> attachment?
>>
>> Please note I am loading emails from file, not constructing them
>> myself, so HtmlEmail is of no use, unless there is some why perhaps to
>> create an HtmlEmail from a saved email - but even then, the inlineEmbeds
>> field
>> is proptected, so I cannot access it.
>>
>> many thanks
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
Re: [email] Map cid's to attachments? (Rendering html content)
Posted by Thomas Neidhart <th...@gmail.com>.
Hi,
I think this is not possible right now.
The MimeMessageParser does not take the Content-ID of any attachments into
account,
but should ideally provide a translation from cid to name (or the
attachment object itself) so that you can post-process the html content.
Could you create a feature request for this on JIRA?
Thanks,
Thomas
On Fri, Jul 18, 2014 at 9:44 AM, Madiba Soft <ma...@gmail.com> wrote:
> Hi,
>
> I'm trying to figure out how to display the output of
> MimeMessageParser's getHtmlContent() into a dojo html widget.
> Obviously the cid: links are not understood by any parser.
> In my previous implementation (using javax.mail) I simply replaced all
> the cid: links with url's pointing back to a web service which served
> those attachtments.
>
> But with commons-email, I cannot find a way to figure out which cid:
> corresponds to which attachment (parser.getAttachmentList();) since
> the DataSource only shows the attachment name.
>
> Could anyone point me at a way to figure out which cid maps to which
> attachment?
>
> Please note I am loading emails from file, not constructing them
> myself, so HtmlEmail is of no use, unless there is some why perhaps to
> create an HtmlEmail from a saved email - but even then, the inlineEmbeds
> field
> is proptected, so I cannot access it.
>
> many thanks
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>