zoukankan      html  css  js  c++  java
  • Extmail 邮箱服务器

    Extmail 邮箱服务器 - 批量添加邮箱用户

    需要修改  userctl.pl  文件

    修改 userctl.pl 文件
    
    cd /var/www/extsuite/extman/tools
    
    编辑 userctl.pl   修改 sub adduer 模块 和 sub badd 模块;

     1、修改 sub adduer 模块;

    注销 my $name 行;重新添加
    
    sub adduser { ... my $email
    = $_[0]; my $password = $_[1]; # 添加 my $name = my $name = $_[2]; my ($user,$domain) = split(/@/,$email); ... my $question = defined $opt{question} ? $opt{question} : ""; my $answer = defined $opt{answer} ? $opt{answer} : ""; # 注释 my $name = # my $name = defined $opt{name} ? $opt{name} : $user; my $mailhost = defined $opt{mailhost} ? $opt{mailhost} : ""; }

    2、修改 sub badd 模块;

    sub badd {
        if(!$opt{file}){
            push @exp, { prompt => "Please input a text file!" , status => 0};
            output ;
        }
        if( -e $opt{file} ){
            my @info;
            my $rv;
            open(BAF,"< $opt{file}")
                or die "Can't open $opt{file} !
    ";
            while(<BAF>){
                chomp;
                @info = split(/ /, untaint($_));
           # 添加 $info[2] ; $rv
    = adduser $info[0],$info[1],$info[2]; } close BAF; }else{ push @exp, { prompt => "File no exist!" , status => 0}; } output ; }

    3、创建 批量邮箱账户模板文件;注意  txt 编码格式需要是 UTF-8 格式;

    用户信息文件格式(Email地址、密码、邮箱配额、netdisk配额MB、名字)
    # cat adduser.txt

    user1@testextmail.com passwd 100 5 user1
    user2@testextmail.com passwd 100 5 user2
    user3@testextmail.com passwd 100 5 user3
    user4@testextmail.com passwd 100 5 user4
    user5@testextmail.com passwd 100 5 user5
    user6@testextmail.com passwd 100 5 user6
    user7@testextmail.com passwd 100 5 user7
    user8@testextmail.com passwd 100 5 user8
    user9@testextmail.com passwd 100 5 user9

    4、执行 perl 批量添加账户:

    /var/www/extsuite/extman/tools 当前目录下 
    
    执行:
    
    # perl ./userctl.pl --mod=badd --file=adduser.txt --setuid=1000 --setgid=1000

    然后可以到 数据量的 mailbox 表进行查询;
  • 相关阅读:
    并发学习之:不使用内核对象同步的并发队列
    破解C#的readonly只读字段
    并发学习之:乱序执行和内存屏障
    并发学习之:缓存一致性
    并发学习之:Keyed Events(没看懂,要调试下才能明白,伤心!)
    静态和非静态的访问
    asc2码
    学习报告
    11号学习总结
    9号总结
  • 原文地址:https://www.cnblogs.com/sharesdk/p/9209141.html
Copyright © 2011-2022 走看看