// this is case #1 : a whole address
String normalized = (new RFC822NameAttribute(arg0)).getValue();
boolResult = normalized.equals(arg1);
} else if (arg0.charAt(0) == '.') {
// this is case #3 : a sub-domain
boolResult = arg1.endsWith(arg0.toLowerCase());
} else {
// this is case #2 : any mailbox at a specific domain
String mailDomain = arg1.substring(arg1.indexOf('@') + 1);
boolResult = arg0.toLowerCase().equals(mailDomain);
}