In South Africa, we are plagued with SMS spam, and it's practically impossible to get rid of it.

All the numbers that the spammers use are usually 13 or 14 digits - much longer than the standard 10 digits.

(Click image to enlarge it)

see the picture

The thinking behind this is that they cycle through literally millions of disposable numbers, so that if you block one of them, they'll still be able to spam you from all the others.

However, this thinking would then (hopefully) also be flawed. Surely there is a way to intercept an SMS, count the number of digits in the number and if it's longer than 12 (10 for the number, 2 for the country code), simply delete it, or even better add to blocked list.

Does anyone out there know of a way? I have Tasker, which I'm thinking is the way to go, but not sure where to start.

  • I can't test my solution here because I'm not yet plagued by spammers (thank goodness!), but I hope that it should work for you. Try it and let me know if it works. – Firelord Jul 16 '15 at 12:19

The first step to this would be detecting the length of the phone number.

This can be done by passing %SMSRF to Test Variable > Type: Length. Test Variable can then output the phone number length as an integer which you can do checks on with an If.

Once Tasker decides if the message is spam or not, you can then have it hide the notification, etc. (but not delete the message, as Tasker does not have this capability yet)


Your Answer


By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.