LinuxForum.Fans
Тема

Subject ****SPAMASSASSIN****

Автор: sagvir 5 сообщений 2534 просмотров 🔒 закрыта
#185719

Всех приветствую, недавно поднял связку postfix+dovecot+mysql+clamav-clamsmtp+spamassassin+squirrelmail основные функции работают почта приходит и уходит, антивирус работает, присылает уведомления о зараженном письме
Но вот антиспам не работает прикрепляю логи, кому будет не затруднительно или кто уже сталкивался с таким, буду признательным в помощи)
Вот так выглядит информация о пришедшем письме, ничего о то что спам фильтр работает не видно..

Показать
Viewing Full Header - View message
Return-Path: <root@mail.company.ru>
Delivered-To: newbox@company.ru
Received: from mail.company.ru (localhost.localdomain [127.0.0.1])
by mail.company.ru (Postfix) with ESMTP id 0B224AC409E
for <newbox@company.ru>; Fri, 19 Aug 2011 15:32:45 +0600 (YEKST)
Received: by mail.company.ru (Postfix, from userid 0)
id E8E8DAC409F; Fri, 19 Aug 2011 15:32:44 +0600 (YEKST)
To: newbox@company.ru
Subject: mail-spam
Message-Id: <20110819093244.E8E8DAC409F@mail.company.ru>
Date: Fri, 19 Aug 2011 15:32:44 +0600 (YEKST)
From: root@mail.company.ru (root)
X-Virus-Scanned: ClamAV using ClamSMTP

cat /var/lib/spamassassin/spamd.log

Показать

Fri Aug 19 15:07:37 2011 [4816] info: logger: removing stderr method
Fri Aug 19 15:07:38 2011 [4818] info: spamd: server started on port 783/tcp (running version 3.3.1)
Fri Aug 19 15:07:38 2011 [4818] info: spamd: server pid: 4818
Fri Aug 19 15:07:38 2011 [4818] info: spamd: server successfully spawned child process, pid 4819
Fri Aug 19 15:07:38 2011 [4818] info: spamd: server successfully spawned child process, pid 4820
Fri Aug 19 15:07:38 2011 [4818] info: prefork: child states: IS
Fri Aug 19 15:07:38 2011 [4818] info: prefork: child states: II
Fri Aug 19 15:26:48 2011 [4818] info: spamd: server killed by SIGTERM, shutting down
Fri Aug 19 15:26:48 2011 [5291] info: logger: removing stderr method
Fri Aug 19 15:26:49 2011 [5293] info: spamd: server started on port 783/tcp (running version 3.3.1)
Fri Aug 19 15:26:49 2011 [5293] info: spamd: server pid: 5293
Fri Aug 19 15:26:49 2011 [5293] info: spamd: server successfully spawned child process, pid 5294
Fri Aug 19 15:26:49 2011 [5293] info: spamd: server successfully spawned child process, pid 5295
Fri Aug 19 15:26:49 2011 [5293] info: prefork: child states: IS
Fri Aug 19 15:26:49 2011 [5293] info: prefork: child states: II

less /var/lib/spamassasin/spamd.log

Показать

Aug 19 10:23:43 mailserver spamd[2770]: config: failed to parse line, skipping, in "/etc/spamassassin/local.cf": use_dcc 1
Aug 19 10:23:43 mailserver spamd[2770]: config: failed to parse line, skipping, in "/etc/spamassassin/local.cf": dcc_home /var/lib/dcc
Aug 19 10:23:44 mailserver spamd[2770]: spamd: server started on port 783/tcp (running version 3.3.1)
Aug 19 10:23:44 mailserver spamd[2770]: spamd: server pid: 2770
Aug 19 10:23:44 mailserver spamd[2770]: spamd: server successfully spawned child process, pid 2776
Aug 19 10:23:44 mailserver spamd[2770]: spamd: server successfully spawned child process, pid 2777
Aug 19 10:23:44 mailserver spamd[2770]: prefork: child states: IS
Aug 19 10:23:44 mailserver spamd[2770]: prefork: child states: II
Aug 19 11:13:37 mailserver spamd[2770]: spamd: server killed by SIGTERM, shutting down

less /etc/postfix/main.cf

Показать
# Postfix master process configuration file.
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
# ==========================================================
#smtp inet n - n - - smtpd
smtp inet n - - - - smtpd
# -o content_filter=spamfilter:dummy
-o content_filter=spamassassin

pickup fifo n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr fifo n - n 300 1 qmgr
tlsmgr unix - - n 1000? 1 tlsmgr
rewrite unix - - n - - trivial-rewrite
bounce unix - - n - 0 bounce
defer unix - - n - 0 bounce
trace unix - - n - 0 bounce
verify unix - - n - 1 verify
flush unix n - n 1000? 0 flush
proxymap unix - - n - - proxymap
smtp unix - - n - - smtp
-o fallback_relay=
showq unix n - n - - showq
error unix - - n - - error
discard unix - - n - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - n - - lmtp
anvil unix - - n - 1 anvil
scache unix - - n - 1 scache

maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}

old-cyrus unix - n n - - pipe
flags=R user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -m ${extension} ${user}

cyrus unix - n n - - pipe
user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -r ${sender} -m ${extension} ${user}

uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)

ifmail unix - n n - - pipe
flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)

bsmtp unix - n n - - pipe
flags=Fq. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient

dovecot unix - n n - - pipe
flags=DRhu user=vmail:mail argv=/usr/lib64/dovecot/deliver -d $(recipient)

scan unix - - n - 16 smtp -o smtp_send_xforward_command=yes
-o content_filter=
-o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
-o smtpd_helo_restrictions=
-o smtpd_client_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o mynetworks_style=host
-o smtpd_authorized_xforward_hosts=127.0.0.0/8

#spam unix - n n - - pipe
#flags=R user=vmail argv=/usr/bin/spamc -u vmail -e /usr/sbin/sendmail -f $sender $recipient
spamassasin unix - n n - - pipe
flags=Rq user=spamfilter argv=/usr/local/bin/spamfilter -f ${sender} -- ${recipient}
# flags=Rq user=spamfilter argv=/usr/bin/spamc -f -e argv=/usr/sbin/sendmail -oi -f ${sender} ${recipient}

(END)

127.0.0.1:10026 inet n - n - 16 smtpd

less /etc/spamassassin/local.cf

Показать
required_hits 5
rewrite_header Subject ****SPAM****
report_safe 0
use_bayes 1

bayes_path /etc/mail/spamassassin/bayes
bayes_file_mode 0666
bayes_learn_to_journal 1

bayes_min_ham_num 50
bayes_min_spam_num 50

score SUBJ_FULL_OF_8BITS 0.00
score HTML_COMMENT_8BITS 0.01
score HEADER_8BITS 0.00
score TO_NO_USER 0.01
score FORGED_MUA_OUTLOOK 0.5
score X_AUTH_WARNING 0.01
score SUBJ_HAS_UNIQ_ID 9.99
score HTTP_USERNAME_USED 9.99
score FORGED_YAHOO_RCVD 9.99
score FORGED_JUNO_RCVD 16
score UNWANTED_LANGUAGE_BODY 1.02
score MLM 5.55
score RCVD_NUMERIC_HELO 4.95

ok_locales en ru

whitelist_from root@localhost
blacklist_from *@outblaze.com

auto_whitelist_path /etc/mail/spamassassin/auto-whitelist
auto_whitelist_file_mode 0666

trusted_networks 192.168.2.0/24

less /etc/default/spamassassin

Показать
# Change to one to enable spamd
ENABLED=1

SAHOME="/var/lib/spamassassin/"

# Options
# See man spamd for possible options. The -d option is automatically added.

# SpamAssassin uses a preforking model, so be careful! You need to
# make sure --max-children is not set to anything higher than 5,
# unless you know what you're doing.

#OPTIONS="--create-prefs --max-children 5 --helper-home-dir"
OPTIONS="--max-children 5 --allow-tell --nouser-config --sql-config --username spamfilter --helper-home-dir ${SAHOME} -s ${SAHOME}spamd.log"
# Pid file
# Where should spamd write its PID to file? If you use the -u or
# --username option above, this needs to be writable by that user.
# Otherwise, the init script will not be able to shut spamd down.
PIDFILE="/var/run/spamd.pid"

плагины тоже включал
в процесах есть
[console]ps aux |grep spam
root 5293 0.0 1.5 121920 56192 ? Ss 15:26 0:01 /usr/sbin/spamd --max-children 5 --allow-tell --nouser-config --sql-config --username spamfilter --helper-home-dir /var/lib/spamassassin/ -s /var/lib/spamassassin/spamd.log -d --pidfile=/var/run/spamd.pid
5001 5294 0.0 1.5 121920 54412 ? S 15:26 0:00 spamd child
5001 5295 0.0 1.5 121920 54412 ? S 15:26 0:00 spamd child
root 6274 0.0 0.0 8948 856 pts/0 S+ 17:09 0:00 grep spam
[/console]

#185904

Попробуйте сделать единого оунера для всех процессов. Юзера постфикса, есстессно.

#186129

Разве постфикса надо?Я создал пользователя с юидом 5001 spamassassin и к нему привязывал спамассассин, где лежат бейс базы этого пользователя включил. Можете конкретней пояснить какие файлы и каталоги на этого пользователя заточить и процессы.

#186192

sagvir, а зачем было создавать отдельно? Из сорсов установлен? Ну, вот и можно попробовать поменять оунера бйес баз, самих бинарей и тп. Все, что выведет find по юиду.

#188844
Denlookh написал:
sagvir, а зачем было создавать отдельно? Из сорсов установлен? Ну, вот и можно попробовать поменять оунера бйес баз, самих бинарей и тп. Все, что выведет find по юиду.

Безопасность. Все удалось настроить выставил пользователя vmail:mail заранее их создав, почта так же от этого пользователя уходит, А конкретно ошибка была в
/etc/postfix/master.cf
-o content_filter=
Спасибо за содействие,тему можно закрывать.

Войдите или зарегистрируйтесь, чтобы ответить.