Re: [vchkpw] Help! /var/qmail removed
John Simpson wrote: i've run into the same thing with qmailadmin and vqadmin, and even went so far as to write a patch for vqadmin (which has been ignored by inter7 for two years- maybe mentioning it again here will make somebody look at it? visit http://qmail.jms1.net/ and search for "vqadmin" to see the patch.) Thanks for the link John. I'm going to attempt, again, to collect updates to vqadmin and release a new version. Ken Jones
Re: [vchkpw] Help! /var/qmail removed
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 John Simpson wrote: > is there a reason you couldn't have it recursively run itself using > "$0" instead of forcing a fixed name? does it not work this way, or is > this a testing version and not meant to be a finished product yet? Because that wont exist when it goes into a sub directory. > also, you're hard-coding the numeric uid/gid for the vpopmail user... > you can do this at the beginning with Well, thanks for pointing that out, but the reason I'm releasing the script is not so people with absolutely no idea what they're doing can generate the control files, but so that walking the hashed directories can be shown. :) Let me rephrase that so it's ultimately clear, I'm not looking for suggestions and patches that make this the end-all control file generating script, I just wanted to get the directory tree walking portion out to people who had asked how. > i've run into the same thing with qmailadmin and vqadmin, and even went > so far as to write a patch for vqadmin (which has been ignored by > inter7 for two years- maybe mentioning it again here will make somebody It's hardly ignored, as we deal with it on a daily basis, however, our development efforts, yes, are currently in another direction. - -- /* Matt Brookings <[EMAIL PROTECTED]> GnuPG Key B7B54216 Software developer Systems technician Inter7 Internet Technologies, Inc. (815)776-9465 */ -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQFDMBnNhzYRRre1QhYRAlmLAJsHliz69gwA8i/lZkJNSxl6HUelQQCfYoQs CAEwyouvaN7JUsU9cSGCB+A= =Iahj -END PGP SIGNATURE-
Re: [vchkpw] Help! /var/qmail removed
On 2005-09-19, at 1406, Matt Brookings wrote: I just wanted to follow this posting up with a script that handles hashed domains directories. It's a little longer the previous one, and may be a little fishy on older bash shells, but it should work on any newer systems. If you use it, let me know how it goes, or any changes you feel should be made. As the comment says at the top, you must name this script gen- hashed.sh since it calls itself for recursion through the hashed directories, and the script should be copied to ~vpopmail/domains and executed there. is there a reason you couldn't have it recursively run itself using "$0" instead of forcing a fixed name? does it not work this way, or is this a testing version and not meant to be a finished product yet? also, you're hard-coding the numeric uid/gid for the vpopmail user... you can do this at the beginning with VU=`id -u vpopmail` VG=`id -g vpopmail` then use ${VU} and ${VG} instead of 89 when generating the assign file. i've found it dangerous to make too many assumptions about how and where a program is run... i have a queue repair script, and early versions made the assumption that the bucket count was 23- somebody with a different bucket count ran it on their queue without reading the directions, and ended up causing more damage instead of fixing anything. i ended up having it call "qmail-showctl | grep split:" to use the correct count now... i've run into the same thing with qmailadmin and vqadmin, and even went so far as to write a patch for vqadmin (which has been ignored by inter7 for two years- maybe mentioning it again here will make somebody look at it? visit http://qmail.jms1.net/ and search for "vqadmin" to see the patch.) -- | 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
Re: [vchkpw] Help! /var/qmail removed
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jan-Willem Regeer wrote: > > On Aug 8, 2005, at 4:52 PM, Matt Brookings wrote: > > Rick Macdougall wrote: > | Matt Brookings wrote: > |> | > |> | #!/bin/sh > |> | # > |> | # 06/21/05 > |> | # <[EMAIL PROTECTED]> > |> | # > |> | # Using vpopmail/domains directory, and locals file, > |> | # generate rcpthosts, virtualdomains, and users/assign > |> | # > |> | > |> | rm -f assign rcpthosts virtualdomains > |> | > |> | cat /var/qmail/control/locals > rcpthosts > |> | > |> | for i in *; do > |> | ~if [ ! -d $i ]; then > |> | ~continue; > |> | ~fi > |> | > |> | ~echo "+$i-:$i:89:89:/home/vpopmail/domains/$i:-::" >> > assign > |> | ~echo "$i" >> rcpthosts > |> | ~echo "$i:$i" >> virtualdomains > |> | done > |> | > |> | echo "." >> assign I just wanted to follow this posting up with a script that handles hashed domains directories. It's a little longer the previous one, and may be a little fishy on older bash shells, but it should work on any newer systems. If you use it, let me know how it goes, or any changes you feel should be made. As the comment says at the top, you must name this script gen-hashed.sh since it calls itself for recursion through the hashed directories, and the script should be copied to ~vpopmail/domains and executed there. Again, let me know how it goes! #!/bin/sh # # Generate control files from hashed # vpopmail domain tree. Should be run # from ~vpopmail/domains directory, # and script should be named gen-hashed.sh # # <[EMAIL PROTECTED]> # SUB="" rm -f users.assign control.rcpthosts control.virtualdomains if [ $# -eq 1 ]; then CPWD=$PWD SUB=$1/ cd $1 fi for i in *; do if [ ! -d $i ]; then continue fi if [ ${#i} -eq 1 ]; then ~vpopmail/domains/gen-hashed.sh $i continue fi if [ "$CPWD" != "" ]; then CPWD="${CPWD}/" fi echo "+$i-:$i:89:89:$PWD/$i:-::" >> ${CPWD}users.assign echo "$i:$i" >> ${CPWD}control.virtualdomains echo "$i" >> ${CPWD}control.rcpthosts done if [ "$SUB" != "" ]; then cd $CPWD fi if [ $# -eq 0 ]; then echo "." >> ${CPWD}users.assign fi - -- /* Matt Brookings <[EMAIL PROTECTED]> GnuPG Key B7B54216 Software developer Systems technician Inter7 Internet Technologies, Inc. (815)776-9465 */ -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQFDLv4zhzYRRre1QhYRAiRFAJ4nah4+RVzvG9bWJGOLaBD4aj580gCeNtTV k5cgtP2DJL5DE8+uJaZWmvc= =Uis0 -END PGP SIGNATURE-
Re: [vchkpw] Help! /var/qmail removed
On Aug 8, 2005, at 4:52 PM, Matt Brookings wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Rick Macdougall wrote: | Matt Brookings wrote: | |> -BEGIN PGP SIGNED MESSAGE- |> Hash: SHA1 |> |> Matt Brookings wrote: |> | Timothy Arnold wrote: |> | | |> | |> If you have your qmail source tree cd into it and type |> | |> make setup check |> | |> |> | |> You will probably have to re-install vpopmail and qmailadmin as well |> | |> |> | |> If not you will have to rebuild from scratch ;-( |> | |> |> | | |> | | Hmm, how do I generate all of the virtualdomains, rcpthosts, append, |> | | assign etc for the vpopmail hosted domains? |> | | |> | | Cheers |> | | Tim. |> | | |> | | |> | | |> | |> | #!/bin/sh |> | # |> | # 06/21/05 |> | # <[EMAIL PROTECTED]> |> | # |> | # Using vpopmail/domains directory, and locals file, |> | # generate rcpthosts, virtualdomains, and users/assign |> | # |> | |> | rm -f assign rcpthosts virtualdomains |> | |> | cat /var/qmail/control/locals > rcpthosts |> | |> | for i in *; do |> | ~if [ ! -d $i ]; then |> | ~continue; |> | ~fi |> | |> | ~echo "+$i-:$i:89:89:/home/vpopmail/domains/$i:-::" >> assign |> | ~echo "$i" >> rcpthosts |> | ~echo "$i:$i" >> virtualdomains |> | done |> | |> | echo "." >> assign |> | |> | |> | |> |> Change into the vpopmail domains directory, and create |> this script. Edit the 89:89 part to proper uid/gid of |> vpopmail:vchkpw. Then run the script and move the created |> control files into your qmail directories. Run |> /var/qmail/bin/qmail-newu, and you're all set. | | | Hi, | | Except you'll miss domains that are hashed. | | Something like | | vpopbull -n | cut -d "@" -f 2 | sort | uniq | | will work better except you'll have to manually weed out any domain | aliases. | | Regards, | | Rick Of course, but chances someone who wiped their /var/qmail has enough domains to hash? :) - -- /* ~Matt Brookings <[EMAIL PROTECTED]> GnuPG Key B7B54216 ~Software developer Systems technician ~Inter7 Internet Technologies, Inc. (815)776-9465 */ -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQFC93G8hzYRRre1QhYRAom0AJwOW077jG0g+lnGwvjbYqSrfWyoTACfQDJU +HDkIoh/GWFLtVO1rb3jNWI= =NMoC -END PGP SIGNATURE- Well, i knew a sysadmin with over 1,000 domains who failed to remember to add a . to a rm -rf, causing him to wipe out most of his drives before he noticed his error. rm -rf /* instead of rm -rf ./*. vpopmail would have been hashing at 1,000 domains. Jan-Willem Regeer This message is authored under the license which can be found at http://x-istence.com/LICENSE smime.p7s Description: S/MIME cryptographic signature
Re: [vchkpw] Help! /var/qmail removed
Matt, Worked a treat - thanks for that! Tim - Original Message - From: "Matt Brookings" <[EMAIL PROTECTED]> To: Sent: Monday, August 08, 2005 3:39 PM Subject: Re: [vchkpw] Help! /var/qmail removed -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Matt Brookings wrote: | Timothy Arnold wrote: | | | |> If you have your qmail source tree cd into it and type | |> make setup check | |> | |> You will probably have to re-install vpopmail and qmailadmin as well | |> | |> If not you will have to rebuild from scratch ;-( | |> | | | | Hmm, how do I generate all of the virtualdomains, rcpthosts, append, | | assign etc for the vpopmail hosted domains? | | | | Cheers | | Tim. | | | | | | | | #!/bin/sh | # | # 06/21/05 | # <[EMAIL PROTECTED]> | # | # Using vpopmail/domains directory, and locals file, | # generate rcpthosts, virtualdomains, and users/assign | # | | rm -f assign rcpthosts virtualdomains | | cat /var/qmail/control/locals > rcpthosts | | for i in *; do | ~if [ ! -d $i ]; then | ~continue; | ~fi | | ~echo "+$i-:$i:89:89:/home/vpopmail/domains/$i:-::" >> assign | ~echo "$i" >> rcpthosts | ~echo "$i:$i" >> virtualdomains | done | | echo "." >> assign | | | Change into the vpopmail domains directory, and create this script. Edit the 89:89 part to proper uid/gid of vpopmail:vchkpw. Then run the script and move the created control files into your qmail directories. Run /var/qmail/bin/qmail-newu, and you're all set. - -- /* ~Matt Brookings <[EMAIL PROTECTED]> GnuPG Key B7B54216 ~Software developer Systems technician ~Inter7 Internet Technologies, Inc. (815)776-9465 */ -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQFC926/hzYRRre1QhYRAh51AJ9aN7sJCYHyQGl/vW32IKqlOGaVPgCfTxW4 vagzr9lafE7Arc9JPLXclZI= =GJdx -END PGP SIGNATURE-
Re: [vchkpw] Help! /var/qmail removed
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Rick Macdougall wrote: | Matt Brookings wrote: | |> -BEGIN PGP SIGNED MESSAGE- |> Hash: SHA1 |> |> Matt Brookings wrote: |> | Timothy Arnold wrote: |> | | |> | |> If you have your qmail source tree cd into it and type |> | |> make setup check |> | |> |> | |> You will probably have to re-install vpopmail and qmailadmin as well |> | |> |> | |> If not you will have to rebuild from scratch ;-( |> | |> |> | | |> | | Hmm, how do I generate all of the virtualdomains, rcpthosts, append, |> | | assign etc for the vpopmail hosted domains? |> | | |> | | Cheers |> | | Tim. |> | | |> | | |> | | |> | |> | #!/bin/sh |> | # |> | # 06/21/05 |> | # <[EMAIL PROTECTED]> |> | # |> | # Using vpopmail/domains directory, and locals file, |> | # generate rcpthosts, virtualdomains, and users/assign |> | # |> | |> | rm -f assign rcpthosts virtualdomains |> | |> | cat /var/qmail/control/locals > rcpthosts |> | |> | for i in *; do |> | ~if [ ! -d $i ]; then |> | ~continue; |> | ~fi |> | |> | ~echo "+$i-:$i:89:89:/home/vpopmail/domains/$i:-::" >> assign |> | ~echo "$i" >> rcpthosts |> | ~echo "$i:$i" >> virtualdomains |> | done |> | |> | echo "." >> assign |> | |> | |> | |> |> Change into the vpopmail domains directory, and create |> this script. Edit the 89:89 part to proper uid/gid of |> vpopmail:vchkpw. Then run the script and move the created |> control files into your qmail directories. Run |> /var/qmail/bin/qmail-newu, and you're all set. | | | Hi, | | Except you'll miss domains that are hashed. | | Something like | | vpopbull -n | cut -d "@" -f 2 | sort | uniq | | will work better except you'll have to manually weed out any domain | aliases. | | Regards, | | Rick Of course, but chances someone who wiped their /var/qmail has enough domains to hash? :) - -- /* ~Matt Brookings <[EMAIL PROTECTED]> GnuPG Key B7B54216 ~Software developer Systems technician ~Inter7 Internet Technologies, Inc. (815)776-9465 */ -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQFC93G8hzYRRre1QhYRAom0AJwOW077jG0g+lnGwvjbYqSrfWyoTACfQDJU +HDkIoh/GWFLtVO1rb3jNWI= =NMoC -END PGP SIGNATURE-
Re: [vchkpw] Help! /var/qmail removed
Matt Brookings wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Matt Brookings wrote: | Timothy Arnold wrote: | | | |> If you have your qmail source tree cd into it and type | |> make setup check | |> | |> You will probably have to re-install vpopmail and qmailadmin as well | |> | |> If not you will have to rebuild from scratch ;-( | |> | | | | Hmm, how do I generate all of the virtualdomains, rcpthosts, append, | | assign etc for the vpopmail hosted domains? | | | | Cheers | | Tim. | | | | | | | | #!/bin/sh | # | # 06/21/05 | # <[EMAIL PROTECTED]> | # | # Using vpopmail/domains directory, and locals file, | # generate rcpthosts, virtualdomains, and users/assign | # | | rm -f assign rcpthosts virtualdomains | | cat /var/qmail/control/locals > rcpthosts | | for i in *; do | ~if [ ! -d $i ]; then | ~continue; | ~fi | | ~echo "+$i-:$i:89:89:/home/vpopmail/domains/$i:-::" >> assign | ~echo "$i" >> rcpthosts | ~echo "$i:$i" >> virtualdomains | done | | echo "." >> assign | | | Change into the vpopmail domains directory, and create this script. Edit the 89:89 part to proper uid/gid of vpopmail:vchkpw. Then run the script and move the created control files into your qmail directories. Run /var/qmail/bin/qmail-newu, and you're all set. Hi, Except you'll miss domains that are hashed. Something like vpopbull -n | cut -d "@" -f 2 | sort | uniq will work better except you'll have to manually weed out any domain aliases. Regards, Rick
Re: [vchkpw] Help! /var/qmail removed
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Matt Brookings wrote: | Timothy Arnold wrote: | | | |> If you have your qmail source tree cd into it and type | |> make setup check | |> | |> You will probably have to re-install vpopmail and qmailadmin as well | |> | |> If not you will have to rebuild from scratch ;-( | |> | | | | Hmm, how do I generate all of the virtualdomains, rcpthosts, append, | | assign etc for the vpopmail hosted domains? | | | | Cheers | | Tim. | | | | | | | | #!/bin/sh | # | # 06/21/05 | # <[EMAIL PROTECTED]> | # | # Using vpopmail/domains directory, and locals file, | # generate rcpthosts, virtualdomains, and users/assign | # | | rm -f assign rcpthosts virtualdomains | | cat /var/qmail/control/locals > rcpthosts | | for i in *; do | ~if [ ! -d $i ]; then | ~continue; | ~fi | | ~echo "+$i-:$i:89:89:/home/vpopmail/domains/$i:-::" >> assign | ~echo "$i" >> rcpthosts | ~echo "$i:$i" >> virtualdomains | done | | echo "." >> assign | | | Change into the vpopmail domains directory, and create this script. Edit the 89:89 part to proper uid/gid of vpopmail:vchkpw. Then run the script and move the created control files into your qmail directories. Run /var/qmail/bin/qmail-newu, and you're all set. - -- /* ~Matt Brookings <[EMAIL PROTECTED]> GnuPG Key B7B54216 ~Software developer Systems technician ~Inter7 Internet Technologies, Inc. (815)776-9465 */ -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQFC926/hzYRRre1QhYRAh51AJ9aN7sJCYHyQGl/vW32IKqlOGaVPgCfTxW4 vagzr9lafE7Arc9JPLXclZI= =GJdx -END PGP SIGNATURE-
Re: [vchkpw] Help! /var/qmail removed
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Timothy Arnold wrote: | |> If you have your qmail source tree cd into it and type |> make setup check |> |> You will probably have to re-install vpopmail and qmailadmin as well |> |> If not you will have to rebuild from scratch ;-( |> | | Hmm, how do I generate all of the virtualdomains, rcpthosts, append, | assign etc for the vpopmail hosted domains? | | Cheers | Tim. | | | #!/bin/sh # # 06/21/05 # <[EMAIL PROTECTED]> # # Using vpopmail/domains directory, and locals file, # generate rcpthosts, virtualdomains, and users/assign # rm -f assign rcpthosts virtualdomains cat /var/qmail/control/locals > rcpthosts for i in *; do ~if [ ! -d $i ]; then ~continue; ~fi ~echo "+$i-:$i:89:89:/home/vpopmail/domains/$i:-::" >> assign ~echo "$i" >> rcpthosts ~echo "$i:$i" >> virtualdomains done echo "." >> assign - -- /* ~Matt Brookings <[EMAIL PROTECTED]> GnuPG Key B7B54216 ~Software developer Systems technician ~Inter7 Internet Technologies, Inc. (815)776-9465 */ -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQFC9257hzYRRre1QhYRAibjAJ46T1+8TKMC1RhDFpghdLZOGor7KwCfZ5zA YM3eS31ZqFR57IVdGfqO3/k= =0mYG -END PGP SIGNATURE-
Re: [vchkpw] Help! /var/qmail removed
On Monday 08 Aug 2005 13:22, Timothy Arnold wrote: > > If you have your qmail source tree cd into it and type > > make setup check > > > > You will probably have to re-install vpopmail and qmailadmin as well > > > > If not you will have to rebuild from scratch ;-( > > Hmm, how do I generate all of the virtualdomains, rcpthosts, append, assign > etc for the vpopmail hosted domains? eek carefully you should be able to find the info you need in each vpopmail/domains//vpasswd move the existing out of the way, parse the vpasswd files and use vadddomain and vadduser to rebuild the control files, then overwrite the newly created with the original ones as you will be replacing the new vpasswd files with the old ones you can use a dummy password good luck, and make backups when you are finished! > > Cheers > Tim. -- - Bob Hutchinson Midwales dot com -
Re: [vchkpw] Help! /var/qmail removed
Timothy Arnold wrote: Hello! I am in need of some assistance! I have managed to lose /var/qmail and all I have left is /home/vpopmail and the mysql database. What is the easiest way to recreate all of the required qmail files?? You might want to see if anyone else has suggestions, but if you have a relatively standard installation... Move the /home/vpopmail directory somewhere else. (/home/vpopmail.old) Move the mysql database (/var/lib/mysql/vpopmail?) somewhere else. Reinstall qmail and vpopmail following the same toaster you used before. ls /home/vpopmail.old/domains and execute vadddomain for each domain. Replace the original /home/vpopmail and database directory.
Re: [vchkpw] Help! /var/qmail removed
From your backup!? which I don't have :(very very stupid I know
Re: [vchkpw] Help! /var/qmail removed
> >> If you have your qmail source tree cd into it and type >> make setup check >> >> You will probably have to re-install vpopmail and qmailadmin as well >> >> If not you will have to rebuild from scratch ;-( >> > > Hmm, how do I generate all of the virtualdomains, rcpthosts, append, > assign > etc for the vpopmail hosted domains? > > Cheers > Tim. > > > >From your backup!?
Re: [vchkpw] Help! /var/qmail removed
If you have your qmail source tree cd into it and type make setup check You will probably have to re-install vpopmail and qmailadmin as well If not you will have to rebuild from scratch ;-( Hmm, how do I generate all of the virtualdomains, rcpthosts, append, assign etc for the vpopmail hosted domains? Cheers Tim.
Re: [vchkpw] Help! /var/qmail removed
On Monday 08 Aug 2005 12:48, Timothy Arnold wrote: > Hello! > > I am in need of some assistance! I have managed to lose /var/qmail and all > I have left is /home/vpopmail and the mysql database. What is the easiest > way to recreate all of the required qmail files?? If you have your qmail source tree cd into it and type make setup check You will probably have to re-install vpopmail and qmailadmin as well If not you will have to rebuild from scratch ;-( > > Cheers > Tim. -- - Bob Hutchinson Midwales dot com -