Re: [vchkpw] Re: Feature request for vaddaliasdomain

2003-09-25 Thread Nick Harring
Erik Bourget wrote:

Paul L. Allen [EMAIL PROTECTED] writes:

 

Because vpopmail bridges so many divides, it cannot intuit what you want.
It doesn't know if you're using cdb for everything or using MySQL for
everything or whatever unless you tell it.  But, wherever possible, it
should be DWIM.  Tom's proposed patch allowing real and alias domain in
any order is very much DWIM that pleases both sides of te argument.
   

You know, intense as this whole argument is, the fact remains that DWIM is no
substitute for proper documentation.  Patching software to accept every
possible 'first-guess' input isn't just sloppy, it's unmaintainable.
Maintainers -

Please don't implement this.  Spend the time patching writing down the one
supported way instead.
- Erik Bourget

 

This is easily properly documentable, there are only four cases, each of 
which has a clear, easily explainable outcome.

Here's a stab at usable documentation:
Usage: vaddaliasdomain [options] x.com y.com
vaddaliasdomain requires two domains as arguments in an order 
independent fashion. vaddaliasdomain then aliases one domain to the 
other based on the following logic:
If x.com exists and y.com doesn't, y.com becomes an alias for x.com.
If y.com exists and x.com doesn't, x.com becomes an alias for y.com.
If neither or both exist, vaddaliasdomain exits with an error.

That wasn't so hard now was it?
Cheers,
Nick Harring


Re: [vchkpw] Re: Feature request for vaddaliasdomain

2003-09-25 Thread Nick Harring
Paul L. Allen wrote:

Erik Bourget writes:

 

You know, intense as this whole argument is, the fact remains that DWIM
is no substitute for proper documentation.
   

Let's see, the documentation says vaddaliasdomain original alias.
If you do what the documentation says, it works.  If you reverse the
arguments, it still works.  It would be nice to document that the
arguments can be either way around but it is not strictly necessary.
 

Patching software to accept every possible 'first-guess' input isn't
just sloppy, it's unmaintainable.
   

 

irrelevant posturing snipped

This whole argument is ridiculous. The correctness of design doesn't 
really rely on what some random users first guess of how it should work 
would be, because they're wrong to be guessing when man pages are 
supplied. The One Correct Way of using new software in unix is to read 
the docs first. For windows you need to read the docs twice, but that's 
another discussion.
I already posted verbiage that I think clearly explains how the new 
design would work, such that anyone who can read and comprehend with 
basic logic would get it right. However, I must agree with many others 
that silently doing the right thing without changing the docs is a bad, 
bad idea. Perl does what you mean, but everyplace it does so there's 
thorough documentation telling you not just that it does so, but also 
how it knows what you mean, so that just in case you know you don't mean 
what its going to think you mean, you can work around it.
I happen to not care about the order of the arguments, however I do very 
much care that the documentation stay accurate for any future versions 
of vpopmail.

Cheers,
Nick


Re: [vchkpw] Re: Feature request for vaddaliasdomain

2003-09-24 Thread JB

The worst one of our clients has managed so far is 13, added in dribs and
drabs of two or three at a time.  For one it makes no difference.  For
hundreds I'd go the perl script reading a text file route.  For twos and
threes the current argument order of vaddaliasdomain is annoying.
 

Write a shell script that takes the arguments in the order you want and 
pass them to vaddaliasdomain in the order expected,

i.e.

#!/bin/bash

`~vpopmail/bin/vaddaliasdomain $2 $1`

~jb





RE: [vchkpw] Re: Feature request for vaddaliasdomain

2003-09-24 Thread webmaster
Gotta give this Paul guy a round of applause.
I have never seen anyone who uses his sheer incompetency as a brutal attack
weapon.
Have you ?

Let's try this Paul,
if it is soo important to you and it seems from what you're saying that it
is also soo important to everyone else to fix this OBVIOUS DEFECT,  we
would love for you to submit a patch at once so we can all benefit.
This way, only a bit of your precious time is wasted and not THOUSANDS of
man hours spent by mindless people try to back-space and left-arrow.

From the sound of the horn, you can do this with your eyes closed so we
won't feel too imposing.

Thanks in advance for the patch.

Lu

 -Original Message-
 From: Paul L. Allen [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, September 24, 2003 3:07 PM
 To: JB
 Cc: [EMAIL PROTECTED]
 Subject: [vchkpw] Re: Feature request for vaddaliasdomain
 
 
 
 You don't read so good, do you?
 
 JB writes:
 
  Write a shell script that takes the arguments in the order you want 
  and
  pass them to vaddaliasdomain in the order expected,
 
 I already explained that while I am more than capable of 
 coming up with that idea and implementing it all by myself, 
 that such a solution does not help the many others who have 
 this same problem.  Now you may think it 
 sensible that hundreds or thousands of people each spend time 
 writing a script that overcomes an OBVIOUS DEFECT in a piece 
 of software but I do not.  I think it more sensible to fix 
 the defect at source, thereby minimizing the total amount of 
 person-hours wasted.
 
 But since you did not bother to read (or could not 
 comprehend) my previous message where I stated that, no doubt 
 this too will pass several miles over your head.
 
 GOOD software design requires creating a user interface that 
 is optimized for the common case.  The common case is people 
 who already know about the order in which ln expects its 
 arguments and who have to add several alias domains at once.  
 I'm picking up some vibes here... Apparently, you do not 
 understand that either.  Me used to having to do a lot of 
 extra key-presses.  Me no want change.  Change bad. Me hated 
 vpopmail being ported from abacus to computer.
 
 -- 
 Paul Allen
 Softflare Support
 
 




Re: [vchkpw] Re: Feature request for vaddaliasdomain

2003-09-24 Thread Toasterz Admin
Paul L. Allen wrote:

You don't read so good, do you?

snappy opener,  i wonder what prompted this? whiners hate being called
whiners.
you are obviously a person who loves to whine and when not whining,
likes to rage.
am i correct in this? no need to reply, i'm confident in my analysis.
a better one could be... /you don't listen so good, do you/

JB writes:

 

Write a shell script that takes the arguments in the order you want and 
pass them to vaddaliasdomain in the order expected,
   

I already explained that while I am more than capable of coming up with
that idea and implementing it all by myself, that such a solution does not
help the many others who have this same problem.  Now you may think it 
sensible that hundreds or thousands of people each spend time writing
a script that overcomes an OBVIOUS DEFECT in a piece of software but I
do not.  I think it more sensible to fix the defect at source, thereby
minimizing the total amount of person-hours wasted.

if you're so incredibly competent, why don't you grasp the simple
premise of open source.
--to wit: write the incredibly easy and simple patch. other may improve
on it. wasting no person-hours.
post it to the list thereby contributing meaningfully to open source.
if this OBVIOUS DEFECT is so abhorrent that 100,000 grateful souls
immediately congratulate you on
your brilliant and elegent solution to this nagging and OBVIOUS DEFECT,
then you can be fairly certain
that you are justified in your extended whine.
the only OBVIOUS DEFECT here is your highly evolved sense of whining.

But since you did not bother to read (or could not comprehend) my
previous message where I stated that, no doubt this too will pass
several miles over your head.
you are such a deep thinker... wait, i mean whiner.

GOOD software design requires creating a user interface that is
optimized for the common case.  The common case is people who already
know about the order in which ln expects its arguments and who have to
add several alias domains at once.  I'm picking up some vibes here...
Apparently, you do not understand that either.  Me used to having
to do a lot of extra key-presses.  Me no want change.  Change bad.
Me hated vpopmail being ported from abacus to computer.
i'm picking up some vibes here too...
you're whining about the incredibly complicated case of two (2)
possibilities and 2 or 3 domains at a time.
the vibe is that you're a -- need i say it again -- whiner..
get with the program, read the source. make patches. stop whining.
contribute.
kelley g






Re: [vchkpw] Re: Feature request for vaddaliasdomain

2003-09-24 Thread X-Istence
Stop bickering please, common.

Difference between the origional and that what i changed around

Breached# diff vaddaliasdomain.c.backup vaddaliasdomain.c
56c56,57
 printf(vaddaliasdomain: usage: [options] alias_domain 
real_domain\n);
---
 /*  printf(vaddaliasdomain: usage: [options] alias_domain 
real_domain\n); */
 printf(vaddaliasdomain: usage: [options] real_domain 
alias_domain\n);
79a81
 /* We want the real domain to come first, so lets comment this, and 
move it after the real domain gets set
83a86
 */
84a88
 /* Get the real domain from the command line first */
88a93,99

 /* Code from above ^^ */
 if ( optind  argc ) {
 snprintf(Domain_alias, sizeof(Domain_alias), %s, argv[optind]);
 ++optind;
 }


The name vaddaliasdomain.c:

/*
* Copyright (C) 1999-2002 Inter7 Internet Technologies, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include stdio.h
#include stdlib.h
#include unistd.h
#include string.h
#include pwd.h
#include sys/types.h
#include sys/stat.h
#include fcntl.h
#include signal.h
#include config.h
#include vpopmail.h
#define MAX_BUFF 256

char Domain_real[MAX_BUFF];
char Domain_alias[MAX_BUFF];
void usage();
void get_options(int argc,char **argv);
int main(int argc, char *argv[])
{
int err;
   get_options(argc,argv);

   err = vaddaliasdomain( Domain_alias, Domain_real);
   if ( err != VA_SUCCESS ) {
   printf(Error: %s\n, verror(err));
   vexit(err);
   }
   return(vexit(0));
}
void usage()
{
/*  printf(vaddaliasdomain: usage: [options] alias_domain 
real_domain\n); */
   printf(vaddaliasdomain: usage: [options] real_domain alias_domain\n);
   printf(options: -v (print version number)\n);
}

