You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@synapse.apache.org by stlecho <st...@gmail.com> on 2008/09/17 18:01:15 UTC

Support for Mail Attachments

Hi,

Currently, I'm able to poll a message box and "forward" the content of the
mail to a Mediator. Now I would like to "forward" the attachments of the
mail message to the same Mediator. Is this supported by Synapse ? 

Regards, Stefan Lecho.
-- 
View this message in context: http://www.nabble.com/Support-for-Mail-Attachments-tp19535437p19535437.html
Sent from the Synapse - User mailing list archive at Nabble.com.


Re: Support for Mail Attachments

Posted by stlecho <st...@gmail.com>.
Jira issue has been created:
https://issues.apache.org/jira/browse/SYNAPSE-453

Andreas Veithen wrote:
> 
> Stefan,
> 
> Please go ahead and create a JIRA enhancement request. I will comment  
> on this proposal later.
> 
> Andreas
> 
> On 18 sept. 08, at 12:51, stlecho wrote:
> 
>>
>> Andreas,
>>
>> I would like to handle mail messages with and without attachments.
>>
>> In my current configuration, I've defined in the inSequence a Spring- 
>> based
>> Mediator. The MessageContext I'm receiving in the mediate method  
>> contains
>> the content of the mail message, but it does not contain the mail
>> attachment(s).
>>
>> When an email with an attachment (for instance a PDF document) is  
>> triggered
>> by the MailListener, the attachment should be accessible in the
>> MessageContext. If that is possible, I could for instance store the  
>> Word
>> document in a database for further treatment.
>>
>> Based on the stacktrace included underneath I guess that the
>> MailTransportListener reads the attachment but probably does not  
>> initialize
>> it in the MessageContext.
>>
>> PS: Should I create a Jira issue for this ?
>>
>> Stacktrace
>> 2008-09-18 12:19:39,428 [192.168.13.175-INFOR2] [mailto-Worker-6]  
>> DEBUG
>> MailTransportListener 1 messgaes in folder : INBOX
>> A7 FETCH 1 (FLAGS)
>> * 1 FETCH (FLAGS (\Recent))
>> A7 OK FETCH completed
>> A8 FETCH 1 (BODYSTRUCTURE)
>> * 1 FETCH (BODYSTRUCTURE ((("text" "plain" ("charset" "us-ascii")  
>> NIL NIL
>> "7bit" 46 1 NIL NIL NIL) "related" ("boundary"
>> "----=_Part_1_14721926.1221733166287") NIL NIL)("application" "octet- 
>> stream"
>> ("name" "This is an attachment") NIL NIL "base64" 22476 NIL  
>> ("attachment"
>> ("filename" "This is an attachment")) NIL) "mixed" ("boundary"
>> "----=_Part_0_3794357.1221733166256") NIL NIL))
>> A8 OK FETCH completed
>> A9 FETCH 1 (BODY.PEEK[HEADER])
>> * 1 FETCH (BODY[HEADER] {927}
>> Return-path: <ba...@posthouse.com>
>> Received: from INFOR2 ([192.168.13.175])
>> by posthouse.com (posthouse.com)
>> (MDaemon PRO v10.0.0)
>> with ESMTP id md50000001027.msg
>> for <cr...@posthouse.com>; Thu, 18 Sep 2008 12:19:14 +0200
>> X-Spam-Processed: posthouse.com, Thu, 18 Sep 2008 12:19:14 +0200
>> (not processed: spam filter heuristic analysis disabled)
>> X-Rcpt-To: credoc.in@posthouse.com
>> X-MDRcpt-To: credoc.in@posthouse.com
>> X-MDRemoteIP: 192.168.13.175
>> X-Return-Path: bank.out@posthouse.com
>> X-Envelope-From: bank.out@posthouse.com
>> X-MDaemon-Deliver-To: credoc.in@posthouse.com
>> Date: Thu, 18 Sep 2008 12:19:26 +0200 (CEST)
>> From: bank.out@posthouse.com
>> To: credoc.in@posthouse.com
>> Message-ID: <84...@INFOR2>
>> Subject: WSO2ESB - The subject of the mail - with an attachment !
>> MIME-Version: 1.0
>> Content-Type: multipart/mixed; boundary="---- 
>> =_Part_0_3794357.1221733166256"
>>
>> )
>> A9 OK FETCH completed
>> 2008-09-18 12:19:39,491 [192.168.13.175-INFOR2] [mailto-Worker-6]  
>> DEBUG
>> MailTransportListener Processing message as Content-Type : multipart/ 
>> mixed;
>> boundary="----=_Part_0_3794357.1221733166256"
>> A10 FETCH 1 (ENVELOPE INTERNALDATE RFC822.SIZE)
>> * 1 FETCH (ENVELOPE ("Thu, 18 Sep 2008 12:19:26 +0200 (CEST)"  
>> "WSO2ESB - The
>> subject of the mail - with an attachment !" ((NIL NIL "bank.out"
>> "posthouse.com")) ((NIL NIL "bank.out" "posthouse.com")) ((NIL NIL
>> "bank.out" "posthouse.com")) ((NIL NIL "credoc.in" "posthouse.com"))  
>> NIL NIL
>> NIL "<84...@INFOR2>") INTERNALDATE
>> "18-Sep-2008 12:19:14 +0200" RFC822.SIZE 23992)
>> A10 OK FETCH completed
>> A11 FETCH 1 (BODY[1.1]<0.46>)
>> * 1 FETCH (BODY[1.1]<0> {46}
>> A text message for WSO2 - with an attachment ! FLAGS (\Seen \Recent))
>> A11 OK FETCH completed
>>
>> Regards, Stefan.
>>
>> Andreas Veithen wrote:
>>>
>>> Stefan,
>>>
>>> I don't think that the current implementation can support this
>>> requirement. To evaluate what can be done, can you please explain  
>>> your
>>> use case in more detail?
>>>
>>> Regards,
>>>
>>> Andreas
>>>
>>> On 17 sept. 08, at 18:01, stlecho wrote:
>>>
>>>>
>>>> Hi,
>>>>
>>>> Currently, I'm able to poll a message box and "forward" the content
>>>> of the
>>>> mail to a Mediator. Now I would like to "forward" the attachments of
>>>> the
>>>> mail message to the same Mediator. Is this supported by Synapse ?
>>>>
>>>> Regards, Stefan Lecho.
>>>> -- 
>>>> View this message in context:
>>>> http://www.nabble.com/Support-for-Mail-Attachments-tp19535437p19535437.html
>>>> Sent from the Synapse - User mailing list archive at Nabble.com.
>>>>
>>>
>>>
>>>
>>
>> -- 
>> View this message in context:
>> http://www.nabble.com/Support-for-Mail-Attachments-tp19535437p19550204.html
>> Sent from the Synapse - User mailing list archive at Nabble.com.
>>
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Support-for-Mail-Attachments-tp19535437p19603754.html
Sent from the Synapse - User mailing list archive at Nabble.com.


Re: Support for Mail Attachments

Posted by Andreas Veithen <an...@skynet.be>.
Stefan,

Please go ahead and create a JIRA enhancement request. I will comment  
on this proposal later.

Andreas

On 18 sept. 08, at 12:51, stlecho wrote:

>
> Andreas,
>
> I would like to handle mail messages with and without attachments.
>
> In my current configuration, I've defined in the inSequence a Spring- 
> based
> Mediator. The MessageContext I'm receiving in the mediate method  
> contains
> the content of the mail message, but it does not contain the mail
> attachment(s).
>
> When an email with an attachment (for instance a PDF document) is  
> triggered
> by the MailListener, the attachment should be accessible in the
> MessageContext. If that is possible, I could for instance store the  
> Word
> document in a database for further treatment.
>
> Based on the stacktrace included underneath I guess that the
> MailTransportListener reads the attachment but probably does not  
> initialize
> it in the MessageContext.
>
> PS: Should I create a Jira issue for this ?
>
> Stacktrace
> 2008-09-18 12:19:39,428 [192.168.13.175-INFOR2] [mailto-Worker-6]  
> DEBUG
> MailTransportListener 1 messgaes in folder : INBOX
> A7 FETCH 1 (FLAGS)
> * 1 FETCH (FLAGS (\Recent))
> A7 OK FETCH completed
> A8 FETCH 1 (BODYSTRUCTURE)
> * 1 FETCH (BODYSTRUCTURE ((("text" "plain" ("charset" "us-ascii")  
> NIL NIL
> "7bit" 46 1 NIL NIL NIL) "related" ("boundary"
> "----=_Part_1_14721926.1221733166287") NIL NIL)("application" "octet- 
> stream"
> ("name" "This is an attachment") NIL NIL "base64" 22476 NIL  
> ("attachment"
> ("filename" "This is an attachment")) NIL) "mixed" ("boundary"
> "----=_Part_0_3794357.1221733166256") NIL NIL))
> A8 OK FETCH completed
> A9 FETCH 1 (BODY.PEEK[HEADER])
> * 1 FETCH (BODY[HEADER] {927}
> Return-path: <ba...@posthouse.com>
> Received: from INFOR2 ([192.168.13.175])
> by posthouse.com (posthouse.com)
> (MDaemon PRO v10.0.0)
> with ESMTP id md50000001027.msg
> for <cr...@posthouse.com>; Thu, 18 Sep 2008 12:19:14 +0200
> X-Spam-Processed: posthouse.com, Thu, 18 Sep 2008 12:19:14 +0200
> (not processed: spam filter heuristic analysis disabled)
> X-Rcpt-To: credoc.in@posthouse.com
> X-MDRcpt-To: credoc.in@posthouse.com
> X-MDRemoteIP: 192.168.13.175
> X-Return-Path: bank.out@posthouse.com
> X-Envelope-From: bank.out@posthouse.com
> X-MDaemon-Deliver-To: credoc.in@posthouse.com
> Date: Thu, 18 Sep 2008 12:19:26 +0200 (CEST)
> From: bank.out@posthouse.com
> To: credoc.in@posthouse.com
> Message-ID: <84...@INFOR2>
> Subject: WSO2ESB - The subject of the mail - with an attachment !
> MIME-Version: 1.0
> Content-Type: multipart/mixed; boundary="---- 
> =_Part_0_3794357.1221733166256"
>
> )
> A9 OK FETCH completed
> 2008-09-18 12:19:39,491 [192.168.13.175-INFOR2] [mailto-Worker-6]  
> DEBUG
> MailTransportListener Processing message as Content-Type : multipart/ 
> mixed;
> boundary="----=_Part_0_3794357.1221733166256"
> A10 FETCH 1 (ENVELOPE INTERNALDATE RFC822.SIZE)
> * 1 FETCH (ENVELOPE ("Thu, 18 Sep 2008 12:19:26 +0200 (CEST)"  
> "WSO2ESB - The
> subject of the mail - with an attachment !" ((NIL NIL "bank.out"
> "posthouse.com")) ((NIL NIL "bank.out" "posthouse.com")) ((NIL NIL
> "bank.out" "posthouse.com")) ((NIL NIL "credoc.in" "posthouse.com"))  
> NIL NIL
> NIL "<84...@INFOR2>") INTERNALDATE
> "18-Sep-2008 12:19:14 +0200" RFC822.SIZE 23992)
> A10 OK FETCH completed
> A11 FETCH 1 (BODY[1.1]<0.46>)
> * 1 FETCH (BODY[1.1]<0> {46}
> A text message for WSO2 - with an attachment ! FLAGS (\Seen \Recent))
> A11 OK FETCH completed
>
> Regards, Stefan.
>
> Andreas Veithen wrote:
>>
>> Stefan,
>>
>> I don't think that the current implementation can support this
>> requirement. To evaluate what can be done, can you please explain  
>> your
>> use case in more detail?
>>
>> Regards,
>>
>> Andreas
>>
>> On 17 sept. 08, at 18:01, stlecho wrote:
>>
>>>
>>> Hi,
>>>
>>> Currently, I'm able to poll a message box and "forward" the content
>>> of the
>>> mail to a Mediator. Now I would like to "forward" the attachments of
>>> the
>>> mail message to the same Mediator. Is this supported by Synapse ?
>>>
>>> Regards, Stefan Lecho.
>>> -- 
>>> View this message in context:
>>> http://www.nabble.com/Support-for-Mail-Attachments-tp19535437p19535437.html
>>> Sent from the Synapse - User mailing list archive at Nabble.com.
>>>
>>
>>
>>
>
> -- 
> View this message in context: http://www.nabble.com/Support-for-Mail-Attachments-tp19535437p19550204.html
> Sent from the Synapse - User mailing list archive at Nabble.com.
>


Re: Support for Mail Attachments

Posted by stlecho <st...@gmail.com>.
Maybe it is "sufficient" to call addAttachment(DataHandler) on the
org.apache.axis2.context.MessageContext instance created in the processMail
method in MailTransportListener ?

stlecho wrote:
> 
> Andreas,
> 
> I would like to handle mail messages with and without attachments. 
> 
> In my current configuration, I've defined in the inSequence a Spring-based
> Mediator. The MessageContext I'm receiving in the mediate method contains
> the content of the mail message, but it does not contain the mail
> attachment(s).
> 
> When an email with an attachment (for instance a PDF document) is
> triggered by the MailListener, the attachment should be accessible in the
> MessageContext. If that is possible, I could for instance store the Word
> document in a database for further treatment.
> 
> Based on the stacktrace included underneath I guess that the
> MailTransportListener reads the attachment but probably does not
> initialize it in the MessageContext.
> 
> PS: Should I create a Jira issue for this ?
> 
> Stacktrace
> 2008-09-18 12:19:39,428 [192.168.13.175-INFOR2] [mailto-Worker-6] DEBUG
> MailTransportListener 1 messgaes in folder : INBOX
> A7 FETCH 1 (FLAGS)
> * 1 FETCH (FLAGS (\Recent))
> A7 OK FETCH completed
> A8 FETCH 1 (BODYSTRUCTURE)
> * 1 FETCH (BODYSTRUCTURE ((("text" "plain" ("charset" "us-ascii") NIL NIL
> "7bit" 46 1 NIL NIL NIL) "related" ("boundary"
> "----=_Part_1_14721926.1221733166287") NIL NIL)("application"
> "octet-stream" ("name" "This is an attachment") NIL NIL "base64" 22476 NIL
> ("attachment" ("filename" "This is an attachment")) NIL) "mixed"
> ("boundary" "----=_Part_0_3794357.1221733166256") NIL NIL))
> A8 OK FETCH completed
> A9 FETCH 1 (BODY.PEEK[HEADER])
> * 1 FETCH (BODY[HEADER] {927}
> Return-path: <ba...@posthouse.com>
> Received: from INFOR2 ([192.168.13.175])
>  by posthouse.com (posthouse.com)
>  (MDaemon PRO v10.0.0)
>  with ESMTP id md50000001027.msg
>  for <cr...@posthouse.com>; Thu, 18 Sep 2008 12:19:14 +0200
> X-Spam-Processed: posthouse.com, Thu, 18 Sep 2008 12:19:14 +0200
>  (not processed: spam filter heuristic analysis disabled)
> X-Rcpt-To: credoc.in@posthouse.com
> X-MDRcpt-To: credoc.in@posthouse.com
> X-MDRemoteIP: 192.168.13.175
> X-Return-Path: bank.out@posthouse.com
> X-Envelope-From: bank.out@posthouse.com
> X-MDaemon-Deliver-To: credoc.in@posthouse.com
> Date: Thu, 18 Sep 2008 12:19:26 +0200 (CEST)
> From: bank.out@posthouse.com
> To: credoc.in@posthouse.com
> Message-ID: <84...@INFOR2>
> Subject: WSO2ESB - The subject of the mail - with an attachment !
> MIME-Version: 1.0
> Content-Type: multipart/mixed;
> boundary="----=_Part_0_3794357.1221733166256"
>  
> )
> A9 OK FETCH completed
> 2008-09-18 12:19:39,491 [192.168.13.175-INFOR2] [mailto-Worker-6] DEBUG
> MailTransportListener Processing message as Content-Type :
> multipart/mixed; boundary="----=_Part_0_3794357.1221733166256"
> A10 FETCH 1 (ENVELOPE INTERNALDATE RFC822.SIZE)
> * 1 FETCH (ENVELOPE ("Thu, 18 Sep 2008 12:19:26 +0200 (CEST)" "WSO2ESB -
> The subject of the mail - with an attachment !" ((NIL NIL "bank.out"
> "posthouse.com")) ((NIL NIL "bank.out" "posthouse.com")) ((NIL NIL
> "bank.out" "posthouse.com")) ((NIL NIL "credoc.in" "posthouse.com")) NIL
> NIL NIL "<84...@INFOR2>") INTERNALDATE
> "18-Sep-2008 12:19:14 +0200" RFC822.SIZE 23992)
> A10 OK FETCH completed
> A11 FETCH 1 (BODY[1.1]<0.46>)
> * 1 FETCH (BODY[1.1]<0> {46}
> A text message for WSO2 - with an attachment ! FLAGS (\Seen \Recent))
> A11 OK FETCH completed
> 
> Regards, Stefan.
> 
> Andreas Veithen wrote:
>> 
>> Stefan,
>> 
>> I don't think that the current implementation can support this  
>> requirement. To evaluate what can be done, can you please explain your  
>> use case in more detail?
>> 
>> Regards,
>> 
>> Andreas
>> 
>> On 17 sept. 08, at 18:01, stlecho wrote:
>> 
>>>
>>> Hi,
>>>
>>> Currently, I'm able to poll a message box and "forward" the content  
>>> of the
>>> mail to a Mediator. Now I would like to "forward" the attachments of  
>>> the
>>> mail message to the same Mediator. Is this supported by Synapse ?
>>>
>>> Regards, Stefan Lecho.
>>> -- 
>>> View this message in context:
>>> http://www.nabble.com/Support-for-Mail-Attachments-tp19535437p19535437.html
>>> Sent from the Synapse - User mailing list archive at Nabble.com.
>>>
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Support-for-Mail-Attachments-tp19535437p19550450.html
Sent from the Synapse - User mailing list archive at Nabble.com.


