smtplib, capturing output from set_debuglevel ??

Tim Williams listserver at tdw.net
Fri Oct 8 13:34:18 CEST 2004


[apologies if you got this twice]

----- Original Message ----- 
From: "Josiah Carlson" <jcarlson at uci.edu>

>
> > If you want to use file primitives to read the value back, just create
> > another one:
> >
> > inpt = StringIO.StringIO(firstStringIO.getvalue())
> >
> > then you can read the printed output from inpt just like a file.
>
> Or even:
>
>  firstStringIO.seek(0)
>
>  - Josiah

Steve, Andrew, Josiah,

Thanks for your answers.

The outgoing SMTP is multi-threaded,   so the threads disrupt each other's
output to the file-like object  if there is any concurrent outgoing mail
activity.

Is there anyway I can seperate the output from each thread and capture it ?

The outgoing threads are started  with

thread.start_new_thread(outThread,(args,None))

One thread per out-going message.  Each handles the outgoing message sending
and error-handling for the message.   I can't talk back to the calling
thread/class because it is the incoming SMTP part and it is destroyed when
the remote client connection is dropped.  (The SMTP server is a filtering
relay)

TIA









More information about the Python-list mailing list