Re: [vchkpw] The future of valias other topics

2007-01-08 Thread drew-vpopmail
 First a quick review of the new features added to the 5.4.18 release:
 
 o The option of running a script each time a user or domain is added,
 deleted or modified.  This can be used for sending notification
 messages, maintaining a list of valid users and what ever else you may
 need to do.  See README.onchange
 
 o Complete alias handling.  With this version you can add an address to
 an alias, delete an address from an alias, delete an entire alias, or
 delete all aliases from a domain.  That pretty much takes care of all
 the possibilities for unordered aliases.  Full support is available in
 cdb and MySQL back ends.  The MySQL code can be used as a template for
 other back ends.
 

Attached is a patch for 5.4.18 to enable alias line removal from .qmail 
based aliases and the implementation of alias line removal using the 
valias command line program.

Am I meant to be posting patches here (such as my previous double free 
problem in vpalias.c) or to another list ?
diff -uPr vpopmail-5.4.18.orig/configure vpopmail-5.4.18/configure
--- vpopmail-5.4.18.orig/configure  2006-12-31 04:41:21.0 +
+++ vpopmail-5.4.18/configure   2007-01-05 09:21:29.0 +
@@ -6620,19 +6620,19 @@
   1*|y*|Y*)
 echo $as_me:$LINENO: result: yes 5
 echo ${ECHO_T}yes 6
-if test $USE_SQL != 1
-then
-{ { echo $as_me:$LINENO: error: valias option is only 
supported in the SQL authentication modules 5
-echo $as_me: error: valias option is only supported in the SQL authentication 
modules 2;}
-   { (exit 1); exit 1; }; }
-else
+#if test $USE_SQL != 1
+#then
+#{ { echo $as_me:$LINENO: error: valias option is only 
supported in the SQL authentication modules 5
+#echo $as_me: error: valias option is only supported in the SQL 
authentication modules 2;}
+#   { (exit 1); exit 1; }; }
+#else
 VALIAS=1
 
 cat confdefs.h _ACEOF
 #define VALIAS $VALIAS
 _ACEOF
 
-fi
+#fi
 ;;
   *)
 echo $as_me:$LINENO: result: no 5
diff -uPr vpopmail-5.4.18.orig/valias.c vpopmail-5.4.18/valias.c
--- vpopmail-5.4.18.orig/valias.c   2006-12-19 21:02:47.0 +
+++ vpopmail-5.4.18/valias.c2007-01-05 09:21:29.0 +
@@ -37,8 +37,9 @@
 
 #define VALIAS_SELECT 0
 #define VALIAS_INSERT 1
-#define VALIAS_DELETE 2
-#define VALIAS_NAMES  3
+#define VALIAS_REMOVE 2
+#define VALIAS_DELETE 3
+#define VALIAS_NAMES  4
 
 int AliasAction;
 int AliasExists;
@@ -116,6 +117,23 @@
}
break;
 
