intercepting smtp email

Discussion in 'Python' started by Scott Hathaway, Sep 30, 2003.

  1. 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
     
    Scott Hathaway, Sep 30, 2003
    #1
    1. Advertising

  2. Scott Hathaway

    .r!kard Guest

    I'm no star at this but maybe you can check the code in
    http://www.gnu.org/software/mailman

    ..r!kard

    "Scott Hathaway" <> wrote in message
    news:...
    > 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!kard, Sep 30, 2003
    #2
    1. Advertising

  3. Scott Hathaway

    .r!kard Guest

    Or maybe you can find it here: http://twistedmatrix.com

    Basically i think you have to write your own SMTP-server if nobody else
    hasn't done it already...

    ..r!kard


    ".r!kard" <> wrote in message
    news:blc1kt$ooe$...
    > I'm no star at this but maybe you can check the code in
    > http://www.gnu.org/software/mailman
    >
    > .r!kard
    >
    > "Scott Hathaway" <> wrote in message
    > news:...
    > > 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!kard, Sep 30, 2003
    #3
  4. Scott Hathaway

    .r!kard Guest

    Even more results of Googeling:
    http://www.vex.net/parnassus/apyllo.py?so=d&find=SMTP

    ..r!kard



    ".r!kard" <> wrote in message
    news:blc1ss$p54$...
    > Or maybe you can find it here: http://twistedmatrix.com
    >
    > Basically i think you have to write your own SMTP-server if nobody else
    > hasn't done it already...
    >
    > .r!kard
    >
    >
    > ".r!kard" <> wrote in message
    > news:blc1kt$ooe$...
    > > I'm no star at this but maybe you can check the code in
    > > http://www.gnu.org/software/mailman
    > >
    > > .r!kard
    > >
    > > "Scott Hathaway" <> wrote in message
    > > news:...
    > > > 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!kard, Sep 30, 2003
    #4
  5. Scott Hathaway

    John Roth Guest

    ".r!kard" <> wrote in message
    news:blc1kt$ooe$...
    > I'm no star at this but maybe you can check the code in
    > http://www.gnu.org/software/mailman
    >
    > .r!kard


    I think he's asking for a mini-firewall. In other words, is something
    he doesn't know about sending messages on port 25?

    John Roth

    >
    > "Scott Hathaway" <> wrote in message
    > news:...
    > > 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

    >
    >
     
    John Roth, Sep 30, 2003
    #5
  6. Scott Hathaway

    .r!kard Guest

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

    ..r!kard


    "John Roth" <> wrote in message
    news:...
    >
    > ".r!kard" <> wrote in message
    > news:blc1kt$ooe$...
    > > I'm no star at this but maybe you can check the code in
    > > http://www.gnu.org/software/mailman
    > >
    > > .r!kard

    >
    > I think he's asking for a mini-firewall. In other words, is something
    > he doesn't know about sending messages on port 25?
    >
    > John Roth
    >
    > >
    > > "Scott Hathaway" <> wrote in message
    > > news:...
    > > > 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!kard, Sep 30, 2003
    #6
  7. Scott Hathaway

    John Roth Guest

    ".r!kard" <> wrote in message
    news:blc6f3$3si$...
    > 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!kard
    >
    >
    > "John Roth" <> wrote in message
    > news:...
    > >
    > > ".r!kard" <> wrote in message
    > > news:blc1kt$ooe$...
    > > > I'm no star at this but maybe you can check the code in
    > > > http://www.gnu.org/software/mailman
    > > >
    > > > .r!kard

    > >
    > > I think he's asking for a mini-firewall. In other words, is something
    > > he doesn't know about sending messages on port 25?
    > >
    > > John Roth
    > >
    > > >
    > > > "Scott Hathaway" <> wrote in message
    > > > news:...
    > > > > 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
    > > >
    > > >

    > >
    > >

    >
    >
     
    John Roth, Sep 30, 2003
    #7
  8. 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.

    >>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

    <snip>
    >>>>>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.
     
    Rudy Schockaert, Sep 30, 2003
    #8
  9. Scott Hathaway

    .r!kard Guest

    Google rules:
    http://home.student.utwente.nl/g.v.berg/btk/
    http://pycap.sourceforge.net
    http://www.ghaering.de/python/unsupported/pylibpcap/
    http://aspn.activestate.com/ASPN/Mail/Message/python-list/1578279

    *pheew* that was some real hardcore Googeling I can tell you...

    ..r!kard


    "Rudy Schockaert" <> wrote in message
    news:5Uieb.49566$-ops.be...
    > 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.
    >
    > >>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

    > <snip>
    > >>>>>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.

    >
     
    .r!kard, Sep 30, 2003
    #9
  10. It seems you've looking where I've earlier this week ;-) I'm affraid
    there's nothing for Python on Windows yet.

    ..r!kard wrote:

    > Google rules:
    > http://home.student.utwente.nl/g.v.berg/btk/


    This one is for unices only, no Windows.

    > http://pycap.sourceforge.net


    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 :-/.

    > http://www.ghaering.de/python/unsupported/pylibpcap/


    This could be a candidate if it were available for Python 2.3.x . It's
    for Python 2.2 only now.

    > http://aspn.activestate.com/ASPN/Mail/Message/python-list/1578279

    Further down the thread:
    http://aspn.activestate.com/ASPN/Mail/Message/python-list/1578500
    Gerhard Häring wrote:
    > 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 :-(

    >
    > *pheew* that was some real hardcore Googeling I can tell you...
    >
    > .r!kard


    >><snip>
    >>
    >>>>>>>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.

    >>

    >
    >
     
    Rudy Schockaert, Sep 30, 2003
    #10
  11. 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



    "Rudy Schockaert" <> wrote in message
    news:7tkeb.49855$-ops.be...
    > It seems you've looking where I've earlier this week ;-) I'm affraid
    > there's nothing for Python on Windows yet.
    >
    > .r!kard wrote:
    >
    > > Google rules:
    > > http://home.student.utwente.nl/g.v.berg/btk/

    >
    > This one is for unices only, no Windows.
    >
    > > http://pycap.sourceforge.net

    >
    > 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

    :-/.
    >
    > > http://www.ghaering.de/python/unsupported/pylibpcap/

    >
    > This could be a candidate if it were available for Python 2.3.x . It's
    > for Python 2.2 only now.
    >
    > > http://aspn.activestate.com/ASPN/Mail/Message/python-list/1578279

    > Further down the thread:
    > http://aspn.activestate.com/ASPN/Mail/Message/python-list/1578500
    > Gerhard Häring wrote:
    > > 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 :-(
    >
    > >
    > > *pheew* that was some real hardcore Googeling I can tell you...
    > >
    > > .r!kard

    >
    > >><snip>
    > >>
    > >>>>>>>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.
    > >>

    > >
    > >

    >
     
    Scott Hathaway, Sep 30, 2003
    #11
  12. On Tue, 30 Sep 2003 19:04:35 GMT, Rudy Schockaert
    <> wrote:

    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.
    >
    >.r!kard wrote:
    >
    >> Google rules:
    >> http://home.student.utwente.nl/g.v.berg/btk/

    >
    >This one is for unices only, no Windows.
    >
    >> http://pycap.sourceforge.net


    -Geoff Howland
    http://ludumdare.com/
     
    Geoff Howland, Oct 1, 2003
    #12
  13. Scott Hathaway

    Peter Hansen Guest

    Scott Hathaway wrote:
    >
    > 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
     
    Peter Hansen, Oct 1, 2003
    #13
  14. 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.

    --
    > ============================================================== <
    > | Wulfraed Dennis Lee Bieber KD6MOG <
    > | Bestiaria Support Staff <
    > ============================================================== <
    > Bestiaria Home Page: http://www.beastie.dm.net/ <
    > Home Page: http://www.dm.net/~wulfraed/ <
     
    Dennis Lee Bieber, Oct 2, 2003
    #14
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    1,092
    Roedy Green
    Jan 24, 2006
  2. Alex Hunsley
    Replies:
    4
    Views:
    3,489
    Tim Williams (gmail)
    Jun 29, 2004
  3. Raaijmakers, Vincent \(GE Infrastructure\)

    RE: sending of mail (smtp) - connection refused - but smtp serveris running!

    Raaijmakers, Vincent \(GE Infrastructure\), Jun 29, 2004, in forum: Python
    Replies:
    0
    Views:
    888
    Raaijmakers, Vincent \(GE Infrastructure\)
    Jun 29, 2004
  4. Copelandia Cyanescens

    smtplib.SMTP "no attributes SMTP"

    Copelandia Cyanescens, Jul 31, 2004, in forum: Python
    Replies:
    2
    Views:
    1,442
    Copelandia Cyanescens
    Jul 31, 2004
  5. ashish makani
    Replies:
    5
    Views:
    611
    Mark Lawrence
    Sep 20, 2012
Loading...

Share This Page