RE: Qmail Toaster Help / Perl Help

トップ ページ
添付ファイル:
Eメールのメッセージ
+ (text/plain)
このメッセージを削除
このメッセージに返信
著者: Gilbert T. Gutierrez, Jr.
日付:  
To: 'Main PLUG discussion list'
新しいトピック: Scripting Help (was Qmail Toaster Help / Perl Help)
題目: 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