File I/O, rfc822, and stdin/stdout

Eric Rahmig erahmig at minn.net
Sun Jan 14 02:40:43 EST 2001


* Sheila King (sheila at thinkspot.net) [010114 00:46]:
> I'm getting really confused and frustrated here.
> 
> Ultimately, my goal is to write some scripts to handle my incoming e-mail. My
> web host uses qmail as an MTA and with .qmail files I can invoke scripts to
> process my mail. The scripts receive the incoming e-mail from stdin and if
> they write output to stdout, that output can be delivered as the resulting
> e-mail message.

Hi,

If you're not using qmail's 'preline' utility in your .qmail files
that might cause a problem. Without the use of 'preline' the email
message your script sees will NOT start with a From line and will
NOT contain a Return-Path header.

I'm new to Python and have no experience with the rfc822 module. If
it is strict in its message parsing and expects a message to contain
a From line and a Return-Path header then use of preline should help
you:

.qmail-foo:
|preline somescript.py ...

Hope this helps,

Eric

-----------------+------------------------------------------------------------
Eric Rahmig      | "Merely having an open mind is nothing. The object of
erahmig at minn.net |  opening the mind, as of opening the mouth, is to shut it
                 |  again on something solid." -- G.K. Chesterton




More information about the Python-list mailing list