On 8/3/26 7:46 PM, [email protected] wrote:
Author: fkento
Date: Mon Aug  3 17:46:42 2026
New Revision: 1936844

Log:
Improve phone number obfuscation rule

* use bounded repetition counts

* require valid area code (must not start with 0 or 1, must not end with 11)

this matches only on US phone numbers, what about this regexp instead ?
/(?!(?:(?:\+|00)\d{1,3})?[^a-zA-Z0-9]{0,3}\d{2,7}(?:[^a-zA-Z0-9]{1,30}\d{2,7}){1,3}\b)(?<![a-zA-Z0-9])(?:(?:\+|00)[\dOIl]{1,3})?[^a-zA-Z0-9]{0,3}[\dOIl]{2,7}(?<![Il1]{2})(?:[^a-zA-Z0-9]{1,30}[\dOIl]{2,7}){1,3}\b/

 Giovanni

Modified:
    spamassassin/trunk/rulesrc/sandbox/fkento/20_phone_numbers.cf

Modified: spamassassin/trunk/rulesrc/sandbox/fkento/20_phone_numbers.cf
==============================================================================
--- spamassassin/trunk/rulesrc/sandbox/fkento/20_phone_numbers.cf       Mon Aug 
 3 16:18:06 2026        (r1936843)
+++ spamassassin/trunk/rulesrc/sandbox/fkento/20_phone_numbers.cf       Mon Aug 
 3 17:46:42 2026        (r1936844)
@@ -1,6 +1,6 @@
  uri           __MXG_HAS_PHONE04  /^tel:/
-body __MXG_PHONE_OBFU /(?!(1\W*)?\d{3}\W+\d{3}\W+\d{4})\b([1I][^a-zA-Z0-9]*)?[\dOIl]{3}[^a-zA-Z0-9]+[\dOIl]{3}[^a-zA-Z0-9]+[\dOIl]{4}\b/
+body          __MXG_PHONE_OBFU  
/(?!\d{3}\W{1,30}\d{3}\W{1,30}\d{4})\b[2-9][\dOIl]{2}(?<![Il1]{2})[^a-zA-Z0-9]{1,30}[\dOIl]{3}[^a-zA-Z0-9]{1,30}[\dOIl]{4}\b/
  describe      __MXG_PHONE_OBFU  Has an obfuscated phone number

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to