我在让 spampd 在 OpenBSD 中工作时遇到了一些麻烦。首先,如果我尝试/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
到pkg_scripts
我的/etc/rc.conf/local
. 这确实会使用正确的标志启动服务,但在尝试建立 SMTP 连接时服务会失败。我在前台运行它并在输出中看到:
# /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 用来与似乎没有正确设置的子级通信的套接字。
我的配置有什么问题?
这最终成为一个错误,我在. spampd 维护者创建了一个问题,OpenBSD 团队将更改后的内容拉到了下游。这应该在较新版本的 OpenBSD/spampd 中得到修复。