On Wed, Mar 29, 2000 at 06:49:12PM +0200, Martin Kos wrote:
> hi all
>
> is it possible to e.g. edit the subject line of each mail for a user
> [EMAIL PROTECTED] before it's delivered to his local mailbox or forwarded to the
> final address ?
Aber natürlich, here is a script to rewrite headers.
put this in your .qmail-file:
| /usr/local/bin/tagmail3.pl | forward [EMAIL PROTECTED]
------------%< -- cut here --------------------
#!/usr/bin/perl
# tagmail3.pl; 1999-11-09; [EMAIL PROTECTED]
use strict;
# read mail and split into hdr and body
my ($hdr, $body);
while (<STDIN>)
{
last if /^[\r\n]*$/;
if (/^\s/) {
$hdr .= $_;
next;
}
$hdr .= $_;
next;
}
$body = join '',<STDIN>;
#
# FIX SOMETHING HERE
#
$hdr =~ s/^(subject:\s*)(.*)$/$1 [FORWARDED MAIL] $2/mi;
# print mail
print "$hdr\n$body";
------------%< -- cut here --------------------