smtplib, capturing output from set_debuglevel ??

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

[apologies if you got this twice]

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

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

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

The outgoing threads are started  with


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


More information about the Python-list mailing list