And of course, I catch a typo in my source _after_ I post to the list.
Should have read as such:

#!/usr/bin/perl -w

open(QMAIL, "|/var/qmail/bin/qmail-inject (some different address)") || die
"Uh oh, can't open inject:  $!\n";

# Start sucking in message, get headers.
while ($line = <STDIN>) {
  if ($line =~ /^\n$/) {
    last;
  }
  push(@HEADERS, $line);
}


# Add a header.
$HEADER = "X-CUSTOM-HEADER: blah blah blah\n";
push(@HEADERS, $HEADER);

print QMAIL @HEADERS;

# Pump the rest of the message through.
print QMAIL "\n";
while ($line = <STDIN>) {
  print QMAIL $line;
}
close QMAIL;



---------------------------------------





At 06:57 PM 3/24/99 -0800, you wrote:
>I am having a tough time stuffing a header into a message, and persuading
>it to stay put in a reply.
>I am currently under the assumption that it's the MUA that is stripping my
>custom header away before blasting the message though.
>However, other custom headers stay put.
>
>.qmail file just pipes the message to the perl script.
>
>
>perl script sucks it in, adds a header, and re-pipes it onward to
>qmail-inject at a different address.
>This parts works great.  The problem:   As soon as the message is replied
>to (using pretty much any MUA under the sun), the header mysteriously
>disappears.   Perhaps I am writing it to the wrong spot?
>
>Any help would be appreciated.
>Perl source is below.
>
>
>--------------------------------
>
>#!/usr/bin/perl -w
>
>open(QMAIL, "|/var/qmail/bin/qmail-inject (some different address)") || die
>"Uh oh, can't open inject:  $!\n";
>
># Start sucking in message, get headers.
>while ($line = <STDIN>) {
>  if ($line =~ /^\n$/) {
>    last;
>  }
>  push(@HEADERS, $line);
>}
>
>
># Add a header.
>$HEADER = "X-CUSTOM-HEADER: blah blah blah\n";
>push(@HEADERS, $TRACK_HEADER);
>
>print QMAIL @HEADERS;
>
># Pump the rest of the message through.
>print QMAIL "\n";
>while ($line = <STDIN>) {
>  print QMAIL $line;
>}
>close QMAIL;
>
>------------
>Mahlon Smith
>InternetCDS
>541.773.9600 
>


------------
Mahlon Smith
InternetCDS
541.773.9600 

Reply via email to