> this matches only on US phone numbers, what about this regexp instead ?
Nice idea but way too many FPs. Matches on extremely short strings like:
10 - OO
8l 19
I think we would need a separate regex for each country/region. It's too
complicated to try to match all of them in one.
On Tue, Aug 4, 2026 at 12:01 AM, [email protected] wrote:
------------------------------------------------------------------------------------------------------------------
CAUTION: External email from: giovanni@paclan.it
Use caution before clicking on links or opening attachments.
------------------------------------------------------------------------------------------------------------------
On 8/3/26 7:46 PM, [email protected] (mailto:[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
/(?!(1W*)?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