我在 OpenBSD 中让 spampd 工作时遇到了一些问题。首先,如果我尝试像/etc/rc.conf.local
这样指定守护进程标志:
spampd_flags="--port=10025 --relayhost=127.0.0.1:10027 --tagall -aw"
服务在启动时不会使用这些标志。我必须重新启动服务,它才会获取这些标志。我发现以下文章提到了 2015 年的同一问题:
http://technoquarter.blogspot.com/2015/02/openbsd-mail-server-part-4-spamassassin.html
作为一种解决方法,我创建了一个/etc/rc.d/spampd_custom
如下所示的脚本:
#!/bin/ksh
daemon="/usr/local/sbin/spampd --port=10025 --relayhost=127.0.0.1:10027 --tagall -aw"
. /etc/rc.d/rc.subr
rc_cmd $1
..我在我的 中spampd_custom
添加了。这确实会使用正确的标志启动服务,但尝试建立 SMTP 连接时服务会失败。我在前台运行它并在输出中看到以下内容:pkg_scripts
/etc/rc.conf/local
# /usr/local/sbin/spampd --port=10025 --relayhost=127.0.0.1:10027 --tagall -aw
Jul 14 04:32:24 lori spampd[40465]: Pid_file "/var/run/spampd.pid" already exists. Overwriting!
Jul 14 04:32:24 lori spampd[4112]: Process Backgrounded
lori# Jul 14 04:32:24 lori spampd[4112]: 2018/07/14-04:32:24 SpamPD (type Net::Server::PreForkSimple) starting! pid(4112)
Jul 14 04:32:24 lori spampd[4112]: Binding to TCP port 10025 on host 127.0.0.1 with IPv4
Jul 14 04:32:24 lori spampd[4112]: Setting gid to "746 746"
Jul 14 04:32:24 lori spampd[4112]: Setting uid to "746"
Jul 14 04:32:39 lori spampd[93147]: WARNING!! Error in process_request eval block: /usr/local/sbin/spampd: socket connect failure: Connection refused
WARNING!! Error in process_request eval block: /usr/local/sbin/spampd: socket connect failure: Connection refused
我对此进行了多次搜索,并在 Debian 跟踪器上找到了一些错误报告,但似乎找不到解决方案。这似乎是父 spampd 用于与其子进程通信的套接字,但似乎设置不正确。
我的配置有什么问题?