Maybe because his regex only match one time, if more than one email is present in a line, it won't catch it, try :
on *:SOCKREAD:mysock: {
var %line,%a
sockread %line
if ($regex(%line, /<passportName>(.+?)<\/passportName>/g)) {
%a = $regml(0)
while (%a) { echo -a contact: $regml(%a) | dec %a }
}
}