QmailtoasterMain Page | About | Help | FAQ | Special pages | Log in

Printable version | Disclaimers | Privacy policy

Bulk User Adding For Qmail Toaster

From Qmailtoaster

Greetings, With help from the script PakOgah sent me I have created a bulk user adding script! It reads a text file which has entries like FIRSTNAME LASTNAME USERNAME And automatically adds the users in the text file, creates a comment field sets a default quota and password Suggestions are welcome. The script is attarched. Its still missing some functionality but its work in progress Kisakye ALex akisakye@ucu.ac.ug


#!/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 "pakogah@pala.bo-tak.info"
# helped me with.
# Still very manual, but Work in Progress
#
# Suggestions to akisakye@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
#

Retrieved from "http://wiki.qmailtoaster.com/index.php/Bulk_User_Adding_For_Qmail_Toaster"

This page has been accessed 9,701 times. This page was last modified on 25 June 2007, at 08:28. Content is available under GNU Free Documentation License 1.2.


Find

Browse
Main page
Community portal
Current events
Recent changes
Random page
Help
Edit
View source
Editing help
This page
Discuss this page
New section
Printable version
Context
Page history
What links here
Related changes
My pages
Log in / create account
Special pages
New pages
File list
Statistics
More...