Re: [vchkpw] 5.4.17 patches

2006-12-12 Thread drew-vpopmail
Tom,
The first patch implements .qmail-extension files (and also the -default 
variations).  This is useful for me because it means that any special 
delivery rules created for a user can all be put in the users own 
directory, when the user is deleted all the special rules go aswell.

As far as the second patch goes, it just implements what I think is a 
missing feature from the commandline 'valias', and that is the ability to 
remove a line from an alias (either .qmail file or SQL backend).  This 
patch also removes the SQL only restriction.

I know most of the community only want to use SQL backends, I however do 
not, so I have been patching vpopmail for a while now so the file backend 
works.

While scanning the vpopmaild.c code, I noticed a comment in there that the 
list_alias and list_lists commands needed re-writing to use the new valias 
code, this is what I have done.  This removes the need for the bkscandir 
function (although that patch does not remove it).  Also the output of 
these commands does not display the leading .qmail (as the old commands 
did), this is probably correct for both file and SQL backends.

Patches attached :-
1) vpopmail-5.4.13-dot-qmail.patch - Implements .qmail-extension (etc) in 
the users directory.
2) vpopmail-5.4.13-deliveredto.patch - Some changes to how the 
Delivered-To: header line is inserted into an E-Mail, this patch is needed 
to handle E-Mails delivered using the above patch (maildir_to_email can 
return a blank result).
3) vpopmail-5.4.17-valias.patch - Changes to valias to remove SQL only 
restriction and implement alias line removal.
4) vpopmail-5.4.17-vpopmaild.patch - Implements list_alias and list_lists 
commands using the new valias code.

Note: I also have a patch which is the same as 1) but does not call the 
files in the users .qmail, instead calls them .vpopmail files.  I 
personaly prefer .qmail files so vpopmail looks like a qmail installation 
as far as users are concerned.

If there are any bugs in these patches, please let me know.

On Mon, 11 Dec 2006, Tom Collins wrote:

> On Dec 11, 2006, at 3:25 AM, [EMAIL PROTECTED] wrote:
> > I have a patch for implementing personal .qmail files (.qmail files  
> > inside
> > the user directory and not just in the domain directory), I also  
> > have a
> > variation on this patch to name these .vpopmail files.
> >
> > I also have a patch which implements alias line removal in valias.c  
> > (-r
> > flag), removal of SQL aliases only and adding alias line removal in
> > vpalias.c (function valias_remove()).
> >
> > I also have a patch which changes vpopmaild.c to use the new valias  
> > code
> > (as requested in vpopmaild.c - as a comment).
> >
> > Does anyone want these patches - I did not want to litter the list  
> > with
> > them.  I had sent the first one to the list before which while it
> > provoked a discussion got forgotten.  I find them all VERY useful.
> 
> We're definitely interested.  I maintain the 5.4 releases, and have  
> 5.4.18 waiting to be released.  It includes a lot of changes by Rick  
> Widmer, and patches by Peter Pentchev.
> 
> I'm not sure I understand the first one though -- vdelivermail and  
> qmailadmin already support a .qmail file in the user's directory.   
> Are you talking about .qmail-extension files?
> 
> --
> Tom Collins  -  [EMAIL PROTECTED]
> Vpopmail - virtual domains for qmail: http://vpopmail.sf.net/
> QmailAdmin - web interface for Vpopmail: http://qmailadmin.sf.net/
> 
> 
> 
diff -uPr vpopmail-5.4.13.orig/vdelivermail.c vpopmail-5.4.13/vdelivermail.c
--- vpopmail-5.4.13.orig/vdelivermail.c 2005-09-02 19:47:29.0 +0100
+++ vpopmail-5.4.13/vdelivermail.c  2005-12-16 15:53:29.0 +
@@ -62,6 +62,7 @@
 #ifdef QMAIL_EXT
 /* the User with '-' and following chars out if any */
 char TheUserExt[AUTH_SIZE]; 
+char TheExt[AUTH_SIZE];
 #endif
 
 #define FILE_SIZE 156
@@ -217,6 +218,11 @@
 vexit(EXIT_BOUNCE);
 }
 
+strncpy(TheExt, &TheUser[i+1], AUTH_SIZE);
+for (i = 0; (TheExt[i] != 0); i++) {
+  if (TheExt[i] == '.') TheExt[i] = ':';
+}
+
 #endif
 
 vget_assign(TheDomain, TheDomainDir, sizeof(TheDomainDir), &TheDomainUid, 
&TheDomainGid);
@@ -697,16 +703,36 @@

 chdir(dir);
 
+#ifdef QMAIL_EXT
 /* format the file name */
-if ( (fs = fopen(".qmail","r")) == NULL ) {
+if (strlen(TheExt)) {
+strcpy(tmpbuf,".qmail-");
+strcat(tmpbuf,TheExt);
+if ( (fs = fopen(tmpbuf,"r")) == NULL ) {
+for (i=strlen(TheExt);i>=0;--i) {
+if (!i || TheExt[i-1]=='-') {
+strcpy(tmpbuf,".qmail-");
+strncat(tmpbuf,TheExt,i);
+strcat(tmpbuf,"default");
+if ( (fs = fopen(tmpbuf,"r")) != NULL) {
+break;
+}
+}
+}
+}
+} else {
+fs = fopen(".qmail","r");
+}
+#else
+fs = fopen(".qmail","r");
+#endif
 

Re: [vchkpw] 5.4.17 patches

2006-12-12 Thread Rick Widmer



[EMAIL PROTECTED] wrote:


> Patches attached :-
> 1) vpopmail-5.4.13-dot-qmail.patch - Implements .qmail-extension 
(etc) > in the users directory.


Nice.

> 3) vpopmail-5.4.17-valias.patch - Changes to valias to remove SQL only
> restriction and implement alias line removal.

Very nice!

> 4) vpopmail-5.4.17-vpopmaild.patch - Implements list_alias and
> list_lists commands using the new valias code.

Very nice!


As far as the second patch goes, it just implements what I think is a 
missing feature from the commandline 'valias', and that is the ability to 
remove a line from an alias (either .qmail file or SQL backend).  This 
patch also removes the SQL only restriction.


Next we need the ability to guarantee the order of the lines in both 
.qmail and SQL back ends...



I know most of the community only want to use SQL backends, I however do 
not, so I have been patching vpopmail for a while now so the file backend 
works.


I'm not so sure about most.  I use cdb, and so does everyone else that 
uses the Shupp toaster as written.



While scanning the vpopmaild.c code, I noticed a comment in there that the 
list_alias and list_lists commands needed re-writing to use the new valias 
code, this is what I have done.  This removes the need for the bkscandir 
function (although that patch does not remove it).  Also the output of 
these commands does not display the leading .qmail (as the old commands 
did), this is probably correct for both file and SQL backends.


THANKS!


Note: I also have a patch which is the same as 1) but does not call the 
files in the users .qmail, instead calls them .vpopmail files.  I 
personaly prefer .qmail files so vpopmail looks like a qmail installation 
as far as users are concerned.


I have mixed feelings about this.  I'm sure Charles Cazabon on the qmail 
list would rejoice if we did this.  On the other hand we seem to be 
moving towards having all the functionality of .qmail files built into 
vdelivermail, which would also take care of his objections.


The best solution would probably be to read both .vpopmail and .qmail 
files in the user directories, and start naming files executed by 
vdelivermail .vpopmail.  I'd like to see this patch...



If there are any bugs in these patches, please let me know.


I hope to find some time this weekend.  There are a number of features 
I've wished for for quite some time...


THANKS!
Rick


Re: [vchkpw] 5.4.17 patches

2006-12-12 Thread Remo Mattei
ALl those patches sound great what about the patch that will create a
greeting when you create a user? I just want to check and see if there
was included

Thanks,
Remo

Rick Widmer wrote:
> 
> 
> [EMAIL PROTECTED] wrote:
> 
> 
> 
> Nice.
> 
> 
> Very nice!
> 
> 
> Very nice!
> 
> 
> 
> Next we need the ability to guarantee the order of the lines in both
> .qmail and SQL back ends...
> 
> 
> 
> I'm not so sure about most.  I use cdb, and so does everyone else that
> uses the Shupp toaster as written.
> 
> 
> 
> THANKS!
> 
> 
> 
> I have mixed feelings about this.  I'm sure Charles Cazabon on the qmail
> list would rejoice if we did this.  On the other hand we seem to be
> moving towards having all the functionality of .qmail files built into
> vdelivermail, which would also take care of his objections.
> 
> The best solution would probably be to read both .vpopmail and .qmail
> files in the user directories, and start naming files executed by
> vdelivermail .vpopmail.  I'd like to see this patch...
> 
> 
> I hope to find some time this weekend.  There are a number of features
> I've wished for for quite some time...
> 
> THANKS!
> Rick
> 
> !DSPAM:457eb765325881607328526!
> 


Re: [vchkpw] 5.4.17 patches

2006-12-12 Thread drew-vpopmail
Rick,
As requested I have attached the .qmail and .vpopmail files in the user 
directory patch.  I do not use this patch but created it a little while 
ago incase I did want to migrate to using .vpopmail files.
As far as I can remember the order of name resolution is as follows :-

1) .qmail-{extension} - Open if exists
2) .vpopmail-{extension} - Open if exists
3) Chop the end off the extension (back to the last '-')
4) .qmail-{extension}-default - Open if exists
5) .vpopmail-{extension}-default - Open if exists
6) Loop back to 3 until the extension is empty
7) If no file got opened from 1-6 then just bail, otherwise follow the 
instructions in the opened file.

You do still need to combine this patch with the deleiveredto patch (from 
my previous email) to get it all to work properly.

As far as maintaining the order in .qmail file using valias, I am pretty 
sure that they are maintained in .qmail files.  As far as the SQL is 
concerned I am not sure (I don't use SQL), do you want me to look into 
this ?

On Tue, 12 Dec 2006, Rick Widmer wrote:

> 
> 
> [EMAIL PROTECTED] wrote:
> 
> 
>  > Patches attached :-
>  > 1) vpopmail-5.4.13-dot-qmail.patch - Implements .qmail-extension 
> (etc) > in the users directory.
> 
> Nice.
> 
>  > 3) vpopmail-5.4.17-valias.patch - Changes to valias to remove SQL only
>  > restriction and implement alias line removal.
> 
> Very nice!
> 
>  > 4) vpopmail-5.4.17-vpopmaild.patch - Implements list_alias and
>  > list_lists commands using the new valias code.
> 
> Very nice!
> 
> 
> > As far as the second patch goes, it just implements what I think is a 
> > missing feature from the commandline 'valias', and that is the ability to 
> > remove a line from an alias (either .qmail file or SQL backend).  This 
> > patch also removes the SQL only restriction.
> 
> Next we need the ability to guarantee the order of the lines in both 
> .qmail and SQL back ends...
> 
> 
> > I know most of the community only want to use SQL backends, I however do 
> > not, so I have been patching vpopmail for a while now so the file backend 
> > works.
> 
> I'm not so sure about most.  I use cdb, and so does everyone else that 
> uses the Shupp toaster as written.
> 
> 
> > While scanning the vpopmaild.c code, I noticed a comment in there that the 
> > list_alias and list_lists commands needed re-writing to use the new valias 
> > code, this is what I have done.  This removes the need for the bkscandir 
> > function (although that patch does not remove it).  Also the output of 
> > these commands does not display the leading .qmail (as the old commands 
> > did), this is probably correct for both file and SQL backends.
> 
> THANKS!
> 
> 
> > Note: I also have a patch which is the same as 1) but does not call the 
> > files in the users .qmail, instead calls them .vpopmail files.  I 
> > personaly prefer .qmail files so vpopmail looks like a qmail installation 
> > as far as users are concerned.
> 
> I have mixed feelings about this.  I'm sure Charles Cazabon on the qmail 
> list would rejoice if we did this.  On the other hand we seem to be 
> moving towards having all the functionality of .qmail files built into 
> vdelivermail, which would also take care of his objections.
> 
> The best solution would probably be to read both .vpopmail and .qmail 
> files in the user directories, and start naming files executed by 
> vdelivermail .vpopmail.  I'd like to see this patch...
> 
> > If there are any bugs in these patches, please let me know.
> 
> I hope to find some time this weekend.  There are a number of features 
> I've wished for for quite some time...
> 
> THANKS!
> Rick
> 
diff -uPr vpopmail-5.4.13.orig/vdelivermail.c vpopmail-5.4.13/vdelivermail.c
--- vpopmail-5.4.13.orig/vdelivermail.c 2005-09-02 19:47:29.0 +0100
+++ vpopmail-5.4.13/vdelivermail.c  2005-12-16 21:39:15.0 +
@@ -62,6 +62,7 @@
 #ifdef QMAIL_EXT
 /* the User with '-' and following chars out if any */
 char TheUserExt[AUTH_SIZE]; 
