Is there any activity /Java function Pega Email Listener uses to convert inbound email to .eml format and store as attachment?

We have a requirement to convert the HTML stream to .eml format and store it. Email Listener seems to be doing the similar kind of thing while converting the incoming email messages to .eml format which is available in pyAttachStream.

@SUPRIYA BANERJEE

Yes, Pega Email Listener automatically converts incoming emails to .eml format using Java code in the background and stores them as attachments in the pyAttachStream property. This is done using internal Java classes that convert the email content (MIME format) into a file stream. The email is then saved as a file attachment (usually of type Data-WorkAttach-File) and linked to a case. Although Pega does not expose a direct activity for this, you can achieve similar functionality by using Java code to write the email content into a byte stream using message.writeTo() from the javax.mail API and then save that stream as an attachment. This is helpful when you want to store or forward the email exactly as received