RE: Qmail Toaster Help / Perl Help

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Gilbert T. Gutierrez, Jr.
Date:  
To: 'Main PLUG discussion list'
New-Topics: Scripting Help (was Qmail Toaster Help / Perl Help)
Subject: RE: Qmail Toaster Help / Perl Help
My Script (the cvs file is in the following format
"Username,Password,Domain," with that extra comma that way I loose the end
of line character)...

Now all I need to do is import mail.

Gilbert

#!/usr/bin/perl
# This is a test script to take users with
# encrypted passwords from IMAIL to QMAIL TOASTER

use Crypt::Imail;

# open the csv file
open(CSV,"passwords.csv") or die "Cannot open passwords.csv!\n";

$im = Crypt::Imail->new();

my $string = <CSV>;

while (<CSV>) {
# create an array
my @list = split (/,/);
# decrypt password
my $password = $im->decrypt(lc"$list[0]",$list[1]);
# print to shell username and password
print "The Password is for $list[0]... $password.\n";
# add the user to the toaster
system ("/home/vpopmail/bin/vadduser", "$list[0]\@$list[2]", "$password");
}
# close the csv file
close(CSV);

---
[ This E-mail was scanned for viruses by Phoenix Internet ]
[ Phoenix Internet http://www.phoenixinternet.net ]

---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss