aboutsummaryrefslogtreecommitdiffstats
path: root/rules
diff options
context:
space:
mode:
authorJose Celestino <japc@co.sapo.pt>2025-01-23 12:42:40 +0000
committerJose Celestino <japc@co.sapo.pt>2025-01-23 12:42:40 +0000
commitd0d9fb8a1ded3d78c7a0776b2c5a51311537ddda (patch)
treeb1f73da549b87923b2bea461f3f5733aafaef471 /rules
parent7d99c57b55bb230d53863939adf10ef3c0702950 (diff)
downloadrspamd-d0d9fb8a1ded3d78c7a0776b2c5a51311537ddda.tar.gz
rspamd-d0d9fb8a1ded3d78c7a0776b2c5a51311537ddda.zip
[Minor] Move url regexes to regexp/urls.lua
Diffstat (limited to 'rules')
-rw-r--r--rules/regexp/headers.lua28
-rw-r--r--rules/regexp/urls.lua31
-rw-r--r--rules/rspamd.lua1
3 files changed, 32 insertions, 28 deletions
diff --git a/rules/regexp/headers.lua b/rules/regexp/headers.lua
index 349bd204c..3aba02d86 100644
--- a/rules/regexp/headers.lua
+++ b/rules/regexp/headers.lua
@@ -945,34 +945,6 @@ reconf['HAS_LIST_UNSUB'] = {
group = 'headers'
}
-reconf['HAS_GUC_PROXY_URI'] = {
- re = '/\\.googleusercontent\\.com\\/proxy/{url}i',
- description = 'Has googleusercontent.com proxy URL',
- score = 1.0,
- group = 'url'
-}
-
-reconf['HAS_GOOGLE_REDIR'] = {
- re = '/\\.google\\.([a-z]{2,3}(|\\.[a-z]{2,3})|info|jobs)\\/(amp\\/s\\/|url\\?)/{url}i',
- description = 'Has google.com/url or alike Google redirection URL',
- score = 1.0,
- group = 'url'
-}
-
-reconf['HAS_GOOGLE_FIREBASE_URL'] = {
- re = '/\\.firebasestorage\\.googleapis\\.com\\//{url}i',
- description = 'Contains firebasestorage.googleapis.com URL',
- score = 2.0,
- group = 'url'
-}
-
-reconf['HAS_FILE_URL'] = {
- re = '/^file:\\/\\//{url}i',
- description = 'Contains file:// URL',
- score = 2.0,
- group = 'url'
-}
-
reconf['XM_UA_NO_VERSION'] = {
re = string.format('(!%s && !%s) && (%s || %s) && !%s',
'X-Mailer=/https?:/H',
diff --git a/rules/regexp/urls.lua b/rules/regexp/urls.lua
new file mode 100644
index 000000000..76c4115cd
--- /dev/null
+++ b/rules/regexp/urls.lua
@@ -0,0 +1,31 @@
+
+local reconf = config['regexp']
+
+reconf['HAS_GUC_PROXY_URI'] = {
+ re = '/\\.googleusercontent\\.com\\/proxy/{url}i',
+ description = 'Has googleusercontent.com proxy URL',
+ score = 1.0,
+ group = 'url'
+}
+
+reconf['HAS_GOOGLE_REDIR'] = {
+ re = '/\\.google\\.([a-z]{2,3}(|\\.[a-z]{2,3})|info|jobs)\\/(amp\\/s\\/|url\\?)/{url}i',
+ description = 'Has google.com/url or alike Google redirection URL',
+ score = 1.0,
+ group = 'url'
+}
+
+reconf['HAS_GOOGLE_FIREBASE_URL'] = {
+ re = '/\\.firebasestorage\\.googleapis\\.com\\//{url}i',
+ description = 'Contains firebasestorage.googleapis.com URL',
+ score = 2.0,
+ group = 'url'
+}
+
+reconf['HAS_FILE_URL'] = {
+ re = '/^file:\\/\\//{url}i',
+ description = 'Contains file:// URL',
+ score = 2.0,
+ group = 'url'
+}
+
diff --git a/rules/rspamd.lua b/rules/rspamd.lua
index e41a946cb..3fc2d1797 100644
--- a/rules/rspamd.lua
+++ b/rules/rspamd.lua
@@ -30,6 +30,7 @@ dofile(local_rules .. '/regexp/headers.lua')
dofile(local_rules .. '/regexp/misc.lua')
dofile(local_rules .. '/regexp/upstream_spam_filters.lua')
dofile(local_rules .. '/regexp/compromised_hosts.lua')
+dofile(local_rules .. '/regexp/urls.lua')
dofile(local_rules .. '/html.lua')
dofile(local_rules .. '/headers_checks.lua')
dofile(local_rules .. '/subject_checks.lua')