Is there any way &grab_envelope_hdrs; can be called before &working_copy
so one could add X-Envelope-From:/To: headers to the tmp/TMPFILE before
moving to new/
No. If it could be done I would have done what you want way back in the beginning :-)
The problem is one of the design of qmail-smtpd. Even though SMTP means you get the envelope info before the DATA, qmail-smtpd doesn't pass the "queuing" process (qmail-queue or Qmail-Scanner) the envelope until AFTER the DATA segment has occurred. This would have been done for error-checking reasons by DJB. As pipes are used to push data about, there is less information about errors to work with than with other methods. So qmail-smtpd passes the DATA segment straight to the queuing process - which writes it to the queue. Then after qmail-smtpd has done the "<CR><LF>.<CR><LF>" bit, it passes the envelope details to the queuing process - and it "knows" that means the SMTP transaction was completed successfully, and now the queuing has continue. If instead it never sees the envelope, then it "knows" something must have gone wrong at the SMTP level, and Qmail-Scanner then exits with the notorious "g_e_h: no sender and no recips." permanent error.
Now that I write that out, I think I'll change that error msg to be more descriptive and less technically correct - maybe "g_e_h: a permanent error has occurred in the process calling Qmail-Scanner (maybe a SMTP timeout or network error has occurred), cleanup and exit"
However, I'm curious to why I was seeing qmail-smtpd sessions hangingIf I read you correctly, I'm surprise ANY e-mails get through! You just cannot read the envelope information before the DATA. See "man qmail-queue".
about that I wasn't seeing before I made the modification. Can anyone
think of any reasons why reading the STDOUT before the STDIN would
create any problems?
If you really want to do what you're doing, you could let it write out, then grab the envelope details, then make a new file with the envelope details, append the original msg and rename, then continue as before. Yucky. Extra files and rewrites...
-- Cheers
Jason Haar Information Security Manager, Trimble Navigation Ltd. Phone: +64 3 9635 377 Fax: +64 3 9635 417 PGP Fingerprint: 7A2E 0407 C9A6 CAF6 2B9F 8422 C063 5EBB FE1D 66D1
------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Qmail-scanner-general mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/qmail-scanner-general