I'm sending letter from my smtp server, and just got this error: Our system has detected that this message is not RFC 5322 compliant 'From' header is missing.
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mydomain.co.uk;
h=message-id: date: subject: to: from; q=dns/txt; s=s1; t=1663344475;
bh=o123asdgasdfOykBs3BVlhPdLaDUIHXwpyE=;
b=Fp4Za0xB3xT6Wvd7KZJxA9jHTt4vPpeJspD5fh69qDQ9TEVaKm8xZ1oEn/ajONsZsKqEigavy
pTX0CG2i6OaasdfasdfasdfashadsfcxvrerFveuluFdwbq00K+MkFkYWK0JShyem6zyG8nYACs
D0BpHjayOeenq4aetLik6YrPdvnZBdbX2UN6YmLUmO51SZDfEyQhoJaD+StHWbV+arwaulujde5
5+J3U4n/CIBruotbXNdzIOYOfiRO836oslg22I1ADCSQ==
FROM: <cribe@mydomain.co.uk>
TO: <6kFyiXDGCTIb8U@dkimvalidator.com>
SUBJECT: Hello boy
Date: Fri, 16 Sep 2022 18:07:54 +0200
Message-ID: <7JYYPY8I.109XUYB3NIWOZ@mydomain.co.uk>
Lol message from mydomain)
So today i was testing my server, and i succefully passed DKIMvalidator.com and mail-tester showed me 8.2 of 10. The last thing i did was a DKIM configuration. After added i spent about a day to solve the problem with WSP adn LWSP ( Linear Whitespace ). When i was trying to send my letter i just got error, because i didn't add this whitespaces correct.
For now, i use the next rules:
DKIM-Signature Header goes the first, and i the end of it (it ends with ==) i have \r\n (CRLF)
After DKIM-Signature i add whitespace and CRLF, like this: (' \r\n')
Then we go write from, to, subject, date etc. and every has just CRLF (\r\n)
After we have a text. And this field is written like this (CRLF + text + CRLF).
I don't know what the problem with my structure, but my guess is the h= line in the DKIM has a whitespaces between every header(check this out above).It seems that the handler sees the FROM: entry in the h= field and considers it empty. But I realized that DKIM is separated with a space and CRLF, which means that the mail handler does not read these values in the h= field
Edit: I was thinking that my problem is in SPF record, so i've changed it to: v=spf1 ip4:my.ip ~all and still have this problem. Now i'm sure that something wrong with my syntax.
Edit: I have added Mime-version and Content-Type, and removed space between DKIM and Mime.
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=mydomain.com;
h=message-id: date: subject: to: from; q=dns/txt; s=s1;
t=1663509753;
bh=Ci13G0GQSNZwhrDrBS4DS3MJrtCExdB7y0mvbalBwDE=;
...==
MIME-Version: 1.0
From: "name" <mydomain.com>
To: <mevbA6EhZyEA3v@dkimvalidator.com>
Subject: test
Date: Sun, 18 Sep 2022 16:02:33 +0200
Message-ID: <A3ULJM21.3VENGDSCFH9NH@mydomain.com>
Content-Type: text/plain; charset="UTF-8"
Lorem ipsum is the one of the ususal syntax
Edit: Here is a JSON.stringify version of email:
"DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mydomain.com;\r\n h=message-id: date: subject: to: from; q=dns/txt; s=s1; t=1663516571;\r\n bh=duJ3EJw9EhtaTs4jR/BvF/8wkyhQhIqY5B55LWEDhbQ=;\r\n b=YDGmU0lua05iUZs6HNYOSHooO412yk5wfg0EM3d0RALH8lOZHoysdfRXI0/QSrMAQOZxiRvuA\r\n bJNxI4+nde9mOU+Ikk2MNOJf8TK925pwhgt9xFuNwRa3lTyVEl34CEsEF4b06AZKBbIX7vnvJVg\r\n LWYpLXHIMI+QYVrp+FSdmhumJ/1HdQF5rIhQXTdg3t7szr0h5v5dnrGHke/WdUVosuEpJrc4XRN\r\n hwUwwPMKvl81Otfx9YuOXMqvTV4kku4ZB0n+wacvt+ryb1tYDr6iwbkQdqz3SKa+sB73tzKSS3O\r\n Sh+iwz86p8XW3FiqTAuT+VhIefl8ZPIToOyn48zUxf9w==\r\n"
"MIME-Version: 1.0\r\n"
"From: \"Full Name\" <my@domain.com>\r\n"
"To: <test@domain.uk>\r\n"
"Subject: Test string\r\n"
"Date: Sun, 18 Sep 2022 16:56:11 +0100\r\n"
"Message-ID: <A3ULJQ7F.108YMLVU8O3LC@mydomain.com>\r\n"
"Content-Type: text/plain; charset=\"UTF-8\"\r\n"
"\r\nLorem ipsum blah blah\r\n"
