rfc822 module: deleting headers

Jason R. Mastaler jason at mastaler.com
Wed May 22 15:17:11 EDT 2002


Tim Roberts <timr at probo.com> writes:

> You can read the message, send it somewhere else, store it to file,
> or do other things, but you can't alter the message on its way to
> your local mailbox.  Indeed, in your example, you didn't DO anything
> with your altered message.  You read it from stdin and modified it
> in memory, but you didn't write it anywhere.

Yup, that's what I thought, I just wanted to make sure I wasn't
missing something obvious.

As another poster pointed out, this is related to TMDA, and the
program I posted is just a small test case illustrating a larger
problem.

Basically, when TMDA decides to "deliver" a message, it can do this in
a variety of ways (mbox file, Maildir, | to program, etc.).  Under
qmail, another option is exit(0) which allows the user to deliver the
message using the next line in her .qmail, rather than having TMDA do
it.

The problem comes in when I want to remove a certain header just
before delivery.  With all methods except the exit(0) this is trivial,
but as soon as the program exists, the changes to the headers in
memory are lost, so this isn't possible.

Thanks y'all.

-- 
(http://tmda.sourceforge.net/)







More information about the Python-list mailing list