query("SELECT * FROM sub_domaines s WHERE s.domaine='".addslashes($dompart)."' AND s.type='squirrelmail';"); if ($db->next_record()) { $domain=$db->Record; return "http://".$domain["sub"].(($domain["sub"])?".":"").$domain["domaine"]; } $i++; } while (strpos($dompart,'.')!==false); // not found: search for a webmail in the admin user account $db->query("SELECT * FROM sub_domaines s WHERE s.compte=2000 AND s.type='squirrelmail';"); if ($db->next_record()) { $domain=$db->Record; return "http://".$domain["sub"].(($domain["sub"])?".":"").$domain["domaine"]; } } } /* Class Squirrelmail */