PHP Classes

TXT records with DKIM, DMARC are not correctly parsed

Recommend this page to a friend!

      PHP Bind Zone File Parser  >  All threads  >  TXT records with DKIM, DMARC are not...  >  (Un) Subscribe thread alerts  
Subject:TXT records with DKIM, DMARC are not...
Summary:Issues with PHP Bind Zone File Parser
Messages:6
Author:zEitEr
Date:2016-05-11 13:29:01
 

  1. TXT records with DKIM, DMARC are not...   Reply   Report abuse  
Picture of zEitEr zEitEr - 2016-05-11 13:29:02
Hello,

The following issues were found:

1. TXT records with DKIM are not correctly parsed by PHP Bind Zone File Parser
2. TXT records with DMARC are not correctly parsed by PHP Bind Zone File Parser

They contain ; and are treated as comments, the line which makes issues:

$line = preg_replace('/(\s+)?(;|#)([\s\S]+)?/i', '', $line);

3. Email specified in DMARC records email@domain.com becomes emaildomain.comdomain.com because @ gets replaced by an origin:

$record['data'] = str_replace("@", $this->origin, $record['data']);

which is also wrong.

I'm wondering am I the only one who found these issues? And can it be fixed by the package author? Or should I suggest my fix?

Regards,
Alex.


  2. Re: TXT records with DKIM, DMARC are not...   Reply   Report abuse  
Picture of Jan Altensen Jan Altensen - 2016-05-11 18:16:02 - In reply to message 1 from zEitEr
Hello

tanks for this thread
i will look into the issues and hope that i can fix it
can you prove me an example zone file for testing?

Regards,
Jan Altensen

  3. Re: TXT records with DKIM, DMARC are not...   Reply   Report abuse  
Picture of zEitEr zEitEr - 2016-05-12 18:57:43 - In reply to message 2 from Jan Altensen
Hello Jan,

Thank you for your care and work.

Here is an example of a zone: https://codeshare.io/rYIIc

By the way, as for origin, only two-three working cases come to y mind (MX, CNAME, SRV) when we can have @-mark in the right side:

@ 14400 IN MX 10 @

or

example.com. 14400 IN MX 10 @

and

www 14400 IN CNAME @

It would be wrong:

@ 14400 IN MX 10 mail.@

So the @ should not be always replaced, specially in TXT records:

_dmarc 14400 IN TXT "v=DMARC1; p=none; rua=mailto:dmarc@example.com"

Then DKIM records, they can be long enough so they are split into parts.

Kindly let me know if I can be of a further service for you.

Regards,
Alex.

  4. Re: TXT records with DKIM, DMARC are not...   Reply   Report abuse  
Picture of Jan Altensen Jan Altensen - 2016-05-12 20:04:30 - In reply to message 3 from zEitEr
tank you for the example

the @ replacement should be easy to fix
the comments are a problem, i will look into this issue
currently i have no idea how to fiy this but i will figure it out

Regards,
Jan Altensen

  5. Re: TXT records with DKIM, DMARC are not...   Reply   Report abuse  
Picture of Jan Altensen Jan Altensen - 2016-05-13 00:57:06 - In reply to message 4 from Jan Altensen
seems to be fixed now (tested it with your provided example zone)

thank you for the report

Regards,
Jan Altensen

  6. Re: TXT records with DKIM, DMARC are not...   Reply   Report abuse  
Picture of zEitEr zEitEr - 2016-05-14 03:12:23 - In reply to message 5 from Jan Altensen
Hello Jan,

Thanks, it works good now.

Kind regards,
Alex.

 
For more information send a message to info at phpclasses dot org.