|
@@ 101-113 (lines=13) @@
|
| 98 |
|
); |
| 99 |
|
|
| 100 |
|
|
| 101 |
|
if ( preg_match_all ('/^Authentication\-Results:\s+(?<host>[\w\.]+);(?:\s+|\r\n\s+)dmarc=(?<dmarc>\w+)\s+\(p=\w+\s+dis=\w+\)\s+header\.from=(?<DMARCfrom>[\w\.]+)/m',$header,$received) ) { |
| 102 |
|
$k=0; |
| 103 |
|
for ($i = count($received[0])-1;$i>=0;$i--) { |
| 104 |
|
foreach ($ARhosts as $mx) { |
| 105 |
|
if ($mx == $received['host'][$i]) { |
| 106 |
|
/* This is a trusted AR result */ |
| 107 |
|
$result['dmarc']['result']=$received['dmarc'][$i]; |
| 108 |
|
$result['dmarc']['dom'] = $received['DMARCfrom'][$i]; |
| 109 |
|
$k++; |
| 110 |
|
} |
| 111 |
|
} |
| 112 |
|
} |
| 113 |
|
} |
| 114 |
|
$received=NULL; |
| 115 |
|
if ($k>1) $result['warn'][] = 'The trusted DMARC AR Headers are present more than once. Something wrong.'; |
| 116 |
|
|
|
@@ 117-129 (lines=13) @@
|
| 114 |
|
$received=NULL; |
| 115 |
|
if ($k>1) $result['warn'][] = 'The trusted DMARC AR Headers are present more than once. Something wrong.'; |
| 116 |
|
|
| 117 |
|
if ( preg_match_all('/^Authentication\-Results:\s+(?<host>[\w\.]+);(?:\s+|\r\n\s+)spf=(?<spf>\w+)\s+smtp\.(?:mailfrom|helo)=(?<SPFfrom>[\w\.]+)/m',$header,$received) ) { |
| 118 |
|
$k=0; |
| 119 |
|
for ($i = count($received[0])-1;$i>=0;$i--) { |
| 120 |
|
foreach ($ARhosts as $mx) { |
| 121 |
|
if ($mx == $received['host'][$i]) { |
| 122 |
|
/* This is a trusted AR result */ |
| 123 |
|
$result['spf']['result']=$received['spf'][$i]; |
| 124 |
|
$result['spf']['dom'] = $received['SPFfrom'][$i]; |
| 125 |
|
$k++; |
| 126 |
|
} |
| 127 |
|
} |
| 128 |
|
} |
| 129 |
|
} |
| 130 |
|
$received=NULL; |
| 131 |
|
if ($k>1) $result['warn'][] = 'The trusted SPF AR Headers are present more than once. Something wrong.'; |
| 132 |
|
|
|
@@ 133-145 (lines=13) @@
|
| 130 |
|
$received=NULL; |
| 131 |
|
if ($k>1) $result['warn'][] = 'The trusted SPF AR Headers are present more than once. Something wrong.'; |
| 132 |
|
|
| 133 |
|
if ( preg_match_all('/^Authentication\-Results:\s+(?<host>[\w\.]+);(?:\s+|\r\n\s+)dkim=(?<dkim>\w+)\s+[\w\s\(\)\-]+header\.d=(?<DKIMdom>[\w\.]+)/m',$header,$received) ) { |
| 134 |
|
$k=0; |
| 135 |
|
for ($i = count($received[0])-1;$i>=0;$i--) { |
| 136 |
|
foreach ($ARhosts as $mx) { |
| 137 |
|
if ($mx == $received['host'][$i]) { |
| 138 |
|
/* This is a trusted AR result */ |
| 139 |
|
$result['dkim']['result']=$received['dkim'][$i]; |
| 140 |
|
$result['dkim']['dom'] = $received['DKIMdom'][$i]; |
| 141 |
|
$k++; |
| 142 |
|
} |
| 143 |
|
} |
| 144 |
|
} |
| 145 |
|
} |
| 146 |
|
$received=NULL; |
| 147 |
|
if ($k>1) $result['warn'][] = 'The trusted DKIM AR Headers are present more than once. Something wrong.'; |
| 148 |
|
|