проблема с SpamAssassin

Обсуждение настройки и работы сервисов, резервирования, сетевых настроек и вопросов безопасности ОС.

Модераторы: SLEDopit, Модераторы разделов

NeverM
Сообщения: 248
ОС: gentoo

проблема с SpamAssassin

Сообщение NeverM »

в логах вижу вот это:

Код: Выделить всё

Nov  9 07:19:13 srv spamd[14534]: spamd: server started on port 783/tcp (running version 3.2.1-gr1)
Nov  9 07:19:13 srv spamd[14534]: spamd: server pid: 14534
Nov  9 07:19:13 srv spamd[14534]: spamd: server successfully spawned child process, pid 14547
Nov  9 07:19:13 srv spamd[14534]: spamd: server successfully spawned child process, pid 14548
Nov  9 07:19:13 srv spamd[14534]: prefork: child states: IS
Nov  9 07:19:13 srv spamd[14534]: prefork: child states: II
Nov  9 07:19:57 srv spamd[14547]: spamd: connection from localhost [127.0.0.1] at port 39172
Nov  9 07:19:57 srv spamd[14547]: spamd: creating default_prefs: //.spamassassin/user_prefs
Nov  9 07:19:57 srv spamd[14547]: config: cannot write to //.spamassassin/user_prefs: No such file or directory
Nov  9 07:19:57 srv spamd[14547]: spamd: failed to create readable default_prefs: //.spamassassin/user_prefs
Nov  9 07:19:57 srv spamd[14547]: spamd: checking message <123@123.ru> for nobody:8
Nov  9 07:19:57 srv spamd[14547]: auto-whitelist: open of auto-whitelist file failed: locker: safe_lock: cannot create tmp lockfile /.spamassassin/auto-whitelist.lock.srv.ru.14547 for /.spamassassin/auto-whitelist.lock: No such file or directory
Nov  9 07:19:58 srv spamd[14547]: spamd: clean message (1.5/5.0) for nobody:8 in 0.7 seconds, 828 bytes.
Nov  9 07:19:58 srv spamd[14547]: spamd: result: . 1 - ALL_TRUSTED,TVD_SPACE_RATIO scantime=0.7,size=828,user=nobody,uid=8,required_score=5.0,rhost=localhost,raddr
=127.0.0.1,rport=39172,mid=<123@123.ru>,autolearn=no
Nov  9 07:19:58 srv spamd[14534]: prefork: child states: II

Как можно увидет в логе spamd не может создать файл, также можно увидеть что он его пытается создать от nobody хотя spamd запущен от юзера mail:

Код: Выделить всё

root     14534  0.6  5.0  27996 25868 ?        Ss   07:19   0:02 /usr/sbin/spamd -d -r /var/run/spamd.pid -m 5 -c -H -u mail
mail     14547  0.4  5.1  28800 26320 ?        S    07:19   0:01 spamd child
mail     14548  0.0  4.8  27996 24784 ?        S    07:19   0:00 spamd child


Код: Выделить всё

user=nobody,uid=8

кстати uid=8 это и есть mail

Как победить данную проблему?
Спасибо сказали:
d3rp
Сообщения: 28
ОС: Ubuntu 10.01

Re: проблема с SpamAssassin

Сообщение d3rp »

Нада указать SpamAssassin'у не успользовать пользовательские настройки

Код: Выделить всё

man spamd
...
-x, --nouser-config                Disable user config files
...
-x, --nouser-config, --user-config
Turn off(on) reading of per-user configuration files (user_prefs)
from the user’s home directory.  The default behaviour is to read
per-user configuration from the user’s home directory.

This option does not disable or otherwise influence the SQL, LDAP
or Virtual Config Dir settings.
...

Параметры запуска spamd можно изменить в /etc/default/spamassassin

Код: Выделить всё

sudo cat /etc/default/spamassassin
# /etc/default/spamassassin
# Duncan Findlay

# WARNING: please read README.spamd before using.
# There may be security risks.

# Change to one to enable spamd
ENABLED=1

# 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="--nouser-config --max-children 5"
#OPTIONS="--create-prefs --max-children 5 --helper-home-dir"
#OPTIONS="--nouser-config --max-children 5"

# 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"

# Set nice level of spamd
#NICE="--nicelevel 15"
Адрес jabber конференции форума: linuxforum@conference.jabber.ru
https://twitter.com/d3rp
Спасибо сказали: