Re: [vchkpw] Error in checking password length

2006-03-20 Thread Tom Collins
Actually, this patch is incorrect.  vadduser() takes the plaintext 
password, regardless of whether CLEAR_PASS is defined.


The current code behaves as it should.

--
Tom Collins  -  [EMAIL PROTECTED]
QmailAdmin: http://qmailadmin.sf.net/  Vpopmail: http://vpopmail.sf.net/

On Mar 17, 2006, at 6:23 AM, Riccardo Bini wrote:


Patch for checking password length.
Bye
Rick


--- vpopmail.c  2005-05-23 18:12:36.0 +0200
+++ /home/rick/sorgenti/vpopmail-5.4.12/vpopmail.c  2006-03-17
14:52:01.0 +0100
@@ -457,7 +457,11 @@
   if ( strlen(domain) > MAX_PW_DOMAIN ) 
return(VA_DOMAIN_NAME_TOO_LONG);

   if ( strlen(domain) < 3) return(VA_INVALID_DOMAIN_NAME);

+  if ( strlen(password) > MAX_PW_PASS )  return(VA_PASSWD_TOO_LONG);
+#ifdef CLEAR_PASS
   if ( strlen(password) > MAX_PW_CLEAR_PASSWD ) 
return(VA_PASSWD_TOO_LONG);

+#endif
+
   if ( strlen(gecos) > MAX_PW_GECOS )return(VA_GECOS_TOO_LONG);

   umask(VPOPMAIL_UMASK);
@@ -1350,7 +1354,11 @@
   if ( strlen(username) == 1 ) return(VA_ILLEGAL_USERNAME);
 #endif
   if ( strlen(domain) > MAX_PW_DOMAIN ) 
return(VA_DOMAIN_NAME_TOO_LONG);
-  if ( strlen(password) > MAX_PW_CLEAR_PASSWD ) 
return(VA_PASSWD_TOO_LONG);

+
+  if ( strlen(password) > MAX_PW_PASS )  return(VA_PASSWD_TOO_LONG);
+#ifdef CLEAR_PASS
+if ( strlen(password) > MAX_PW_CLEAR_PASSWD ) 
return(VA_PASSWD_TOO_LONG);

+#endif

   lowerit(username);
   lowerit(domain);






Re: [vchkpw] Bug: valias (version 5.4.9) always returns 0

2006-03-20 Thread Tom Collins

On Mar 19, 2006, at 2:51 AM, Daniel wrote:
the program "valias" (version 5.4.9) which is used to manage aliases 
on mail

addresses always returns 0 as return value on exit. That's a problem if
you're using valias in a script because you're not able to check the 
result

(success or not success) easily.


This change is going into the next release.  You can patch your copy of 
5.4.9 and recompile/reinstall to get that functionality.


Index: valias.c
===
RCS file: /cvsroot/vpopmail/vpopmail/valias.c,v
retrieving revision 1.3.2.1
diff -u -r1.3.2.1 valias.c
--- valias.c17 Jan 2006 18:50:22 -  1.3.2.1
+++ valias.c21 Mar 2006 04:51:42 -
@@ -95,6 +95,7 @@
 valias_select_names_end();
} else {
 fprintf(stderr, "Please enter domain name only.\n" );
+   vexit(-1);
}
break;
 
@@ -107,8 +108,9 @@
tmpalias = valias_select_next();
}
if (AliasExists) {
-   printf ("Error: alias %s -> %s already exists.\n",
+   fprintf (stderr, "Error: alias %s -> %s already 
exists.\n",
Email, AliasLine);
+   vexit(-1);
} else {
valias_insert( Alias, Domain, AliasLine );
}
@@ -119,7 +121,8 @@
break;
 
 default:
-   printf("error, Alias Action '%d' is invalid\n", AliasAction);
+   fprintf(stderr, "error, Alias Action '%d' is invalid\n", 
+   AliasAction);
break;
}
return(vexit(0));
@@ -178,14 +181,14 @@
if ( optind < argc ) {
snprintf(Email, sizeof(Email), "%s", argv[optind]);
 if ( (i = parse_email( Email, Alias, Domain, sizeof(Alias))) 
!= 0 ) {
-  printf("Error: %s\n", verror(i));
+  fprintf(stderr, "Error: %s\n", verror(i));
   vexit(i);
 }
++optind;
} 
 
