So Let me present you Part 2 of this Thunderbird Lab and no the caffeine is not kicking in, I’m trying to avoid any intake of coffee… After the initial debug build, I tried to reproduce the issue to ensure that the problem persisted in order for me to fix it in the first place.
Reproducing The Problem

This is a draft copy of an email I sent to myself and as you can see that all the current invalid email addresses contain two or more “.” after the @.
Fixing The Code
To resolve this and thanks to Scott for pointing out “Find()” function belonging to the nsDependentString class; It allows us to check for a specific pattern in a string starting at any given index, and if the pattern is found it will return the position where the pattern first occurred else it will return “-1” meaning not found.
if (inString.FindChar(‘.’, pos) != kNotFound)
This is the original code and it only checks for a single ‘.’ after ‘pos’ which is the index of “@”….So to check for two ‘..’ I appended this to the current code
if (inString.FindChar(‘.’, pos) != kNotFound) && !inString.Find(“..”,pos))
Now the code simply says in the string “inString” look for a single “.” and not “..” and if both conditions are met then a valid email address is found and create the string literal as a “mailto” link.
Result

Seems like the code fixed the problem.
Bye