install opendkim

Issues related to applications and software problems and general support
User avatar
young_nandy
Posts: 21
Joined: 2019/09/30 01:28:15

Re: install opendkim

Post by young_nandy » 2019/12/28 12:39:23

KernelOops wrote:
2019/12/28 07:37:10
just a word of warning, opendkim has had a horrible development history, it has been abandoned by its owner and does not receive regular fixes for the reported bugs.

There is a good alternative: dkimpy and dkimpy-milter but there are no CentOS packages, but its an active project with all the needed features, including support for ed25519 signatures.
I have successfully installed dkimpy-milter on centos 8. but after I configure it does not work? There was no error when restarting the service? dkimpy-milter configuration results, the email will always be entered as SPAM?

User avatar
TrevorH
Forum Moderator
Posts: 27382
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: install opendkim

Post by TrevorH » 2019/12/28 12:57:51

I'm not entirely sure why you would download a Fedora SRPM and then explode it to extract its contents to manually rebuild it when the correct thing to do would be to feed that SRPM into mock --rebuild /path/to/opendkim....src.rpm to build CentOS 8 compatible packages in the first place!

I've added correct rebuild instructions to https://bugzilla.redhat.com/show_bug.cgi?id=1754540 - first download and rebuild Fedora 30's opendbx SRPM and add those to your intermediate yum repo used by your mock rebuild and then rebuild the latest opendkim also from Fedora 30's SRPM.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
CentOS 5 has been EOL for nearly 3 years and should no longer be used for anything!
Full time Geek, part time moderator. Use the FAQ Luke

alexsr
Posts: 3
Joined: 2019/12/27 21:36:17

Re: install opendkim

Post by alexsr » 2019/12/28 15:58:14

Hi. I agree. I did this when there was no instructions how to do it. So I did it this way.

alexsr
Posts: 3
Joined: 2019/12/27 21:36:17

Re: install opendkim

Post by alexsr » 2019/12/28 16:27:26

TrevorH wrote:
2019/12/28 12:57:51
I'm not entirely sure why you would download a Fedora SRPM and then explode it to extract its contents to manually rebuild it when the correct thing to do would be to feed that SRPM into mock --rebuild /path/to/opendkim....src.rpm to build CentOS 8 compatible packages in the first place!

I've added correct rebuild instructions to https://bugzilla.redhat.com/show_bug.cgi?id=1754540 - first download and rebuild Fedora 30's opendbx SRPM and add those to your intermediate yum repo used by your mock rebuild and then rebuild the latest opendkim also from Fedora 30's SRPM.
Hi. I agree. I did this when there was no instructions how to do it. So I did it this way.

User avatar
TrevorH
Forum Moderator
Posts: 27382
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: install opendkim

Post by TrevorH » 2019/12/28 16:32:26

That is still the wrong way to do it. Don't build from source, create packages.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
CentOS 5 has been EOL for nearly 3 years and should no longer be used for anything!
Full time Geek, part time moderator. Use the FAQ Luke

User avatar
KernelOops
Posts: 174
Joined: 2013/12/18 15:04:03
Location: xfs file system

Re: install opendkim

Post by KernelOops » 2019/12/28 17:47:29

More details about mock at the mock wiki.
--
I love my computer - all my friends live there.
--

User avatar
young_nandy
Posts: 21
Joined: 2019/09/30 01:28:15

Re: install opendkim

Post by young_nandy » 2020/01/06 08:45:42

alexsr wrote:
2019/12/27 21:45:30
Here are instructions how to compile opendkim on CentOS 8.
I compiled it and using it in production CentOS 8 more than 6 weeks.

dnf config-manager --set-enabled PowerTools
yum install openssl-devel
yum install libbsd-devel
yum install libdb-devel
yum install libmemcached-devel
yum install tre-devel
yum install patch
yum install sendmail-milter-devel

wget "https://dl.fedoraproject.org/pub/epel/7 ... l7.src.rpm"
rpm2cpio opendkim-2.11.0-0.1.el7.src.rpm | cpio -idv
tar zxvf opendkim-2.11.0.Alpha0.tar.gz
cd opendkim-2.11.0
patch -p1 < ../opendkim.ticket35+37.patch

./configure --disable-reprrd --disable-static --disable-silent-rules --disable-live-testing --enable-db_handle_pools --enable-query_cache --with-libmemcached --with-tre --with-openldap --with-openssl --with-sasl --sysconfdir=/etc --prefix=/usr/local --localstatedir=/var

make
make install


groupadd opendkim
useradd -g opendkim -s /sbin/nologin opendkim

cd /var/run
mkdir opendkim

chown opendkim:opendkim /var/run/opendkim
chmod go-rwx /var/run/opendkim

find /etc/opendkim -exec chown opendkim:opendkim {} \;
find /etc/opendkim -exec chmod go-rwx {} \;

create file (content bellow): /lib/systemd/system/opendkim.service

Code: Select all

# If you are using OpenDKIM with SQL datasets it might be necessary to start OpenDKIM after the database servers.
# For example, if using both MariaDB and PostgreSQL, change "After=" in the "[Unit]" section to:
# After=network.target nss-lookup.target syslog.target mariadb.service postgresql.service

[Unit]
Description=DomainKeys Identified Mail (DKIM) Milter
Documentation=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
After=network.target nss-lookup.target syslog.target

[Service]
Type=forking
PIDFile=/var/run/opendkim/opendkim.pid
EnvironmentFile=-/etc/sysconfig/opendkim
ExecStart=/usr/local/sbin/opendkim $OPTIONS
ExecReload=/bin/kill -USR1 $MAINPID
User=opendkim
Group=opendkim

[Install]
WantedBy=multi-user.target

create file (content bellow): /usr/lib/tmpfiles.d/opendkim.conf

Code: Select all

d /run/opendkim   700 opendkim opendkim
systemctl start opendkim
systemctl enable opendkim


Code: Select all

[root@localhost opendkim-2.11.0]# opendkim -V
opendkim: OpenDKIM Filter v2.11.0
	Compiled with OpenSSL 1.1.1 FIPS  11 Sep 2018
	SMFI_VERSION 0x1000001
	libmilter version 1.0.1
	Supported signing algorithms:
		rsa-sha1
		rsa-sha256
	Supported canonicalization algorithms:
		relaxed
		simple
	Active code options:
		QUERY_CACHE
		USE_DB
		USE_LDAP
	libopendkim 2.11.0: query_cache
where is the opendkim.conf file ? I do not see in the /etc folder

What is this code for? I do not understand ( "d /run/opendkim 700 opendkim opendkim" )

User avatar
KernelOops
Posts: 174
Joined: 2013/12/18 15:04:03
Location: xfs file system

Re: install opendkim

Post by KernelOops » 2020/01/06 16:50:39

that line is for systemd-tmpfiles, which handles temporary and volatile files.

It defines the /run/opendkim directory ("d" stands for directory) with permissions 700 and ownership opendkim/opendkim.
--
I love my computer - all my friends live there.
--

User avatar
TrevorH
Forum Moderator
Posts: 27382
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: install opendkim

Post by TrevorH » 2020/01/06 17:17:15

And you'd still be better off rebuilding the Fedora SRPMs as I suggested.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
CentOS 5 has been EOL for nearly 3 years and should no longer be used for anything!
Full time Geek, part time moderator. Use the FAQ Luke

User avatar
young_nandy
Posts: 21
Joined: 2019/09/30 01:28:15

Re: install opendkim

Post by young_nandy » 2020/01/09 03:53:53

young_nandy wrote:
2020/01/06 08:45:42
alexsr wrote:
2019/12/27 21:45:30
Here are instructions how to compile opendkim on CentOS 8.
I compiled it and using it in production CentOS 8 more than 6 weeks.

dnf config-manager --set-enabled PowerTools
yum install openssl-devel
yum install libbsd-devel
yum install libdb-devel
yum install libmemcached-devel
yum install tre-devel
yum install patch
yum install sendmail-milter-devel

wget "https://dl.fedoraproject.org/pub/epel/7 ... l7.src.rpm"
rpm2cpio opendkim-2.11.0-0.1.el7.src.rpm | cpio -idv
tar zxvf opendkim-2.11.0.Alpha0.tar.gz
cd opendkim-2.11.0
patch -p1 < ../opendkim.ticket35+37.patch

./configure --disable-reprrd --disable-static --disable-silent-rules --disable-live-testing --enable-db_handle_pools --enable-query_cache --with-libmemcached --with-tre --with-openldap --with-openssl --with-sasl --sysconfdir=/etc --prefix=/usr/local --localstatedir=/var

make
make install


groupadd opendkim
useradd -g opendkim -s /sbin/nologin opendkim

cd /var/run
mkdir opendkim

chown opendkim:opendkim /var/run/opendkim
chmod go-rwx /var/run/opendkim

find /etc/opendkim -exec chown opendkim:opendkim {} \;
find /etc/opendkim -exec chmod go-rwx {} \;

create file (content bellow): /lib/systemd/system/opendkim.service

Code: Select all

# If you are using OpenDKIM with SQL datasets it might be necessary to start OpenDKIM after the database servers.
# For example, if using both MariaDB and PostgreSQL, change "After=" in the "[Unit]" section to:
# After=network.target nss-lookup.target syslog.target mariadb.service postgresql.service

[Unit]
Description=DomainKeys Identified Mail (DKIM) Milter
Documentation=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
After=network.target nss-lookup.target syslog.target

[Service]
Type=forking
PIDFile=/var/run/opendkim/opendkim.pid
EnvironmentFile=-/etc/sysconfig/opendkim
ExecStart=/usr/local/sbin/opendkim $OPTIONS
ExecReload=/bin/kill -USR1 $MAINPID
User=opendkim
Group=opendkim

[Install]
WantedBy=multi-user.target

create file (content bellow): /usr/lib/tmpfiles.d/opendkim.conf

Code: Select all

d /run/opendkim   700 opendkim opendkim
systemctl start opendkim
systemctl enable opendkim


Code: Select all

[root@localhost opendkim-2.11.0]# opendkim -V
opendkim: OpenDKIM Filter v2.11.0
	Compiled with OpenSSL 1.1.1 FIPS  11 Sep 2018
	SMFI_VERSION 0x1000001
	libmilter version 1.0.1
	Supported signing algorithms:
		rsa-sha1
		rsa-sha256
	Supported canonicalization algorithms:
		relaxed
		simple
	Active code options:
		QUERY_CACHE
		USE_DB
		USE_LDAP
	libopendkim 2.11.0: query_cache
where is the opendkim.conf file ? I do not see in the /etc folder

What is this code for? I do not understand ( "d /run/opendkim 700 opendkim opendkim" )

I have installed Opendkim according to the guidelines above, but the service does not work with an error "Opendkim milter Socket must be specified". does anyone know the solution? if possible, how is the configuration?

Post Reply

Return to “CentOS 8 - General Support”