]> xenbits.xensource.com Git - people/aperard/emesinae.git/commitdiff
receive.pl: Preserve envelope From as first line
authorIan Campbell <ian.campbell@citrix.com>
Mon, 1 Jul 2013 09:42:07 +0000 (10:42 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 1 Jul 2013 10:02:11 +0000 (11:02 +0100)
Things like mbox generation prefer this.

THis bug is propagated to the /var/raw/NN.hdr files. The sed rune to fix is
'1h; 2{p;g;p}; 3,$p'.

    cd /var/raw/
    sudo find -name \*.hdr -print -exec sed -n -i -e '1h; 2{p;g;p}; 3,$p' {} \;

scripts/receive.pl

index c99c277ca2ad7723d526cd132bf56cb56b59afda..2796562cfa00382611097df2926f1bf600ff99fc 100755 (executable)
@@ -62,6 +62,9 @@ umask(002);
 
 open( FILE, ">T.$id" ) || &failure("open temporary file: $!");
 
+my $envelope = <STDIN>;
+print(FILE $envelope) || &failure("write envelope to temporary file: $!");
+
 printf( FILE
       "Received: (at %s) by $c{MailDomain}; %d %s %d %02d:%02d:%02d +0000\n",
     $recv, $mday, $months[$mon], $year + 1900,