<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-CA">
	<id>http://help.computerisms.ca/index.php?action=history&amp;feed=atom&amp;title=Mod_auth_imap_for_apache2.4_patch</id>
	<title>Mod auth imap for apache2.4 patch - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://help.computerisms.ca/index.php?action=history&amp;feed=atom&amp;title=Mod_auth_imap_for_apache2.4_patch"/>
	<link rel="alternate" type="text/html" href="http://help.computerisms.ca/index.php?title=Mod_auth_imap_for_apache2.4_patch&amp;action=history"/>
	<updated>2026-04-24T17:57:19Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>http://help.computerisms.ca/index.php?title=Mod_auth_imap_for_apache2.4_patch&amp;diff=815&amp;oldid=prev</id>
		<title>Bob: Created page with &quot;The following patch can be applied to the mod_auth_imap module found at http://ben.brillat.net/projects/mod_auth_imap/ to make it work with apache2.4  &lt;pre&gt; --- mod_auth_imap....&quot;</title>
		<link rel="alternate" type="text/html" href="http://help.computerisms.ca/index.php?title=Mod_auth_imap_for_apache2.4_patch&amp;diff=815&amp;oldid=prev"/>
		<updated>2016-01-01T02:12:02Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;The following patch can be applied to the mod_auth_imap module found at http://ben.brillat.net/projects/mod_auth_imap/ to make it work with apache2.4  &amp;lt;pre&amp;gt; --- mod_auth_imap....&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The following patch can be applied to the mod_auth_imap module found at http://ben.brillat.net/projects/mod_auth_imap/ to make it work with apache2.4&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--- mod_auth_imap.c.orig	2015-09-15 20:51:06.321378328 -0400&lt;br /&gt;
+++ mod_auth_imap.c	2015-09-15 20:54:18.553530740 -0400&lt;br /&gt;
@@ -20,6 +20,8 @@&lt;br /&gt;
 #include &amp;quot;apr_dbm.h&amp;quot;&lt;br /&gt;
 #include &amp;quot;apr_md5.h&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
+#include &amp;quot;mod_auth.h&amp;quot;&lt;br /&gt;
+&lt;br /&gt;
 #include &amp;quot;httpd.h&amp;quot;&lt;br /&gt;
 #include &amp;quot;http_config.h&amp;quot;&lt;br /&gt;
 #include &amp;quot;http_core.h&amp;quot;&lt;br /&gt;
@@ -346,56 +348,10 @@&lt;br /&gt;
  * 	checks the username against the allowed users in the .htaccess or httpd.conf&lt;br /&gt;
  * 	returns &amp;quot;OK&amp;quot;, &amp;quot;DECLINED&amp;quot;, or &amp;quot;HTTP_UNAUTHORIZED&amp;quot; (see defines)&lt;br /&gt;
  *******************************************************************************/    &lt;br /&gt;
-static int imap_check_user_access (request_rec *r) {&lt;br /&gt;
-    imap_config_rec *sec =&lt;br /&gt;
-     (imap_config_rec *)ap_get_module_config (r-&amp;gt;per_dir_config, &amp;amp;auth_imap_module);&lt;br /&gt;
-    char *user = r-&amp;gt;user;&lt;br /&gt;
-    int m = r-&amp;gt;method_number;&lt;br /&gt;
-    int method_restricted = 0;&lt;br /&gt;
-    register int x;&lt;br /&gt;
-    const char *t, *w;&lt;br /&gt;
-    const apr_array_header_t *reqs_arr = ap_requires (r);&lt;br /&gt;
-    require_line *reqs;&lt;br /&gt;
-&lt;br /&gt;
-    if (!reqs_arr)&lt;br /&gt;
-        return (OK);&lt;br /&gt;
-    reqs = (require_line *)reqs_arr-&amp;gt;elts;&lt;br /&gt;
-  &lt;br /&gt;
-    for(x=0; x &amp;lt; reqs_arr-&amp;gt;nelts; x++) {&lt;br /&gt;
-      &lt;br /&gt;
-	if (! (reqs[x].method_mask &amp;amp; (1 &amp;lt;&amp;lt; m))) continue;&lt;br /&gt;
-	&lt;br /&gt;
-	method_restricted = 1;&lt;br /&gt;
-&lt;br /&gt;
-        t = reqs[x].requirement;&lt;br /&gt;
-        w = ap_getword(r-&amp;gt;pool, &amp;amp;t, &amp;#039; &amp;#039;);&lt;br /&gt;
-        if(!strcmp(w,&amp;quot;valid-user&amp;quot;))&lt;br /&gt;
-            return OK;&lt;br /&gt;
-        if(!strcmp(w,&amp;quot;user&amp;quot;)) {&lt;br /&gt;
-            while(t[0]) {&lt;br /&gt;
-                w = ap_getword_conf (r-&amp;gt;pool, &amp;amp;t);&lt;br /&gt;
-                if(!strcmp(user,w))&lt;br /&gt;
-                    return OK;&lt;br /&gt;
-            }&lt;br /&gt;
-        }&lt;br /&gt;
-	else if(!strcmp(w,&amp;quot;group&amp;quot;))&lt;br /&gt;
-	        return DECLINED;&lt;br /&gt;
-    }&lt;br /&gt;
-    &lt;br /&gt;
-    if (!method_restricted)&lt;br /&gt;
-      return OK;&lt;br /&gt;
-&lt;br /&gt;
-    if (!(sec-&amp;gt;imap_authoritative))&lt;br /&gt;
-      return DECLINED;&lt;br /&gt;
-&lt;br /&gt;
-    ap_note_basic_auth_failure (r);&lt;br /&gt;
-    return HTTP_UNAUTHORIZED;&lt;br /&gt;
-}&lt;br /&gt;
 &lt;br /&gt;
 static void imap_register_hooks(apr_pool_t *p) {&lt;br /&gt;
-    ap_hook_check_user_id(imap_authenticate_basic_user, NULL, NULL, &lt;br /&gt;
-                          APR_HOOK_MIDDLE);&lt;br /&gt;
-    ap_hook_auth_checker(imap_check_user_access, NULL, NULL, APR_HOOK_MIDDLE);&lt;br /&gt;
+	ap_register_auth_provider(p, AUTHN_PROVIDER_GROUP, &amp;quot;IMAP&amp;quot;, AUTHN_PROVIDER_VERSION, &amp;amp;auth_imap_module, AP_AUTH_INTERNAL_PER_CONF);&lt;br /&gt;
+        ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, &amp;quot;valid-user&amp;quot;, AUTHZ_PROVIDER_VERSION, &amp;amp;auth_imap_module, AP_AUTH_INTERNAL_PER_CONF);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 /*******************************************************************************&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bob</name></author>
	</entry>
</feed>