+char TheExt[AUTH_SIZE];
 #endif
 
 #define FILE_SIZE 156
@@ -217,6 +218,11 @@
 vexit(EXIT_BOUNCE);
 }
 
+strncpy(TheExt, &TheUser[i+1], AUTH_SIZE);
+for (i = 0; (TheExt[i] != 0); i++) {
+  if (TheExt[i] == '.') TheExt[i] = ':';
+}
+
 #endif
 
 vget_assign(TheDomain, TheDomainDir, sizeof(TheDomainDir), &TheDomainUid, 
&TheDomainGid);
@@ -697,16 +703,48 @@

 chdir(dir);
 
+#ifdef QMAIL_EXT
 /* format the file name */
-if ( (fs = fopen(".qmail","r")) == NULL ) {
+if (strlen(TheExt)) {
+strcpy(tmpbuf,".qmail-");
+strcat(tmpbuf,TheExt);
+if ( (fs = fopen(tmpbuf,"r")) == NULL ) {
+strcpy(tmpbuf,".vpopmail-");
+strcat(tmpbuf,TheExt);
+if ( (fs = fopen(tmpbuf,"r")) == NULL ) {
+for (i=strlen(TheExt);i>=0;--i) {
+if (!i || TheExt[i-1]=='-') {
+strcpy(tmpbuf,".qmail-");
+strncat(tmpbuf,TheExt,i);
+ 

Re: [vchkpw] 5.4.17 patches

2006-12-12 Thread drew-vpopmail
Remo,
I did have a look at doing this a while ago by dumping a file into the new 
users Maildir/new directory, but then got into having to write a 
templating system for the dumped email so gave up.  I guess I could have 
another look at this if its really wanted.

On Tue, 12 Dec 2006, Remo Mattei wrote:

> ALl those patches sound great what about the patch that will create a
> greeting when you create a user? I just want to check and see if there
> was included
> 
> Thanks,
> Remo
> 
> Rick Widmer wrote:
> > 
> > 
> > [EMAIL PROTECTED] wrote:
> > 
> > 
> > 
> > Nice.
> > 
> > 
> > Very nice!
> > 
> > 
> > Very nice!
> > 
> > 
> > 
> > Next we need the ability to guarantee the order of the lines in both
> > .qmail and SQL back ends...
> > 
> > 
> > 
> > I'm not so sure about most.  I use cdb, and so does everyone else that
> > uses the Shupp toaster as written.
> > 
> > 
> > 
> > THANKS!
> > 
> > 
> > 
> > I have mixed feelings about this.  I'm sure Charles Cazabon on the qmail
> > list would rejoice if we did this.  On the other hand we seem to be
> > moving towards having all the functionality of .qmail files built into
> > vdelivermail, which would also take care of his objections.
> > 
> > The best solution would probably be to read both .vpopmail and .qmail
> > files in the user directories, and start naming files executed by
> > vdelivermail .vpopmail.  I'd like to see this patch...
> > 
> > 
> > I hope to find some time this weekend.  There are a number of features
> > I've wished for for quite some time...
> > 
> > THANKS!
> > Rick
> > 
> > !DSPAM:457eb765325881607328526!
> > 
> 



[vchkpw] Custom Fields ?

2006-12-12 Thread Yahoo User
Hi, i am trying to use vpopmail to administer qmail base as mysql, i was 
wondering if there is a way to create new fields when you create a new user, 
for example when you create  new user i would like the option to add maybe a 
phone number field or an id number field, so the admins can look up records 
quicker.





 

Cheap talk?
Check out Yahoo! Messenger's low PC-to-Phone call rates.
http://voice.yahoo.com


Re: [vchkpw] Custom Fields ?

2006-12-12 Thread Joshua Megerman

> Hi, i am trying to use vpopmail to administer qmail base as mysql, i was
> wondering if there is a way to create new fields when you create a new
> user, for example when you create  new user i would like the option to add
> maybe a phone number field or an id number field, so the admins can look
> up records quicker.
>
In my experience, as long as you add new fields AFTER the existing
vpopmail fields, you shouldn't have any problems.  Just remember that
you're likely to break things if you do something funky.  Also, you'll
have to populate those fields manually after you create the user unless
you want to hack the vpopmail code to do it directly.  YMMV...

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] 5.4.17 patches

2006-12-12 Thread Tom Collins

Drew,

The functionality added by these patches sounds great.  If the code  
looks good I'll get them into the next release.


--
Tom Collins  -  [EMAIL PROTECTED]
Vpopmail - virtual domains for qmail: http://vpopmail.sf.net/
QmailAdmin - web interface for Vpopmail: http://qmailadmin.sf.net/




Re: [vchkpw] 5.4.17 patches

2006-12-12 Thread John Simpson

On 2006-12-12, at 0926, Remo Mattei wrote:


ALl those patches sound great what about the patch that will create a
greeting when you create a user? I just want to check and see if there
was included


no, but my "onchange" patch (which is waiting to be included, hint,  
hint guys) will add a hook that you can use to send a welcome message  
whenever a mailbox is added. it's a much more generic mechanism, but  
it can be used with the appropriate scripting to do what you need.


http://qmail.jms1.net/patches/vpopmail.shtml

the only thing it's waiting on is for somebody (rick?) who knows how  
to edit the ./configure script to add an option to enable or disable  
it from the ./configure command line, and have that add lines to  
config.h... and then somebody (tom?) to add it to an official version  
of vpopmail.


--
| John M. Simpson - KG4ZOW - Programmer At Large |
| http://www.jms1.net/   <[EMAIL PROTECTED]> |
--
| Mac OS X proves that it's easier to make UNIX  |
| pretty than it is to make Windows secure.  |
--




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


[vchkpw] .vpopmail-* instead of .qmail-*

2006-12-12 Thread Rick Widmer
One of the biggest complaints against vpopmail heard on the qmail 
mailing list is the fact that it uses files kind of like .qmail files, 
that are not interpreted by qmail-local, yet it names them .qmail*. 
Drew-vpopmail has submitted a patch to vdelivermail that follows the 
.qmail-ext file resolution process just like qmail-local except that at 
each level it looks for both a .qmail* and .vpopmail* file.


I believe this should be implemented.  Vdelivermail should read both 
file types.  The new standard should be to create .vpopmail files where 
the file will be executed by vdelivermail.


I disagree with the author about one thing...  I think if both exist, 
vdelivermail should process .vpopmail files instead of .qmail files.


Qmailadmin should read .vpopmail files before .qmail files and delete 
the .qmail file if it exists when the .vpopmail file is written. 
Effectively the files will be renamed as they are edited.  Maybe there 
needs to be a ./configure option to disable the new file name.





What do you think?


Rick


Re: [vchkpw] 5.4.17 patches

2006-12-12 Thread Rick Widmer



John Simpson wrote:
the only thing it's waiting on is for somebody (rick?) who knows how  to 
edit the ./configure script to add an option to enable or disable  it 
from the ./configure command line, and have that add lines to  
config.h... 


I believe this is all in 5.5.  We just need to grab it.   I may have 
some time to look at this batch of patches over the weekend.



Rick


Re: [vchkpw] .vpopmail-* instead of .qmail-*

2006-12-12 Thread Tom Collins

On Dec 12, 2006, at 9:36 PM, Rick Widmer wrote:
Qmailadmin should read .vpopmail files before .qmail files and  
delete the .qmail file if it exists when the .vpopmail file is  
written. Effectively the files will be renamed as they are edited.   
Maybe there needs to be a ./configure option to disable the new  
file name.


What do you think?


If we go with that, should the user's .qmail file become .vpopmail- 
default?


I think that it should be a configure option in vpopmail that  
cascades into QmailAdmin.  We'll need to make it clear to the admin  
enabling the feature that they need to update their QmailAdmin as well.


--
Tom Collins  -  [EMAIL PROTECTED]
Certified Rabbit Semiconductor Consultant based in Napa, California




Re: [vchkpw] 5.4.17 patches

2006-12-12 Thread Tom Collins

On Dec 12, 2006, at 7:48 PM, John Simpson wrote:
no, but my "onchange" patch (which is waiting to be included, hint,  
hint guys) will add a hook that you can use to send a welcome  
message whenever a mailbox is added. it's a much more generic  
mechanism, but it can be used with the appropriate scripting to do  
what you need.


http://qmail.jms1.net/patches/vpopmail.shtml

the only thing it's waiting on is for somebody (rick?) who knows  
how to edit the ./configure script to add an option to enable or  
disable it from the ./configure command line, and have that add  
lines to config.h... and then somebody (tom?) to add it to an  
official version of vpopmail.


The squeaky wheel gets the grease...

It's in my queue, and I hope to have some time to work on vpopmail  
and qmailadmin over the holidays.


--
Tom Collins  -  [EMAIL PROTECTED]
Vpopmail - virtual domains for qmail: http://vpopmail.sf.net/
QmailAdmin - web interface for Vpopmail: http://qmailadmin.sf.net/




Re: [vchkpw] Custom Fields ?

2006-12-12 Thread Rick Widmer



Joshua Megerman wrote:



In my experience, as long as you add new fields AFTER the existing
vpopmail fields, you shouldn't have any problems.  


The order of the fields in the table should not matter.  I believe 
vpopmail always uses explicit lists, so as long as you provide all of 
the required fields it should be happy.




Just remember that you're likely to break things if you do something

> funky.

Yes.  The fields vpopmail uses must be the right size and type.


Also, you'll have to populate those fields manually after you create 

> the user unless you want to hack the vpopmail code to do it directly.

I believe vdelivermail has support for creating the Maildir for a user 
when the first email comes in.  All you have to do is create the 
database entry and wait for a message.  (Maybe the one sent by John's 
onchange patch.)  I may be wrong, I use cdb.



Rick


Re: [vchkpw] 5.4.17 patches

2006-12-12 Thread Rick Widmer


If this thread goes on much longer, we should probably move to the 
[EMAIL PROTECTED] list.  I'm sure most here aren't 
interested in the gory details.



[EMAIL PROTECTED] wrote:
As far as maintaining the order in .qmail file using valias, I am pretty 
sure that they are maintained in .qmail files.  As far as the SQL is 
concerned I am not sure (I don't use SQL), do you want me to look into 
this ?


Sure.

Its been a while since I've looked at this, but maybe it will help...

There will be no problem maintaining the order of lines in a .qmail 
file.  The trick will be making a set of functions that give you the 
same access for both SQL and files.  The existing functions need to stay 
the same for backwards compatibility.  If you want to take control of 
the sequence of entries you need to use new functions.


For the SQL back end we should add a sequence field 
with a default value of 0.  When retrieving the valias lines they should 
be ORDER BY Sequence, Address.  Extra credit if the addresses are sorted 
like the /var/qmail/congrol files so domains sort together.[1]  The 
functions that allow you to control the order of lines simply set the 
sequence field.  Provide a function to renumber the sequence.


The fun part is making a .qmail/.vpopmail file look like a table.  I 
think it will be easier to efficiently make the file look like a 
database rather than treating the database like a file.





Rick


[1]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]