diff --git a/full/src/main/java/de/ids_mannheim/korap/authentication/LdapAuth3.java b/full/src/main/java/de/ids_mannheim/korap/authentication/LdapAuth3.java
index 129843f..bc091ad 100644
--- a/full/src/main/java/de/ids_mannheim/korap/authentication/LdapAuth3.java
+++ b/full/src/main/java/de/ids_mannheim/korap/authentication/LdapAuth3.java
@@ -77,12 +77,22 @@
         sUserDN = Filter.encodeValue(sUserDN);
         sUserPwd = Filter.encodeValue(sUserPwd);
 
+        SearchResult srchRes = search(sUserDN, sUserPwd, ldapConfigFilename);
+
+        if (srchRes == null || srchRes.getEntryCount() == 0) {
+            if (DEBUGLOG) System.out.printf("Finding '%s': no entry found!\n", sUserDN);
+            return LDAP_AUTH_RNAUTH;
+        }
+        return LDAP_AUTH_ROK;
+    }
+
+    public static SearchResult search(String sUserDN, String sUserPwd, String ldapConfigFilename) throws LDAPException {
         Map<String, String> ldapConfig;
         try {
             ldapConfig = loadProp(ldapConfigFilename);
         } catch (IOException e) {
             System.out.println("Error: LDAPAuth.login: cannot load Property file!");
-            return LDAP_AUTH_RINTERR;
+            return null;
         }
 
         assert ldapConfig != null;
@@ -137,7 +147,8 @@
                 lc = new LDAPConnection(socketFactory);
             } catch (GeneralSecurityException e) {
                 System.err.printf("Error: login: Connecting to LDAPS Server: failed: '%s'!\n", e);
-                return ldapTerminate(null, LDAP_AUTH_RCONNECT);
+                ldapTerminate(null);
+                return null;
             }
         } else {
             lc = new LDAPConnection();
@@ -149,7 +160,8 @@
         } catch (LDAPException e) {
             String fullStackTrace = org.apache.commons.lang.exception.ExceptionUtils.getFullStackTrace(e);
             System.err.printf("Error: login: Connecting to LDAP Server: failed: '%s'!\n", fullStackTrace);
-            return ldapTerminate(lc, LDAP_AUTH_RCONNECT);
+            ldapTerminate(lc);
+            return null;
         }
 
 
@@ -162,7 +174,8 @@
             if (DEBUGLOG) System.out.print("Binding: OK.\n");
         } catch (LDAPException e) {
             System.err.printf("Error: login: Binding failed: '%s'!\n", e);
-            return ldapTerminate(lc, LDAP_AUTH_RINTERR);
+            ldapTerminate(lc);
+            return null;
         }
 
         if (DEBUGLOG) System.out.printf("Debug: isConnected=%d\n", lc.isConnected() ? 1 : 0);
@@ -179,25 +192,52 @@
             if (DEBUGLOG) System.out.printf("Finding '%s': %d entries.\n", sUserDN, srchRes.getEntryCount());
         } catch (LDAPSearchException e) {
             System.err.printf("Error: login: Search for User failed: '%s'!\n", e);
-            return ldapTerminate(lc, LDAP_AUTH_RNAUTH);
+            ldapTerminate(lc);
+            return null;
         }
 
         if (srchRes.getEntryCount() == 0) {
             if (DEBUGLOG) System.out.printf("Finding '%s': no entry found!\n", sUserDN);
-            return ldapTerminate(lc, LDAP_AUTH_RNAUTH);
+            return null;
         }
 
-        return ldapTerminate(lc, LDAP_AUTH_ROK); // OK.
+        ldapTerminate(lc);
+        return srchRes;
     }
 
-    public static int ldapTerminate(LDAPConnection lc, int ret) {
+    public static String getEmail(String sUserDN, String ldapConfigFilename) throws LDAPException {
+        String sUserPwd = "*";
+        Map<String, String> ldapConfig;
+        try {
+            ldapConfig = loadProp(ldapConfigFilename);
+        } catch (IOException e) {
+            System.out.println("Error: LDAPAuth.login: cannot load Property file!");
+            return null;
+        }
+        final String emailAttribute = ldapConfig.getOrDefault("emailAttribute", "mail");
+
+        SearchResult searchResult = search(sUserDN, sUserPwd, ldapConfigFilename);
+
+        if (searchResult == null) {
+            return null;
+        }
+
+        for (SearchResultEntry entry : searchResult.getSearchEntries()) {
+            String mail = entry.getAttributeValue(emailAttribute);
+            if (mail != null) {
+                return mail;
+            }
+        }
+        return null;
+    }
+
+    public static void ldapTerminate(LDAPConnection lc) {
         if (DEBUGLOG) System.out.println("Terminating...");
 
         if (lc != null) {
             lc.close(null);
         }
         if (DEBUGLOG) System.out.println("closing connection: done.\n");
-        return ret;
     }
 
     private static void addSSLCipherSuites(String ciphersCsv) {
diff --git a/full/src/test/java/de/ids_mannheim/korap/authentication/LdapAuth3Test.java b/full/src/test/java/de/ids_mannheim/korap/authentication/LdapAuth3Test.java
index 9df6359..30d585b 100644
--- a/full/src/test/java/de/ids_mannheim/korap/authentication/LdapAuth3Test.java
+++ b/full/src/test/java/de/ids_mannheim/korap/authentication/LdapAuth3Test.java
@@ -132,4 +132,10 @@
         assertEquals(LDAP_AUTH_RNAUTH, LdapAuth3.login("testuser", "*", TEST_LDAPS_TS_CONF));
     }
 
+    @Test
+    public void testGettingMailForUid() throws LDAPException {
+        assertEquals("testuser@example.com", LdapAuth3.getEmail("testuser", TEST_LDAP_CONF));
+        assertEquals("peter@example.org", LdapAuth3.getEmail("testuser2", TEST_LDAPS_CONF));
+        assertEquals(null, LdapAuth3.getEmail("non-exsting", TEST_LDAPS_CONF));
+    }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/server/EmbeddedLdapServerTest.java b/full/src/test/java/de/ids_mannheim/korap/server/EmbeddedLdapServerTest.java
index 8532839..e5e5cb7 100644
--- a/full/src/test/java/de/ids_mannheim/korap/server/EmbeddedLdapServerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/server/EmbeddedLdapServerTest.java
@@ -42,4 +42,14 @@
     public void unauthorizedUsersAreNotAllowed() throws LDAPException {
         assertEquals(LDAP_AUTH_RNAUTH, LdapAuth3.login("yuser", "password", EMBEDDED_LDAP_DEFAULT_CONF));
     }
+
+    @Test
+    public void gettingMailForUser() throws LDAPException {
+        assertEquals("user2@example.com", LdapAuth3.getEmail("user2", EMBEDDED_LDAP_DEFAULT_CONF));
+    }
+
+    @Test
+    public void gettingMailForUnknownUserIsNull() throws LDAPException {
+        assertEquals(null, LdapAuth3.getEmail("user1000", EMBEDDED_LDAP_DEFAULT_CONF));
+    }
 }
