DKIM is failing when using swift mailer to sign emails, but works when I use http://php-dkim.sourceforge.net/ #636
Comments
have you tried setting the body canon to relaxed? It's probably the culprit here, one mail server messes up with your
On Fri, Jul 10, 2015 at 8:30 AM, Pankaj Garg notifications@github.com
Xavier De Cock |
Thanks @xdecock for your reply. I have set the body canon to relaxed. How can I get the failing DKIM header? The email headers shows
|
You probably want to exclude the return-path from the signed headers, i the rest is probably ok On Fri, Jul 10, 2015 at 9:38 AM, Pankaj Garg notifications@github.com
Xavier De Cock |
@xdecock But the test is still failing. Should i include return-path in signing headers? |
No it is signed, you should add it to ignored headers ;) as it's usually this is what is causing the failure ->ignoreHeader('Return-Path'); On Fri, Jul 10, 2015 at 10:22 AM, Pankaj Garg notifications@github.com
Xavier De Cock |
Hey @xdecock , Thank you so much :) that really worked. I wasted my two days because I was new to DKIM. Ignoring Return-path header worked for me. But may I know why do we need to ignore the Return-path header? |
Because this is the only header that can move in the mail, it should Always As such the header is missing and the signature is invalid. regards, On Fri, Jul 10, 2015 at 11:54 AM, Pankaj Garg notifications@github.com
Xavier De Cock |
@xdecock is it safe if we ignore it? |
yes, as it cannot be signed, it's probably not signed by default by php-dkim On Fri, Jul 10, 2015 at 12:55 PM, Pankaj Garg notifications@github.com
Xavier De Cock |
okay, Thanks a lot @xdecock You are really awesome!! |
To be completely honnest, it's linked to the way DKIM works, so either we But any patch is welcome. On Mon, Jul 13, 2015 at 7:39 AM, Pankaj Garg notifications@github.com
Xavier De Cock |
@xdecock ok, is this the official documentation of DKIM http://www.opendkim.org/opendkim.conf.5.html ? or would be helpful if you could share the correct one. |
DKIM Documentation? https://tools.ietf.org/html/rfc6376 On Mon, Jul 13, 2015 at 10:18 AM, Pankaj Garg notifications@github.com
Xavier De Cock |
@xdecock okay, thanks |
@xdecock
|
those are examples, and altough i think Return-Path might be a good idea, the other ones might have usage, or we nee to implement a "signHeader" to Regards, Xavier On Mon, Jul 13, 2015 at 10:47 AM, Pankaj Garg notifications@github.com
Xavier De Cock |
Didn't get you exactly what do you mean by "we need to implement a "signHeader" to Apart from that, I checked some well known product's emails, no one includes return-path in signing headers even github does not. |
@xdecock Can you please explain bit more what should we do if adding Return-path to |
Return-path is ok, no other headers should be included however regards, Xavier On Mon, Jul 13, 2015 at 12:51 PM, Pankaj Garg notifications@github.com
Xavier De Cock |
Travis build is not passing for PHP5.3, says Segmentation fault when phpunit tests are executed |
Am working on a project to help send mail via a contact form, but am having this issue while using swiftmailer DKIM class to authenticate the message before sending it. Here is the error i get: Fatal error: Uncaught exception 'Swift_SwiftException' with message 'Unable to load DKIM Private Key [error:0906D06C:PEM routines:PEM_read_bio:no start line]' in /home/villaroc/public_html/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/DKIMSigner.php:691 Stack trace: #0 /home/villaroc/public_html/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/DKIMSigner.php(560): Swift_Signers_DKIMSigner->_getEncryptedHash() #1 /home/villaroc/public_html/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Message.php(213): Swift_Signers_DKIMSigner->addSignature(Object(Swift_Mime_SimpleHeaderSet)) #2 /home/villaroc/public_html/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Message.php(179): Swift_Message->doSign() #3 /home/villaroc/public_html/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(327): Swift_Message->toByteStream(Object(Swift_Transport_StreamBuffer)) #4 /home/villaroc/public_html/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(428): Swif in /home/villaroc/public_html/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/DKIMSigner.php on line 691 Your assistance will be highly appreciated. |
it seems you don't have a pem encoded private key does your key start with ---- START PRIVATE RSA ---- (or something like 2016-10-14 11:08 GMT+02:00 tunexlevel notifications@github.com:
Xavier De Cock |
@xdecock Thanks for your prompt response. I think you are right. Am new to swiftmailer framework but how can I get a pem encoded private key and selector for the parameter of Swift_Signers_DKIMSigne() |
@pankaj-garg That really helped. I was so excited but the mail is still not verified. Find attached below the error message from gmail. Thanks in anticipation... |
@tunexlevel Have you added proper DNS records? and also check your code with the code snippet here #636 (comment) |
Here is how my code looks like: ` //create swiftmailer instance //create content //create a message $privateKey = '---'; // Generated one as the paired public key is set in DNS $message ->attachSigner((new \Swift_Signers_DKIMSigner($privateKey, $domain, $selector)) //send it if($send){ |
I don't see SPF and DKIM related TXT records on your domain villarockestate.com |
@pankaj-garg I really appreciate your effort, what can I do
|
@pankaj-garg Is this what you mean |
If that is what you meant; I tried that also, but didn't solve the problem Kind regards, |
Add getUid() to UidProcessor
I downloaded php-dkim from http://php-dkim.sourceforge.net/ and tried to test from same privatekey, domain and selector i am using for swift mailer. That works perfectly, dkim is passed and shows mails signed-by pankajgarg.in But when I do same with swift mailer, DKIM test is failed.
Code I am using to sign emails using Swift Mailer
Please suggest, how can I achieve that
The text was updated successfully, but these errors were encountered: