How can I solve spamassassin DKIM timeout request? - mail-server

I have a mail server runs CentOS 7 with Exim + Dovecot + Spamassassin v3.4.0, and VestaCP.
Everything works fine except too long spamassassin check. It takes 10-11 seconds.
At the spamassassin debug log I see that the problem with DNS query for DKIM record (1st log line) and it terminates with 10 seconds timeout (3rd log line). And it fails DKIM test.
Sun Jul 14 14:47:12 2019 [94687] dbg: dkim: performing public key lookup and signature verification
Sun Jul 14 14:47:22 2019 [94687] dbg: dkim: DKIM, i=#yandex.ru, d=yandex.ru, s=mail, a=rsa-sha256, c=relaxed/relaxed, invalid, matches author domain
Sun Jul 14 14:47:22 2019 [94687] dbg: dkim: signature verification result: INVALID (PUBLIC KEY: DNS QUERY TIMEOUT FOR MAIL._DOMAINKEY.YANDEX.RU)
Sun Jul 14 14:47:22 2019 [94687] dbg: dkim: adsp: performing lookup on _adsp._domainkey.yandex.ru
Sun Jul 14 14:47:22 2019 [94687] dbg: dkim: adsp result: U/unknown (dns: unknown), author domain 'yandex.ru'
Sun Jul 14 14:47:22 2019 [94687] dbg: spf: checking to see if the message has a Received-SPF header that we can use
Sun Jul 14 14:47:22 2019 [94687] dbg: spf: checking HELO (helo=forward400j.mail.yandex.net, ip=5.45.198.245)
Sun Jul 14 14:47:22 2019 [94687] dbg: dns: bgsend, DNS servers: [8.8.8.8]:53, [8.8.4.4]:53
Sun Jul 14 14:47:22 2019 [94687] dbg: dns: attempt 1/2, trying connect/sendto to [8.8.8.8]:53
Sun Jul 14 14:47:22 2019 [94687] dbg: dns: providing a callback for id: 49973/IN/SPF/forward400j.mail.yandex.net
Sun Jul 14 14:47:22 2019 [94687] dbg: dns: dns reply 690 is OK, 4 answer records
Sun Jul 14 14:47:22 2019 [94687] dbg: async: calling callback on key dns:A:yandex.ru
Sun Jul 14 14:47:22 2019 [94687] dbg: dns: hit <dns:yandex.ru> 5.255.255.5
Sun Jul 14 14:47:22 2019 [94687] dbg: dns: hit <dns:yandex.ru> 77.88.55.50
Sun Jul 14 14:47:22 2019 [94687] dbg: dns: hit <dns:yandex.ru> 77.88.55.88
Sun Jul 14 14:47:22 2019 [94687] dbg: dns: hit <dns:yandex.ru> 5.255.255.88
If I run special check with spamassassin -t -D dkim at the same email then eveything works fast and DKIM passing test.
# spamassassin -t -D dkim < /home/admin/mail/domain/user/cur/messageId
Jul 14 20:46:49.922 [24398] dbg: dkim: using Mail::DKIM version 0.39
Jul 14 20:46:49.923 [24398] dbg: dkim: performing public key lookup and signature verification
Jul 14 20:46:49.962 [24398] dbg: dkim: DKIM, i=#yandex.ru, d=yandex.ru, s=mail, a=rsa-sha256, c=relaxed/relaxed, pass, matches author domain
Jul 14 20:46:49.962 [24398] dbg: dkim: signature verification result: PASS
How can I solve this problem?

Solved it with install local DNS resolver instead of using Google DNS.

Related

Why is EmailHeaders analyzer showing blank "from" information while there is one in the X-Received of email header

