Roundup Tracker - Issues

Issue 2551425

classification
userauditor rejects valid alternate_addresses that are substrings of existing ones
Type: behavior Severity: normal
Components: Database Versions: 2.4.0
process
Status: open
:
: rouilj : matre, rouilj, wilsj
Priority: : patch

Created on 2026-08-31 08:46 by matre, last changed 2026-09-01 01:18 by rouilj.

Files
File name Uploaded Description Edit Remove
fix-false-matches-alternate-address.patch matre, 2026-08-31 08:46 Patch to find exact matches post-filtering on alternate_addresses
Messages
msg8504 Author: [hidden] (matre) Date: 2026-08-31 08:46
audit_user_fields() in the userauditor detector checks for duplicate alternate addresses 
using:

    check_alts = [x for x in db.user.filter(None, {'alternate_addresses': address}) if x != 
nodeid]

`filter()` on a String property compiles to `ILIKE '%value%'`, so any address that's a 
substring of an existing alternate_addresses entry is rejected as a duplicate. For example, 
setting `ken@example.com` fails if another user has `sp_ken@example.com` in their alternates.

This bug has seemingly existed for as long as the `check_alt` line was added, but I confirmed 
it on version 2.4.0. Attached is a patch mitigating this by checking for exact matches post-
filter, sort of like how it's done in the `mailgw.py` function `uidFromAddress()`.
msg8505 Author: [hidden] (rouilj) Date: 2026-09-01 01:18
Hello Mattias:

Thanks for the patch and including a test as well.

I am busy tomorrow and will plan on committing it on wednesday
with credit given to you.
History
Date User Action Args
2026-09-01 01:18:25rouiljsetstatus: new -> open
assignee: rouilj
messages: + msg8505
nosy: + rouilj
2026-08-31 09:45:15wilsjsetnosy: + wilsj
2026-08-31 08:46:18matrecreate