diff --git a/_sources/index.rst.txt b/_sources/index.rst.txt index a40658a..57f4e14 100644 --- a/_sources/index.rst.txt +++ b/_sources/index.rst.txt @@ -3,7 +3,6 @@ You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -====================================== Welcome to parsedmarc's documentation! ====================================== diff --git a/_static/basic.css b/_static/basic.css index 6df76b0..3c7223b 100644 --- a/_static/basic.css +++ b/_static/basic.css @@ -445,10 +445,14 @@ dd { margin-left: 30px; } -dt:target, .highlighted { +dt:target, span.highlighted { background-color: #fbe54e; } +rect.highlighted { + fill: #fbe54e; +} + dl.glossary dt { font-weight: bold; font-size: 1.1em; diff --git a/_static/doctools.js b/_static/doctools.js index 5654977..24992e6 100644 --- a/_static/doctools.js +++ b/_static/doctools.js @@ -45,7 +45,7 @@ jQuery.urlencode = encodeURIComponent; * it will always return arrays of strings for the value parts. */ jQuery.getQueryParameters = function(s) { - if (typeof s == 'undefined') + if (typeof s === 'undefined') s = document.location.search; var parts = s.substr(s.indexOf('?') + 1).split('&'); var result = {}; @@ -66,29 +66,53 @@ jQuery.getQueryParameters = function(s) { * span elements with the given class name. */ jQuery.fn.highlightText = function(text, className) { - function highlight(node) { - if (node.nodeType == 3) { + function highlight(node, addItems) { + if (node.nodeType === 3) { var val = node.nodeValue; var pos = val.toLowerCase().indexOf(text); if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { - var span = document.createElement("span"); - span.className = className; + var span; + var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg"); + if (isInSVG) { + span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); + } else { + span = document.createElement("span"); + span.className = className; + } span.appendChild(document.createTextNode(val.substr(pos, text.length))); node.parentNode.insertBefore(span, node.parentNode.insertBefore( document.createTextNode(val.substr(pos + text.length)), node.nextSibling)); node.nodeValue = val.substr(0, pos); + if (isInSVG) { + var bbox = span.getBBox(); + var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); + rect.x.baseVal.value = bbox.x; + rect.y.baseVal.value = bbox.y; + rect.width.baseVal.value = bbox.width; + rect.height.baseVal.value = bbox.height; + rect.setAttribute('class', className); + var parentOfText = node.parentNode.parentNode; + addItems.push({ + "parent": node.parentNode, + "target": rect}); + } } } else if (!jQuery(node).is("button, select, textarea")) { jQuery.each(node.childNodes, function() { - highlight(this); + highlight(this, addItems); }); } } - return this.each(function() { - highlight(this); + var addItems = []; + var result = this.each(function() { + highlight(this, addItems); }); + for (var i = 0; i < addItems.length; ++i) { + jQuery(addItems[i].parent).before(addItems[i].target); + } + return result; }; /* @@ -131,21 +155,21 @@ var Documentation = { * i18n support */ TRANSLATIONS : {}, - PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; }, + PLURAL_EXPR : function(n) { return n === 1 ? 0 : 1; }, LOCALE : 'unknown', // gettext and ngettext don't access this so that the functions // can safely bound to a different name (_ = Documentation.gettext) gettext : function(string) { var translated = Documentation.TRANSLATIONS[string]; - if (typeof translated == 'undefined') + if (typeof translated === 'undefined') return string; - return (typeof translated == 'string') ? translated : translated[0]; + return (typeof translated === 'string') ? translated : translated[0]; }, ngettext : function(singular, plural, n) { var translated = Documentation.TRANSLATIONS[singular]; - if (typeof translated == 'undefined') + if (typeof translated === 'undefined') return (n == 1) ? singular : plural; return translated[Documentation.PLURALEXPR(n)]; }, @@ -216,7 +240,7 @@ var Documentation = { var src = $(this).attr('src'); var idnum = $(this).attr('id').substr(7); $('tr.cg-' + idnum).toggle(); - if (src.substr(-9) == 'minus.png') + if (src.substr(-9) === 'minus.png') $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); else $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); @@ -248,7 +272,7 @@ var Documentation = { var path = document.location.pathname; var parts = path.split(/\//); $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { - if (this == '..') + if (this === '..') parts.pop(); }); var url = parts.join('/'); diff --git a/_static/searchtools.js b/_static/searchtools.js index c821573..33fedf4 100644 --- a/_static/searchtools.js +++ b/_static/searchtools.js @@ -540,6 +540,9 @@ var Search = { }); } else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) { var suffix = DOCUMENTATION_OPTIONS.SOURCELINK_SUFFIX; + if (suffix === undefined) { + suffix = '.txt'; + } $.ajax({url: DOCUMENTATION_OPTIONS.URL_ROOT + '_sources/' + item[5] + (item[5].slice(-suffix.length) === suffix ? '' : suffix), dataType: "text", complete: function(jqxhr, textstatus) { diff --git a/index.html b/index.html index 464b993..4818a1d 100644 --- a/index.html +++ b/index.html @@ -90,7 +90,7 @@
@@ -172,8 +170,9 @@