void get_options(int argc,char **argv)
{
int c;
int errflag;
   memset(Domain_real, 0, sizeof(Domain_real));
   memset(Domain_alias, 0, sizeof(Domain_alias));
   errflag = 0;
   while( !errflag  (c=getopt(argc,argv,v)) != -1 ) {
 switch(c) {
   case 'v':
 printf(version: %s\n, VERSION);
 break;
   default:
 errflag = 1;
 break;
 }
   }
/* We want the real domain to come first, so lets comment this, and move 
it after the real domain gets set
   if ( optind  argc ) {
   snprintf(Domain_alias, sizeof(Domain_alias), %s, argv[optind]);
   ++optind;
   }
*/

/* Get the real domain from the command line first */
   if ( optind  argc ) {
   snprintf(Domain_real, sizeof(Domain_real), %s, argv[optind]);
   ++optind;
   }
/* Code from above ^^ */
   if ( optind  argc ) {
   snprintf(Domain_alias, sizeof(Domain_alias), %s, argv[optind]);
   ++optind;
   }
   if ( Domain_alias[0] == 0 || Domain_real[0] == 0 ) {
   usage();
   vexit(-1);
   }
   if ( strcmp( Domain_real, Domain_alias ) == 0 ) {
   printf(new domain and old domain are the same!\n);
   usage();
   vexit(-1);
   }
}
Have fun :), now it is:

~vpopmail/bin/vaddaliasdomain existing_domain alias_domain






Re: [vchkpw] Re: Feature request for vaddaliasdomain

2003-09-24 Thread X-Istence
Stop bickering please, common.

Difference between the origional and that what i changed around

Breached# diff vaddaliasdomain.c.backup vaddaliasdomain.c
56c56,57
 printf(vaddaliasdomain: usage: [options] alias_domain 
real_domain\n);
---
 /*  printf(vaddaliasdomain: usage: [options] alias_domain 
real_domain\n); */
 printf(vaddaliasdomain: usage: [options] real_domain 
alias_domain\n);
79a81
 /* We want the real domain to come first, so lets comment this, and 
move it after the real domain gets set
83a86
 */
84a88
 /* Get the real domain from the command line first */
88a93,99

 /* Code from above ^^ */
 if ( optind  argc ) {
 snprintf(Domain_alias, sizeof(Domain_alias), %s, 
argv[optind]);
 ++optind;
 }


The name vaddaliasdomain.c:

/*
* Copyright (C) 1999-2002 Inter7 Internet Technologies, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include stdio.h
#include stdlib.h
#include unistd.h
#include string.h
#include pwd.h
#include sys/types.h
#include sys/stat.h
#include fcntl.h
#include signal.h
#include config.h
#include vpopmail.h
#define MAX_BUFF 256

char Domain_real[MAX_BUFF];
char Domain_alias[MAX_BUFF];
void usage();
void get_options(int argc,char **argv);
int main(int argc, char *argv[])
{
int err;
  get_options(argc,argv);

  err = vaddaliasdomain( Domain_alias, Domain_real);
  if ( err != VA_SUCCESS ) {
  printf(Error: %s\n, verror(err));
  vexit(err);
  }
  return(vexit(0));
}
void usage()
{
/*  printf(vaddaliasdomain: usage: [options] alias_domain 
real_domain\n); */
  printf(vaddaliasdomain: usage: [options] real_domain alias_domain\n);
  printf(options: -v (print version number)\n);
}

void get_options(int argc,char **argv)
{
int c;
int errflag;
  memset(Domain_real, 0, sizeof(Domain_real));
  memset(Domain_alias, 0, sizeof(Domain_alias));
  errflag = 0;
  while( !errflag  (c=getopt(argc,argv,v)) != -1 ) {
switch(c) {
  case 'v':
printf(version: %s\n, VERSION);
break;
  default:
errflag = 1;
break;
}
  }
/* We want the real domain to come first, so lets comment this, and move 
it after the real domain gets set
  if ( optind  argc ) {
  snprintf(Domain_alias, sizeof(Domain_alias), %s, argv[optind]);
  ++optind;
  }
*/

/* Get the real domain from the command line first */
  if ( optind  argc ) {
  snprintf(Domain_real, sizeof(Domain_real), %s, argv[optind]);
  ++optind;
  }
/* Code from above ^^ */
  if ( optind  argc ) {
  snprintf(Domain_alias, sizeof(Domain_alias), %s, argv[optind]);
  ++optind;
  }
  if ( Domain_alias[0] == 0 || Domain_real[0] == 0 ) {
  usage();
  vexit(-1);
  }
  if ( strcmp( Domain_real, Domain_alias ) == 0 ) {
  printf(new domain and old domain are the same!\n);
  usage();
  vexit(-1);
  }
}
Have fun , now it is:

~vpopmail/bin/vaddaliasdomain existing_domain alias_domain

This is my patch, it doesnt allow for both types, but does what you want :).




Re: [vchkpw] Re: Feature request for vaddaliasdomain

2003-09-24 Thread Anders Brander
Hi,

On Thu, 2003-09-25 at 03:26, Paul L. Allen wrote:
  A bit odd to document,
 Damn right.  I still haven't figured out a sensible usage message.

I think we should just ignore the old way of calling vaddaliasdomain
in the usage message, in that way new users will adobt the new way of
doing things. The autosensing will ensure that we don't brake old script
etc.

  but otherwise a fabulous idea.
 Bad Anders.  Bad, bad, Anders.  Letting people do what they find
 easiest is BAD.  Ask the people who criticised me for suggesting it.

I will NOT participate in that discussion. I provided a simple patch,
try it, test it, feel it. No more, no less.

[snip]

/Anders





Re: [vchkpw] Re: Feature request for vaddaliasdomain

2003-09-24 Thread Anders Brander
Hi,

On Thu, 2003-09-25 at 03:46, Paul L. Allen wrote:
  I think we should just ignore the old way of calling vaddaliasdomain
  in the usage message, in that way new users will adobt the new way of
  doing things.
 Ummm, that implies that one way is more correct than the other.  I do
 not believe that to be the case.  I believe that one way is more natural
 to some of us than the other and that each of us should be able to use
 the interface we prefer.

Well... I have nothing to say.

  The autosensing will ensure that we don't brake old script
 Yeah, old scripts will still work.  But old sysadmins like me will get
 confused (I'm old, it's nearly 3am and I've had a lot of wine so I'm
 easily confused).  We do something and it works and then later we look at 
 the usage message and find that it COULD NOT HAVE WORKED.  That causes to
 go
 diving into the code to see what the hell is happening...  The usage
 message MUST explain both alternatives.  It will be a little clumsy, to
 be sure, but it must explain both alternatives.

Hummm Or something like:
... the two domains to be aliased ... - without saying which is which,
for the user it doesn't matter much.

A usage like:
vaddaliasdomain [options] domain-a.tld domain-b.tld - nothing to be
confused about.

/Anders