Halo John,
I am replied to qmailtoaster list so everyone can also use it as reference for future use or correct me If I am making an error.
In your case, I have modified the script into below
===============================
#!/bin/sh
#
#  BULK USER ADDING FOR QMAIL TOASTER
#
# Created after I ran into an issue of creating 20,000 users on my toaster!
# Initial ideas come from a script that PakOgah "pako...@pala.bo-tak.info"
# helped me with.
# Still very manual, but Work in Progress
#
# Suggestions to akisa...@ucu.ac.ug
#
# Change a few variables and you are good to go
#
#
# Location of the users file
# Rememeber that the users file is in the format
# Firstname Lastname Username Password
USERS_FILE="/path/to/file.txt"
# The mail domain to which users are created
#
MAILDOMAIN="@domain.com"
# the vadduser command
QMAILADD="/home/vpopmail/bin/vadduser"
# Select a default password for all users
#PASS="mypass"
#Specify the Default Quota_in_bytes for your Users
# 10 MB = 10 x 1024 x 1024
QUOTA="10485760"
#Fun starts here No more variables to change below this line
cat ${USERS_FILE} | \
while read FIRSTNAME LASTNAME USERNAME PASSWORD
do
 echo "adding the user: $USERNAME"
$QMAILADD -q $QUOTA -c "$FIRSTNAME $LASTNAME" $USERNAME$MAILDOMAIN $PASSWORD
done
#
===============================

John Hansen wrote:
Hi,

I'm looking at using this script for a bulk user import, but the users have
passwords all ready, so I don't want to use the same default password for
everyone. What changes would I need in the script so I can use it with a
separate password for each user?

I was thinking the format for the users file could just include the extra line
for the password.
Firstname Lastname Username Password


#!/bin/sh
#
#  BULK USER ADDING FOR QMAIL TOASTER
#
# Created after I ran into an issue of creating 20,000 users on my toaster!
# Initial ideas come from a script that PakOgah "pako...@pala.bo-tak.info"
# helped me with.
# Still very manual, but Work in Progress
#
# Suggestions to akisa...@ucu.ac.ug
#
# Change a few variables and you are good to go
#
#
# Location of the users file
# Rememeber that the users file is in the format
# Firstname Lastname Username
USERS_FILE="/path/to/file.txt"
# The mail domain to which users are created
#
MAILDOMAIN="@domain.com"
# the vadduser command
QMAILADD="/home/vpopmail/bin/vadduser"
# Select a default password for all users
PASS="mypass"
#Specify the Default Quota_in_bytes for your Users
# 10 MB = 10 x 1024 x 1024
QUOTA="10485760"
#Fun starts here No more variables to change below this line
cat ${USERS_FILE} | \
while read FIRSTNAME LASTNAME USERNAME
do
  echo "adding the user: $USERNAME"
        $QMAILADD -q $QUOTA -c "$FIRSTNAME $LASTNAME" $USERNAME$MAILDOMAIN $PASS
done
#

Thanks,

John




---------------------------------------------------------------------------------
Qmailtoaster is sponsored by Vickers Consulting Group 
(www.vickersconsulting.com)
   Vickers Consulting Group offers Qmailtoaster support and installations.
     If you need professional help with your setup, contact them today!
---------------------------------------------------------------------------------
    Please visit qmailtoaster.com for the latest news, updates, and packages.
To unsubscribe, e-mail: qmailtoaster-list-unsubscr...@qmailtoaster.com
    For additional commands, e-mail: qmailtoaster-list-h...@qmailtoaster.com


Reply via email to