[vchkpw] Fwd: template .qmail file

2003-06-13 Thread Tom Collins
Begin forwarded message:
From: Ryan Summers [EMAIL PROTECTED]>
Date: Fri Jun 13, 2003  2:15:24  PM America/Phoenix
To: [EMAIL PROTECTED]
Subject: [qmailadmin] template .qmail file



Perhaps this is a strange request, but here goes...

It would be nice to have a template .qmail file that gets coppied into the vpopmail user's directory when creating a new user.  This would work sort of like how useradd takes /etc/skel and copies those files into the new user's home dir.

Reason for this?

I want to be able to use the .qmail file to call a script that filters spam (using the spamassassin spamc/spamd) 

Perhaps there's a better way to do this using qmail (filtering at the queue level perhaps)?  Any suggestions are more than welcome.

Anyways, the .qmail file will work for now.  I was able to hack the user.c addusernow() function so that it copies a .qmail file into the new user's directory.  If anybody is interested in how I did this let me know... its a pretty ugly hack though.

Ryan / Plastic Portal


MM Recordings http://www.mmrecordings.com

This request is probably more appropriate for vpopmail development.

Could one of the vpopmail developers consider submitting a patch to make_user_dir that would copy a default .qmail file (perhaps from ~vpopmail/etc?) into the new user's directory?

You could insert the code here:

if ( chdir(username) != 0 ) {
chdir(tmpbuf); free(tmpbuf); free(tmpdir);
printf( make_user_dir: error 2\n);
return(NULL);
}
/* insert code to copy default .qmail file */
if (mkdir(Maildir,VPOPMAIL_DIR_MODE) == -1){
chdir(tmpbuf); free(tmpbuf); free(tmpdir);
printf(make_user_dir: error 3\n);
return(NULL);
}

Thoughts?

--
Tom Collins
[EMAIL PROTECTED]



Re: [vchkpw] Fwd: template .qmail file

2003-06-13 Thread Tom Collins
On Friday, June 13, 2003, at 04:33  PM, Ron Guerin wrote:
It would be nice to have a template .qmail file that gets coppied into
the vpopmail user's directory when creating a new user.  This would
work sort of like how useradd takes /etc/skel and copies those files
into the new user's home dir.
This is a job for a BASH script around vadduser, not a patch.
That would work, but then you'd have different behavior when adding 
users from the command line (vadduser) and from qmailadmin (which uses 
the vpopmail libraries).  I was hoping for consistent behavior, perhaps 
even with other programs that might link into vpopmail.

A modification that used a skeleton directory could also be useful for 
those who want to have extra Maildirs automatically created (say for 
SPAM) on user creation.  A shell script wrapper does the trick on the 
command line, but not for qmailadmin.

--
Tom Collins
[EMAIL PROTECTED]