Filtering Message based on attachment extension

Hi All,

I have task to develop a java based email client (POP3, IMAP and SMTP based) which only allows email with attachment with certain extension to be downloaded by clients. I develop it with javamail API.

So far my implementation for IMAP is to retrieve all unread/new messages and then check its attachments. All Messages that do not have attachment with intended file extension are discarded and my email client will only present those with intended file extension attachment.

Is there a more efficient way of doing this? can we, for example query the IMAP server by using certain search term so that we only retrieve messages with intended file extension? How about POP3?

Thank you

[719 byte] By [caesara] at [2007-11-27 4:06:30]
# 1

Very little information is retrieved from the IMAP server to get the

information you need. You can use the search method to reduce

the set of messages you need to consider, and you can use the

fetch method to optimize the fetching of the information needed

to decide whether to display the message. Note that the message

content won't be fetched until you display it.

You can turn on session debugging to see the IMAP protocol

commands being used.

POP3 is completely different. With POP3 you'll need to download

the entire message content to get the information you need to decide

whether to display the message.

bshannona at 2007-7-12 9:11:38 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...