Read only
Every query below is a SELECT. It changes nothing. Run it in phpMyAdmin or the mysql client, on a copy of the database if you have one.
WHMCS guide
Card testers and spam bots open account after account with the same mailbox, adding a +tag and a new name each time. On our own US install the first query below found 186 mailboxes behind 617 client accounts. 545 of them placed an order. Not one ever paid an invoice.
DMS.S2 — Before you start
Every query below is a SELECT. It changes nothing. Run it in phpMyAdmin or the mysql client, on a copy of the database if you have one.
An agency can open accounts for its own clients with +tags on one mailbox, and our Brazilian install shows exactly that. Query 4 tells a paying customer from a tester.
Merging fake accounts into one keeps their orders and invoices around. Close or delete them after you check query 4.
DMS.S3 — The queries
Ignores +tags on any provider and dots on Gmail. Listed only when at least one account uses a +tag and no two accounts share a last name.
SELECT CONCAT(IF(SUBSTRING_INDEX(LOWER(TRIM(email)), '@', -1) = 'gmail.com',
REPLACE(SUBSTRING_INDEX(SUBSTRING_INDEX(LOWER(TRIM(email)), '@', 1), '+', 1), '.', ''),
SUBSTRING_INDEX(SUBSTRING_INDEX(LOWER(TRIM(email)), '@', 1), '+', 1)),
'@', SUBSTRING_INDEX(LOWER(TRIM(email)), '@', -1)) AS mailbox,
COUNT(*) AS accounts, GROUP_CONCAT(id ORDER BY id) AS client_ids
FROM tblclients
GROUP BY mailbox
HAVING COUNT(*) > 1 AND SUM(email LIKE '%+%') > 0
AND COUNT(DISTINCT LOWER(TRIM(lastname))) = COUNT(*);
WHMCS saves the signup IP on each client. A family or an office behind one router can show up here too, so open the accounts before you act.
SELECT ip, DATE(datecreated) AS day, COUNT(*) AS signups,
GROUP_CONCAT(id ORDER BY id) AS client_ids
FROM tblclients
WHERE ip <> ''
GROUP BY ip, day
HAVING COUNT(*) >= 3
ORDER BY day DESC;
Card testing shows up in the gateway log as many declines in one day. The result text depends on the gateway: Stripe logs Declined, others log Failed, so check Billing > Gateway Log for the words yours uses.
SELECT DATE(date) AS day, gateway, COUNT(*) AS declined
FROM tblgatewaylog
WHERE result IN ('Declined', 'Failed')
GROUP BY day, gateway
HAVING COUNT(*) >= 5
ORDER BY day DESC;
Paste the client IDs from query 1 or 2. A tester places orders and pays nothing; an agency account has paid invoices.
SELECT c.id, c.status, c.datecreated,
(SELECT COUNT(*) FROM tblorders o WHERE o.userid = c.id) AS orders,
(SELECT COUNT(*) FROM tblinvoices i WHERE i.userid = c.id AND i.status = 'Paid') AS paid_invoices
FROM tblclients c
WHERE c.id IN (101, 102, 103);
DMS.S4 — The addon
Brasa Duplicate Clients finds one mailbox behind unrelated names, including Gmail dots and +tags, lists those groups last as possible fake signups and e-mails admins when a new group appears. Queries 2 to 4 are not in the addon. It never merges or deletes anything.

$39 per year
Finds the accounts that look like the same person or company, so you can merge the right ones.
DMS.S5 — Questions
Close accounts that have invoices or orders you want to keep for your records, and delete the empty ones. Before either, run query 4: an account with a paid invoice is a real customer.
In Configuration > System Settings > General Settings > Security, pick reCAPTCHA v3 or hCaptcha as the Captcha Type, the type WHMCS recommends against spam orders, and tick Shopping Cart Checkout and Client Registration under Captcha for Selected Forms. A fraud check module on orders adds a second gate.
It does not: WHMCS refuses an e-mail already in use. The +tag makes each address different to WHMCS while the mail still lands in one inbox, which is why query 1 strips it.
DMS.S6 — Start a project
Tell us what the accounts have in common. If other hosts would hit it, it may become a check.