Extracting attachments from email
-
Hi, I'm creating a small application that will function as a filter-application on a mailserver (as an extension lib). The case: I receive an email from the server, as 'raw data'. I need to extract all attachments attached in that file. Anybody has a clue how to do this? I actually don't want to write sourcecode that parses the message and looks for every single supported encoding-type .. I couldn't find any support for it in the MSDN library (but I only spend a few minutes searching) Help appreciated :) -- Alex Marbus www.marbus.net But then again, I could be wrong.
-
Hi, I'm creating a small application that will function as a filter-application on a mailserver (as an extension lib). The case: I receive an email from the server, as 'raw data'. I need to extract all attachments attached in that file. Anybody has a clue how to do this? I actually don't want to write sourcecode that parses the message and looks for every single supported encoding-type .. I couldn't find any support for it in the MSDN library (but I only spend a few minutes searching) Help appreciated :) -- Alex Marbus www.marbus.net But then again, I could be wrong.
See PJN's CPop3Connection[^] class and MIME++ (and other offerings) from HunnySoft[^]. /ravi Let's put "civil" back in "civilization" http://www.ravib.com ravib@ravib.com
-
See PJN's CPop3Connection[^] class and MIME++ (and other offerings) from HunnySoft[^]. /ravi Let's put "civil" back in "civilization" http://www.ravib.com ravib@ravib.com
It looks very promising, but I really can't afford the 600 bucks :( -- Alex Marbus www.marbus.net But then again, I could be wrong.
-
Hi, I'm creating a small application that will function as a filter-application on a mailserver (as an extension lib). The case: I receive an email from the server, as 'raw data'. I need to extract all attachments attached in that file. Anybody has a clue how to do this? I actually don't want to write sourcecode that parses the message and looks for every single supported encoding-type .. I couldn't find any support for it in the MSDN library (but I only spend a few minutes searching) Help appreciated :) -- Alex Marbus www.marbus.net But then again, I could be wrong.
I'm afraid you will have to write your own code for this, unless you decide to use something which is already out there. MAPI, while OK for client side stuff, won't scale well in a server environment. You won't have to take care of too many suported encoding types, just understand MIME. Go to http://www.imc.org/rfcs.html#mime[^] for more information on MIME. Don't let the number of RFCs there scare you away, it's not for the faint of heart anyway ( ;) ). Although I'm sure you could find a lot of open source stuff out there to help you get started. AlexMarbus wrote: The case: I receive an email from the server, as 'raw data'. Wait a minute now. Are you saying the mail server will mail you the emails that it gets so that you can then extract the attachments and do your stuff with it? This can be horribly slow, and can bog the server down. Imagine what it'd be like, the same email travelling on the network twice. Or did I get it wrong and you meant something else? In any case, my suggestion would be to install your dll as a proxy for the server. It can then process the emails before they get to the email server itself, and will have done its processing (stripping the attachments, scanning for virii, whatever). Let the filter and the server communicate via the computer memory, don't use files or the network for it. You can't imagine how slow it will make everything if it's a busy site.
Regards,Rohit Sinha
-
I'm afraid you will have to write your own code for this, unless you decide to use something which is already out there. MAPI, while OK for client side stuff, won't scale well in a server environment. You won't have to take care of too many suported encoding types, just understand MIME. Go to http://www.imc.org/rfcs.html#mime[^] for more information on MIME. Don't let the number of RFCs there scare you away, it's not for the faint of heart anyway ( ;) ). Although I'm sure you could find a lot of open source stuff out there to help you get started. AlexMarbus wrote: The case: I receive an email from the server, as 'raw data'. Wait a minute now. Are you saying the mail server will mail you the emails that it gets so that you can then extract the attachments and do your stuff with it? This can be horribly slow, and can bog the server down. Imagine what it'd be like, the same email travelling on the network twice. Or did I get it wrong and you meant something else? In any case, my suggestion would be to install your dll as a proxy for the server. It can then process the emails before they get to the email server itself, and will have done its processing (stripping the attachments, scanning for virii, whatever). Let the filter and the server communicate via the computer memory, don't use files or the network for it. You can't imagine how slow it will make everything if it's a busy site.
Regards,Rohit Sinha
Rohit Sinha wrote: I'm afraid you will have to write your own code for this, unless you decide to use something which is already out there. I did: http://www.funduc.com/decenc.htm It does exactly what I need :-) Rohit Sinha wrote: In any case, my suggestion would be to install your dll as a proxy for the server. That is exactly what it is: a filter application for a certain mailserver (ArgoSoft). See http://triplef.marbus.net for more details. Thanks for your reply -- Alex Marbus www.marbus.net But then again, I could be wrong.