On Sat, 09 Aug 2003 13:42:06 -0400, Jesse Guardiani
<[EMAIL PROTECTED]> wrote:

>On 09 Aug 2003 01:33:52 -0500, Tim Legant <[EMAIL PROTECTED]> wrote:
>
>>Jesse Guardiani <[EMAIL PROTECTED]> writes:
>>
>>> And figure out how to print the body of the message to disk/stdout without
>>> using the email module. Instead of this:
>>> 
>>>   print msg_as_string(msgin)
>>> 
>>> I do this:
>>> 
>>>   # Print headers
>>>   print msg_as_string(msgin)
>>>   # Print body
>>>   print sys.stdin.read()
>>
>>I don't think this does what you think it does.
>
>Are you 100% sure about that?

Well, even if you're not - I am, now.

My test message was running through my secondary MX for some
reason, which caused it to avoid being processed by my script.

Oops. :-)


I did some checking, and in a more fool (that's me) proof test, this
appears to do the job:

while 1:
    data = sys.stdin.read(256)
    if data != '':
        sys.stdout.write(data)
    else:
        sys.stdout.flush()
        break

I bet it's a bit slower than a straight copy, but it fits the bill for
me.

I'll do some more testing then post the results. Perhaps this *is*
a "feature" that is better implemented as an option. The speed
tests should let me know...

Sorry I spoke so soon, and thanks for pointing that out to me Tim!

--
Jesse Guardiani, Systems Administrator
WingNET Internet Services,
P.O. Box 2605 // Cleveland, TN 37320-2605
423-559-LINK (v)  423-559-5145 (f)
http://www.wingnet.net


_________________________________________________
tmda-workers mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-workers

Reply via email to