New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Mail sent with curl fails DKIM
Whilst testing a bash script I'm writing that sends notification emails via MXRoute SMTP using just curl
, I noticed that DKIM is failing. I'm receiving the email with no issues, and SPF is passing.
"Regular" emails aren't failing.
The only thing I've noticed in the headers is:
X-ACL-Warn: Adding Message-ID header because it is missing!
Am I overlooking anything?
smtpBody="Testing email from script"
curl --url smtps://$smtpHost:$smtpPort --ssl-reqd \
--mail-from $fromAddress \
--mail-rcpt $toAddress \
--user $smtpUser:$smtpPass \
-H "Subject: $smtpSubject" \
-H "From: $fromName <$fromAddress>" -H "To: $toAddress" \
-F "=$smtpBody"
Comments
Try sending it with a random Message-ID. iirc message id is part of the DKIM signiture, and maybe the auto-generated message id is making a problem?
The
Date
header is required as per RFC 822 so that could be the problem. The format is specified in the RFC.Message-ID
is an optional nice to have.Pavin.
Today I learned you can send emails with curl.
It can do a whole lot more
Source:
man 1 curl
Pavin.
I tried adding a random message ID, but I don't think google liked that 😅
I probably need to work on this a little more.
I added the date and DKIM passed! thanks @mailcheap
Pretty cool huh?