Menu

#119 count column of xml that opendmarc-reports make is always to 1

1.3.0
open
nobody
None
2017-02-24
2015-03-18
tau
No

The perl script of opendmarc-reports <count> 1 </ count> is hard-coded.
Never to count up from that reason always 1.Is this the correct behavior?</count>

    print $tmpout " <record>\n";
    print $tmpout "  <row>\n";
    print $tmpout "   <source_ip>$ipaddr</source_ip>\n";
    print $tmpout "   <count>1</count>\n";
    print $tmpout "   <policy_evaluated>\n";
    print $tmpout "    <disposition>$dispstr</disposition>\n";
    print $tmpout "    <dkim>$align_dkimstr</dkim>\n";
    print $tmpout "    <spf>$align_spfstr</spf>\n";
    print $tmpout "   </policy_evaluated>\n";
    print $tmpout "  </row>\n";
    print $tmpout "  <identifiers>\n";
    print $tmpout "   <header_from>$fromdomain</header_from>\n";
    print $tmpout "  </identifiers>\n";
    print $tmpout "  <auth_results>\n";
    print $tmpout "   <spf>\n";
    print $tmpout "    <domain>$envdomain</domain>\n";
    print $tmpout "    <result>$spfresultstr</result>\n";
    print $tmpout "   </spf>\n";

Discussion

  • Mark Reidenbach

    Mark Reidenbach - 2015-03-19

    This behavior was also fixed in my ticket 111 https://sourceforge.net/p/opendmarc/tickets/111/.

    I'm not sure if it matters as I found the code in 1.3.1 resulted in many identical records (one for each email). However, the perl files in my ticket group these together into one record.

     
    • Eneas Ulir de Queiroz

      The only problem with the code in 111 is that it treats a message with two DKIM signatures as two different messages; getting the signatures out of the GROUP BY clause could group messages with different signatures togheter. That's why I had to concatenate the signatures into one field, so that the GROUP BY clause would group them correctly. As for the many identical records, you're right, the final result is OK, but grouping them into one record makes it a lot easier to read.

       

      Last edit: Eneas Ulir de Queiroz 2017-03-06
  • Murray S. Kucherawy

    Will look into this after 1.3.2 ships.

     
  • Eneas Ulir de Queiroz

    I have a patch that resolves this now, but it only works with MySQL, as it uses a subquery and the GROUP_CONCAT function to aggregate the signatures into one field. My suggestion for the next version is to change the schema so that the signatures are saved from opendmarc-import in one varchar field, formatted as 'domain|pass|error,domain|pass|error...', so that a simpler SELECT clause could be used to work with any DB.

     
    • Eneas Ulir de Queiroz

      Here is the patch for release 1.3.2.

       

Log in to post a comment.

MongoDB Logo MongoDB