Страница 1 из 1
spamassassin и freebsd
Добавлено: 2009-08-25 10:46:23
serj1981
Здравствуйте!
Есть почтовый сервер на Freebsd 7.0
На нём установлен спам фильтр spamassassin.
Как выяснить запущен он или нет и настроить его соответсвенно на максимум?
Re: spamassassin и freebsd
Добавлено: 2009-08-25 10:59:37
serj1981
Код: Выделить всё
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
Re: spamassassin и freebsd
Добавлено: 2009-08-25 11:14:58
terminus
посмотрите тут, запущен или нет:
/etc/rc.conf
/usr/local/etc/postfix/master.cf
Код: Выделить всё
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}
настройки строгости фильтрации:
/usr/local/etc/mail/spamassassin/local.cf
Re: spamassassin и freebsd
Добавлено: 2009-08-25 11:28:28
serj1981
посмотрите тут, запущен или нет:
/etc/rc.conf
Код: Выделить всё • Развернуть
spamd_enable="YES"
в rc.conf такого нет.
/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}
и тут такого нет.
Re: spamassassin и freebsd
Добавлено: 2009-08-25 11:32:09
terminus
Re: spamassassin и freebsd
Добавлено: 2009-08-25 12:28:54
serj1981
Код: Выделить всё
/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...
Re: spamassassin и freebsd
Добавлено: 2009-08-25 12:49:22
terminus
полностью весь /usr/local/etc/postfix/master.cf покажите
Re: spamassassin и freebsd
Добавлено: 2009-08-25 12:54:06
serj1981
Код: Выделить всё
#
# 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
Re: spamassassin и freebsd
Добавлено: 2009-08-25 13:05:37
terminus
как-то все мудрено сделано...
сейчас асасин выключен (для этого наверно были причины?)
Возможно, что включить его назад можно бужет так:
Код: Выделить всё
# ==========================================================================
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
перед этим не забыть прописать разрещение в rc.conf, запустить spamd и выполнить
Код: Выделить всё
/usr/local/bin/sa-update && /usr/local/etc/rc.d/sa-spamd reload
ну и postfix тоже перезапустить и проверить что так все работает...
Re: spamassassin и freebsd
Добавлено: 2009-08-25 17:26:29
serj1981
Возможно, что включить его назад можно бужет так:
Возможно или точно? нужно наверняка, экспериментировать не могу.
И как запустить spamd?
Re: spamassassin и freebsd
Добавлено: 2009-08-25 17:46:06
terminus
чтобы наверняка - надо смотреть всю остальную конфигурацию postfix и знать как к вам почта идет.
У вас там сейчас две smtp компоненты запущены, видете - на 25 и на 10026, и между ними должна быть пересылка настроена (по-идее - иначе зачем так сделано). А може и нет, на самом деле - может эти два smtp независимые, и тогда ассасин надо цеплять к первой smtp компоненте. Без поллитры не того-этого короче
Включите, проверите - работает или нет. Если нет то вернете все обратно как было.
Если нужны гарантии, что все 100% точно, то лучше сами разберитесь как в postfix трафик ходит между его компонентами и не внешние фильтры (это довольно нудно учить правда), и сделайте все с 100% уверенностью.
---
И как запустить spamd?
/etc/rc.conf
Код: Выделить всё
/usr/local/etc/rc.d/sa-spamd start && /usr/local/bin/sa-update && /usr/local/etc/rc.d/sa-spamd reload
Re: spamassassin и freebsd
Добавлено: 2009-08-26 10:52:52
serj1981
master.cf отредактировал.
spamd запустил.
Код: Выделить всё
/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/>
И как теперь проверить почта фильтруется или нет?
Кстати а строчка
из master.cf ?
Её не надо раскомментировать?
Re: spamassassin и freebsd
Добавлено: 2009-08-26 11:03:09
serj1981
Вот кусок maillog:
Код: Выделить всё
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
Re: spamassassin и freebsd
Добавлено: 2009-08-26 11:10:54
terminus
проверить можно послав такое письмо:
This is the GTUBE, the
Generic
Test for
Unsolicited
Bulk
Email
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
Re: spamassassin и freebsd
Добавлено: 2009-08-26 11:20:23
terminus
На ругань в логах можно не обращать внимания - кажется ничего там страшного нет, вроде...
Или просто руками создать те файлы про которые он ругается и все.
Вообще кажется была директива специальная для local.cf отключающая поиск юзерских настроек ЕМНИП...
Re: spamassassin и freebsd
Добавлено: 2009-08-26 13:12:49
serj1981
terminus писал(а):проверить можно послав такое письмо:
This is the GTUBE, the
Generic
Test for
Unsolicited
Bulk
Email
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 есть.
Но спам то всё равно приходит!
Как сделать так чтобы спам не приходил?
Re: spamassassin и freebsd
Добавлено: 2009-08-26 14:26:02
terminus
Вы хотите удалять письма которые асасин класифицировал как спам?
http://wiki.apache.org/spamassassin/Int ... xViaSpampd
Re: spamassassin и freebsd
Добавлено: 2009-08-27 10:21:07
serj1981
Так что получается что spamassassin только помечает письма как спам но не удаляет?
Re: spamassassin и freebsd
Добавлено: 2009-08-27 14:38:41
serj1981
А какое другое ПО удаляет письма, а не помечает их?