Hello mbeltran,

If you are using vpopbull ou probably are also interested in my patch
sent some months ago to this maillist that still doesn't make part of
the official releases of vpopmail ...

#######################################################################

This patch makes vpopbull work with multiple domains in the argument
The base 5.4.x AFAIK only processes the first domain due to nested use of
strtok !!!!

--- ../vpopmail-5.4.10-IPLNet-9/vpopbull.c      2004-01-11 09:16:53.000000000 
+0000
+++ vpopbull.c  2005-05-18 14:00:30.000000000 +0100
@@ -127,16 +127,16 @@
   }
 
   if (( EmailFile[0] != 0 || DoNothing == 1) && Domain[0] != 0 ) {
-
+       char *idx;
     /* Process list of domains */
-    domain = strtok(Domain, " ");
+    domain = strtok_r(Domain, " ",&idx);
     while (domain != NULL ) {
         if((vget_assign(domain, domain_dir, sizeof(domain_dir), NULL, NULL)) 
!= NULL) {
             process_domain(domain,  fsi, fsx );
         } else {
             fprintf(stderr, "Error: domain %s does not exist\n", domain);
         }
-        domain = strtok(NULL, " ");
+        domain = strtok_r(NULL, " ",&idx);
     }
     vexit(0);
 
@@ -150,11 +150,12 @@
     }
 
     while ( fgets(TmpBuf, sizeof(TmpBuf), fsassign) != NULL ) {
-      if ( (alias=strtok(TmpBuf, TOKENS)) == NULL ) continue;
-      if ( (domain=strtok(NULL, TOKENS)) == NULL ) continue;
-      if ( (tmpstr=strtok(NULL, TOKENS)) == NULL ) continue;
-      if ( (tmpstr=strtok(NULL, TOKENS)) == NULL ) continue;
-      if ( (domain_dir=strtok(NULL, TOKENS)) == NULL ) continue;
+           char *idx;
+      if ( (alias=strtok_r(TmpBuf, TOKENS,&idx)) == NULL ) continue;
+      if ( (domain=strtok_r(NULL, TOKENS,&idx)) == NULL ) continue;
+      if ( (tmpstr=strtok_r(NULL, TOKENS,&idx)) == NULL ) continue;
+      if ( (tmpstr=strtok_r(NULL, TOKENS,&idx)) == NULL ) continue;
+      if ( (domain_dir=strtok_r(NULL, TOKENS,&idx)) == NULL ) continue;
       alias++;  /* point past leading + */
       alias[strlen(alias)-1] = '\0';  /* remove trailing - */
       if (strcmp (alias, domain) != 0) {

################################################################################

Friday, October 7, 2005, 4:13:54 PM, you wrote:

> Hello 


> Yesterday I want to get a list of all emails accounts on my mail server, so
> i run vpopbull. I got this message

> ~vpopmail/bin/vpopbull -n -V  >> ~mbeltran/cuentas.txt
> skipping promotionalrepaldo/home.123.hn (alias of promotionalhome.123.hn)
> skipping simon.intertel.hn (alias of hn2.com)
> skipping t.hn2.com (alias of david.intertel.hn)
> skipping ps.com.sv (alias of powersystems.com.sv)
> skipping data-sistemas.com (alias of magicsoftware.hn


> When i look the file cuentas.txt, in fact, vpopbull skip to list accounts in
> a alias domain.

> the question is: how can get the missing alias mails?

> I really need all accounts beause i need then for use in a recipients
> features for spamcontrol pathc

> thanks in advance

> Mario



-- 
Best regards,
 Pedro                            mailto:[EMAIL PROTECTED]

Reply via email to