Ok here's a quick hack, but it works...

Follow these steps:

1. copy the code below to a file and make it 755.

2. add the full path and name of file to your .qmail
   ex: 
        | /acct/staff/lcl/mailtofile

3. make sure you change the variables for $file and $which_sender to your
   desired values.

4. Email me let me know if it works for you, and how I could improve :)

5. I know that the variables could be passed on the command line, but
   thats more work than I can do while eating my lunch!

Samuel Daffner
Mills College ITS

====== code begins here ========

#!/usr/local/bin/perl
#
# mailtofile 
#
# by Samuel Daffner , [EMAIL PROTECTED]
#
#####

### which sender do you want to idenify ?
### note: if you use an @ symbol, please use a \ in front :)
###   ex: daffners\@mills.edu

$which_sender="daffners";

##### which file do you want to write to ?

$file="/acct/staff/lcl/mail/fromsam";

## MODIFY BELOW AT YOUR OWN RISK ###

$sender=  $ENV{'SENDER'};
@IN=<STDIN>;

if ($sender =~ /$which_sender/i){

open (FILE, ">>$file");

foreach $line (@IN){
print FILE "$line";}

close (FILE);
} else {

}






Reply via email to