查看完整版本: [轉貼]/extman/tools 里面几个脚本的功能

chun 2014-12-9 14:59

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

http://www.extmail.org/forum/archiver/tid-13615.html<br><p class="author"><strong>chanli003</strong> 发表于 2010-2-6 21:42</p>
<h3>/extman/tools 里面几个脚本的功能</h3>adminctl.pl<br>
aliasctl.pl<br>
diffinfo.pl<br>
domainctl.pl<br>
expireusers.pl<br>
maildirmake.pl<br>
purgeuser.pl<br>
reportusage.pl<br>
setid.pl<br>
userctl.pl<br>
<br>
这几个脚本到底有什么功能,怎么使用,还是给个文档出来吧,不然做了很多人不知道用浪费了<p class="author"><strong>wxd5981</strong> 发表于 2010-2-21 10:29</p>
好建议<p class="author"><strong>lecchi</strong> 发表于 2010-9-14 15:53</p>
恩,这些工具其实是很有用的,希望版主能给个文档出来。<br>
我知道其中的两个,分享给大家:<br>
1.[color=Red]expireusers.pl[/color]。<br>
功能:读出域中所有alive的邮件账号。<br>
用法:/var/www/extsuite/extman/tools/expireusers.pl -all [email]postmaster@yourdomain.com[/email]<br>
示例:见附件<br>
2.[color=Red]reportusage.pl[/color]。<br>
功能:读出域中邮件账号的QUOTA、USAGE和两者的百分比。<br>
用法:/var/www/extsuite/extman/tools/reportusage.pl -all /home/domains [email]postmaster@yourdomain.com[/email]<br>
示例:见附件<br>
---------------------------------------------------------------------------------------------------------------------------------<br>
网上搜到到了一些相关的资料,也分享给大家:<br>
[quote]CmdTools 0.1 Beta<br>
对于系统管理员而言,有时候做维护涉及到批量化的操作,比如批量加用户,删用户,或者改密码等。使用web后台会很麻烦,如果能有类似vpopmail的
工具来管理,那就很方便了。Cmdtools
应运而生,它主要提供了对domain,管理员,别名,帐户等4类信息的管理。大致有增/删/改/批量加/删/列表/查询等功能。可以看作是命令行下的
extman。该工具由chifeng
老大设计编写,基于extman的api,因此必须在安装有extman的环境下使用。由于该软件还不成熟,目前在对付一些老的ldap数据时还有些小问
题,所以大家使用时多留意问题,多多反馈,期待下一个版本的Cmdtools将更稳定可靠。<br>
程序主要放在extman/tools下,分别是domainctl.pl, aliasctl.pl, userctl.pl, adminctl.pl及diffinfo.pl。<br>
程序介绍: <br>
<br>
引用 <br>
<br>
domainctl.pl - 管理域名,支持增/删/改/查/列表等。详细用法直接执行就可以看到help了<br>
aliasctl.pl - 别名管理,支持增/删/改/查/列表等<br>
userctl.pl - 用户管理,支持增/批量增/改/删/批量删/列表/查等<br>
adminctl.pl - 管理员管理,支持增/删/改/查等操作<br>
diffinfo.pl - 校验用户在数据库中的记录和实际的邮件目录是否匹配 <br>
<br>
[/quote]<br>
<br>
[[i] 本帖最后由 lecchi 于 2010-9-14 17:39 编辑 [/i]]<p class="author"><strong>lecchi</strong> 发表于 2010-9-14 17:30</p>
这是[color=Red]adminctl.pl[/color]的。<br>
以下转自[url]http://hi.baidu.com/shengit/blog/item/eb238ef395ec891fb17ec50f.html[/url]<br>
-------------------------------------------------分割线-------------------------------------------------<br>
关于 extman tools/adminctl.pl 使用 _ extman 字符下 用户管理<br>
2010/03/24 14:51<br>
<br>
版本不同 命令不用 <br>
= = = <br>
<br>
[root@mail tools]#&nbsp;&nbsp;cd /var/www/extsuite/extman/tools<br>
[root@mail tools]# ./adminctl.pl<br>
<br>
usage: ./adminctl.pl command [options] ...<br>
<br>
Commands:<br>
<br>
add&nbsp; &nbsp;&nbsp;&nbsp;-- add a admin<br>
badd&nbsp; &nbsp; -- batch add admins<br>
del&nbsp; &nbsp;&nbsp;&nbsp;-- delete a admin<br>
bdel&nbsp; &nbsp; -- batch delete admins<br>
list&nbsp; &nbsp; -- list all of admins<br>
show&nbsp; &nbsp; -- show profile of a admin<br>
mod&nbsp; &nbsp;&nbsp;&nbsp;-- modify admin infomation<br>
help&nbsp; &nbsp; -- display this help and exit<br>
<br>
Options:<br>
<br>
-u, --username="admin"&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;A admin name<br>
-p, --password="******"&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; Admin password<br>
-f, --file="/path/to/filename.csv"&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;A CSV file path, Just for batch add users, one user one line<br>
eg: username password domain.tld,domain2.tld,...<br>
-n, --name="name"&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; common name<br>
-Q, --question="what are you doing?"&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;Question?<br>
-A, --answer="play games"&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;Answer<br>
-e, --expire="2009-09-17"&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;Expire date<br>
-a, --active=1&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; Enable or disable (1 or 0)<br>
-su, --setuid="vuser"&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;A system user to setuid if you want<br>
-sg, --setgid="vgroup"&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;A system user to setgid if you want<br>
-d, --domains="domain.tld,domain2.tld,..."&nbsp; &nbsp;&nbsp; &nbsp;Ignore any domains before value,Just set these domains to this admin<br>
-ad, --adddomains="domain.tld,domain2.tld,..."&nbsp;&nbsp;Append these domains to this admin<br>
-dd, --deldomains="domain.tld,domain2.tld,..."&nbsp;&nbsp;Delete these domains from current value of this admin<br>
-qq, --quiet&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;quiet mode, no any feedback<br>
-x, --xml&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;xml format output<br>
<br>
[root@mail tools]#<br>
<br>
<br>
= = = <br>
<br>
[root@mail tools]# ./adminctl.pl<br>
<br>
--managername = managername<br>
--mode = add,badd,del,bdel,list,show,mod,help<br>
--setuid = vuser<br>
--deldomains = domain1.tld,domain2.tld,...<br>
--file = /path/to/filename.csv<br>
--adddomains = domain1.tld,domain2.tld,...<br>
--password = ******<br>
--quiet = 1 or 0<br>
--answer = working<br>
--changepwd = 1 or 0<br>
--name = name<br>
--active = 1 or 0<br>
--question = what are you doing?<br>
--domains = domain1.tld,domain2.tld,...<br>
--expire = 2010-08-18<br>
--setgid = vgroup<br>
[root@mail tools]#<br>
<br>
<br>
= = = <br>
<br>
2个版本修改用户密码<br>
<br>
提示报错 : <br>
Can't use string ("") as an ARRAY ref while "strict refs" in use at ../libs/Ext/Mgr/MySQL.pm line 761.<br>
<br>
解决方法 :<br>
编辑 adminctl.pl 文件 vi adminctl.pl <br>
<br>
将 domain =&gt; $domains, 注释 # domain =&gt; $domains,<br>
<br>
<br>
修改用户密码<br>
<br>
[root@mail tools]# ./adminctl.pl --mode=mod --managername='root@1314it.com' --password='1314it'<br>
<br>
status = 1<br>
answer = postmaster<br>
active = 1<br>
changepwd = 0<br>
name = Super User<br>
manager = [email]root@1314it.com[/email]<br>
question = who are you?<br>
domains =<br>
expire = 2015-11-08<br>
password = 1314it<br>
[root@mail tools]#<br>
<br>
= = = <br>
<br>
[root@mail tools]# ./adminctl.pl --mode=mod -u='sheng@1314it.com' --password='1314it'<br>
[email]sheng@1314it.com[/email] Modified!<br>
1314it<br>
[root@mail tools]#<br>
<br>
<br>
= = = <br>
<br>
./adminctl.pl mod --username="root@1314it.com" --password="root" --active=1<br>
将 [email]root@1314it.com[/email] 密码修改成 root<br>
<br>
<br>
1. 修改 | mod -- modify user infomation<br>
2. 激活 | -a, --active=1<br>
<br>
以这个格式去修改<br>
<br>
[[i] 本帖最后由 lecchi 于 2010-9-14 17:32 编辑 [/i]]<br>
頁: [1]
查看完整版本: [轉貼]/extman/tools 里面几个脚本的功能