Hi Carl,

Yes, it is possible to process a mail attachment from within a mailet.

For example, in your matcher, you can check if your message content is an instance of MimeMultipart (assuming the incoming email is multipart MIME encoded), and use the javax.mail.internet.MimeBodyPart to check the type of attachment (using its getContentType()). Then in your mailet, you can do a similar thing and process the attachment as desired.

Example code for matcher:

public Collection match(Mail mail) throws MessagingException {
 if(mail.getMessage().getContent() instanceof MimeMultipart) {
MimeMultipart multipart = (MimeMultipart) mail.getMessage().getContent(); // extract the MimeBodyParts and check for content type if required.
 }

 // if your desired condition is satisfied
 return mail.getRecipients();
}

Hope this helps.

Cheers,
Sandeep
--
http://sandeep.weblogs.us/

Carl Vorster wrote:
Hi,

Is it possible to access/process a mail attachment from a mailet, I can't
seem to find anything to point me in the right direction.

Thanks in advance

Carl


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to