-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I know this is a little off topic for this list, but today I had a
customer who manages some ezmlm lists, and some of their subscribers
were using Barracuda devices with BATV features enabled.

The lists are private, and so, they cannot accept mail from addresses
which are not subscribed.  Due to how BATV and ezmlm work, ezmlm feels
the sender is not subscribed.

Below is the patch which allows ezmlm to handle BATV-like syntax in
the envelope sender.  It skips the "scheme=private=" part of the BATV
addressing.  It does *not* implement BATV addressing.

Hope this helps someone!

PS: I know the below code is not commented well, and the variables
names are silly, but I tossed it together quickly as a test, and it
just worked.

- --- ezmlm-0.53-idx-0.41/ezmlm-issubn.c  1999-12-24 14:15:01.000000000
- -0600
+++ ezmlm-0.53-idx-0.41-batv/ezmlm-issubn.c     2010-09-02
15:05:53.000000000 -0500
@@ -1,5 +1,6 @@
 /*$Id: ezmlm-issubn.c,v 1.13 1999/08/07 20:45:16 lindberg Exp $*/
 /*$Name: ezmlm-idx-040 $*/
+#include <stdio.h>
 #include "strerr.h"
 #include "env.h"
 #include "subscribe.h"
@@ -30,9 +31,57 @@
   int flagsub = 0;
   int opt;

+  char *h = NULL, *t = NULL, *f = NULL, *b = NULL;
+
   addr = env_get("SENDER");
   if (!addr) die_sender();     /* REQUIRE sender */

+  /*
+         Test for BATV-like syntax
+         <inter7.com>
+  */
+
+  for (h = addr; *h; h++) {
+        if (*h == '@')
+               break;
+   }
+
+  if (*h) {
+        /*
+                Find last =
+     */
+
+        for (t = (h - 1); t > addr; t--) {
+               if (*t == '=')
+                  break;
+         }
+
+          /*
+                  Find first =
+          */
+
+        if ((*t == '=') && (t > addr)) {
+               for (f = (addr + 1); f < t; f++) {
+                  if (*f == '=')
+                         break;
+                }
+
+               if ((*f == '=') && (f < t)) {
+#if 0
+                  fprintf(stderr, "BATV:[");
+                  for (b = addr; b <= t; b++)
+                         fputc(*b, stderr);
+                  fprintf(stderr, "] for [");
+                  for (b = (t + 1); *b; b++)
+                         fputc(*b, stderr);
+                  fprintf(stderr, "]\n");
+#endif
+
+                  addr = (t + 1);
+           }
+         }
+   }
+
   while ((opt = getopt(argc,argv,"nNvV")) != opteof)
     switch(opt) {
       case 'n': flagsub = 99; break;
- -- 
/*
    Matt Brookings <m...@inter7.com>       GnuPG Key FAE0672C
    Software developer                     Systems technician
    Inter7 Internet Technologies, Inc.     (815)776-9465
*/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkyAA+AACgkQIwet2/rgZyxPcQCfRN0fU06G5H1FgqJe3TfYi7BC
GcEAn2GAkRfovz2/EBHltIcF7RLNpIw2
=p/dQ
-----END PGP SIGNATURE-----

Reply via email to