pimlie/authres_status

Duplicates removal

Pascal76 opened this issue · 0 comments

There may be duplicates on results:

Ex: from:

ARC-Authentication-Results: i=1; mx.google.com;
dkim=pass header.i=@3suisses.fr header.s=splio header.b=dMrDDDOG;
dkim=pass header.i=@s3s-main.net header.s=dkim02 header.b=SfWG7Lbo;
spf=pass (google.com: domain of 3suisses_fr@newsletter.3suisses.fr designates 91.190.168.87 as permitted sender) smtp.mailfrom=3suisses_fr@newsletter.3suisses.fr;
dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=newsletter.3suisses.fr
...
Authentication-Results: mx.google.com;
dkim=pass header.i=@3suisses.fr header.s=splio header.b=dMrDDDOG;
dkim=pass header.i=@s3s-main.net header.s=dkim02 header.b=SfWG7Lbo;
spf=pass (google.com: domain of 3suisses_fr@newsletter.3suisses.fr designates 91.190.168.87 as permitted sender) smtp.mailfrom=3suisses_fr@newsletter.3suisses.fr;
dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=newsletter.3suisses.fr

=> I suggest this to remove them:
return array_map('unserialize',array_unique(array_map('serialize',$results)));

  • I also suggest this to remove first/last parenthesis on reasons:
    'reason' => isset($m[7]) ? preg_replace("/^((.+))$/","$1",preg_replace("/\r?\n/",'',$m[7][0])) : '',