Re: Qmail Toaster Help / Perl Help

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Jeremy C. Reed
Date:  
To: Main PLUG discussion list
Subject: Re: Qmail Toaster Help / Perl Help
> Below is what I would execute using a shell to create users into the
> toaster.
>
> /home/vpopmail/bin/vadduser USER@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.
---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss