LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-25-2003, 09:03 AM   #1
iihay
Member
 
Registered: Jul 2001
Location: Morpeth UK
Distribution: Mandrake 10.0
Posts: 51

Rep: Reputation: 15
Spamassassin conf with fetchmail, postfix, procmail, kmail


Hi guys,

Update: I don't seem to have sa-learn and also mail for the inbox is still going to /home/user1/Mail rather than /home/user1/Maildir

I am trying to configure spamassassin to filter the 100's of crap email I get everyday andI am having a few problems. I have it filtering some spam sucessfully so I think I am nearly there. However, some still gets through and also I cannot access the folders I am filtering mail into via procmail. Any help would be greatly appreciated.

I am running Mandrake 9.1 with fetchmail release 6.2.1, procmail 3.22, postfix and kmail

My setup has 2 local users receiving mail from an external smtp server. I have fetchmail set up to run as a daemon from startup and root has a .fetchmailrc as follows

set syslog
set postmaster "user1"
set bouncemail
set spambounce
set properties ""
set daemon 180
poll mail.btinternet.com with proto POP3
user 'removed1' there with password 'removed1' is 'user1 here options fetchall antispam 501
user 'removed2' there with password 'removed2' is 'user2' here options fetchall antispam 501

This has been sucessfully pulling down mail and dropping it into /var/spool/mail from which we have add access from kmail set up to access the mail file. Kmail was then set with folders confirgured to filer mail into using rules.

Postfix is up and running and has been sucessful for ages under this system. main.cf is as follows:

#soft_bounce = no
command_directory = /usr/sbin
daemon_directory = /usr/lib/postfix
myhostname = machine.mydomain.com
mydomain = mydomain.com
inet_interfaces = localhost
unknown_local_recipient_reject_code = 450
alias_maps = hash:/etc/postfix/aliases

home_mailbox = Mailbox
#home_mailbox = Maildir/

mail_spool_directory = /var/spool/mail
mailbox_command = /usr/bin/procmail -Y -a $DOMAIN
smtpd_banner = $myhostname ESMTP $mail_name ($mail_version) (Mandrake Linux)
debug_peer_level = 2
delay_warning_time = 4
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
readme_directory = /usr/share/doc/postfix-2.0.6/README_FILES
alias_database = hash:/etc/postfix/aliases
myorigin = btinternet.com
notify_classes = resource, software, delay

This has been chopped to what I think is needed to show here, One of the lines I am uncertain about if homemailbox. Should this be set to maildir?

This all worked a treat until I tried to spamassassin on. I installed sa and set up a .procmailrc in /home/user1 as follows:

home/user1/.procmailrc
SHELL=/bin/sh
PATH="$HOME/bin:/usr/bin:/usr/local/bin:/usr/include:/usr/local/sbin:/bin:/sbin:/usr/sbin"
MAILDIR=
PMDIR=$HOME/.procmail
LOCKFILE=/home/user1/.procmail/lockfile.lock
DEFAULT=/home/user1/Maildir/
JUNKMAIL=/home/user1/Maildir/.junkmail/
LFS=/home/user1/Maildir/LFS/
IPCOP=/home/user1/Maildir/IPCOP
LOCKTIMEOUT=10
LOGFILE=$PMDIR/log
LOGABSTRACT=all
VERBOSE=no
#Filter out Mails from Newgroups
:0 : $LOCKFILE
* ^To:.ipcop-user@*
$IPCOP

#Filter out Mail from lfs
:0 : $LOCKFILE
* ^To:.*@linuxfromscratch.org
$LFS

#Run SpamAssasin
:0fw
| spamassassin -a -P
:0e
{
EXITCODE=$?
}
:0: $LOCKFILE
* ^Subject:.*\*\*\*\*SPAM\*\*\*\*
$JUNKMAIL
# Everything else goes in default mailbox.
:0 : $LOCKFILE

I then set up kmail to receive mail from maildir at /home/user1/maildir. I also ran maildirmake++ and created maildir with a .junkmail .lfs and .ipcop folder underneath. This receives email and also appears to filter some span leaving it in .junkmail with spam addedd as a prefix to the message subject. Also stuff like the following appears in teh message headers so that must be working:

-Spam-Status: No, hits=-0.8 required=6.0
tests=AWL,FROM_AND_TO_SAME_5,NOSPAM_INC,SPAM_PHRASE_00_01,
USER_AGENT
version=2.44
X-Spam-Level:
Status: R
X-Status: N

This is fine although I need to adjust the scoring as some gets through. However I still have the folders I set up in kmail when using a flat Mail directory. I cannot see the procmail .lfs and .ipcop folders even when I remove the . I really want to use procmail to filter these and others but also access them from kmail.

Can anyone point me in the correct direction. I would also appreciate assistance with score tweaking. A lot of stuff on the web about this is fairly confusing. I think I have posted all the config which will help here but if not please ask for more. Once I have set this up I am going to do the same for user2.

Cheers

Iain

Last edited by iihay; 05-26-2003 at 08:06 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
postfix - procmail, fetchmail varun_saa Mandriva 3 09-11-2005 12:53 AM
fetchmail procmail spamassassin VincentB Linux - Software 4 08-24-2004 01:35 PM
fetchmail + KMail. oh and spamassassin graffitici Linux - Networking 0 01-23-2004 11:01 AM
good email setup? fetchmail -> procmail -> spamassassin -> evolution xmnemonic Linux - Software 0 10-12-2003 04:33 PM
IMAP and fetchmail / postfix / procmail / spamc etc... fordboy0 Linux - Networking 2 09-17-2003 07:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration