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 表进行查询;
  • 相关阅读:
    【转载】一键安装maven脚本
    secureCRT的自动登录设置
    vi相关内容
    windows上的命令telnet
    【转载】bash: ifconfig: command not found 解决办法
    【转载】Linux中profile、bashrc、bash_profile之间的区别和联系
    virgo-tomcat没有任务错误日志的停掉的解决办法
    【转载】Linux kill, killall, kill -9
    #!bin/sh是啥
    Mysql 查找表中的多组前n大元素
  • 原文地址:https://www.cnblogs.com/sharesdk/p/9209141.html
Copyright © 2011-2022 走看看