Ok, a bit of a hack and there is probably a better way to do this, but 
it works for me.  Anything that gets past all the filters and ends up in 
my inbox I move to the 1spam folder and an hourly cron job routes it to 
spamcop and other places.
Kerry.

#hourly.spam.report.sh
#!/bin/sh
grep "From " /home/nice/mail/1spam > /dev/null
RTN=$(echo $?)
if [ "$RTN" = "1" ];
   then  # no emails in the folder
     exit 0
fi

cat ~/mail/1spam > /tmp/spam_toprocess.txt
/bin/rm /home/nice/mail/1spam
touch /home/nice/mail/1spam
#break the mbox into individual files
/usr/local/jdk1.2.2/bin/java -cp /home/nice/bin SpamReport
#this is the gcj compiled version
#/home/nice/bin/SpamReport

/usr/bin/find /tmp/spam -name 'spamMessage*' -print > /tmp/spam/spam.list
cat /tmp/spam/spam.list | while read line
do
   #append to running spam folder
   cat $line >> /home/nice/mail/2002spam
   echo "" >> /home/nice/mail/2002spam
   #report to razor-report
   cat $line | /usr/bin/razor-report
   #get subject
   SUBJECT=`grep Subject: $line | /bin/sed 's/Subject://g'`
   #forward to spamcop - elm seems to be the only mailer that doesn't 
mess up the formatting
   /usr/bin/elm -s "${SUBJECT}" [EMAIL PROTECTED] < $line
   /usr/bin/elm -s "${SUBJECT}" [EMAIL PROTECTED] < $line
   /usr/bin/elm -s "${SUBJECT}" 
[EMAIL PROTECTED] < $line
   /bin/rm $line
done
#end of hourly.spam.report.sh


//SpamReport.java
import java.util.*;
import java.io.*;

public class SpamReport
{
   public static void main(String[] args)
   {
     int spamCount = 0;
     String fileNameBeginning = new String("/tmp/spam/spamMessage");
     try
     {
       BufferedReader in = new BufferedReader(new 
FileReader("/tmp/spam_toprocess.txt"));
       String aLine = null;
       String spamMessage = new String();
       String previousLine = new String();

       //read in first line
       if (in.ready())
       {
         spamMessage = in.readLine();
         previousLine = spamMessage;
       }
       while(in.ready())
       {
         aLine = in.readLine();
         //is it the next message yet
         if (aLine.startsWith("From ") && previousLine.equals("") )
         {
            FileWriter spamFile = new FileWriter(new 
File(fileNameBeginning + "_" + spamCount) );
            spamFile.write(spamMessage);
            spamFile.flush();
            spamFile.close();
            spamCount++;
            spamMessage = aLine;
         }
         else
         {
            spamMessage = spamMessage + "\n" + aLine;
            previousLine = aLine;
         }
       }
       //end of file - finish off last message
       FileWriter spamFile = new FileWriter(new File(fileNameBeginning + 
"_" + spamCount) );
       spamFile.write(spamMessage);
       spamFile.flush();
       spamFile.close();
     }
     catch (Exception e)
     {
       e.printStackTrace();
     }
   }//main
}
//end of SpamReport.java



Ron 'The InSaNe One' Rosson wrote:
 > I know I have seen this on the list before but for some reason am
 > unable to locate it. Some of the users on my system get their e-mail
 > via IMAP from the mail server using Outlook Express. Since this mail
 > client does n ot have a bounce/redirect function they are unable to
 > report SPAM back to the system. Does anyone know of an easy no brainer
 > for the user to be able to do this.
 >
 > The one idea that I remember is the one where the luser places the
 > "one that got thru" into another mailbox and then there is a script
 > ran on that mailbox that gets processed with either razor-report or
 > spamassassin.
 >
 > My mailboxes are in maildir format.
 >
 > TIA
 >



Ron 'The InSaNe One' Rosson wrote:
> I know I have seen this on the list before but for some reason am
> unable to locate it. Some of the users on my system get their e-mail
> via IMAP from the mail server using Outlook Express. Since this mail
> client does n ot have a bounce/redirect function they are unable to
> report SPAM back to the system. Does anyone know of an easy no brainer
> for the user to be able to do this. 
> 
> The one idea that I remember is the one where the luser places the
> "one that got thru" into another mailbox and then there is a script
> ran on that mailbox that gets processed with either razor-report or
> spamassassin. 
> 
> My mailboxes are in maildir format.
> 
> TIA
> 



_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to