intercepting smtp email

S

Scott Hathaway

I want to write an NT service that will intercept any outgoing smtp
traffic, like Norton Antivirus does. Can anyone tell me how I can do
something like this in Python? I do not know how to intercept the
outgoing traffic, specifically.

Any help is greatly appreciated.

Thanks,
Scott
 
R

.r!kard

Now you got me corious, is that possible in python?
Possibly by extending it with som C of course...

..r!kard
 
J

John Roth

.r!kard said:
Now you got me corious, is that possible in python?
Possibly by extending it with som C of course...

I've got no idea where you would put that kind of hook
in Windows.

John Roth
 
R

Rudy Schockaert

Woldn't this require something like winpcap? I know some folks have
attempted to call winpcap from within Python, but I don't know if they
succeeded. If my memory serves well, it was Gerhard Häring who did
something with it.

I would also be interested in something similar, but then for MSN
traffic. Decoding the MSN Messenger stream is not the problem, capturing
the traffic from a promiscous nic in Python is where I get stuck.
 
R

Rudy Schockaert

It seems you've looking where I've earlier this week ;-) I'm affraid
there's nothing for Python on Windows yet.

..r!kard said:

This one is for unices only, no Windows.

From the Todo.txt file:

* Make this work on Windows. I briefly struggled with compiling using
VC7 under Win XP
using winpcap_ and LibnetNT_. No luck, and was getting some rather
interesting errors
about missing header files which appeared to be where they should be :-/.

This could be a candidate if it were available for Python 2.3.x . It's
for Python 2.2 only now.
Further down the thread:
http://aspn.activestate.com/ASPN/Mail/Message/python-list/1578500
Gerhard said:
> http://www.ghaering.de/python/unsupported/pylibpcap/
> I'll check if the sniff.py example will work, too.

It doesn't look like it does. I may have introduced a subtle bug or some
more changes are needed to make it useful under win32.

If anybody wants to continue the win32 port, it's open source and you
can continue where I stopped.

-- Gerhard

Out of luck again :-(
 
S

Scott Hathaway

Thanks for the suggestions. My second alternative is to simply use the api
in outlook and be bound to that client. Worse things have happened.

:)

Scott
 
G

Geoff Howland

On Tue, 30 Sep 2003 19:04:35 GMT, Rudy Schockaert

http://winpcap.polito.it/

Grab SWIG and you can probably get something working in a few hours.
Last time I did this it took about 40 minutes to get working, and a
few hours to push it out so others could use it as well.

Extra bonus points for making it use either winpcap or libpcap
depending on the OS built on. ;)

-Geoff
It seems you've looking where I've earlier this week ;-) I'm affraid
there's nothing for Python on Windows yet.



This one is for unices only, no Windows.

-Geoff Howland
http://ludumdare.com/
 
P

Peter Hansen

Scott said:
I want to write an NT service that will intercept any outgoing smtp
traffic, like Norton Antivirus does. Can anyone tell me how I can do
something like this in Python? I do not know how to intercept the
outgoing traffic, specifically.

Normally a mail program does not connect directly to the receiving
server, but sends all mail via a "relay" server which talks SMTP.
For example, if you have an ISP connection, your mail would go through
their server, which would forward it to the appropriate final destination.

Why do you need to *intercept* SMTP traffic, when you could simply
modify the "outgoing server" setting for your mail program, and then
run a proxy SMTP server which would receive your mail, do the processing
you want, then forward the results to the original server?

-Peter
 
D

Dennis Lee Bieber

Peter Hansen fed this fish to the penguins on Wednesday 01 October 2003
10:46 am:
Why do you need to *intercept* SMTP traffic, when you could simply
modify the "outgoing server" setting for your mail program, and then
run a proxy SMTP server which would receive your mail, do the
processing you want, then forward the results to the original server?
I vaguely recall a comment in this thread to the effect that the
original poster wanted a method that was transparent to any mail client
in use -- ie, users would /not/ have to change their configuration.

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top