我正在尝试在Debian Stretch上设置opendkim,但无法更改套接字。我想将套接字更改为,/var/spool/postfix/opendkim/opendkim.sock
以便可以与后缀一起使用。
我加Socket local:/var/spool/postfix/opendkim/opendkim.sock
了/etc/opendkim.conf
并尝试添加SOCKET="local:/var/spool/postfix/opendkim/opendkim.sock
到/etc/default/opendkim
(我不得不创建)。
无论我进行了什么更改或重新启动opendkim的频率如何,它始终/var/run/opendkim/opendkim.sock
用作其套接字。
➜ ~ netstat -a | fgrep LISTEN | grep open
unix 2 [ ACC ] STREAM LISTENING 5534128 /var/run/opendkim/opendkim.sock
➜ ~ sudo systemctl status opendkim.service
● opendkim.service - OpenDKIM DomainKeys Identified Mail (DKIM) Milter
Loaded: loaded (/lib/systemd/system/opendkim.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2017-04-30 12:41:54 CEST; 5min ago
Docs: man:opendkim(8)
man:opendkim.conf(5)
man:opendkim-genkey(8)
man:opendkim-genzone(8)
man:opendkim-testadsp(8)
man:opendkim-testkey
http://www.opendkim.org/docs.html
Process: 25246 ExecStart=/usr/sbin/opendkim -P /var/run/opendkim/opendkim.pid -p local:/var/run/opendkim/opendkim.sock (code=exited, status=0/SUCCESS)
Main PID: 25248 (opendkim)
Tasks: 7 (limit: 4915)
CGroup: /system.slice/opendkim.service
├─25248 /usr/sbin/opendkim -P /var/run/opendkim/opendkim.pid -p local:/var/run/opendkim/opendkim.sock
└─25249 /usr/sbin/opendkim -P /var/run/opendkim/opendkim.pid -p local:/var/run/opendkim/opendkim.sock
Apr 30 12:41:54 vServer systemd[1]: Starting OpenDKIM DomainKeys Identified Mail (DKIM) Milter...
Apr 30 12:41:54 vServer systemd[1]: Started OpenDKIM DomainKeys Identified Mail (DKIM) Milter.
Apr 30 12:41:54 vServer opendkim[25249]: OpenDKIM Filter v2.11.0 starting (args: -P /var/run/opendkim/opendkim.pid -p local:/var/run/opendkim/opendkim.sock)
我究竟做错了什么?(我想这是我的错误,因为我找不到其他人遇到同样的问题)
更新:
更改/etc/default/opendkim
为SOCKET="inet:8891@localhost"
和更改postfix配置以使用此套接字会导致inet:localhost:8891: Connection refused
UPDATE2:
我现在已替换为debian Stretch软件包中捆绑的文件:
# Command-line options specified here will override the contents of
# /etc/opendkim.conf. See opendkim(8) for a complete list of options.
#DAEMON_OPTS=""
# Change to /var/spool/postfix/var/run/opendkim to use a Unix socket with
# postfix in a chroot:
RUNDIR=/var/spool/postfix/var/run/opendkim
#RUNDIR=/var/run/opendkim
#
# Uncomment to specify an alternate socket
# Note that setting this will override any Socket value in opendkim.conf
# default:
SOCKET=local:$RUNDIR/opendkim.sock
# listen on all interfaces on port 54321:
#SOCKET=inet:54321
# listen on loopback on port 12345:
#SOCKET=inet:12345@localhost
# listen on 192.0.2.1 on port 12345:
#SOCKET=inet:12345@192.0.2.1
USER=opendkim
GROUP=opendkim
PIDFILE=$RUNDIR/$NAME.pid
EXTRAAFTER=
其中包括确定套接字的以下行:
if [ -f /etc/opendkim.conf ]; then
CONFIG_SOCKET=`awk '$1 == "Socket" { print $2 }' /etc/opendkim.conf`
fi
# This can be set via Socket option in config file, so it's not required
if [ -n "$SOCKET" -a -z "$CONFIG_SOCKET" ]; then
DAEMON_OPTS="-p $SOCKET $DAEMON_OPTS"
fi
connect to Milter service local:/var/run/opendkim/opendkim.sock: No such file or directory
甚至认为它存在,因为它被更改为/var/spool/postfix/
/var/spool/postfix/var/run...
,如果它是