Похоже, при маске UMask 002 opendkim сам меняет права на srwxrwxr-x при запуске.
Сейчас права такие:
spoiler
ubuntu@vps:/var/run/opendkim$ ls -la
total 4
drwxr-xr-x 2 opendkim opendkim 80 Mar 25 14:29 .
drwxr-xr-x 27 root root 960 Mar 25 14:35 ..
-rw-r--r-- 1 opendkim opendkim 5 Mar 25 14:29 opendkim.pid
srwxrwxr-x 1 opendkim opendkim 0 Mar 25 14:29 opendkim.sock
Конфиг изменил на такой:
spoiler
# This is a basic configuration that can easily be adapted to suit a standard
# installation. For more advanced options, see opendkim.conf(5) and/or
# /usr/share/doc/opendkim/examples/opendkim.conf.sample.
# Log to syslog
Syslog yes
# Required to use local socket with MTAs that access the socket as a non-
# privileged user (e.g. Postfix)
UMask 002
UserID opendkim:opendkim
# Sign for example.com with key in /etc/dkimkeys/dkim.key using
# selector '2007' (e.g. 2007._domainkey.example.com)
#Domain example.com
#KeyFile /etc/dkimkeys/dkim.key
#Selector 2007
# Commonly-used options; the commented-out versions show the defaults.
#Canonicalization simple
#Mode sv
#SubDomains no
# Always oversign From (sign using actual From and a null From to prevent
# malicious signatures header fields (From and/or others) between the signer
# and the verifier. From is oversigned by default in the Debian pacakge
# because it is often the identity key used by reputation systems and thus
# somewhat security sensitive.
OversignHeaders From
## ResolverConfiguration filename
## default (none)
##
## Specifies a configuration file to be passed to the Unbound library that
## performs DNS queries applying the DNSSEC protocol. See the Unbound
## documentation at http://unbound.net for the expected content of this file.
## The results of using this and the TrustAnchorFile setting at the same
## time are undefined.
## In Debian, /etc/unbound/unbound.conf is shipped as part of the Suggested
## unbound package
# ResolverConfiguration /etc/unbound/unbound.conf
## TrustAnchorFile filename
## default (none)
##
## Specifies a file from which trust anchor data should be read when doing
## DNS queries and applying the DNSSEC protocol. See the Unbound documentation
## at http://unbound.net for the expected format of this file.
TrustAnchorFile /usr/share/dns/root.key
Canonicalization relaxed/relaxed
SyslogSuccess yes
KeyTable file:/etc/opendkim/keytable
SigningTable file:/etc/opendkim/signingtable
X-Header yes
#
postfix и opendkim находятся в группе друг друга:
spoiler
ubuntu@vps:/var/run/opendkim$ groups postfix
postfix : postfix opendkim
ubuntu@vps:/var/run/opendkim$ groups opendkim
opendkim : opendkim postfix
Но получается все так же ошибка
Mar 25 14:30:22 vps postfix/cleanup[5934]: warning: connect to Milter service unix:/var/run/opendkim/opendkim.sock: No such file or directory
Вот еще конфиг postfix, но в нём, кажется, все правильно.
Спасибо за решение, но, честно говоря, никогда не пользовался прототипами и не знаю как правильно их применить. Вынес эту функцию в прототип, но теперь в консоли ошибка, что нету такой функции..
Похоже, при маске UMask 002 opendkim сам меняет права на srwxrwxr-x при запуске.
Сейчас права такие:
Конфиг изменил на такой:
postfix и opendkim находятся в группе друг друга:
Но получается все так же ошибка
Вот еще конфиг postfix, но в нём, кажется, все правильно.