A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/103363.html below:

looking for command-pipe performance advice

looking for command-pipe performance advice looking for command-pipe performance advicejason-dated-af27661e5bfe243d at mastaler.com jason-dated-af27661e5bfe243d at mastaler.com
Thu Apr 5 19:45:12 EDT 2001
Can anyone suggest a more efficient, and/or higher performance method
of reading in a mail message as standard input, and then feeding the
message to a command pipe (qmail in my case).

I do need to examine the mail headers, but don't need to look at the
message body at all.

Here is what I'm doing currently:

--------------------------------------------------------------------

import os, rfc822, cStringIO

raw_message = sys.stdin.read()       
message = cStringIO.StringIO(raw_message)
headers = rfc822.Message(message)    

# header examination and processing deleted

inject_message = os.popen('/var/qmail/bin/qmail-inject','w')
inject_message.write(raw_message)
inject_message.close()

--------------------------------------------------------------------

Thanks.

-- 
My e-mail address represents an experiment in SPAM reduction.
For more information, see <URL:http://jason.mastaler.com/tms>


More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4