Hello everyone, tell me where I went wrong…
I want to make Opendkim in docker
Here is the docker file:
FROM ubuntu
RUN apt-get update -y && apt-get install -y \
opendkim \
opendkim-tools \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /etc/opendkim/conf \
&& mkdir -p /etc/opendkim/original
# Копируем файлы конфигурации
COPY ./docker-entrypoint.sh /usr/local/bin
COPY ./opendkim.conf /etc/opendkim/original/opendkim.conf
COPY ./TrustedHosts /etc/opendkim/original/
COPY ./SigningTable /etc/opendkim/original/
COPY ./KeyTable /etc/opendkim/original/
#WORKDIR /etc/opendkim
ENV TZ {$TZ:-UTC}
RUN chmod a+x /usr/local/bin/docker-entrypoint.sh
RUN mkdir -p /etc/opendkim/keys
EXPOSE 8891/tcp
#USER opendkim
ENTRYPOINT [ "/usr/local/bin/docker-entrypoint.sh"]
Settings
cat KeyTable
relay._domainkey.example.com example.com:relay:/etc/opendkim/keys/example.com/relay.private
cat SigningTable
*.example.com relay._domainkey.example.com
cat TrustedHosts:
127.0.0.1
localhost
*.example.com
#(ip postfix)
192.168.100.103
cat opendkim.conf
AutoRestart Yes
AutoRestartRate 10/1h
Umask 002
Syslog yes
SyslogSuccess Yes
LogWhy Yes
Canonicalization relaxed/simple
ExternalIgnoreList refile:/etc/opendkim/conf/TrustedHosts
InternalHosts refile:/etc/opendkim/conf/TrustedHosts
KeyTable refile:/etc/opendkim/conf/KeyTable
SigningTable refile:/etc/opendkim/conf/SigningTable
Mode sv
PidFile /var/run/opendkim/opendkim.pid
SignatureAlgorithm rsa-sha256
UserID opendkim:opendkim
Socket inet:8891@172.16.150.2
./docker-entrypoint.sh
#!/bin/bash
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime
echo $TZ > /etc/timezone
cp -rn /etc/opendkim/original/opendkim.conf /etc/opendkim/opendkim.conf
cp -rn /etc/opendkim/original/TrustedHosts /etc/opendkim/conf/TrustedHosts
cp -rn /etc/opendkim/original/SigningTable /etc/opendkim/conf/SigningTable
cp -rn /etc/opendkim/original/KeyTable /etc/opendkim/conf/KeyTable
/usr/sbin/opendkim -f -x /etc/opendkim/opendkim.conf -u opendkim -P /var/run/opendkim/opendkim.pid -D
settings in main.cf which relate to Opendkim:
#172.16.150.2 ip opendkim
#OpenDKIM
milter_protocol = 2
milter_default_action = accept
smtpd_milters = inet:172.16.150.2:8891
non_smtpd_milters = inet:172.16.150.2:8891
I get the following error in the Postfix logs:
milter-reject: END-OF-MESSAGE from unknown[172.16.110.7]: 4.7.1 Service unavailable - try again later;
telnet 172.16.150.2 8891
Trying 172.16.150.2...
Connected to 172.16.150.2.
Escape character is '^]'.
I really hope for your help