Qmail Toaster Help / Perl Help

Jeremy C. Reed reed at reedmedia.net
Fri Dec 15 11:08:07 MST 2006


> Below is what I would execute using a shell to create users into the
> toaster.
> 
> /home/vpopmail/bin/vadduser USER at DOMAIN PASSWORD
...

> Maybe, is there a way to create a shell script to process a csv file and do
> the same thing.

Here is an example:

glacier:/tmp$ cat users.csv                                                    
bob,example.com,RH5dHyohFVLp2
susan,foo.bar,od6Ce0r3LGawI
sauce,pizza,19eelsSOQVeFc

cat users.csv  | tr "," " " | while read USER DOMAIN PASSWORD ; do \
  /home/vpopmail/bin/vadduser "${USER}@${DOMAIN}" "${PASSWORD}" ; done


Not a true CSV parser, but maybe good enough for you...

If your data file has quotes or spaces, we may need to do some sed magic 
to clean up first.


More information about the PLUG-discuss mailing list