I am trying to understand the email header and I found out using email header checker (i.g. mxtoolbox) can easily get the information. But I wonder how does this work?
For example, I have a email header showing like this:
Received: from DM5PR04MB0251.namprd04.prod.outlook.com (::1) by
DM6PR04MB6592.namprd04.prod.outlook.com with HTTPS; Tue, 13 Sep 2022 00:17:52
+0000
Received: from DB6PR1001CA0016.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:4:b7::26)
by DM5PR04MB0251.namprd04.prod.outlook.com (2603:10b6:3:74::12) with
Microsoft SMTP Server (version=TLS1_2,
cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Tue, 13 Sep
2022 00:17:51 +0000
Received: from DB8EUR06FT019.eop-eur06.prod.protection.outlook.com
(2603:10a6:4:b7:cafe::4b) by DB6PR1001CA0016.outlook.office365.com
(2603:10a6:4:b7::26) with Microsoft SMTP Server (version=TLS1_2,
cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.14 via Frontend
Transport; Tue, 13 Sep 2022 00:17:51 +0000
...
...
And it shows blank in the from information.
Do you know why is this?

Installation of CDK fails when running the CDS-installer

As I want to get a bit of exposure to OpenShift, I decided to install the CDK on my machine. According to the documentation I started the installation. Everything is fine, but the CDK download/install fails.
Here are the lines from the log file:
Wed, 26 Jul 2017 07:52:20 GMT-ERROR: cdk failed to download: SHA256 checksum
verification failed
Wed, 26 Jul 2017 07:52:26 GMT-INFO: Restarting download
Wed, 26 Jul 2017 07:52:28 GMT-Configured
file='C:\Users\ALEXAN~1.MEN\AppData\Local\Temp\minishift_3_0_0_GA.exe'
sha256='4f51b5b6bc8fc93bda5d25f5f58f213a8165b6c0e0f2b77dbb53ae6da4966068'
Wed, 26 Jul 2017 07:52:28 GMT-ERROR: cdk failed to download: SHA256 checksum
verification failed
Wed, 26 Jul 2017 07:52:34 GMT-INFO: Restarting download
Wed, 26 Jul 2017 07:52:36 GMT-Configured
file='C:\Users\ALEXAN~1.MEN\AppData\Local\Temp\minishift_3_0_0_GA.exe'
sha256='4f51b5b6bc8fc93bda5d25f5f58f213a8165b6c0e0f2b77dbb53ae6da4966068'
Wed, 26 Jul 2017 07:52:36 GMT-ERROR: cdk failed to download: SHA256 checksum
verification failed
Wed, 26 Jul 2017 07:52:38 GMT-INFO: Restarting download
So I am grateful for any ideas what I am doing wrong.
Alternatively, how I can install the CDK manually.
I am running on a Win 10 machine with 16 GB memory, have Oracle JDK 1.8 installed and put the install below "Documents" as an installation in the C root will not work (IT sec restrictions)
It works now. maybe there was something wrong yesterday.

Centos Postfix mail not received in gmail

Simple usecase but doesn't work.
I have a web application and want to configure a SMTP server to send emails from application.
Installed mailx as per link - http://tecadmin.net/bash-mail-command-not-found/
All good.
Test Sending email as: echo "This is a test email body " | mail -s "This is a test email " dk#xxx.com
Now I get the following in logs :
root#/var/log $ tail -f /var/log/maillog
Jul 19 16:47:57 bridgeapps-dev01 postfix/postfix-script[23104]: stopping the Postfix mail system
Jul 19 16:47:57 bridgeapps-dev01 postfix/master[1466]: terminating on signal 15
Jul 19 16:47:57 bridgeapps-dev01 postfix/postfix-script[23184]: starting the Postfix mail system
Jul 19 16:47:57 bridgeapps-dev01 postfix/master[23186]: daemon started -- version 2.10.1, configuration /etc/postfix
Jul 19 16:48:12 bridgeapps-dev01 postfix/pickup[23187]: 4163841204: uid=0 from=<root>
Jul 19 16:48:12 bridgeapps-dev01 postfix/cleanup[23194]: 4163841204: message-id=<20160719154812.4163841204#bridgeapps-dev01.localdomain>
Jul 19 16:48:12 bridgeapps-dev01 postfix/qmgr[23188]: 4163841204: from=<root#bridgeapps-dev01.localdomain>, size=582, nrcpt=1 (queue active)
Jul 19 16:48:12 bridgeapps-dev01 postfix/smtp[23196]: connect to ASPMX.L.GOOGLE.com[2a00:1450:400c:c09::1b]:25: Network is unreachable
Jul 19 16:48:12 bridgeapps-dev01 postfix/smtp[23196]: 4163841204: to=<dk#xxx.com>, relay=ASPMX.L.GOOGLE.com[64.233.166.26]:25, delay=0.47, delays=0.02/0.01/0.24/0.2, dsn=2.0.0, status=sent (250 2.0.0 OK 1468943292 l4si11397516wmf.56 - gsmtp)
Jul 19 16:48:12 bridgeapps-dev01 postfix/qmgr[23188]: 4163841204: removed
All green, no errors, just as things seem to be too good to be true, I never receive this email in gmail.
What am I missing ?
Thank you,
First off, you can't send an email from localhost. You need a mail relay. Since you're already using gmail I would recommend this:
https://www.howtoforge.com/tutorial/configure-postfix-to-use-gmail-as-a-mail-relay/

getting lots of spam from "unknown" and helo localhost

On our server, we keep receiving spam with the following headers. We are using whm 11.44 and exim.
Return path is always:
Return-path: <>
and it says Received: from unknown (HELO localhost)
Both which raise flags. We're just not sure exactly how to stop/reject them.
From - Mon Feb 16 14:27:02 2015
X-Account-Key: account3
X-UIDL: UID10475-1296887657
X-Mozilla-Status: 0001
X-Mozilla-Status2: 00000000
X-Mozilla-Keys:
Return-path: <>
Envelope-to: me#myserver.com
Delivery-date: Mon, 16 Feb 2015 09:13:38 -0600
Received: from [122.160.73.62] (port=10732 helo=122.160.73.62)
by myserver.myserver.com with smtp (Exim 4.82)
id 1YNN0Z-00056c-7P
for me#myserver.com; Mon, 16 Feb 2015 08:50:47 -0600
Received: from unknown (HELO localhost) (intlimd#highgrove.net#214.92.72.48)
by 122.160.73.62 with ESMTPA; Mon, 16 Feb 2015 20:23:11 +0530
From: intlimd#highgrove.net
To: myemail#myserver.com
Subject: Do not disapoint your girl this night
http://mandatory.natur.com/ Real magic in your life
Can you please check the full logs of your this mail with the following command and let me know so that we can assist you.
cat /var/log/exim_mainlog | grep 1YNN0Z-00056c-7P

JavaMail message getReceivedDate() and getSentDate()

I'm using JavaMail 1.4.7, and a specific message in my mail account contains the header:
Received: from ... (localhost.localdomain [127.0.0.1])
by ... (lmtpd) with LMTP id 25811.002;
Tue, 12 Nov 2013 16:52:11 +0100 (CET)
Subject: CONSEGNA: numerodacontare
Date: Tue, 12 Nov 2013 16:52:11 +0100
And for this message
getReceivedDate() =Tue Nov 12 16:52:10 CET 2013
getSentDate() =Tue Nov 12 16:52:11 CET 2013
So it seems that the message has been received before sending it.
How should this be interpreted?
What is exactly the difference?
Is this behavior common for all mail server?