EHLO
i wrote a small perl script, which forwards the mail's subject to a given
address. the problem is, that it doesn't work perfect.
so...
/etc/aliases:
john.doe: john
/home/john/.forward:
john, "|/home/john/subjforw"
a mail comes to johm.doe@???. exim delivers to the local user john
and to the script, named subjforw. in this way, it's good.
bob isn't in the /etc/aliases
but his .forward file is the same:
bob, "|/home/bob/subjforw"
bob gets a copy to his local mailbox (which is correct), but he gets two
copies of every mail in the specified e-mail, which is $mail_to.
-------------------------------------------------------------------------
subjforw is the following:
#!/usr/bin/perl
# send the subject to this e-mail
$mail_to = 'bob@???';
# parse the mail
while(<>)
{
/^$/ && last; # exit the loop if we reach the first
# blank line
/^From: (.*)/ && ($sender = $1); # get the sender
/^Subject: (.*)/ && ($subject = $1); # get the subject
}
# open a pipe to exim, and send the subject.
open HAL, '|/usr/lib/sendmail -t';
print HAL "From: $sender\n";
print HAL "To: $mail_to\n";
print HAL "Subject: $subject\n";
close HAL;
-------------------------------------------------------------------------
i tryed to change $mail_to, but that didn't help.
i guess i do something wrong.
Please Cc the replies to naonjo@???, since i'm not on the list.
Thanks in advance.
Creed.