Re: Support for Mail Attachments

Posted by stlecho <st...@gmail.com>.
Andreas,

I would like to handle mail messages with and without attachments. 

In my current configuration, I've defined in the inSequence a Spring-based
Mediator. The MessageContext I'm receiving in the mediate method contains
the content of the mail message, but it does not contain the mail
attachment(s).

When an email with an attachment (for instance a PDF document) is triggered
by the MailListener, the attachment should be accessible in the
MessageContext. If that is possible, I could for instance store the Word
document in a database for further treatment.

Based on the stacktrace included underneath I guess that the
MailTransportListener reads the attachment but probably does not initialize
it in the MessageContext.

PS: Should I create a Jira issue for this ?

Stacktrace
2008-09-18 12:19:39,428 [192.168.13.175-INFOR2] [mailto-Worker-6] DEBUG
MailTransportListener 1 messgaes in folder : INBOX
A7 FETCH 1 (FLAGS)
* 1 FETCH (FLAGS (\Recent))
A7 OK FETCH completed
A8 FETCH 1 (BODYSTRUCTURE)
* 1 FETCH (BODYSTRUCTURE ((("text" "plain" ("charset" "us-ascii") NIL NIL
"7bit" 46 1 NIL NIL NIL) "related" ("boundary"
"----=_Part_1_14721926.1221733166287") NIL NIL)("application" "octet-stream"
("name" "This is an attachment") NIL NIL "base64" 22476 NIL ("attachment"
("filename" "This is an attachment")) NIL) "mixed" ("boundary"
"----=_Part_0_3794357.1221733166256") NIL NIL))
A8 OK FETCH completed
A9 FETCH 1 (BODY.PEEK[HEADER])
* 1 FETCH (BODY[HEADER] {927}
Return-path: <ba...@posthouse.com>
Received: from INFOR2 ([192.168.13.175])
 by posthouse.com (posthouse.com)
 (MDaemon PRO v10.0.0)
 with ESMTP id md50000001027.msg
 for <cr...@posthouse.com>; Thu, 18 Sep 2008 12:19:14 +0200
X-Spam-Processed: posthouse.com, Thu, 18 Sep 2008 12:19:14 +0200
 (not processed: spam filter heuristic analysis disabled)
X-Rcpt-To: credoc.in@posthouse.com
X-MDRcpt-To: credoc.in@posthouse.com
X-MDRemoteIP: 192.168.13.175
X-Return-Path: bank.out@posthouse.com
X-Envelope-From: bank.out@posthouse.com
X-MDaemon-Deliver-To: credoc.in@posthouse.com
Date: Thu, 18 Sep 2008 12:19:26 +0200 (CEST)
From: bank.out@posthouse.com
To: credoc.in@posthouse.com
Message-ID: <84...@INFOR2>
Subject: WSO2ESB - The subject of the mail - with an attachment !
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="----=_Part_0_3794357.1221733166256"
 
)
A9 OK FETCH completed
2008-09-18 12:19:39,491 [192.168.13.175-INFOR2] [mailto-Worker-6] DEBUG
MailTransportListener Processing message as Content-Type : multipart/mixed;
boundary="----=_Part_0_3794357.1221733166256"
A10 FETCH 1 (ENVELOPE INTERNALDATE RFC822.SIZE)
* 1 FETCH (ENVELOPE ("Thu, 18 Sep 2008 12:19:26 +0200 (CEST)" "WSO2ESB - The
subject of the mail - with an attachment !" ((NIL NIL "bank.out"
"posthouse.com")) ((NIL NIL "bank.out" "posthouse.com")) ((NIL NIL
"bank.out" "posthouse.com")) ((NIL NIL "credoc.in" "posthouse.com")) NIL NIL
NIL "<84...@INFOR2>") INTERNALDATE
"18-Sep-2008 12:19:14 +0200" RFC822.SIZE 23992)
A10 OK FETCH completed
A11 FETCH 1 (BODY[1.1]<0.46>)
* 1 FETCH (BODY[1.1]<0> {46}
A text message for WSO2 - with an attachment ! FLAGS (\Seen \Recent))
A11 OK FETCH completed

Regards, Stefan.

Andreas Veithen wrote:
> 
> Stefan,
> 
> I don't think that the current implementation can support this  
> requirement. To evaluate what can be done, can you please explain your  
> use case in more detail?
> 
> Regards,
> 
> Andreas
> 
> On 17 sept. 08, at 18:01, stlecho wrote:
> 
>>
>> Hi,
>>
>> Currently, I'm able to poll a message box and "forward" the content  
>> of the
>> mail to a Mediator. Now I would like to "forward" the attachments of  
>> the
>> mail message to the same Mediator. Is this supported by Synapse ?
>>
>> Regards, Stefan Lecho.
>> -- 
>> View this message in context:
>> http://www.nabble.com/Support-for-Mail-Attachments-tp19535437p19535437.html
>> Sent from the Synapse - User mailing list archive at Nabble.com.
>>
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Support-for-Mail-Attachments-tp19535437p19550204.html
Sent from the Synapse - User mailing list archive at Nabble.com.


Re: Support for Mail Attachments

Posted by Andreas Veithen <an...@skynet.be>.
Stefan,

I don't think that the current implementation can support this  
requirement. To evaluate what can be done, can you please explain your  
use case in more detail?

Regards,

Andreas

On 17 sept. 08, at 18:01, stlecho wrote:

