Есть почтовый сервер на Freebsd 7.0
На нём установлен спам фильтр spamassassin.
Как выяснить запущен он или нет и настроить его соответсвенно на максимум?
Код: Выделить всё
FreeBSD 7.0-RELEASE-p1 #0Модератор: terminus
Код: Выделить всё
FreeBSD 7.0-RELEASE-p1 #0Код: Выделить всё
postfix-2.4.6,1 A secure alternative to widely-used Sendmail
postfixadmin-2.1.0_7 PHP web-based management tool for Postfix virtual domains aКод: Выделить всё
spamd_enable="YES"Код: Выделить всё
smtp inet n - n - - smtpd -o content_filter=spamassassin
spamassassin unix - n n - - pipe user=spamd argv=/usr/local/bin/spamc -e /usr/local/sbin/sendmail -oi -f ${sender} ${recipient}
Код: Выделить всё
required_score 5.0в rc.conf такого нет.посмотрите тут, запущен или нет:
/etc/rc.conf
Код: Выделить всё • Развернуть
spamd_enable="YES"
/usr/local/etc/postfix/master.cf
Код: Выделить всё • Развернуть
smtp inet n - n - - smtpd -o content_filter=spamassassinspamassassin unix - n n - - pipe user=spamd argv=/usr/local/bin/spamc -e /usr/local/sbin/sendmail -oi -f ${sender} ${recipient}
Код: Выделить всё
pkg_info | grep spamКод: Выделить всё
/usr/local/etc/postfix/>pkg_info | grep spam
p5-Mail-SpamAssassin-3.2.3 A highly efficient mail filter for identifying spam
Press any key to continue...Код: Выделить всё
#
# Postfix master process configuration file. For details on the format
# of the file, see the master(5) manual page (command: "man 5 master").
#
# Do not forget to execute "postfix reload" after editing this file.
#
# ==========================================================================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
# ==========================================================================
smtp inet n - n - - smtpd
#submission inet n - n - - smtpd
# -o smtpd_tls_security_level=encrypt
-o smtpd_sasl_auth_enable=yes
# -o content_filter=spam:dummy
# -o smtpd_client_restrictions=permit_sasl_authenticated,reject
# -o milter_macro_daemon_name=ORIGINATING
smtps inet n - n - - smtpd
# -o smtpd_tls_wrappermode=yes
-o smtpd_sasl_auth_enable=yes
# -o smtpd_client_restrictions=permit_sasl_authenticated,reject
# -o milter_macro_daemon_name=ORIGINATING
#628 inet n - n - - qmqpd
pickup fifo n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr fifo n - n 300 1 qmgr
#qmgr fifo n - n 300 1 oqmgr
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
proxywrite unix - - n - 1 proxymap
smtp unix - - n - - smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay unix - - n - - smtp
-o smtp_fallback_relay=
# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq unix n - n - - showq
error unix - - n - - error
retry 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
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent. See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# Dovecot LDA
dovecot unix - n n - - pipe
flags=DRhu user=virtual:virtual argv=/usr/libexec/dovecot/deliver -d ${recipient}
#scan unix - - n - 16 smtp
# -o smtp_send_xforward_command=yes
# -o smtp_tls_security_level=none
127.0.0.1:10026 inet n - n - 16 smtpd
-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=virtual argv=/usr/local/bin/spamc -u virtual -e /usr/local/sbin/sendmail -f $sender $recipientКод: Выделить всё
# ==========================================================================
smtp inet n - n - - smtpd
#submission inet n - n - - smtpd
# -o smtpd_tls_security_level=encrypt
-o smtpd_sasl_auth_enable=yes
# -o content_filter=spam:dummy
# -o smtpd_client_restrictions=permit_sasl_authenticated,reject
# -o milter_macro_daemon_name=ORIGINATING
smtps inet n - n - - smtpd
# -o smtpd_tls_wrappermode=yes
-o smtpd_sasl_auth_enable=yes
# -o smtpd_client_restrictions=permit_sasl_authenticated,reject
# -o milter_macro_daemon_name=ORIGINATING
#628 inet n - n - - qmqpd
pickup fifo n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr fifo n - n 300 1 qmgr
#qmgr fifo n - n 300 1 oqmgr
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
proxywrite unix - - n - 1 proxymap
smtp unix - - n - - smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay unix - - n - - smtp
-o smtp_fallback_relay=
# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq unix n - n - - showq
error unix - - n - - error
retry 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
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent. See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# Dovecot LDA
dovecot unix - n n - - pipe
flags=DRhu user=virtual:virtual argv=/usr/libexec/dovecot/deliver -d ${recipient}
#scan unix - - n - 16 smtp
# -o smtp_send_xforward_command=yes
# -o smtp_tls_security_level=none
127.0.0.1:10026 inet n - n - 16 smtpd
-o content_filter=spam
-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=virtual argv=/usr/local/bin/spamc -u virtual -e /usr/local/sbin/sendmail -f $sender $recipientКод: Выделить всё
/usr/local/bin/sa-update && /usr/local/etc/rc.d/sa-spamd reloadВозможно или точно? нужно наверняка, экспериментировать не могу.Возможно, что включить его назад можно бужет так:
/etc/rc.confИ как запустить spamd?
Код: Выделить всё
spamd_enable="YES"Код: Выделить всё
/usr/local/etc/rc.d/sa-spamd start && /usr/local/bin/sa-update && /usr/local/etc/rc.d/sa-spamd reloadКод: Выделить всё
/usr/home/noname/>ps -ax | grep spamd
803 ?? Ss 0:00.25 /usr/local/bin/spamd -c -Q -d -r /var/run/spamd/spamd
959 ?? I 0:00.00 spamd child (perl5.8.8)
960 ?? I 0:00.00 spamd child (perl5.8.8)
1122 p0 R+ 0:00.00 grep spamd
/usr/home/noname/>Код: Выделить всё
# -o content_filter=spam:dummyКод: Выделить всё
Aug 26 11:48:39 post spamd[959]: spamd: connection from localhost [127.0.0.1] at port 62846
Aug 26 11:48:39 post spamd[959]: spamd: setuid to virtual succeeded
Aug 26 11:48:39 post spamd[959]: spamd: creating default_prefs: /home/virtual/.spamassassin/user_prefs
Aug 26 11:48:39 post spamd[959]: config: cannot write to /home/virtual/.spamassassin/user_prefs: No such file or directory
Aug 26 11:48:39 post spamd[959]: spamd: failed to create readable default_prefs: /home/virtual/.spamassassin/user_prefs
Aug 26 11:48:39 post spamd[959]: spamd: processing message <4A94EAEC.7020404@mail.ru> for virtual:1981
Aug 26 11:48:39 post postfix/smtpd[1106]: disconnect from mx7.mail.ru[94.100.176.21]
Aug 26 11:48:40 post spamd[959]: auto-whitelist: open of auto-whitelist file failed: locker: safe_lock: cannot create tmp lockfile /home/virtual/.spamassassin/auto-whitelist.lock.post.td-limon.ru.959 for /home/virtual/.spamassassin/auto-whitelist.lock: No such file or directory
Aug 26 11:48:40 post spamd[959]: spamd: clean message (0.6/7.0) for virtual:1981 in 0.8 seconds, 24656 bytes.
Aug 26 11:48:40 post spamd[959]: spamd: result: . 0 - HTML_IMAGE_RATIO_02,HTML_MESSAGE,SPF_PASS scantime=0.8,size=24656,user=virtual,uid=1981,required_score=7.0,rhost=localhost,raddr=127.0.0.1,rport=62846,mid=<4A94EAEC.7020404@mail.ru>,autolearn=no
Aug 26 11:48:40 post postfix/pipe[1178]: 3EFD01FDF464: to=<>, relay=spam, delay=2.8, delays=1.9/0/0/0.81, dsn=2.0.0, status=sent (delivered via spam service)
Aug 26 11:48:40 post postfix/qmgr[1000]: 3EFD01FDF464: removed
Aug 26 11:48:40 post postfix/pickup[999]: ADE211FDF516: uid=1981 from=<>
Aug 26 11:48:40 post postfix/cleanup[1177]: ADE211FDF516: message-id=<4A94EAEC.7020404@mail.ru>
Aug 26 11:48:40 post postfix/qmgr[1000]: ADE211FDF516: from=<>, size=25482, nrcpt=1 (queue active)
Aug 26 11:48:40 post spamd[803]: prefork: child states: II кроме того можно посмотреть на заголовки в письме:This is the GTUBE, the
Generic
Test for
Unsolicited
Bulk
If your spam filter supports it, the GTUBE provides a test by which you
can verify that the filter is installed correctly and is detecting incoming
spam. You can send yourself a test mail containing the following string of
characters (in upper case and with no white spaces and line breaks):
XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X
You should send this test mail from an account outside of your network.
Код: Выделить всё
Received: by mail.sdf.lv (Postfix, from userid 58) id EA7335C58; Thu, 20
Aug 2009 15:57:26 +0300 (EEST)
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail.sdf.lv
X-Spam-Level:
X-Spam-Status: No, score=0.0 required=6.0 tests=ALL_TRUSTED,AWL,SUBJ_ALL_CAPS
autolearn=no version=3.2.5В заголовках писем spamassassin есть.terminus писал(а):проверить можно послав такое письмо:
кроме того можно посмотреть на заголовки в письме:This is the GTUBE, the
Generic
Test for
Unsolicited
Bulk
If your spam filter supports it, the GTUBE provides a test by which you
can verify that the filter is installed correctly and is detecting incoming
spam. You can send yourself a test mail containing the following string of
characters (in upper case and with no white spaces and line breaks):
XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X
You should send this test mail from an account outside of your network.Код: Выделить всё
Received: by mail.sdf.lv (Postfix, from userid 58) id EA7335C58; Thu, 20 Aug 2009 15:57:26 +0300 (EEST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail.sdf.lv X-Spam-Level: X-Spam-Status: No, score=0.0 required=6.0 tests=ALL_TRUSTED,AWL,SUBJ_ALL_CAPS autolearn=no version=3.2.5
Так что получается что spamassassin только помечает письма как спам но не удаляет?terminus писал(а):Вы хотите удалять письма которые асасин класифицировал как спам?
http://wiki.apache.org/spamassassin/Int ... xViaSpampd