發新話題
打印

[轉貼]/extman/tools 里面几个脚本的功能

[轉貼]/extman/tools 里面几个脚本的功能

http://www.extmail.org/forum/archiver/tid-13615.html

chanli003 发表于 2010-2-6 21:42

/extman/tools 里面几个脚本的功能

adminctl.pl
aliasctl.pl
diffinfo.pl
domainctl.pl
expireusers.pl
maildirmake.pl
purgeuser.pl
reportusage.pl
setid.pl
userctl.pl

这几个脚本到底有什么功能,怎么使用,还是给个文档出来吧,不然做了很多人不知道用浪费了

wxd5981 发表于 2010-2-21 10:29

好建议

lecchi 发表于 2010-9-14 15:53

恩,这些工具其实是很有用的,希望版主能给个文档出来。
我知道其中的两个,分享给大家:
1.expireusers.pl
功能:读出域中所有alive的邮件账号。
用法:/var/www/extsuite/extman/tools/expireusers.pl -all postmaster@yourdomain.com
示例:见附件
2.reportusage.pl
功能:读出域中邮件账号的QUOTA、USAGE和两者的百分比。
用法:/var/www/extsuite/extman/tools/reportusage.pl -all /home/domains postmaster@yourdomain.com
示例:见附件
---------------------------------------------------------------------------------------------------------------------------------
网上搜到到了一些相关的资料,也分享给大家:
引用:
CmdTools 0.1 Beta
对于系统管理员而言,有时候做维护涉及到批量化的操作,比如批量加用户,删用户,或者改密码等。使用web后台会很麻烦,如果能有类似vpopmail的 工具来管理,那就很方便了。Cmdtools 应运而生,它主要提供了对domain,管理员,别名,帐户等4类信息的管理。大致有增/删/改/批量加/删/列表/查询等功能。可以看作是命令行下的 extman。该工具由chifeng 老大设计编写,基于extman的api,因此必须在安装有extman的环境下使用。由于该软件还不成熟,目前在对付一些老的ldap数据时还有些小问 题,所以大家使用时多留意问题,多多反馈,期待下一个版本的Cmdtools将更稳定可靠。
程序主要放在extman/tools下,分别是domainctl.pl, aliasctl.pl, userctl.pl, adminctl.pl及diffinfo.pl。
程序介绍:

引用

domainctl.pl - 管理域名,支持增/删/改/查/列表等。详细用法直接执行就可以看到help了
aliasctl.pl - 别名管理,支持增/删/改/查/列表等
userctl.pl - 用户管理,支持增/批量增/改/删/批量删/列表/查等
adminctl.pl - 管理员管理,支持增/删/改/查等操作
diffinfo.pl - 校验用户在数据库中的记录和实际的邮件目录是否匹配



[ 本帖最后由 lecchi 于 2010-9-14 17:39 编辑 ]

lecchi 发表于 2010-9-14 17:30

这是adminctl.pl的。
以下转自http://hi.baidu.com/shengit/blog ... ec891fb17ec50f.html
-------------------------------------------------分割线-------------------------------------------------
关于 extman tools/adminctl.pl 使用 _ extman 字符下 用户管理
2010/03/24 14:51

版本不同 命令不用
= = =

[root@mail tools]#  cd /var/www/extsuite/extman/tools
[root@mail tools]# ./adminctl.pl

usage: ./adminctl.pl command [options] ...

Commands:

add     -- add a admin
badd    -- batch add admins
del     -- delete a admin
bdel    -- batch delete admins
list    -- list all of admins
show    -- show profile of a admin
mod     -- modify admin infomation
help    -- display this help and exit

Options:

-u, --username="admin"                          A admin name
-p, --password="******"                         Admin password
-f, --file="/path/to/filename.csv"              A CSV file path, Just for batch add users, one user one line
eg: username password domain.tld,domain2.tld,...
-n, --name="name"                               common name
-Q, --question="what are you doing?"            Question?
-A, --answer="play games"                       Answer
-e, --expire="2009-09-17"                       Expire date
-a, --active=1                                  Enable or disable (1 or 0)
-su, --setuid="vuser"                           A system user to setuid if you want
-sg, --setgid="vgroup"                          A system user to setgid if you want
-d, --domains="domain.tld,domain2.tld,..."      Ignore any domains before value,Just set these domains to this admin
-ad, --adddomains="domain.tld,domain2.tld,..."  Append these domains to this admin
-dd, --deldomains="domain.tld,domain2.tld,..."  Delete these domains from current value of this admin
-qq, --quiet                                    quiet mode, no any feedback
-x, --xml                                       xml format output

[root@mail tools]#


= = =

[root@mail tools]# ./adminctl.pl

--managername = managername
--mode = add,badd,del,bdel,list,show,mod,help
--setuid = vuser
--deldomains = domain1.tld,domain2.tld,...
--file = /path/to/filename.csv
--adddomains = domain1.tld,domain2.tld,...
--password = ******
--quiet = 1 or 0
--answer = working
--changepwd = 1 or 0
--name = name
--active = 1 or 0
--question = what are you doing?
--domains = domain1.tld,domain2.tld,...
--expire = 2010-08-18
--setgid = vgroup
[root@mail tools]#


= = =

2个版本修改用户密码

提示报错 :
Can't use string ("") as an ARRAY ref while "strict refs" in use at ../libs/Ext/Mgr/MySQL.pm line 761.

解决方法 :
编辑 adminctl.pl 文件 vi adminctl.pl

将 domain => $domains, 注释 # domain => $domains,


修改用户密码

[root@mail tools]# ./adminctl.pl --mode=mod --managername='root@1314it.com' --password='1314it'

status = 1
answer = postmaster
active = 1
changepwd = 0
name = Super User
manager = root@1314it.com
question = who are you?
domains =
expire = 2015-11-08
password = 1314it
[root@mail tools]#

= = =

[root@mail tools]# ./adminctl.pl --mode=mod -u='sheng@1314it.com' --password='1314it'
sheng@1314it.com Modified!
1314it
[root@mail tools]#


= = =

./adminctl.pl mod --username="root@1314it.com" --password="root" --active=1
root@1314it.com 密码修改成 root


1. 修改 | mod -- modify user infomation
2. 激活 | -a, --active=1

以这个格式去修改

[ 本帖最后由 lecchi 于 2010-9-14 17:32 编辑 ]

TOP

發新話題