Changeset View
Changeset View
Standalone View
Standalone View
src/app/Http/Controllers/API/V4/PolicyController.php
Show First 20 Lines • Show All 292 Lines • ▼ Show 20 Lines | public function senderPolicyFramework() | ||||
$data = \request()->input(); | $data = \request()->input(); | ||||
if (!array_key_exists('client_address', $data)) { | if (!array_key_exists('client_address', $data)) { | ||||
\Log::error("SPF: Request without client_address: " . json_encode($data)); | \Log::error("SPF: Request without client_address: " . json_encode($data)); | ||||
return response()->json( | return response()->json( | ||||
[ | [ | ||||
'response' => 'DEFER_IF_PERMIT', | 'response' => 'DEFER_IF_PERMIT', | ||||
'reason' => 'Temporary error. Please try again later.' | 'reason' => 'Temporary error. Please try again later.', | ||||
'log' => ["SPF: Request without client_address: " . json_encode($data)] | |||||
], | ], | ||||
403 | 403 | ||||
); | ); | ||||
} | } | ||||
list($netID, $netType) = \App\Utils::getNetFromAddress($data['client_address']); | list($netID, $netType) = \App\Utils::getNetFromAddress($data['client_address']); | ||||
// This network can not be recognized. | // This network can not be recognized. | ||||
if (!$netID) { | if (!$netID) { | ||||
\Log::error("SPF: Request without recognizable network: " . json_encode($data)); | \Log::error("SPF: Request without recognizable network: " . json_encode($data)); | ||||
return response()->json( | return response()->json( | ||||
[ | [ | ||||
'response' => 'DEFER_IF_PERMIT', | 'response' => 'DEFER_IF_PERMIT', | ||||
'reason' => 'Temporary error. Please try again later.' | 'reason' => 'Temporary error. Please try again later.', | ||||
'log' => ["SPF: Request without recognizable network: " . json_encode($data)] | |||||
], | ], | ||||
403 | 403 | ||||
); | ); | ||||
} | } | ||||
$senderLocal = 'unknown'; | $senderLocal = 'unknown'; | ||||
$senderDomain = 'unknown'; | $senderDomain = 'unknown'; | ||||
▲ Show 20 Lines • Show All 113 Lines • Show Last 20 Lines |