Solved

Filtering packets and detecting email messages

Posted on 2003-12-06
5
226 Views
Last Modified: 2011-09-20
Hello, I am an intermediate c++ programmer. What I am looking to do is create a program that basically intercepts e-mail coming in, like a spam filter.

For example, say Microsoft Outlook (or any client) begins to check for new mail. I want to create a program that watches any packets coming in, and if those packets are part of an email, it will filter the email and either continue to pass the packets on to the email client, or dump them.

I really am not sure where to start, and I am looking for someone to point me in the right direction. Can this be done with any part of MFC? Help Help Help!
0
Comment
Question by:jtysco
  • 2
5 Comments
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 9889916
I suspect that this can be done with MFC, but you are in the wrong topic area. This is probably better suited for one of the Windows areas. You want to use MAPI (Messaging API).

This article has some information about how a virus checker does it's job (it does not intercept the messages, it runs after the message is delivered to the user's mail box and scans it from the mailbox).

This page has information about how you would use MAPI: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mapi/html/_mapi1book_mapi_programming_basics.asp (see the navigation links on the left side).
0
 
LVL 30

Accepted Solution

by:
Axter earned 125 total points
ID: 9890662
The only way I can think of that you can do this before the Mail program gets the data is to replace the windows Winsock DLL with your own DLL that would intercept socket functions.

But this would require you to create a DLL that has all the function that are in the winsock.dll.  Then rename the winsock.dll, and call the renamed winsock.dll functions from your replaced functions.

You can then monitor all the data coming in and out via socket functions.

You can intercept the data before a mail program or MAPI receives it.
0
 
LVL 30

Expert Comment

by:Axter
ID: 9890666
FYI:
This can be done with or without MFC.
And (IMHO) the topic is not outside of the scope of this topic area.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
java inner class, for the sole use of parameter passing 21 77
Safe conversion? 4 69
Which Linux flavors will this run on? 6 88
C++ mouse_event mouse look 7 83
Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question