Hello Charles,
thanks for your very interesting reply, I see there is a lot wrong in
my code...
CC> readlines() isn't really what you want here, anyway -- the envelope, in
CC> particular, won't contain linefeeds. It's ASCII NUL terminated strings
CC> in series.
Aha, interesting to know, I am completely wrong at this point.
>> koz=''
>> for key in fd0:
>> koz=koz + key + "\n"
CC> What are you trying to do here? Add additional linefeeds to each line
CC> in the message? That will mess the header up nicely -- only the first
CC> line will remain in the header; the rest of it will be considered part
CC> of the body due to the extra linefeed after the first line.
Aaaaah yes, I understand (hope) lol.
>> koz ="/var/qmail/bin/qmail-queue.orig "+koz
CC> ... then you prepend the path to qmail-queue to the message contents...
>> infd, outfd = popen2.popen2(koz)
CC> Then you try to open the whole mess of a string as a command. It
CC> doesn't exist. I think you mean to open the command and then feed it
CC> the message on stdin, but this is not the way to do it.
Yes I have seen this, too. Puh..
>> for key in fd1:
>> outfd.write(key+"\n")
CC> This will write the entire envelope out, plus an extra linefeed. As I
CC> said, readlines() will treat the whole envelope as one 'line' with no
CC> trailing linefeed.
Ok.
CC> What are you trying to do?
I am writing the blue marked module for QSP specified here:
http://www.x-itec.de/QSP/index-modules.html
My goal is to write a wrapper that can do specific things,
rewriting msg-header and/or add/remove specific content from mails.
So I need to read fd0 and fd1, do some changes with the mail and
forward the content to the original qmail-queue in fd0 and fd1.
I will rewrite this now and trash the old code of this module.
--
Best regards,
Boris K�ster [MCSE, CNA] mailto:[EMAIL PROTECTED]
QSP: Qmail Spamkiller Project: http://www.x-itec.de/QSP