LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   fetchmail procmail spamassassin (http://www.linuxquestions.org/questions/linux-software-2/fetchmail-procmail-spamassassin-220978/)

VincentB 08-22-2004 03:38 PM

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

homey 08-22-2004 05:29 PM

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


VincentB 08-23-2004 04:09 PM

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

homey 08-23-2004 04:23 PM

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

VincentB 08-24-2004 02:35 PM

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


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