简体   繁体   中英

Mule ESB - How to get MimeMessage instead of MimeBodyPart?

I'm trying to get the FROM email address in Mule ESB.
I'm getting the retrieved object as MimeBodyPart, I'd like to have MimeMessage instead. How to do this?

Any solution - either in Mule or Java is welcome.

The Mule config part for inbound end-point is as below -

<inbound>
    <pop3s:inbound-endpoint user="xxx%40gmail.com" password="xxx" host="pop.gmail.com"/>
</inbound>

Thanks in advance.

The solution is this -

MimeBodyPart obj;
MimeMultipart top = (MimeMultipart) obj.getParent();
MimeMessage msg = (MimeMessage) top.getParent();

The initial obj is provided by Mule.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM