Topic: *SOLVED* AMAVIS - ERROR reading new DKIM keys
======== Required information ====
- iRedMail version 0.9.7
- Linux/BSD distribution name and version: Ubuntu 16.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? no
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
Following tutorial to create a new dkim key for a second domain in amavis: https://docs.iredmail.org/sign.dkim.sig … il-domains
Trying to add new DKIM domain in amavis.conf file according to manual. Key is generated, I can read it out with cat, changed user and group to amavis:amavis, set rights 0400
amavisd-new genrsa /var/lib/dkim/steyregg.com.pem 1024
chown amavis:amavis /var/lib/dkim/steyregg.com.pem
chmod 0400 /var/lib/dkim/steyregg.com.pem
Restarting amavis. Running
amavisd-new showkeys
Error given: Error in config file "/etc/amavis/conf.d/50-user": Can't open PEM file var/lib/dkim/steyregg.com.pem: No such file or directory at /usr/sbin/amavisd-new line 636.
I have played around a lot with setting directory rights below to amavis, chmod others to +rx, nothing helps.
However the first dkim key - the one generated automatically during iredmail installation - works perfectly. Only the second one can't be read/whatever by amavis.
cat /var/log/mail.log | grep amavis
This is Amavis with just the original DKIM key
Feb 19 22:10:22 server amavis[2065]: starting. /usr/sbin/amavisd-new at server.radhuber.eu amavisd-new-2.10.1 (20141025), Unicode aware, LC_ALL="C"
Feb 19 22:10:22 server amavis[2072]: Net::Server: Group Not Defined. Defaulting to EGID '137 137'
Feb 19 22:10:22 server amavis[2072]: Net::Server: User Not Defined. Defaulting to EUID '130'
Feb 19 22:10:22 server amavis[2072]: Module Amavis::Conf 2.404
Feb 19 22:10:22 server amavis[2072]: Module Archive::Zip 1.56
Feb 19 22:10:22 server amavis[2072]: Module BerkeleyDB 0.55
Feb 19 22:10:22 server amavis[2072]: Module Compress::Raw::Zlib 2.068
Feb 19 22:10:22 server amavis[2072]: Module Compress::Zlib 2.068
Feb 19 22:10:22 server amavis[2072]: Module Crypt::OpenSSL::RSA 0.28
Feb 19 22:10:22 server amavis[2072]: Module DBD::mysql 4.033
Feb 19 22:10:22 server amavis[2072]: Module DBI 1.634
Feb 19 22:10:22 server amavis[2072]: Module DB_File 1.835
Feb 19 22:10:22 server amavis[2072]: Module Digest::MD5 2.54
Feb 19 22:10:22 server amavis[2072]: Module Digest::SHA 5.95
Feb 19 22:10:22 server amavis[2072]: Module Encode 2.72
Feb 19 22:10:22 server amavis[2072]: Module File::Temp 0.2304
Feb 19 22:10:22 server amavis[2072]: Module IO::Socket::INET6 2.72
Feb 19 22:10:22 server amavis[2072]: Module IO::Socket::IP 0.37
Feb 19 22:10:22 server amavis[2072]: Module MIME::Entity 5.507
Feb 19 22:10:22 server amavis[2072]: Module MIME::Parser 5.507
Feb 19 22:10:22 server amavis[2072]: Module MIME::Tools 5.507
Feb 19 22:10:22 server amavis[2072]: Module Mail::DKIM::Signer 0.4
Feb 19 22:10:22 server amavis[2072]: Module Mail::DKIM::Verifier 0.4
Feb 19 22:10:22 server amavis[2072]: Module Mail::Header 2.13
Feb 19 22:10:22 server amavis[2072]: Module Mail::Internet 2.13
Feb 19 22:10:22 server amavis[2072]: Module Mail::SPF v2.009
Feb 19 22:10:22 server amavis[2072]: Module Mail::SpamAssassin 3.004001
Feb 19 22:10:22 server amavis[2072]: Module Net::DNS 0.81
Feb 19 22:10:22 server amavis[2072]: Module Net::LibIDN 0.12
Feb 19 22:10:22 server amavis[2072]: Module Net::Server 2.008
Feb 19 22:10:22 server amavis[2072]: Module NetAddr::IP 4.078
Feb 19 22:10:22 server amavis[2072]: Module Scalar::Util 1.41
Feb 19 22:10:22 server amavis[2072]: Module Socket 2.018
Feb 19 22:10:22 server amavis[2072]: Module Socket6 0.25
Feb 19 22:10:22 server amavis[2072]: Module Time::HiRes 1.9726
Feb 19 22:10:22 server amavis[2072]: Module URI 1.71
Feb 19 22:10:22 server amavis[2072]: Module Unix::Syslog 1.1
Feb 19 22:10:22 server amavis[2072]: Amavis::ZMQ code NOT loaded
Feb 19 22:10:22 server amavis[2072]: Amavis::DB code loaded
Feb 19 22:10:22 server amavis[2072]: SQL base code loaded
Feb 19 22:10:22 server amavis[2072]: SQL::Log code loaded
Feb 19 22:10:22 server amavis[2072]: SQL::Quarantine loaded
Feb 19 22:10:22 server amavis[2072]: Lookup::SQL code loaded
Feb 19 22:10:22 server amavis[2072]: Lookup::LDAP code NOT loaded
Feb 19 22:10:22 server amavis[2072]: AM.PDP-in proto code loaded
Feb 19 22:10:22 server amavis[2072]: SMTP-in proto code loaded
Feb 19 22:10:22 server amavis[2072]: Courier proto code NOT loaded
Feb 19 22:10:22 server amavis[2072]: SMTP-out proto code loaded
Feb 19 22:10:22 server amavis[2072]: Pipe-out proto code NOT loaded
Feb 19 22:10:22 server amavis[2072]: BSMTP-out proto code NOT loaded
Feb 19 22:10:22 server amavis[2072]: Local-out proto code NOT loaded
Feb 19 22:10:22 server amavis[2072]: OS_Fingerprint code NOT loaded
Feb 19 22:10:22 server amavis[2072]: ANTI-VIRUS code loaded
Feb 19 22:10:22 server amavis[2072]: ANTI-SPAM code loaded
Feb 19 22:10:22 server amavis[2072]: ANTI-SPAM-EXT code NOT loaded
Feb 19 22:10:22 server amavis[2072]: ANTI-SPAM-C code NOT loaded
Feb 19 22:10:22 server amavis[2072]: ANTI-SPAM-SA code loaded
Feb 19 22:10:22 server amavis[2072]: Unpackers code loaded
Feb 19 22:10:22 server amavis[2072]: DKIM code loaded
Feb 19 22:10:22 server amavis[2072]: Tools code NOT loaded
Feb 19 22:10:22 server amavis[2072]: Found $file at /usr/bin/file
Feb 19 22:10:22 server amavis[2072]: Found $altermime at /usr/bin/altermime
Feb 19 22:10:22 server amavis[2072]: Internal decoder for .mail
Feb 19 22:10:22 server amavis[2072]: Found decoder for .Z at /bin/uncompress
Feb 19 22:10:22 server amavis[2072]: Found decoder for .gz at /bin/gzip -d
Feb 19 22:10:22 server amavis[2072]: Found decoder for .bz2 at /bin/bzip2 -d
Feb 19 22:10:22 server amavis[2072]: Found decoder for .xz at /usr/bin/xz -dc
Feb 19 22:10:22 server amavis[2072]: Found decoder for .lzma at /usr/bin/xz -dc --format=lzma
Feb 19 22:10:22 server amavis[2072]: Found decoder for .lrz at /usr/bin/lrzip -q -k -d -o -
Feb 19 22:10:22 server amavis[2072]: Found decoder for .lzo at /usr/bin/lzop -d
Feb 19 22:10:22 server amavis[2072]: Found decoder for .lz4 at /usr/bin/lz4c -d
Feb 19 22:10:22 server amavis[2072]: Found decoder for .rpm at /usr/bin/rpm2cpio
Feb 19 22:10:22 server amavis[2072]: Found decoder for .cpio at /bin/pax
Feb 19 22:10:22 server amavis[2072]: Found decoder for .tar at /bin/pax
Feb 19 22:10:22 server amavis[2072]: Found decoder for .deb at /usr/bin/ar
Feb 19 22:10:22 server amavis[2072]: Found decoder for .rar at /usr/bin/unrar-free
Feb 19 22:10:22 server amavis[2072]: Found decoder for .arj at /usr/bin/arj
Feb 19 22:10:22 server amavis[2072]: Found decoder for .arc at /usr/bin/nomarch
Feb 19 22:10:22 server amavis[2072]: Found decoder for .zoo at /usr/bin/zoo
Feb 19 22:10:22 server amavis[2072]: Found decoder for .doc at /usr/bin/ripole
Feb 19 22:10:22 server amavis[2072]: Found decoder for .cab at /usr/bin/cabextract
Feb 19 22:10:22 server amavis[2072]: Internal decoder for .tnef
Feb 19 22:10:22 server amavis[2072]: Found decoder for .zip at /usr/bin/7za
Feb 19 22:10:22 server amavis[2072]: Found decoder for .kmz at /usr/bin/7za
Feb 19 22:10:22 server amavis[2072]: Found decoder for .7z at /usr/bin/7za
Feb 19 22:10:22 server amavis[2072]: Found decoder for .jar at /usr/bin/7z
Feb 19 22:10:22 server amavis[2072]: Found decoder for .swf at /usr/bin/7z
Feb 19 22:10:22 server amavis[2072]: Found decoder for .lha at /usr/bin/7z
Feb 19 22:10:22 server amavis[2072]: Found decoder for .iso at /usr/bin/7z
Feb 19 22:10:22 server amavis[2072]: Found decoder for .exe at /usr/bin/unrar-free; /usr/bin/arj
Feb 19 22:10:22 server amavis[2072]: No decoder for .F
Feb 19 22:10:22 server amavis[2072]: Using primary internal av scanner code for ClamAV-clamd
Feb 19 22:10:22 server amavis[2072]: Found secondary av scanner ClamAV-clamscan at /usr/bin/clamscan
Feb 19 22:10:22 server amavis[2072]: Deleting db files __db.003,snmp.db,__db.001,__db.002,nanny.db in /var/lib/amavis/db
Feb 19 22:10:22 server amavis[2072]: Creating db in /var/lib/amavis/db/; BerkeleyDB 0.55, libdb 5.3
This is amavis with 2 dkim keys
Feb 19 21:43:50 server amavis[1338]: starting. /usr/sbin/amavisd-new at server.radhuber.eu amavisd-new-2.10.1 (20141025), Unicode aware, LC_ALL="C"
Feb 19 21:43:50 server amavis[1345]: (!)Net::Server: 2018/02/19-21:43:50 Can't connect to UNIX socket at file /var/lib/amavis/amavisd.sock [Permission denied]\n at line 68 in file /usr/share/perl5/Net/Server/Proto/UNIX.pm
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.