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