diff --git a/hsarback/src/de/hsadmin/autoconfig/AutoconfigAutodiscoverServlet.java b/hsarback/src/de/hsadmin/autoconfig/AutoconfigAutodiscoverServlet.java index ab2a868..349ea80 100644 --- a/hsarback/src/de/hsadmin/autoconfig/AutoconfigAutodiscoverServlet.java +++ b/hsarback/src/de/hsadmin/autoconfig/AutoconfigAutodiscoverServlet.java @@ -51,7 +51,7 @@ public class AutoconfigAutodiscoverServlet extends HttpServlet { final String domain = addrParts[1]; final Transaction transaction = new Transaction("autoconfig"); final EntityManager em = transaction.getEntityManager(); - final Query emailQuery = em.createQuery("SELECT addr FROM EMailAddresses WHERE addr.localpart = :localpart AND addr.domain = :domain AND ( addr.subdomain IS NULL OR addr.subdomain = :subdomain)"); + final Query emailQuery = em.createQuery("SELECT addr FROM EMailAddresses addr WHERE addr.localpart = :localpart AND addr.domain = :domain AND ( addr.subdomain IS NULL OR addr.subdomain = :subdomain)"); emailQuery.setParameter("subdomain", ""); emailQuery.setParameter("domain", domain); emailQuery.setParameter("localpart", localpart); @@ -62,7 +62,7 @@ public class AutoconfigAutodiscoverServlet extends HttpServlet { return; } final EMailAddress emailAddress = (EMailAddress) emailResult; - final Query mboxQuery = em.createQuery("SELECT mbox FROM UnixUsers WHERE mbox.name = :target"); + final Query mboxQuery = em.createQuery("SELECT mbox FROM UnixUsers mbox WHERE mbox.name = :target"); final String target = emailAddress.getTarget(); if (target == null || target.length() < 5 || (target.length() > 6 && target.charAt(5) != '-')) { transaction.close();