Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F118459151
D4217.1775823735.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
D4217.1775823735.diff
View Options
diff --git a/extras/kolab_policy_spf b/extras/kolab_policy_spf
--- a/extras/kolab_policy_spf
+++ b/extras/kolab_policy_spf
@@ -7,6 +7,7 @@
import json
import time
import sys
+import logging
import requests
@@ -23,6 +24,7 @@
while not end_of_request:
if (time.time() - start_time) >= 10:
+ logging.warning("policy/spf rate-limited.")
print("action=DEFER_IF_PERMIT Temporary error, try again later.\n")
sys.stdout.flush()
sys.exit(0)
@@ -57,6 +59,7 @@
)
# pylint: disable=broad-except
except Exception:
+ logging.warning("policy/spf request failed.")
print("action=DEFER_IF_PERMIT Temporary error, try again later.\n")
sys.stdout.flush()
sys.exit(0)
@@ -65,7 +68,8 @@
R = json.loads(RESPONSE.text)
# pylint: disable=broad-except
except Exception:
- print("action=DEFER_IF_PERMIT Temporary error, try again later.\n")
+ logging.warning("Failed to load json from policy/spf request.")
+ print("action=DEFER_IF_PERMIT Temporary SPF request error, try again later.\n")
sys.stdout.flush()
sys.exit(0)
@@ -73,10 +77,15 @@
for prepend in R['prepend']:
print("action=PREPEND {0}".format(prepend))
+ if 'log' in R:
+ for line in R['log']:
+ logging.warning(line)
+
if RESPONSE.ok:
print("action={0}\n".format(R['response']))
else:
print("action={0} {1}\n".format(R['response'], R['reason']))
+ logging.warning("spf failed with reason: %s" % R['reason'])
sys.stdout.flush()
sys.exit(0)
diff --git a/src/app/Http/Controllers/API/V4/PolicyController.php b/src/app/Http/Controllers/API/V4/PolicyController.php
--- a/src/app/Http/Controllers/API/V4/PolicyController.php
+++ b/src/app/Http/Controllers/API/V4/PolicyController.php
@@ -298,7 +298,8 @@
return response()->json(
[
'response' => 'DEFER_IF_PERMIT',
- 'reason' => 'Temporary error. Please try again later.'
+ 'reason' => 'Temporary SPF check error. Please try again later.',
+ 'log' => ["SPF: Request without client_address: " . json_encode($data)]
],
403
);
@@ -313,7 +314,8 @@
return response()->json(
[
'response' => 'DEFER_IF_PERMIT',
- 'reason' => 'Temporary error. Please try again later.'
+ 'reason' => 'Temporary SPF check error. Please try again later.',
+ 'log' => ["SPF: Request without recognizable network: " . json_encode($data)]
],
403
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 10, 12:22 PM (1 h, 32 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18856066
Default Alt Text
D4217.1775823735.diff (2 KB)
Attached To
Mode
D4217: Log spf failure reasons
Attached
Detach File
Event Timeline