Hi,

> I already found the place in the code where the email is printed
> (mod_mbox_file.c in 879), but my knowledge of C is too limited to
> write a patch.

Here it is ;-)

% cd mod_mbox
% patch -p0 < ../mod_mbox_antispam.patch

- Sam
-- 
Maxime Petazzoni (http://www.bulix.org)
 -- gone crazy, back soon. leave message.
Index: module-2.0/mod_mbox_file.c
===================================================================
--- module-2.0/mod_mbox_file.c  (revision 185050)
+++ module-2.0/mod_mbox_file.c  (working copy)
@@ -22,7 +22,33 @@
  */
 
 #include "mod_mbox.h"
+#include <string.h>
 
+/** Antispam protection.
+ *
+ */
+char *email_antispam(char *email)
+{
+    char *pos;
+    int i, p;
+
+    pos = strrchr(email, '@');
+
+    if (!pos) {
+        return email;
+    }
+
+    p = pos - email - 1;
+
+    for (i=0 ; i<3 ; i++) {
+        if ((p - i) > 0) {
+           email[p-i] = '.';
+       }
+    }
+
+    return email;
+}
+
 /*
  * This function prints one message 
  */
@@ -33,7 +59,7 @@
                baseURI, 
                URI_ESCAPE_OR_BLANK(r->pool, m->msgID),
                ESCAPE_OR_BLANK(r->pool, m->subject),
-               ESCAPE_OR_BLANK(r->pool, m->str_from),
+               email_antispam(ESCAPE_OR_BLANK(r->pool, m->str_from)),
                ESCAPE_OR_BLANK(r->pool, m->str_date));
 }
 
@@ -887,7 +913,7 @@
             "<HR>\n<PRE>\n", 
             ap_escape_html(f->r->pool, m->subject), 
             ctx->baseURI, ctx->baseURI, ctx->baseURI,
-            ESCAPE_OR_BLANK(f->r->pool, m->from),
+            email_antispam(ESCAPE_OR_BLANK(f->r->pool, m->from)),
             ESCAPE_OR_BLANK(f->r->pool, m->subject),
             ESCAPE_OR_BLANK(f->r->pool, m->str_date),
             ctx->baseURI, temp,

Attachment: signature.asc
Description: Digital signature

Reply via email to