>
> Hi,
>
> Currently, I'm able to poll a message box and "forward" the content  
> of the
> mail to a Mediator. Now I would like to "forward" the attachments of  
> the
> mail message to the same Mediator. Is this supported by Synapse ?
>
> Regards, Stefan Lecho.
> -- 
> View this message in context: http://www.nabble.com/Support-for-Mail-Attachments-tp19535437p19535437.html
> Sent from the Synapse - User mailing list archive at Nabble.com.
>


Re: Support for Mail Attachments

Posted by indika kumara <in...@gmail.com>.
Hi Stefan

Yes and only one of the parts will be processed. A Part selection is
happened as follows.

 If  a part's content type is set as either "application/soap+xml" or
"text/xml", then selects it. Otherwise, one of text part will select.

Thanks
Indika

On Wed, Sep 17, 2008 at 9:31 PM, stlecho <st...@gmail.com> wrote:
>
> Hi,
>
> Currently, I'm able to poll a message box and "forward" the content of the
> mail to a Mediator. Now I would like to "forward" the attachments of the
> mail message to the same Mediator. Is this supported by Synapse ?
>
> Regards, Stefan Lecho.
> --
> View this message in context: http://www.nabble.com/Support-for-Mail-Attachments-tp19535437p19535437.html
> Sent from the Synapse - User mailing list archive at Nabble.com.
>