+   case VALIAS_REMOVE:
+   /* check to see if it already exists */
+   AliasExists = 0;
+   tmpalias = valias_select( Alias, Domain );
+   while (tmpalias != NULL ) {
+   if (strcmp (tmpalias, AliasLine) == 0) AliasExists = 1;
+   tmpalias = valias_select_next();
+   }
+   if (AliasExists) {
+   valias_remove( Alias, Domain, AliasLine );
+   } else {
+   fprintf (stderr, Error: alias %s - %s does not 
exist.\n,
+   Email, AliasLine);
+   vexit(-1);
+   }
+   break;
+
case VALIAS_DELETE:
valias_delete( Alias, Domain );
break;
@@ -136,6 +154,7 @@
printf( -s ( show aliases, can use just domain )\n);
printf( -d ( delete alias )\n);
printf( -i alias_line (insert alias line)\n);
+   printf( -r alias_line (remove alias line)\n);
printf(\n);
printf(Example: valias -i [EMAIL PROTECTED] [EMAIL PROTECTED]);
printf( (adds alias from [EMAIL PROTECTED] to [EMAIL 
PROTECTED]);
@@ -154,7 +173,7 @@
memset(AliasLine, 0, sizeof(AliasLine));
AliasAction = VALIAS_SELECT;
 
-   while( (c=getopt(argc,argv,vnsdi:)) != -1 ) {
+   while( (c=getopt(argc,argv,vnsr:di:)) != -1 ) {
switch(c) {
case 'v':
printf(version: %s\n, VERSION);
@@ -165,6 +184,10 @@
case 's':
AliasAction = VALIAS_SELECT;
break;
+   case 'r':
+   AliasAction = VALIAS_REMOVE;
+   snprintf(AliasLine, sizeof(AliasLine), %s, optarg);
+   break;
case 'd':
AliasAction = VALIAS_DELETE;
break;
diff -uPr vpopmail-5.4.18.orig/vpalias.c vpopmail-5.4.18/vpalias.c
--- vpopmail-5.4.18.orig/vpalias.c  2006-12-19 21:02:47.0 +
+++ vpopmail-5.4.18/vpalias.c   2007-01-05 09:23:09.0 +
@@ -1,3 +1,4 @@
+#ifndef VALIAS 
 /*
  * $Id: vpalias.c,v 1.6.2.14 2006/12/19 21:02:47 rwidmer Exp $
  * Copyright (C) 2000-2004 Inter7 Internet Technologies, Inc.
@@ -16,8 +17,6 @@
  * along with this 

[vchkpw] onauth Roadmap (WAS: Local relay patch)

2007-01-08 Thread Joshua Megerman
Rick Widmer wrote:
 John Simpson wrote:

 you're right, the onauth code itself is simple- i could probably
 write it in about fifteen minutes, and i'm sure several other people
 could as well.

 yeah,

 vi vpopmail.c

 duplicate the existing call_onchange function

 line range of new functions/change/auth/g
 line range of new functions/CHANGE/AUTH/g

 then...

 grep POP_AUTH_OPEN_RELAY *.[c,h]

 Replace what ever it finds with a call to call_onauth if needed.  Keep
 track of what you remove, as you need to analyze it to decide what parms
 to send to call_onauth, and probably write a script for each (supported)
 backend that does the same thing.

 Not bad, there are only 14 instances... and you probably won't have to
 do anything but delete some of them.  Be sure to keep the ifdefs around
 any calls to call_onauth, we still want to require the same ./configure
 option to enable the functionality.

Should be simple enough - I haven't had a chance to look at 5.4.18 yet, so
I'm not sure what the new code looks like and if any changes other than
that will be needed.

 what we need is to decide exactly what the interface will be when the
 script when it gets run (i.e. what gets passed on the command line,  and
 what environment variables are passed.) what i see is the following:

 command line arguments:
 timestampi.e. sprintf(%lu,time())
 servicepop3, imap, smtp
 [EMAIL PROTECTED]

snip

 thoughts?

 You need the remote IP address to handle the existing functionality from
 the command line parms, so yes I think it should be there.

 The timestamp is an interesting idea.  I would have left it to the
 script to find out what time it was called, if it cared.  It sure makes
 a logger easy.

 I'm willing to assume the environment of the calling program is
 acceptable until such time as someone shows a reason to build a custom
 environment for the script.

OK, it looks like there are several tasks that need to be done, in several
phases.

1) Implement the onauth hook and document the API (should be simple,
unless there need to be changes to the onchange functionality, plus the
design work to make sure the API isn't going to need to be redone because
we forgot about something).  Add --enable-onauth-script to configure as a
forward-looking replacement for the roaming-users functionality.  Plan to
include in 5.4.19.
2) Create a new program (vrelayupdate?) that calls the existing code that
gets defined if POP_AUTH_OPEN_RELAY is defined using the new API, but link
against the existing code in libvpopmail.a for now.  Change vchkpw to call
the onauth API and document that the new program should be used as the
onauth program to duplicate existing functionality.  Deprecate the relay
update functionality and document that it will no longer be part of later
releases.  I expect to get this into 5.4.19 as well.
3) Remove the non-common code used for updating the relay table and
rebuilding the relay cdb from the core vpopmail and move it into the
vrelayupdate program or it's support files.  Move everything into the
contrib directory and provide a method for building it to match the
configuration of vpopmail.  It will still link against libvpopmail so that
the various common functions will still be available, but all
auth-before-smtp-relay-specific functionality will be moved out of the
vpopmail code.  Plan this for 5.4.20 or 5.4.21, depending on how long this
takes.  Possibly have the code moved for 5.4.20 but not move the program
to contrib until 5.4.21.  In any case, at that point pop-before-smtp will
officially be removed from vpopmail, and will be supported only through
external scripts.  Also, --enable-roaming-users,
--disable-rebuild-tcpserver-file and --enable-relay-clear-minutes=# will
be removed from configure and any use related to that will require
--enable-onauth-script instead.
4) Possibly remove the authentication logging from vpopmailand make it
external, but a quick look at the code shows ENABLE_AUTH_LOGGING to be
pervasive and less likely to be a candidate for an external function,
although maybe just the call to it could be migrated outside (since
vuserinfo, vpopmaild and vdeloldusers all make user of it in addition to
vchkpw).

I need to do a little more looking to see what the exact API should be
(i.e., what info gets passed to the onauth script, but I expect it won't
be much different than what's been discussed here.  It's mostly a matter
of walking the code so that I understand it to my satisfaction and think
about what else I can make a good argument for having available when
making the call.  I'm leaning towards the timestamp, but I'll here
arguments on both sides.  And for now I agree that there's no good reason
to much with the calling environment...

Josh
-- 
Joshua Megerman
SJGames MIB #5273 - OGRE AI Testing Division
You can't win; You can't break even; You can't even quit the game.
  - Layman's translation of the Laws of Thermodynamics
[EMAIL PROTECTED]




[vchkpw] vchkpw/onauth connection types

2007-01-08 Thread Joshua Megerman
In developing the onauth API, one of the things that I want to be a part
of it is the connection type.  Currently, I've got pop3, imap, smtp,
vpopmaild and other.  vchkpw supports 4 different auth types (POP, SMTP,
IMAP and WEBMAIL).  It sets the connection type based on a list of known
ports (25/465/587 for SMTP, 110/995 for POP and 143/993 for IMAP), and
defaults to POP on an unknown conenction.  If it gets a POP or IMAP
connection from a static list of webmail IPs (defaults to 127.0.0.1 only),
it assumes that it's a webmail connection (and there's a bug in that code
too, but I'll address that separately).

vpopmaild checks the username and password directly against the user
database, so setting the type to vpopmaild shouldn't depend on what port
you run it on.  Is there any need for other, and should I add webmail
to the list?  Also, should I use the words listed above, or should I just
use the numeric types defined in vchkpw (0-3) and increment them for
vpopmaild (4) and other (5 - if used)?

Josh
-- 
Joshua Megerman
SJGames MIB #5273 - OGRE AI Testing Division
You can't win; You can't break even; You can't even quit the game.
  - Layman's translation of the Laws of Thermodynamics
[EMAIL PROTECTED]




Re: [vchkpw] The future of valias

2007-01-08 Thread Rick Widmer

First here is the into to the documentation for what I have in mind for
vpopmail script handling, then I'll answer points from John's email.



vpopmail mail script handling.

Vpopmail provides a way to manage mail scripts that allows you to choose
at configure time between storing scripts in the database or in .qmail
or .vpopmail files.  The mail script api is available for the cdb back
end, but the configure options to use a table for storage are not available.

Actually, for historic reasons, there are two api's available.  The
first, aliases stores a list of addresses to forward messages to.  You
are allowed to deliver to a program, but can not depend on the order of
entries in an alias.  Aliases are controlled by --enable-valias which
causes vpopmail to store aliases in the databases.

By the time lack of support for order in aliases became a problem there
were a number of people using valias in programs they have written.
Rather than changing the existing api ordered mail scripts have been
provided by adding a new api, mail scripts.  Mail scripts are controlled
by --enable-scripts which causes vpopmail to store scripts in the database.

Depending on the settings of --enable-valias and --enable-scripts [1]
both may be stored in the same place.  If so, it is safe to edit an
alias as a script, but editing a script as an alias may not retain the
order of lines within the script, causing it to fail.

Mail scripts allow the calling program to store or retrieve the script
as a .qmail or .vpopmail file, even when configure options specify it
should be in the database. [2] If a file and database entry both exist,
the file is executed and the database entry is ignored. [3]  Files in
the domain directory are executed by qmail-local, so they don't have the
overhead of executing vdelivermail.  Files in user level directories are
executed by vdelivermail so there isn't as much advantage to using real
files there.


[1] Both of the configure options probably need to be renamed to reflect
that they cause their associated data to be stored in a database table.

[2] This can be used if the user chooses to use files instead of the
database, and for programs like vconvert and dotqmail2valias which need
to access both files and the database.

[3] Sometimes you may have to delete a script twice, once to delete the
file, then to delete the database entry exposed when the file disappeared.


Note that this provides two switches that allow the system administrator
to control storage of aliases and scripts separately.  It also allows
the programmer to chose to use a file to store a script even when the
system administrator has selected database storage.


John Simpson wrote:

so you're going to design this new thing which is LIKE an alias, but  it 
supports sequencing... and it can use the same code and probably the 
same database tables... but it's NOT an alias, simply because you give 
it some other name.


Yes, but it is not a _new_ thing.  I want to freeze the alias interface
and provide a new interface for scripts.  Both can end up in either a
.qmail/.vpopmail file or a database.


explain to me how your scripts are any different from aliases with  a 
sequence field, or a .qmail file. either way, the functional  result 
is the same: a set of delivery targets, guaranteed to be  processed in a 
certain order.


The calling conventions, and the idea that having two sets of calls
allows you to optimize how things are handled in the back end.  For
example most scripts I can think of have two or more lines, and you
don't want to attempt a delivery to a partially written script.

By having separate functions we can better optimize the update process
for its storage method.  I think most scripts will be the result of
template expansion or copied out of a text area and there will be more
than one line that needs to be added.  For example when writing to a
file the write-script function can copy an entire script with one open /
close / rename.  If I have to use alias calls each line added will
require the file to be copied to a temp file then renamed.

Aliases are an unordered collection of delivery commands that you add or
remove a single entry at a time.  They stay what they are in 5.4.18 for
a MySQL or pgsql user.  The key to an alias is that you work with it one
address (line) at a time.  An email coming in to an alias when you have
only written two of three destination addresses isn't as much of a
disaster as a script that is not completely written.

A mail script is an ordered collection of delivery commands that is
created or updated as a group.  The key to a script is that you update
the whole thing at once.  I know there are multiple lines to most
scripts so its handler should accept all lines before making the script
available to receive mail.  If you use the existing add alias call and
the script receives an email when only two of three lines have been
written you may have a disaster.

I'm thinking a pointer to an 

Re: [vchkpw] vchkpw/onauth connection types

2007-01-08 Thread Rick Widmer
I think I would prefer the words, but then I don't plan to use it at 
all, so my opinion probably isn't that important.




Joshua Megerman wrote:


In developing the onauth API, one of the things that I want to be a part
of it is the connection type.  Currently, I've got pop3, imap, smtp,
vpopmaild and other.  vchkpw supports 4 different auth types (POP, SMTP,
IMAP and WEBMAIL).  It sets the connection type based on a list of known
ports (25/465/587 for SMTP, 110/995 for POP and 143/993 for IMAP), and
defaults to POP on an unknown conenction.  If it gets a POP or IMAP
connection from a static list of webmail IPs (defaults to 127.0.0.1 only),
it assumes that it's a webmail connection (and there's a bug in that code
too, but I'll address that separately).

vpopmaild checks the username and password directly against the user
database, so setting the type to vpopmaild shouldn't depend on what port
you run it on.  Is there any need for other, and should I add webmail
to the list?  Also, should I use the words listed above, or should I just
use the numeric types defined in vchkpw (0-3) and increment them for
vpopmaild (4) and other (5 - if used)?

Josh


Re: [vchkpw] vchkpw/onauth connection types

2007-01-08 Thread Remo Mattei
words sounds good to me.

Just my 2 cents.

Remo

Rick Widmer wrote:
 I think I would prefer the words, but then I don't plan to use it at
 all, so my opinion probably isn't that important.
 
 
 
 Joshua Megerman wrote:
 
 
 !DSPAM:45a28ed9183882444718425!
 


[vchkpw] onauth API

2007-01-08 Thread Joshua Megerman
OK, I think I can say that I've figured out what I think the onauth API
should be, so I'd like to get some comments on it.  I haven't done any
implementation yet (other than copying John's onchange function and doing
the search  replace).  Assuming I get positive feedback, I'll move
forward with the implementation.

The onauth script will be given 4 parameters. the first three of which
will come from the parameters to the call_onauth function.

  $1 is the username. [1]
  $2 is the domain name or NULL if it's a system user. [1]
  $3 is the numeric value associated with the service type. [2]
  $4 is the current timestamp as generated by time(NULL). [3]

[1] The username and domain name are passed separately because they are
already broken apart in order for vchkpw/vpopmaild to authenticate the
user, and would have to be concatenated together before calling onauth,
and then split back apart by the onauth script.  That increases the
workload on both ends, so why bother.

[2] Except when being used to determine whether a particular service is
authorized in vchkpw, this information is never used.  I think it might be
good to pass a long for logging purposes, but see no reason not to stick
to numeric codes, and let the called script deal with the information as
it sees fit.  I'll add defines so that vpomaild and  other have numeric
code designations as well, and they remain static unless someone decides
to renumber them.

[3] While strictly not necessary (the script can calculate it on its own),
if you are using a script that just hands off the parameters to a daemon
which queue's up the updates, it's possible that any given onauth script
won't be processed until after the timestamp has changed.  Since we can't
guarantee that the onauth script will be run atomically, it's better to
send the timestamp as a parameter and let the script decide if it cares.

Other API notes:

The call to call_onauth should probably return the exit status of the
onauth script, which can be gotten after the wait(pid) call returns.  And
instead of returning 0 for a failed call, return -1.  I'm not sure if we
care about that, but it's information that might be useful later on.

Other code notes:

There's a couple of minor issues I see in the onchange code, which I'll
fix in my onauth code and you can port back to the onchange code.  Mostly
the handling of a failed exec call - you should call _exit rather than
return, since it's in the vfork and you don't want the vfork'd process
doing anything more...

Josh
-- 
Joshua Megerman
SJGames MIB #5273 - OGRE AI Testing Division
You can't win; You can't break even; You can't even quit the game.
  - Layman's translation of the Laws of Thermodynamics
[EMAIL PROTECTED]




[vchkpw] vchkpw webmailips traversal bug

2007-01-08 Thread Joshua Megerman
In vchkpw, you can statically compile in a list of IP addresses that are
to be treated as webmail connections for auth purposes.  However, the
traversal of the list do es a loop based on dividing the size of the
entire array by the size of the first element in the array.  Since IP
addresses can be anywhere from 8 characters (A.B.C.D\0) to 16 characters
(AAA.BBB.CCC.DDD\0), this makes it likely that any added addresses will
cause some sort of segfault, especially if several large (character-wise)
addresses are added (since the default, 127.0.0.1 is only 10
characters).  This patch fixes it by NULL-terminating the list of strings,
and using that fact for bounds-checking in the for loop...

This bug has been present since at least 5.4.13, but my guess is that so
few people use this feature (I didn't even know about it until I was
walking the code earlier today checking on the connection types!) that
it's not likely to be hit very often.  Still, it's a bug, and so this
patch... :)  Also uploaded to SourceForge as bug #1630944.

Josh
-- 
Joshua Megerman
SJGames MIB #5273 - OGRE AI Testing Division
You can't win; You can't break even; You can't even quit the game.
  - Layman's translation of the Laws of Thermodynamics
[EMAIL PROTECTED]




Re: [vchkpw] vchkpw webmailips traversal bug

2007-01-08 Thread Rick Macdougall

Joshua Megerman wrote:

In vchkpw, you can statically compile in a list of IP addresses that are
to be treated as webmail connections for auth purposes.  However, the
traversal of the list do es a loop based on dividing the size of the
entire array by the size of the first element in the array.  Since IP
addresses can be anywhere from 8 characters (A.B.C.D\0) to 16 characters
(AAA.BBB.CCC.DDD\0), this makes it likely that any added addresses will
cause some sort of segfault, especially if several large (character-wise)
addresses are added (since the default, 127.0.0.1 is only 10
characters).  This patch fixes it by NULL-terminating the list of strings,
and using that fact for bounds-checking in the for loop...

This bug has been present since at least 5.4.13, but my guess is that so
few people use this feature (I didn't even know about it until I was
walking the code earlier today checking on the connection types!) that
it's not likely to be hit very often.  Still, it's a bug, and so this
patch... :)  Also uploaded to SourceForge as bug #1630944.


Thanks.

I believe that's my patch or patch request at any rate.  I'm not sure if 
I or Tom C. wrote the code for that.


Thanks for the patch.

Regards,

Rick



[vchkpw] cannot send email

2007-01-08 Thread shadc254
Hi,

I am having some problems sending emails through all domain names.

Internally it is OK though. 

Any ideas please.

 



[vchkpw] sending emails

2007-01-08 Thread saimir hafizi
Hi,

I am having some difficulties sending emails. Internally I can send but

externally none of the domains can send. 

Any ideas please,



RE: [vchkpw] cannot send email

2007-01-08 Thread shadowplay.net
looks to me like you are behind a 
rogers account 
 
rogers blocks all ob prot 25 connections NOT to its
mailservers
 
enjoy
 
kenneth gf brown

-Original Message-
From: shadc254 [mailto:[EMAIL PROTECTED] 
Sent: January 8, 2007 19:07
To: vchkpw@inter7.com
Subject: [vchkpw] cannot send email



Hi,

I am having some problems sending emails through all domain names.

Internally it is OK though. 

Any ideas please.

 



[vchkpw] cannot send emails

2007-01-08 Thread saimir hafizi
Hi,

I am having some problems sending emails through all domain names.

Internally it is OK though. 

Any ideas please.



RE: [vchkpw] cannot send email

2007-01-08 Thread shadc254
I can't use my accounts, so I registered my personal account I have with
rogers to mail out my question.

This problem has nothing to do with rogers. I have other domain names that
do not work.

As I said internally I can send messages but not out.

Thank you

 

 

  _  

From: shadowplay.net [mailto:[EMAIL PROTECTED] 
Sent: Monday, January 08, 2007 7:46 PM
To: vchkpw@inter7.com
Subject: RE: [vchkpw] cannot send email

 

looks to me like you are behind a 

rogers account 

 

rogers blocks all ob prot 25 connections NOT to its

mailservers

 

enjoy

 

kenneth gf brown

-Original Message-
From: shadc254 [mailto:[EMAIL PROTECTED] 
Sent: January 8, 2007 19:07
To: vchkpw@inter7.com
Subject: [vchkpw] cannot send email

Hi,

I am having some problems sending emails through all domain names.

Internally it is OK though. 

Any ideas please.

 



[vchkpw] roaming user relay problem, no relay in /home/vpopmail/etc/tcp.smtp.cdb file

2007-01-08 Thread A OKAN YÜKSEL

hi,

i installed vpopmail with roaming user and  with mysql support correctly.
but i have a problem about relaying pop3 users.. when pop3 used remote ip
address is added to relay table on mysql.. but i cant see ip address on cdb
file..  i checked tcp.smtp.cdb file with cdbdump ..
smtp run file like:

exec /usr/local/bin/softlimit -m 200 \
/usr/local/bin/tcpserver -H -R -v -p -x /home/vpopmail/etc/tcp.smtp.cdb \
-u $VPOPMAILUID -g 1010 0 smtp /var/qmail/bin/qmail-smtpd 21

and i changed qmail startup file too for right path of tcp.smtp..

-rw-r--r--  1 vpopmail  vchkpw26 Jan  8 11:53 tcp.smtp
-rw-r--r--  1 vpopmail  vchkpw  2090 Jan  9 03:51 tcp.smtp.cdb

thanks


Re: [vchkpw] vchkpw webmailips traversal bug

2007-01-08 Thread Joshua Megerman
On Monday 08 January 2007 18:19, Rick Macdougall wrote:
 Joshua Megerman wrote:
  In vchkpw, you can statically compile in a list of IP addresses that are
  to be treated as webmail connections for auth purposes.  However, the
  traversal of the list do es a loop based on dividing the size of the
  entire array by the size of the first element in the array.  Since IP
  addresses can be anywhere from 8 characters (A.B.C.D\0) to 16 characters
  (AAA.BBB.CCC.DDD\0), this makes it likely that any added addresses will
  cause some sort of segfault, especially if several large (character-wise)
  addresses are added (since the default, 127.0.0.1 is only 10
  characters).  This patch fixes it by NULL-terminating the list of
  strings, and using that fact for bounds-checking in the for loop...
 
  This bug has been present since at least 5.4.13, but my guess is that so
  few people use this feature (I didn't even know about it until I was
  walking the code earlier today checking on the connection types!) that
  it's not likely to be hit very often.  Still, it's a bug, and so this
  patch... :)  Also uploaded to SourceForge as bug #1630944.

 Thanks.

 I believe that's my patch or patch request at any rate.  I'm not sure if
 I or Tom C. wrote the code for that.

 Thanks for the patch.

My turn to say oops - As Tom pointed out in response to my sourceforge 
posting, I was mistaking the sizeof the pointer for the sizeof the string.  
I've closed the SF bug as invalid, please discard the patch (not that it 
doesn't work, but the original code is perfectly valid).

josh
-- 
Joshua Megerman
SJGames MIB #5273 - OGRE AI Testing Division
You can't win; You can't break even; You can't even quit the game.
  - Layman's translation of the Laws of Thermodynamics
[EMAIL PROTECTED]


Re: [vchkpw] The future of valias other topics

2007-01-08 Thread John Simpson

On 2007-01-08, at 0602, [EMAIL PROTECTED] wrote:


Attached is a patch for 5.4.18 to enable alias line removal  
from .qmail

based aliases and the implementation of alias line removal using the
valias command line program.

Am I meant to be posting patches here (such as my previous double free
problem in vpalias.c) or to another list ?
vpopmail-5.4.18-valias.patch


here is fine, but you should probably start a new thread instead of  
replying your message into the middle of an existing one.



| John M. Simpson---   KG4ZOW   ---Programmer At Large |
| http://www.jms1.net/ [EMAIL PROTECTED] |

| http://video.google.com/videoplay?docid=-4312730277175242198 |





PGP.sig
Description: This is a digitally signed message part


Re: [vchkpw] The future of valias other topics

2007-01-08 Thread Rick Widmer



[EMAIL PROTECTED] wrote:

Am I meant to be posting patches here (such as my previous double free 
problem in vpalias.c) or to another list ?


The best place for patches is the tracker on SourceForge.  They don't 
get lost or forgotten that way.



Rick


Re: [vchkpw] The future of valias other topics

2007-01-08 Thread Rick Widmer



[EMAIL PROTECTED] wrote:

Attached is a patch for 5.4.18 to enable alias line removal from .qmail 
based aliases and the implementation of alias line removal using the 
valias command line program.


How did I miss that?  I would have sworn that patch was included in the 
last release.  Oh well, thanks for catching it now.



Rick


Re: [vchkpw] The future of valias

2007-01-08 Thread John Simpson

On 2007-01-08, at 1313, Rick Widmer wrote:

John Simpson wrote:

so you're going to design this new thing which is LIKE an alias,  
but  it supports sequencing... and it can use the same code and  
probably the same database tables... but it's NOT an alias, simply  
because you give it some other name.


Yes, but it is not a _new_ thing.  I want to freeze the alias  
interface

and provide a new interface for scripts.  Both can end up in either a
.qmail/.vpopmail file or a database.


here's a thought: the current function names become macros which call  
functions with new names and new functionality. the old API is  
preserved, and the new functionality is available with reasonable  
defaults to programs whose source code calls the old function names.


only two functions really need to be changed:

valias_insert(alias,domain,line)
valias_remove(alias,domain,line)

the functions would be renamed and gain a new parameter...

valias_insertseq(alias,domain,seq,line)
valias_removeset(alias,domain,seq,line)

and the existing function names become macros which call the new  
functions:


#define valias_insert(a,d,l) valias_insertseq((a),(d),INT_MAX,(l))
#define valias_remove(a,d,l) valias_removeseq((a),(d),-1,(l))

valias_insertseq() would be written to treat a seq parameter beyond  
the end of the alias as insert after the end. the SQL versions  
would include logic to find the current highest sequence within the  
alias and replace the huge number with max plus one, so that the  
lines within a given alias are always maintained as 0,1,2,3,etc. with  
no gaps and no duplications.


valias_removeseq() would treat a seq parameter lower than zero as  
ignore the sequence and search for the text instead.




By having separate functions we can better optimize the update process
for its storage method.  I think most scripts will be the result of
template expansion or copied out of a text area and there will be more
than one line that needs to be added.  For example when writing to a
file the write-script function can copy an entire script with one  
open /

close / rename.  If I have to use alias calls each line added will
require the file to be copied to a temp file then renamed.


i see the value of the template processing stuff, it gives an  
administrator a way to pre-define templates for users who want spam  
filtered into a spam folder and things like that. it IS a good idea.


however, i see this implemented as a new function call:

	int valias_replace ( const char *alias , const char *domain , const  
char **lines )


which would start by wiping the current contents of the alias (if  
any) and then just writing the new lines into the alias, with  
sequences 0,1,2,3,etc... all within a single BEGIN TRANSACTION ...  
COMMIT block (or simply by writing the new lines to a .new.qmail  
file, chmod()ing it as needed, then rename()ing it over any existing  
.qmail file.


Aliases are an unordered collection of delivery commands that you  
add or

remove a single entry at a time.


NO. aliases are, and have always been, a layer of abstraction  
above .qmail files, and are therefore ORDERED collections of delivery  
targets.



They stay what they are in 5.4.18 for a MySQL or pgsql user.


if current users are not expecting a specific sequence, and are used  
to not having any specific sequence, then how does it hurt things if  
suddenly they ARE sequenced? if nothing else, it's still random...  
it's just that it's the same random every time.


besides, if every line in an alias is an email address, then the  
sequence (or lack thereof) doesn't matter.


The key to an alias is that you work with it one address (line) at  
a time.  An email coming in to an alias when you have only written  
two of three destination addresses isn't as much of a disaster as a  
script that is not completely written.


you're thinking of the race condition where a delivery might happen  
while a .qmail file is halfway through being written. there are two  
solutions to this:


- djb's solution, which is to enable the sticky bit for the home  
directory, which suspends all deliveries to that directory (for  
vpopmail, the home directory is the domain directory.) this is less  
than optimal, because it suspends all deliveries for the entire  
domain, rather than just the one alias you're updating. it also  
doesn't work with vdelivermail, because vdelivermail doesn't look at  
the sticky bit (it should.)


- update the files or entries in a manner which is guaranteed to be  
atomic, either by using BEGIN TRANSACTION ... COMMIT, or by writing  
your new collection of lines to some other filename, setting its  
permissions, and then using rename() to give it the .qmail name  
which makes it live. this is better.



A mail script is an ordered collection of delivery commands that is
created or updated as a group.  The key to a script is that you update
the whole thing at once.  I know there 

Re: [vchkpw] vchkpw/onauth connection types

2007-01-08 Thread John Simpson

On 2007-01-08, at 1147, Joshua Megerman wrote:


vpopmaild checks the username and password directly against the user
database, so setting the type to vpopmaild shouldn't depend on what  
port
you run it on.  Is there any need for other, and should I add  
webmail
to the list?  Also, should I use the words listed above, or should  
I just

use the numeric types defined in vchkpw (0-3) and increment them for
vpopmaild (4) and other (5 - if used)?


i would go with words.

the one exception would be for other... if you get a type code  
which is unknown, build a string which looks like (type=19) and  
send that as the type code, instead of smtp or pop3.



| John M. Simpson---   KG4ZOW   ---Programmer At Large |
| http://www.jms1.net/ [EMAIL PROTECTED] |

| http://video.google.com/videoplay?docid=-4312730277175242198 |





PGP.sig
Description: This is a digitally signed message part