EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Download message attachments on POP3

Also by EldoS: Solid File System
A virtual file system that offers a feature-rich storage for application documents and data with built-in compression and encryption.
Posted: 02/06/2012 10:30:02
by Daniel Medina (Standard support level)
Joined: 06/21/2011
Posts: 20


I's there an easy way to connect to a POP3 server, look for messages that has attachments and download those attachments.

Can you please give me a short code example (.Net C#)

Posted: 02/06/2012 11:38:39
by Eugene Mayevski (EldoS Corp.)

There's no simple way to do what you want. POP3 protocol supports only picking the complete message or top X lines of the message. You would need to use TOP command (ReceiveMessageLines method) to pick lines of the message, then analyze them by checking mail headers for specific content type etc.

Sincerely yours
Eugene Mayevski
Posted: 02/16/2012 15:18:38
by Leonardo Herrera (Standard support level)
Joined: 02/14/2011
Posts: 66


I know this functionality is not likely to be available (hint) in the near future. Since I'll have to tackle this problem very soon, what would you recommend from a design standpoint? Do you think using a different component just for the parsing of the message is a viable option?
Posted: 02/17/2012 00:56:05
by Eugene Mayevski (EldoS Corp.)

We have MIME parser, but the real question is that MIME format is not a "message with attachment" but rather a tree of various parts. Consequently without having a complete message you will have hard time extracting everything right. It is *possible* that for simpler messages you can cut the tail and extract information from the top lines, but won't always work as you expect. Eg. if you pick top 100 lines, you can miss the second attached file completely.

Sincerely yours
Eugene Mayevski
Posted: 02/20/2012 09:25:30
by Leonardo Herrera (Standard support level)
Joined: 02/14/2011
Posts: 66

Ok, I see. So we need to download the whole message anyways to handle attachments properly. Thank you for the clarification.

Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.



Topic viewed 748 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!