if ( Email[0] == 0 ) {
-   printf("must supply alias email address\n");
+   fprintf(stderr, "must supply alias email address\n");
usage();
vexit(-1);
}



Tom Collins
Tom Logic LLC
PO Box 5717
Napa, CA 94581
(707) 265-6622
(707) 265-6646 fax
[EMAIL PROTECTED]



Re: [vchkpw] List aliases of domain

2006-03-20 Thread Tom Collins

On Mar 20, 2006, at 4:27 PM, Benjamin Owens wrote:
I'm trying to find a way to list all the aliases that a domain has.. 
for
example, I have both oldeportfish.com and oldportfish.com, with the 
latter

being an alias of oldeportfish.com.

If I run vdominfo on oldportfish.com it shows that it is an alias of
oldeportfish.com, but how do I find all the aliases of 
oldeportfish.com (if

there are possibly more that I don't know about.)


I don't think there's a simple way to do it.  Here are two ways that 
will work, but aren't pretty.


~vpopmail/bin/vdominfo | grep "alias of oldeportfish.com"

grep ":oldeportfish.com:" /var/qmail/users/assign | cut -d: -f1
(and then strip/ignore the leading "+" and trailing "-")

--
Tom Collins  -  [EMAIL PROTECTED]
QmailAdmin: http://qmailadmin.sf.net/  Vpopmail: http://vpopmail.sf.net/



Re: [vchkpw] Qmail Courier-Imap (authlib) and Vpopmail trouble

2006-03-20 Thread Jeremy Kitchen
On Saturday 18 March 2006 18:21, Steve B wrote:
> > I am not trying to say it's not a vpopmail issue, however, we need to
> > rule out other things like completely broken qmail setups.  Having LWQ as
> > a base is much easier than having gentoo's awful, horrible qmail ebuilds
> > in place.

> Not a problem.  I will wipe my current Qmail installation and do a LWQ
> installation.  I was really hoping this was a common error :)  My only
> issue with using LWQ is that as you know Gentoo doesn't use standard
> init scripts and every time I try and create my own it never works..
> What is a "recommended" guide for installing vpopmail after a LWQ
> installation?  Thanks

the INSTALL file in the vpopmail source.

it takes all of about 5 steps (3 of which are ./configure && make && make 
install) to set up vpopmail on an LWQ setup.

-Jeremy

> V/R
> Steve

-- 
Jeremy Kitchen ++ [EMAIL PROTECTED]

In the beginning was The Word and The Word was Content-type: text/plain
  -- The Word of Bob.


pgpp84MC2XUOf.pgp
Description: PGP signature


[vchkpw] List aliases of domain

2006-03-20 Thread Benjamin Owens
Hello all again.

I'm trying to find a way to list all the aliases that a domain has.. for 
example, I have both oldeportfish.com and oldportfish.com, with the latter 
being an alias of oldeportfish.com.

If I run vdominfo on oldportfish.com it shows that it is an alias of 
oldeportfish.com, but how do I find all the aliases of oldeportfish.com (if 
there are possibly more that I don't know about.)

Many thanks!


Re: [vchkpw] Qmail Courier-Imap (authlib) and Vpopmail trouble

2006-03-20 Thread Bob Hutchinson
On Sunday 19 Mar 2006 02:21, Steve B wrote:
> > I am not trying to say it's not a vpopmail issue, however, we need to
> > rule out other things like completely broken qmail setups.  Having LWQ as
> > a base is much easier than having gentoo's awful, horrible qmail ebuilds
> > in place.
> >
> > -Jeremy
> >
> > --
> > Jeremy Kitchen ++ [EMAIL PROTECTED]
> >
> > In the beginning was The Word and The Word was Content-type: text/plain
> >  -- The Word of Bob.
>
> Not a problem.  I will wipe my current Qmail installation and do a LWQ
> installation.  I was really hoping this was a common error :)  My only
> issue with using LWQ is that as you know Gentoo doesn't use standard
> init scripts and every time I try and create my own it never works..
> What is a "recommended" guide for installing vpopmail after a LWQ
> installation?  Thanks

Bill Shupp's Toaster instructions at http://shupp.org/toaster/ should help

>
> V/R
> Steve

-- 
-
Bob Hutchinson
Midwales dot com
-