Solved

Filtering packets and detecting email messages

Posted on 2003-12-06
5
224 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
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…
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 learn how to clear a vector as well as how to detect empty vectors in C++.

762 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now