Capturing Email on smtp & pop3 ports

Posted on 2006-05-11
Last Modified: 2010-05-18
I need to  capture all email to and from a computer, is there an easy way to do this, I was thinking of port capturing? I see that some antivirus programs capture the mail ...
Question by:julianpointer
    1 Comment
    LVL 17

    Accepted Solution

    If you want to "intercept" the email before it reaches the computer, and before it is sent, then 1 way is to to change the settings in the email clients. You can get your software to do this automacially on setup/run

    This is how earlier antivirus software did it. Your software changes the outlook/outlook express/other client, settings to point to localhost (same computer) on different ports.

    e.g. change           port 110         port 25
    localhost                         port 2110 (your software listening to this port)
    localhost                         port 2025 (your software listening to this port)

    There are several ways to implement this
    when changing the account settings in the email client, use a different local port for each account (e.g. 2110 - 2210 range)
    That way you know that if the email client talks to localhost: 2110 it is the "first pop account" and really wants to talk to ""
    and if the email client talks to localhost: 2111 it is the "second pop account" and really wants to talk to "adifferentserver:110"

    b) if you just want to check all incoming (pop3) mail, you only need to change the email clients settings
        port: 110
        username: bob
        host: localhost
        port: 2110

    when your software receives the connect form the email client on port 2110 it sends back a welcome message, and then waits for the email client to send the "USER" command
    when it gets the "USER" command, it strips out the "real server name" ( and the "username" (bob)
    It then makes the real connection to "" and sends the "USER bob" command
    from then on, it just relays data both ways. When it does a "RETR" command (DL email), it will save it locally and check for viruses, before relaying it to the email client

    These days, you can do a better hook into the POP3: and  SMTP:  protocols in windows, but I'm not sure how to do that

    I don't have any more info on this for you, but hopefully it's enough to get you started.

    If you want to see the email data, but not intercept/interfere with it, then you will need a packet sniffer.
    You can use Etherel for this, it comes with libraries that can be used by delphi

    Featured Post

    Gigs: Get Your Project Delivered by an Expert

    Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

    Join & Write a Comment

    Suggested Solutions

    Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
    Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    This video discusses moving either the default database or any database to a new volume.

    746 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

    14 Experts available now in Live!

    Get 1:1 Help Now