LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-22-2004, 02:38 PM   #1
VincentB
Member
 
Registered: Jun 2003
Location: Brussels, Belgium
Distribution: Ubuntu 6.10
Posts: 139

Rep: Reputation: 15
fetchmail procmail spamassassin


All,

I would like to use fetchmail + procmail + spamassassin in odre to tag all incoming spams on my server for all users.

Content of my /etc/fecthmailrc

Code:
[root@localhost etc]# more fetchmailrc
poll mail.zzzz.com
        user "xxxxx"
        pass "yyyyyy"
        is vincent
poll pop.aaaa.net
        user "bbbbb"
        pass "fffff"
        is vincent
the mail is correctly retrieved from the various ISP and is correcty written in /var/spool/mail/vincent.

This seems OK.

Content of /etc/procmailrc

Code:
[root@localhost etc]# more procmailrc
# SpamAssassin sample procmailrc
#
# Pipe the mail through spamassassin (replace 'spamassassin' with 'spamc'
# if you use the spamc/spamd combination)
#
# The condition line ensures that only messages smaller than 250 kB
# (250 * 1024 = 256000 bytes) are processed by SpamAssassin. Most spam
# isn't bigger than a few k and working with big messages can bring
# SpamAssassin to its knees.
#
# The lock file ensures that only 1 spamassassin invocation happens
# at 1 time, to keep the load down.
#
:0fw: spamassassin.lock
* < 256000
| /usr/bin/spamc
  
# Mails with a score of 15 or higher are almost certainly spam (with 0.05%
# false positives according to rules/STATISTICS.txt). Let's put them in a
# different mbox. (This one is optional.)
:0:
* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
almost-certainly-spam
  
# All mail tagged as spam (eg. with a score higher than the set threshold)
# is moved to "probably-spam".
:0:
* ^X-Spam-Status: Yes
probably-spam
  
# Work around procmail bug: any output on stderr will cause the "F" in "From"
# to be dropped.  This will re-add it.
:0
* ^^rom[ ]
{
  LOG="*** Dropped F off From_ header! Fixing up. "
    
  :0 fhw
  | sed -e '1s/^/F/'
}
Code of /etc/mail/spamassassin/local.cf

Code:
# This is the right place to customize your installation of SpamAssassin.
#
# See 'perldoc Mail::SpamAssassin::Conf' for details of what can be
# tweaked.
#
###########################################################################
#
rewrite_subject 1
report_safe 1
# trusted_networks 212.17.35.
 
    auto_whitelist_path        /var/spool/spamassassin/auto-whitelist
    auto_whitelist_file_mode   0666

required_hits 1.5
use_bayes      1
skip_rbl_checks 0
use_razor2      1
use_dcc         1
use_pyzor       1
report_header 1
detailed_phrase_score 1
I would like to update the header of my email and set the Spam status to yet when needed. Unfortunately, it is not updated.

When I run

Code:
spamc < vincent
it detects well spams.

What do I have to do to effectively uppdate header of spam ???
Thanks in advance for your help,

Regards,

Vincent
 
Old 08-22-2004, 04:29 PM   #2
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
Quote:
required_hits 1.5
That seems like it would mark everything as spam.

I have a tag for the subject line......

Code:
# SpamAssassin config file for version 2.5x
# generated by http://www.yrex.com/spam/spamconfig.php (version 1.01)

# How many hits before a message is considered spam.
required_hits           5.0

# Whether to change the subject of suspected spam
rewrite_subject         1

# Text to prepend to subject if rewrite_subject is used
subject_tag             *****SPAM*****

# Encapsulate spam in an attachment
report_safe             1

# Use terse version of the spam report
use_terse_report        0

# Enable the Bayes system
use_bayes               1

# Enable Bayes auto-learning
auto_learn              1

# Enable or disable network checks
skip_rbl_checks         0
use_razor2              1
use_dcc                 1
use_pyzor               1

# Mail using languages used in these country codes will not be marked
# as being possibly spam in a foreign language.
ok_languages            all

# Mail using locales used in these country codes will not be marked
# as being possibly spam in a foreign language.
ok_locales              all
 
Old 08-23-2004, 03:09 PM   #3
VincentB
Member
 
Registered: Jun 2003
Location: Brussels, Belgium
Distribution: Ubuntu 6.10
Posts: 139

Original Poster
Rep: Reputation: 15
Homey,

Thanks for your reply. I have updated my local.cf for spamassassin according to your comment.

What is strange is that, when I run spamc on a SPAM, it detects it and tag it as SPAM. The header is unfortunately not updated accordingly.

Could the problem come from the procmail definition?
It seems that either 1) Procmail does not start spamc or 2) spamassasin does not update the header or 3) Procmail does not catch the update from spamassassin.

Is there a log file somewhere for procmail?

Have you an idea on how I could find the origin of the problem?

Thanks in advance for your help,

Regards,

Vincent
 
Old 08-23-2004, 03:23 PM   #4
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
Sorry, I'm not up to speed on mail yet. I used the tutorial at qmailrocks.org which I think is really excellent.

I don't have that machine loaded up at this time but it seemed to work ok for me.

Here is my procmailrc but I don't recall where I got this from.

/etc/procmailrc
INCLUDERC=/etc/mail/spamassassin/spamassassin-default.rc
 
Old 08-24-2004, 01:35 PM   #5
VincentB
Member
 
Registered: Jun 2003
Location: Brussels, Belgium
Distribution: Ubuntu 6.10
Posts: 139

Original Poster
Rep: Reputation: 15
I think I have the solution.
I have added, in /etc/fetchmailrc, the following line for each of my accounts:

mda "/usr/bin/procmail -d %T"

Now, headers are updated.

Hope this will help other people.

Regards
 
  


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
fetchmail and procmail ryedunn Linux - Newbie 1 10-20-2004 10:37 AM
spamassassin w/ procmail vs. spamassassin w/sendmail bleunuit Linux - Networking 1 08-01-2004 07:12 AM
good email setup? fetchmail -> procmail -> spamassassin -> evolution xmnemonic Linux - Software 0 10-12-2003 04:33 PM
Spamassassin conf with fetchmail, postfix, procmail, kmail iihay Linux - Networking 0 05-25-2003 09:03 AM
fetchmail + procmail (?) markus1982 Linux - Networking 1 11-12-2002 06:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:05 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