Welcome to parsedmarc’s documentation!

Build Status

pasedmarc is a Python module and CLI utility for parsing aggregate DMARC reports.

+
-

Features

+

Features

-

CLI help

+

CLI help

usage: parsedmarc.py [-h] [-f FORMAT] [-o OUTPUT]
                      [-n NAMESERVER [NAMESERVER ...]] [-t TIMEOUT] [-v]
                      file_path [file_path ...]
@@ -211,7 +210,7 @@
 
-

Sample output

+

Sample output

Here are the results from parsing the example report from the dmarc.org wiki. It’s actually an older draft of the the 1.0 report schema standardized in @@ -219,7 +218,7 @@ report schema standardized in This draft schema is still in wide use.

parsedmarc produces consistent, normalized output, regardless of the report schema.

-

JSON

+

JSON

{
   "xml_schema": "draft",
   "report_metadata": {
@@ -283,7 +282,7 @@ This draft schema is still in wide use.

-

CSV

+

CSV

xml_schema,org_name,org_email,org_extra_contact_info,report_id,begin_date,end_date,errors,domain,adkim,aspf,p,sp,pct,fo,source_ip_address,source_country,source_reverse_dns,source_base_domain,count,disposition,dkim_alignment,spf_alignment,policy_override_reasons,policy_override_comments,envelope_from,header_from,envelope_to,dkim_domains,dkim_selectors,dkim_results,spf_domains,spf_scopes,spf_results
 draft,acme.com,noreply-dmarc-support@acme.com,http://acme.com/dmarc/support,9391651994964116463,2012-04-27 20:00:00,2012-04-28 19:59:59,[],example.com,r,r,none,none,100,0,72.150.241.94,US,adsl-72-150-241-94.shv.bellsouth.net,bellsouth.net,2,none,fail,pass,,,example.com,example.com,,example.com,none,fail,example.com,mfrom,pass
 
@@ -291,7 +290,7 @@ This draft schema is still in wide use.

-

What about forensic DMARC reports?

+

What about forensic DMARC reports?

Forensic DMARC reports are emails with an attached email sample that failed a DMARC check. You can parse them with any email message parser, such as mail-parser.

@@ -300,12 +299,12 @@ provide only the message headers, and not the message’s content, for privacy reasons.

-

Bug reports

+

Bug reports

Please report bugs on the GitHub issue tracker

https://github.com/domainaware/parsedmarc/issues

-

Installation

+

Installation

parsedmarc works with Python 2 or 3, but Python 3 is preferred.

On Debian or Ubuntu systems, run:

$ sudo apt-get install python3-pip
@@ -327,7 +326,7 @@ substitute pip as
 
-

API

+

API

A Python module and CLI for parsing aggregate DMARC reports

@@ -409,13 +408,12 @@ headers

-

Indices and tables

+

Indices and tables

-
diff --git a/searchindex.js b/searchindex.js index 62dc317..f838a44 100644 --- a/searchindex.js +++ b/searchindex.js @@ -1 +1 @@ -Search.setIndex({docnames:["index"],envversion:53,filenames:["index.rst"],objects:{"":{parsedmarc:[0,0,0,"-"]},parsedmarc:{InvalidAggregateReport:[0,1,1,""],parse_aggregate_report_file:[0,2,1,""],parse_aggregate_report_xml:[0,2,1,""],parsed_aggregate_report_to_csv:[0,2,1,""]}},objnames:{"0":["py","module","Python module"],"1":["py","exception","Python exception"],"2":["py","function","Python function"]},objtypes:{"0":"py:module","1":"py:exception","2":"py:function"},terms:{"byte":0,"default":0,"float":0,"null":0,"return":0,DNS:0,The:0,_input:0,abov:0,acm:0,actual:0,adkim:0,administr:0,adsl:0,aggreg:0,ani:0,answer:0,appendix:0,apt:0,argument:0,aspf:0,attach:0,auth_result:0,base_domain:0,begin_d:0,bellsouth:0,can:0,check:0,checkdmarc:0,com:0,command:0,compress:0,consist:0,content:0,convert:0,count:0,countri:0,csv:[],data:0,debian:0,develop:0,directli:0,disposit:0,dkim:0,dkim_align:0,dkim_domain:0,dkim_result:0,dkim_selector:0,domain:0,domainawar:0,download:0,draft:0,email:0,encount:0,end_dat:0,envelope_from:0,envelope_to:0,error:0,even:0,exampl:0,except:0,exit:0,fail:0,few:0,file:0,file_path:0,flat:0,format:0,found:0,from:0,get:0,git:0,github:0,given:0,gzip:0,handl:0,header:0,header_from:0,here:0,http:0,identifi:0,includ:0,index:0,invalid:0,invalidaggregatereport:0,ip_address:0,issu:0,json:[],latest:0,like:0,linux:0,list:0,maco:0,mail:0,messag:0,mfrom:0,modul:0,more:0,nameserv:0,net:0,none:0,norepli:0,normal:0,number:0,object:0,often:0,older:0,one:0,onli:0,option:0,ordereddict:0,org:0,org_email:0,org_extra_contact_info:0,org_nam:0,page:0,paramet:0,pars:0,parse_aggregate_report_fil:0,parse_aggregate_report_xml:0,parsed_aggregate_report_to_csv:0,parsedmarc:[],parser:0,pasedmarc:0,pass:0,path:0,pct:0,pip3:0,pip:0,place:0,pleas:0,policy_evalu:0,policy_override_com:0,policy_override_reason:0,policy_publish:0,posit:0,prefer:0,print:0,privaci:0,produc:0,program:0,provid:0,python3:0,python:0,queri:0,rais:0,rather:0,reason:0,recipi:0,record:0,regardless:0,releas:0,report_id:0,report_metadata:0,result:0,reverse_dn:0,rfc:0,run:0,schema:0,scope:0,screen:0,search:0,second:0,selector:0,send:0,set:0,show:0,shv:0,simpl:0,simpli:0,sourc:0,source_base_domain:0,source_countri:0,source_ip_address:0,source_reverse_dn:0,specifi:0,spf:0,spf_align:0,spf_domain:0,spf_result:0,spf_scope:0,stabl:0,standard:0,still:0,str:0,string:0,structur:0,substitut:0,sudo:0,support:0,system:0,than:0,them:0,thi:0,those:0,timeout:0,tracker:0,transpar:0,type:0,ubuntu:0,uncompress:0,upgrad:0,usag:0,use:0,util:0,veri:0,version:0,wait:0,when:0,who:0,wide:0,wiki:0,window:0,work:0,www:0,xml:0,xml_schema:0,you:0,zip:0},titles:["Welcome to parsedmarc\u2019s documentation!"],titleterms:{about:0,api:0,bug:0,cli:0,csv:0,dmarc:0,document:0,featur:0,forens:0,help:0,indic:0,instal:0,json:0,output:0,parsedmarc:0,passedmaarc:[],report:0,sampl:0,tabl:0,welcom:0,what:0}}) \ No newline at end of file +Search.setIndex({docnames:["index"],envversion:53,filenames:["index.rst"],objects:{"":{parsedmarc:[0,0,0,"-"]},parsedmarc:{InvalidAggregateReport:[0,1,1,""],parse_aggregate_report_file:[0,2,1,""],parse_aggregate_report_xml:[0,2,1,""],parsed_aggregate_report_to_csv:[0,2,1,""]}},objnames:{"0":["py","module","Python module"],"1":["py","exception","Python exception"],"2":["py","function","Python function"]},objtypes:{"0":"py:module","1":"py:exception","2":"py:function"},terms:{"byte":0,"default":0,"float":0,"null":0,"return":0,DNS:0,The:0,_input:0,abov:0,acm:0,actual:0,adkim:0,administr:0,adsl:0,aggreg:0,ani:0,answer:0,appendix:0,apt:0,argument:0,aspf:0,attach:0,auth_result:0,base_domain:0,begin_d:0,bellsouth:0,can:0,check:0,checkdmarc:0,com:0,command:0,compress:0,consist:0,content:0,convert:0,count:0,countri:0,data:0,debian:0,develop:0,directli:0,disposit:0,dkim:0,dkim_align:0,dkim_domain:0,dkim_result:0,dkim_selector:0,domain:0,domainawar:0,download:0,draft:0,email:0,encount:0,end_dat:0,envelope_from:0,envelope_to:0,error:0,even:0,exampl:0,except:0,exit:0,fail:0,few:0,file:0,file_path:0,flat:0,format:0,found:0,from:0,get:0,git:0,github:0,given:0,gzip:0,handl:0,header:0,header_from:0,here:0,http:0,identifi:0,includ:0,index:0,invalid:0,invalidaggregatereport:0,ip_address:0,issu:0,latest:0,like:0,linux:0,list:0,maco:0,mail:0,messag:0,mfrom:0,modul:0,more:0,nameserv:0,net:0,none:0,norepli:0,normal:0,number:0,object:0,often:0,older:0,one:0,onli:0,option:0,ordereddict:0,org:0,org_email:0,org_extra_contact_info:0,org_nam:0,page:0,paramet:0,pars:0,parse_aggregate_report_fil:0,parse_aggregate_report_xml:0,parsed_aggregate_report_to_csv:0,parser:0,pasedmarc:0,pass:0,path:0,pct:0,pip3:0,pip:0,place:0,pleas:0,policy_evalu:0,policy_override_com:0,policy_override_reason:0,policy_publish:0,posit:0,prefer:0,print:0,privaci:0,produc:0,program:0,provid:0,python3:0,python:0,queri:0,rais:0,rather:0,reason:0,recipi:0,record:0,regardless:0,releas:0,report_id:0,report_metadata:0,result:0,reverse_dn:0,rfc:0,run:0,schema:0,scope:0,screen:0,search:0,second:0,selector:0,send:0,set:0,show:0,shv:0,simpl:0,simpli:0,sourc:0,source_base_domain:0,source_countri:0,source_ip_address:0,source_reverse_dn:0,specifi:0,spf:0,spf_align:0,spf_domain:0,spf_result:0,spf_scope:0,stabl:0,standard:0,still:0,str:0,string:0,structur:0,substitut:0,sudo:0,support:0,system:0,than:0,them:0,thi:0,those:0,timeout:0,tracker:0,transpar:0,type:0,ubuntu:0,uncompress:0,upgrad:0,usag:0,use:0,util:0,veri:0,version:0,wait:0,when:0,who:0,wide:0,wiki:0,window:0,work:0,www:0,xml:0,xml_schema:0,you:0,zip:0},titles:["Welcome to parsedmarc\u2019s documentation!"],titleterms:{about:0,api:0,bug:0,cli:0,csv:0,dmarc:0,document:0,featur:0,forens:0,help:0,indic:0,instal:0,json:0,output:0,parsedmarc:0,report:0,sampl:0,tabl:0,welcom:0,what:0}}) \ No newline at end of file