[vchkpw] Re: 5.4.15 onchange patch
Charles J. Boening wrote: Why not use the .qmail-default to process your skeleton directories? Have it call a script that can test for the existence of the directory and then copy the skeleton as appropriate. Because that would add overhead to every mail delivery for something that is a one-time creation task. This would be significant in large ISP installations. R.
[vchkpw] Re: 5.4.15 onchange patch
Michael Krieger wrote: The reason I mention this is that I'm having a bugger of a job getting my code that implements skel dirs to work with vqadmin - it works fine from the command line (as root) but I get a permission denied error when executing from vqadmin. Have you thought at all about just wrapping your qmail programs executed from tcpserver and doing it at run-time instead of account creation? Example that I use for creating an IMAP folder structure for use with bincimap # /var/qmail/bin/linkwrapper # #!/bin/sh test -d IMAPdir || mkdir IMAPdir test -e IMAPdir/INBOX || ln -sf ../Maildir IMAPdir/INBOX exec $@ Then in my service run file, I have tcpserver parameters and programs \ br /home/vpopmail/bin/vchkpw \ /var/qmail/bin/linkwrapper \ /var/qmail/bin/bincimapd I don't see why you couldn't do the same with your pop daemon or smtp daemon to do some basic parameters (and maybe extend it to keep additional information). Something to consider. On a run of qmail-smtpd, test the timestamp of a file to the cdb file and rebuild if needed. Borrowing a famous perl acronym, TMTOWTDI It is indeed possible to use wrappers as you do, but this adds overhead to every invocation of [insert progran here] which I'd rather avoid. Have you seen qpsmtpd? There's an example of how extensibility should be done. It's incredibly easy to add or modify functionality to qpsmtpd because of the plugin hooks that are built-in. Anyway, I've solved the IMAPdir issue a different way (see separate post). R.
[vchkpw] Patch to create IMAPdir
Hi all, After struggling for sometime to get skeldir functionality to work, I've given up for now. The primary reason for wanting skeldirs was so that new accounts could be created with IMAPdir support for use with bincimap. The following patch modifies vpopmail to create an IMAPdir directory. It also modifies r_chown to work correctly with symlinks (required since IMAPdir contains a symlink IMAPdir/INBOX - ../Maildir/) R. --- vpopmail-5.4.15/vpopmail.c 2006-01-17 11:30:52.0 -0800 +++ vpopmail-5.4.15-IMAPdir/vpopmail.c 2006-03-27 11:30:50.0 -0800 @@ -1298,11 +1298,16 @@ while((mydirent=readdir(mydir))!=NULL){ if ( strncmp(mydirent-d_name,., 2)!=0 strncmp(mydirent-d_name,.., 3)!=0 ) { - stat( mydirent-d_name, statbuf); - if ( S_ISDIR(statbuf.st_mode) ) { -r_chown( mydirent-d_name, owner, group); + lstat( mydirent-d_name, statbuf); + // don't recurse into symlinks - just chown symlink to owner:group + if ( S_ISLNK(statbuf.st_mode) ) { +lchown(mydirent-d_name,owner,group); } else { -chown(mydirent-d_name,owner,group); +if ( S_ISDIR(statbuf.st_mode) ) { + r_chown( mydirent-d_name, owner, group); +} else { + chown(mydirent-d_name,owner,group); +} } } } @@ -2115,7 +2120,7 @@ struct vqpasswd *mypw; char calling_dir[MAX_BUFF]; char domain_dir[MAX_BUFF]; - const char *dirnames[] = {Maildir, Maildir/new, Maildir/cur, + const char *dirnames[] = {Maildir, IMAPdir, Maildir/new, Maildir/cur, Maildir/tmp}; int i; @@ -2175,6 +2180,16 @@ } } + // Add the symlink IMAPdir/INBOX - ../Maildir/ + if (symlink(../Maildir/, IMAPdir/INBOX) == -1) { +fprintf(stderr, make_user_dir: failed to symlink %s\n, IMAPdir/INBOX); +/* back out of changes made above */ +chdir(..); +vdelfiles(username); +chdir(calling_dir); +return(NULL); + } + /* set permissions on the user's dir */ r_chown(., uid, gid);
[vchkpw] /var/qmail/alias/.qmail-user
Hello, I have a server that is setup as having vpopmail installed to run all of the emails without having system accounts. I have got users on the system that have cronjobs running. If those users have a crontab that runs and has an error it will email [EMAIL PROTECTED] the hostname of the server does not have a virtual host setup in vpopmail but I have put aliases into /var/qmail/aliases/.qmail-username. I would have expected that to route the email over to the users vpopmail account however it does not work. Any sugestions? or am I missing something totally stupid? Regards, Jimmy
Re: [vchkpw] Patch to create IMAPdir
Did you see my post last night about the same issue and wrapping a shell script and exec call around bincimap? It means you don't have to deal with this problem for pop/smtp uses, but only imap.Why modify vpopmail to do something specific to another program?-MRobin Bowes [EMAIL PROTECTED] wrote: Hi all,After struggling for sometime to get skeldir functionality to work, I'vegiven up for now.The primary reason for wanting skeldirs was so that new accounts couldbe created with IMAPdir support for use with bincimap.The following patch modifies vpopmail to create an IMAPdir directory.It also modifies r_chown to work correctly with symlinks (required sinceIMAPdir contains a symlink IMAPdir/INBOX - ../Maildir/)R.--- vpopmail-5.4.15/vpopmail.c 2006-01-17 11:30:52.0 -0800+++ vpopmail-5.4.15-IMAPdir/vpopmail.c 2006-03-27 11:30:50.0 -0800@@ -1298,11 +1298,16 @@ while((mydirent=readdir(mydir))!=NULL){ if ( strncmp(mydirent-d_name,".", 2)!=0 strncmp(mydirent-d_name,"..", 3)!=0 ) {- stat( mydirent-d_name, statbuf);- if ( S_ISDIR(statbuf.st_mode) ) {-r_chown( mydirent-d_name, owner, group);+ lstat( mydirent-d_name, statbuf);+ // don't recurse into symlinks - just chown symlink to owner:group+ if ( S_ISLNK(statbuf.st_mode) ) {+lchown(mydirent-d_name,owner,group); } else {-chown(mydirent-d_name,owner,group);+if ( S_ISDIR(statbuf.st_mode) ) {+ r_chown( mydirent-d_name, owner, group);+} else {+ chown(mydirent-d_name,owner,group);+} } } }@@ -2115,7 +2120,7 @@ struct vqpasswd *mypw; char calling_dir[MAX_BUFF]; char domain_dir[MAX_BUFF];- const char *dirnames[] = {"Maildir", "Maildir/new", "Maildir/cur",+ const char *dirnames[] = {"Maildir", "IMAPdir", "Maildir/new","Maildir/cur","Maildir/tmp"}; int i;@@ -2175,6 +2180,16 @@ } }+ // Add the symlink IMAPdir/INBOX - ../Maildir/+ if (symlink("../Maildir/", "IMAPdir/INBOX") == -1) {+fprintf(stderr, "make_user_dir: failed to symlink %s\n","IMAPdir/INBOX");+/* back out of changes made above */+chdir("..");+vdelfiles(username);+chdir(calling_dir);+return(NULL);+ }+ /* set permissions on the user's dir */ r_chown(".", uid, gid);
Re: [vchkpw] Re: 5.4.15 onchange patch
It is indeed possible to use wrappers as you do, but this adds overheadto every invocation of [insert progran here] which I'd rather avoid. How much overhead do you think executing a shell script and an internal call to test implements? How often do you think IMAP connections are made? Think of all the calls that already wrap around shells. Think of how many exec calls (or their variiants in this case) are made to run tcpserver, authentication programs, bincimap-up, and bincimapd? Why not modify bincimap or bincimap-up to do the same thing on invocation and provide the patch to the bincimap folks instead- a likely better way to do things.Just don't get caught up in the hype as to how much faster c programs are- when the shell is probably kept in memory, and the stat calls used by test are cached, this isn't a huge performance hit- especially for a connection like imap that is more persistant.I run about 10K+ users on bincimap through this linkwrapper and generally see almost no load... I know that's vague, but I've never benchmarked the use with or without a simple shell script.It's incredibly easy to add or modify functionality to qpsmtpdbecause of the plugin hooks that are built-in. I'd suggest that: 1. qpsmtpd lacks many plugins and doesn't seem to have a lot of support in the community, along with the various plugin methods to qmail-smtpd. I'm sure there's a good chunk of overhead in there as well, not to mention difficulties like plugin ordering, etc.2. vpopmail manages qmail users and delivers mail. I'm weary of making it even more of a kitchen sink to start adding plugins and management functions that would likely be used by a small number. It's still changing considerably between major releases.Anyway, I've solved the IMAPdir issue a different way (see separate post). Saw it- thumbs up. Glad you solved your issue.-M
[vchkpw] Re: 5.4.15 onchange patch
Michael Krieger wrote: It is indeed possible to use wrappers as you do, but this adds overhead to every invocation of [insert progran here] which I'd rather avoid. How much overhead do you think executing a shell script and an internal call to test implements? How often do you think IMAP connections are made? Think of all the calls that already wrap around shells. Think of how many exec calls (or their variiants in this case) are made to run tcpserver, authentication programs, bincimap-up, and bincimapd? Why not modify bincimap or bincimap-up to do the same thing on invocation and provide the patch to the bincimap folks instead- a likely better way to do things. Just don't get caught up in the hype as to how much faster c programs are- when the shell is probably kept in memory, and the stat calls used by test are cached, this isn't a huge performance hit- especially for a connection like imap that is more persistant. I run about 10K+ users on bincimap through this linkwrapper and generally see almost no load... I know that's vague, but I've never benchmarked the use with or without a simple shell script. All valid points, and I do take the point that the actual real-world hit might not be too bad. However, I see that doing stuff when you create users logically belongs with the program that creates users - vpopmail in this case. So to my perfectionist mind, I'd rather make vpopmail do this once when the user is added than checking for it every time the account is accessed for the lifetime of the account. It's incredibly easy to add or modify functionality to qpsmtpd because of the plugin hooks that are built-in. I'd suggest that: 1. qpsmtpd lacks many plugins and doesn't seem to have a lot of support in the community, along with the various plugin methods to qmail-smtp d. I'm sure there's a good chunk of overhead in there as well, not to mention difficulties like plugin ordering, etc. qpsmtpd functionality is almost all implemented as plugins. If you've not checked it out it's really worth a look. 2. vpopmail manages qmail users and delivers mail. I'm weary of making it even more of a kitchen sink to start adding plugins and management functions that would likely be used by a small number. It's still changing considerably between major releases. I agree with your sentiment, but vpopmail already creates the directory into which the mail is delivered. All I'm suggesting is that there is some degree of flexibility in the structure of that mail directory. Anyway, I've solved the IMAPdir issue a different way (see separate post). Saw it- thumbs up. Glad you solved your issue. Yeah, should have done it this way in the first place but I went looking for a (generic|perfect|correct ) solution. All working nicely now though. R.
[vchkpw] Re: Patch to create IMAPdir
Michael Krieger wrote: Did you see my post last night about the same issue and wrapping a shell script and exec call around bincimap? It means you don't have to deal with this problem for pop/smtp uses, but only imap. Why modify vpopmail to do something specific to another program? For completeness, yes I did see your other post. My other recent reply in this thread answers the same question. As to the question of why modify vpopmail? Well, vpopmail manages users, including the creation of the mail directory. Also, many people have expressed an interest in having a custom directory structure for new users. So, to me, it seems that vpopmail is the right place to implement a custom structure. Possible examples are: - welcome mail for all new users - custom IMAP directories (e.g. Spam) Thanks for the interest. R.
Re: [vchkpw] Re: 5.4.15 onchange patch
On Mar 28, 2006, at 10:37 AM, Robin Bowes wrote: However, I see that doing stuff when you create users logically belongs with the program that creates users - vpopmail in this case. So to my perfectionist mind, I'd rather make vpopmail do this once when the user is added than checking for it every time the account is accessed for the lifetime of the account. I agree with this as well. A single patch to vpopmail to add hooks for adding and deleting users and domains allows for a lot of flexibility. I've seen requests to automatically send a welcome message to new users. Instead of adding it as a feature to vpopmail, it can be a script that gets called automatically. Robin's original requirement (and one that others have had) is to have an alternate Maildir directory layout, with symbolic links. Again, this is easily accommodated (and updated) by calling a script/program on user add. -- Tom Collins - [EMAIL PROTECTED] QmailAdmin: http://qmailadmin.sf.net/ Vpopmail: http://vpopmail.sf.net/
Re: [vchkpw] /var/qmail/alias/.qmail-user
On Mar 28, 2006, at 3:06 AM, Jimmy Stewpot wrote: I would have expected that to route the email over to the users vpopmail account however it does not work. Any sugestions? or am I missing something totally stupid? I did the following on my system to accomplish what you're looking for. Put the server's fqdn (hostname) in /var/qmail/control/me (and locals and rcpthosts/morercpthosts). Put the address to forward to in ~username/.qmail (the user's actual home directory). This allows expert users to update the forwarding address if necessary. If you want to continue trying files in ~qmail/alias, did you make sure they were owned by alias:qmail? That might work... -- Tom Collins - [EMAIL PROTECTED] QmailAdmin: http://qmailadmin.sf.net/ Vpopmail: http://vpopmail.sf.net/
[vchkpw] Re: 5.4.15 onchange patch
Tom Collins wrote: On Mar 28, 2006, at 10:37 AM, Robin Bowes wrote: However, I see that doing stuff when you create users logically belongs with the program that creates users - vpopmail in this case. So to my perfectionist mind, I'd rather make vpopmail do this once when the user is added than checking for it every time the account is accessed for the lifetime of the account. I agree with this as well. A single patch to vpopmail to add hooks for adding and deleting users and domains allows for a lot of flexibility. I've seen requests to automatically send a welcome message to new users. Instead of adding it as a feature to vpopmail, it can be a script that gets called automatically. Robin's original requirement (and one that others have had) is to have an alternate Maildir directory layout, with symbolic links. Again, this is easily accommodated (and updated) by calling a script/program on user add. Tom, One possible issue with using hooks is that they won't work in vqadmin/qmailadmin because the httpd process won't allow the CGI scripts to fork a shell process. Or at least that's what I think was stopping my code to copy skel dirs using a system(cp -r) command from working. R.
Re: [vchkpw] /var/qmail/alias/.qmail-user~
On Tuesday 28 March 2006 16:13, Tom Collins wrote: On Mar 28, 2006, at 3:06 AM, Jimmy Stewpot wrote: I would have expected that to route the email over to the users vpopmail account however it does not work. Any sugestions? or am I missing something totally stupid? I did the following on my system to accomplish what you're looking for. Put the server's fqdn (hostname) in /var/qmail/control/me (and locals and rcpthosts/morercpthosts). Put the address to forward to in ~username/.qmail (the user's actual home directory). This allows expert users to update the forwarding address if necessary. If you want to continue trying files in ~qmail/alias, did you make sure they were owned by alias:qmail? That might work... ownership of files in ~alias has nothing to do with his problem. if 'joe' exists as a system user, qmail will deliver email addressed to joe... to joe. ~alias is only consulted if the user 'joe' doesn't exist. -Jeremy -- Jeremy Kitchen ++ [EMAIL PROTECTED] In the beginning was The Word and The Word was Content-type: text/plain -- The Word of Bob. And the lord said unto John; Come forth and receive eternal life. John came fifth and won a toaster. pgpw10yPFhmxr.pgp Description: PGP signature
Re: [vchkpw] /var/qmail/alias/.qmail-user~
On Mar 28, 2006, at 4:59 PM, Jeremy Kitchen wrote: if 'joe' exists as a system user, qmail will deliver email addressed to joe... to joe. ~alias is only consulted if the user 'joe' doesn't exist. Are you sure about that? I have a ~alias/.qmail-root file that seems to be forwarding email. I do not have a ~root/.qmail file. I also have one for another account so I get the output of its cron jobs. Again. no ~user/.qmail file, just a ~alias/.qmail-user. -- Tom Collins - [EMAIL PROTECTED] QmailAdmin: http://qmailadmin.sf.net/ Vpopmail: http://vpopmail.sf.net/
Re: [vchkpw] /var/qmail/alias/.qmail-user~
On Tuesday 28 March 2006 17:56, Tom Collins wrote: On Mar 28, 2006, at 4:59 PM, Jeremy Kitchen wrote: if 'joe' exists as a system user, qmail will deliver email addressed to joe... to joe. ~alias is only consulted if the user 'joe' doesn't exist. Are you sure about that? I have a ~alias/.qmail-root file that seems to be forwarding email. I do not have a ~root/.qmail file. qmail will not deliver to users with uid of 0, or users who don't own their home directory. For instance, if you have a 'bin' user on your system, its home directory is probably /bin, which is owned by root (and therefore, not bin), so emails to [EMAIL PROTECTED] will be delivered to ~alias/.qmail-bin 'man qmail-getpw' describes this in full detail. -Jeremy -- Jeremy Kitchen ++ [EMAIL PROTECTED] In the beginning was The Word and The Word was Content-type: text/plain -- The Word of Bob. And the lord said unto John; Come forth and receive eternal life. John came fifth and won a toaster. pgpw9yI1RZy1U.pgp Description: PGP signature
[vchkpw] qmail comparison
hi , iam new to qmail instllation server.before starting the qmail instllation i like to know few details, please tell me 1 The advantages and disadvantages qmail, 2 comparison of qmail with other MTA cleint like Exchabge serve,postfix,lotus notes,sendmail.etc 3.wich is stable MTA Best regards, Balaji
Re: [vchkpw] qmail comparison
On Wed, 2006-03-29 at 08:29 +0530, [EMAIL PROTECTED] wrote: hi , iam new to qmail instllation server.before starting the qmail instllation i like to know few details, please tell me 1 The advantages and disadvantages qmail, 2 comparison of qmail with other MTA cleint like Exchabge serve,postfix,lotus notes,sendmail.etc 3.wich is stable MTA Best regards, Balaji I think you really need to answer these questions yourself. There is little to no point in getting others to do your research for you. Shane
[vchkpw] [Fwd: qmail comparison]
Hi, what is this no one replyed to my mail Original Message Subject: qmail comparison From:[EMAIL PROTECTED] Date:Wed, March 29, 2006 8:29 am To: vchkpw@inter7.com -- hi , iam new to qmail instllation server.before starting the qmail instllation i like to know few details, please tell me 1 The advantages and disadvantages qmail, 2 comparison of qmail with other MTA cleint like Exchabge serve,postfix,lotus notes,sendmail.etc 3.wich is stable MTA Best regards, Balaji
Re: [vchkpw] [Fwd: qmail comparison]
yes, sir, right away, SIR! PS try http://www.google.com/search?num=30hl=ensafe=offq=comparison+of+qmail+with+other+MTA+client+like+Exchangespell=1 yes, googling. [EMAIL PROTECTED] wrote: Hi, what is this no one replyed to my mail Original Message Subject: qmail comparison From:[EMAIL PROTECTED] Date:Wed, March 29, 2006 8:29 am To: vchkpw@inter7.com -- hi , iam new to qmail instllation server.before starting the qmail instllation i like to know few details, please tell me 1 The advantages and disadvantages qmail, 2 comparison of qmail with other MTA cleint like Exchabge serve,postfix,lotus notes,sendmail.etc 3.wich is stable MTA Best regards, Balaji