[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Sheflug] Spam



Hi

Can anyone help me with this ?

I'm setting up spam filters on my own workstation after an upgrade.
Deleted all of the previous junk out of the way.  I've installed some
CPAN modules....

perl -MCPAN -e shell
cpan> o conf prerequisites_policy ask
    Stops it running away and installing loads of extras.
cpan> install Time::HiRes
cpan> install Net::DNS
cpan> install Spamassassin
cpan> install Mail::Audit


All went well.  Looks as though it likes me.  Tried to use MailScanner
with my Postfix mailer and it didn't quite work out...

http://www.sng.ecs.soton.ac.uk/mailscanner/install/postfix.shtml

So, back to Mail::Audit and Simon Cousins.  I still have
/etc/postfix /etc/postfix.in  as described in the page above.

I created an /etc/procmail which contains...


#LOGFILE=/var/log/procmail.log
#VERBOSE=yes

#SENDER=$1
#SHIFT=1

# Until now, mail is untagged, you may add rules for
# mail that must not be tagged

:0 hbfw
| /usr/bin/spamassassin -P

# Now mail is tagged by spamassassin
# You may insert other rules here

:0
| /usr/sbin/postfix -i -f "$SENDER" -- "$@"

:0
        * ^TO.*
        richard


Doesn't make Spamassassin work at all.  So, that's the first mystery.
.procmailrc contains this ...


:0fw: spamassassin.lock

Don't know if it's doing anything.  There's a .forward file which is
...

"|IFS=' ' && exec /usr/bin/procmail -f- || exit 75 #richard"


This seems to be working fine as my /var/log/mail log shows...

May 15 14:16:37 postfix/local[11564]: C597E45ED7:
to=<richard [at] localhost>, relay=local, delay=1, status=sent
("|IFS=' ' && exec /usr/bin/procmail -f- || exit 75 #richard")


Now,  this is the strange bit.   If I take the above forward file and
add a line that is described by Simon Cousins....

|~/home/richard/.spam

http://www.perl.com/pub/a/2001/07/17/mailfiltering.html

he describes it as " |~/bin/chuckmail".  But, in my case it's
/home/richard/.spam.  What happens is that Postfix starts sending
bounce messages to people who send me mail .........


This is the Postfix program

I'm sorry to have to inform you that the message returned
below could not be delivered to one or more destinations.

For further assistance, please send mail to <postmaster>

If you do so, please include this problem report. You can
delete your own text from the message returned below.

                        The Postfix program

Command died with status 1:
    "/home/richard/.spam" ..........


The logs show that..

May 15 14:06:24 local[11457]: fatal: execvp
/home/richard/.spam: Permission denied
May 15 14:06:24 postfix/smtpd[11448]: disconnect from
localhost[127.0.0.1]


So, this kind of suggests that it might work but something might be
wrong with permissions ?  Anyone know what that might be about?  The
contents of the .spam file are....


  use Mail::Audit;
  my $item    = Mail::Audit->new;
  my $maildir = "/home/richard/inbox";

  my %lists = (
        sheflug         => "sheflug",
        debian          => "debian",
        suse            => "suse",
        spamassassin    => "spamassassin",
        mailscanner     => "mailscanner"
  );

  for my $pattern (keys %lists) {
      $item->accept($maildir.$lists{$pattern})
          if $item->from =~ /$pattern/
             or $item->to =~ /$pattern/;
  }

  $item->accept;

  $incoming->reject;




It would be good to get all of this working and so it would be helpful
if someone could point me in the right direction.

Thanks



Richard
___________________________________________________________________

Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html

  GNU the choice of a complete generation.