会员控制台 会员登陆 会员注册 最后更新 高级搜索 会员投稿 退出登陆
设为首页
收藏本站
留言给我
  首页 | 操作系统类 | 程序设计类 | 数据库类 | 应用服务类 | 网络及硬件类 | 其他技术 | GBunix论坛
操作系统类
程序设计类
数据库类
应用服务类
网络及硬件类
其他技术
Unix中文 / 应用服务类 / MailServer / OpenWebMail README中译版
OpenWebMail README中译版
2005-05-15    冷风    Linux技术中坚站    点击:
OpenWebMail README中译版(二)

使用别名地址映射

------------------

    OpenWebmail可以用sendmailvirtusertable来作用户的别名映射。登录名可以是纯的用户名也可以是用户名◎域名的方式。这个登录名可以在virtusertable被映射为另外一个名字或者名字◎域名。这样我们在帐户管理上就有很大的弹性了。请访问http://www.sendmail.org/virtual-hosting.html获取详细信息

当一个用户登录OpenWebMail后会按照下面的顺序检测:

if (loginname is in the form of 'someone@somedomain') {

   user=someone

   domain=somedomain

} else {       # a purename

   user=loginname

   domain=HTTP_HOST     # hostname in url

}

is user@domain a virtualuser defined in virtusertable?

if not {

   if (domain is mail.somedomain) {

      is user@somedomain defined in virtusertable?

   } else {

      is user@mail.domain defined in virtusertable?

   }

}

if (no mapping found && loginname is pure name) {

   is loginname a virtualuser defined in virtusertable?

}

if (any mapping found) {

   if (mappedname is in the form of 'mappedone@mappeddomain') {

      user=mappedone

      domain=mappeddomain

   } else {

      user=mappedname

      domain=HTTP_HOST

   }

}

if (option auth_withdomain is on) {

   check_userpassword for user@domain

} else {

   if (domain == HTTP_HOST) {

      check_userpassword for user

   } else {

      user not found!

   }

}

注:如果任何在virtusertable中发现别名,别名就会被用为默认的邮件地址。

下面是/etc/virtusertable的一个例子:

projectmanager             pm         

johnson@company1.com      john1

tom@company1.com    tom1

tom@company2.com    tom2

mary@company3.com   mary3

假设webmail 服务器的地址是http://mail.company1.com/那么上面的virtusertable意思是:

1.       如果用户用projectmanager登录,那么openwebmail认为

projectmanager@mail.company1.com

        projectmanager@company1.com

        projectmanager 是虚拟用户 ---> pm

2.       如果用户以johnson@company1.com 登录openwebmail认为

johnson@company1.com      ---> john1

  如果用户以johnson登录, openwebmail 认为

johnson@mail.company1.com

        johnson@company1.com      ---> john1

3. 如果用户以tom@company1.com登录

   openwebmai认为tom@company1.com        ---> tom1

   如果用户以tom@company2.com登录

   openwebmail 认为tom@company2.com             ---> tom2

   如果用户以tom登录

   openwebmail认为tom@mail.company1.com

                   tom@company1.com             ---> tom1

4. 如果用户以mary登录:

   openwebmail 认为mary@mail.company1.com

                   mary@company1.com

                   mary as virtualuser ---> not an alias

每用户配置

---------------------------------

尽管在系统配置文件(openwebmail.conf) 中的设置对所有用户都有效,你还是可以发现单独为某些用户设置参数有时也是十分必要的。例如,限制某些IP对服务器的访问或者限制用户可以发送邮件的目的域名。这些都可以很容易的在每用户配置文件中实现。

用户配置文件位于in cgi-bin/openwebmail/etc/user.conf/并以真实的用户名命名。这个文件中的参数其实是openwebmail.conf中的子集。这个目录下有一个文件'SAMPLE',其中是用户配置文件的样例:

    例如下面为用户guest创建一个配置文件:

1. cd cgi-bin/openwebmail/etc/users.conf/

2. cp SAMPLE guest

3. 编辑文件guest

注:Openwebmail按照下面的顺序加载配置文件

1. cgi-bin/openwebmail/etc/openwebmail.conf.default

2. cgi-bin/openwebmail/etc/openwebmail.conf

3. cgi-bin/openwebmail/etc/sites.conf/domainname (如果存在该文件的话)

   a.加载认证模块。

   b. 映射用户别名.

   c. 验证用户身份。

4. cgi-bin/openwebmail/etc/users.conf/username (如果该文件存在的话)

后面配置文件中参数将覆盖全面配置文件中的参数

PAM认证支持

-----------

PAM (可插拔认证模块)为认证用户身份提供了一个弹性的模式具体细节请访问Linux-PAM 的主页

http://www.kernel.org/pub/linux/libs/pam/

Solaris 2.6Linux FreeBSD 3.1 都支持PAM,为了使OpenWebMail支持PAM认证,按照下面步骤进行:

 1. 下载Perl Authen::PAM模块(Authen-PAM-0.12.tar.gz)

   http://www.cs.kuleuven.ac.be/~pelov/pam/

2. cd /tmp

   tar -zxvf Authen-PAM-0.12.tar.gz

   cd Authen-PAM-0.12

   perl Makefile.PL

   make

   make install

注:建议编译的时候执行'make test',如果在make test中出错,PAM可能不能在你的系统上正常工作。

3./etc/pam.conf加入下面三行

(Solaris系统)

openwebmail   auth     required   /usr/lib/security/pam_unix.so.1

openwebmail   account       required   /usr/lib/security/pam_unix.so.1

openwebmail   password     required   /usr/lib/security/pam_unix.so.1

(Linux系统)

openwebmail   auth     required   /lib/security/pam_unix.so

openwebmail   account       required   /lib/security/pam_unix.so

openwebmail   password     required   /lib/security/pam_unix.so

(如果你的 Linux系统没有/etc/pam.conf  protech.AT.protech.net.tw)

如果你没有/etc/pam.conf 而是目录etc/pam.d/,

请创建/etc/pam.d/openwebmail文件,并加入一下内容:

auth       required     /lib/security/pam_unix.so

account    required     /lib/security/pam_unix.so

password   required     /lib/security/pam_unix.so

(FreeBSD系统)

openwebmail   auth     required   /usr/lib/pam_unix.so

openwebmail   account       required   /usr/lib/pam_unix.so

openwebmail   password     required   /usr/lib/pam_unix.so   

注:PAM 在一些版本的 FreeBSD 上可能不能正常工作(例如:4.1)

4. 改变openwebmail.conf文件中的auth_module 'auth_pam.pl'

5.检查auth_pam.pl 是否适应你的系统

注:更多关于 PAM 的配置信息建议阅读《The Linux-PAM System Administrators' Guide

    http://www.kernel.org/pub/linux/libs/pam/Linux-PAM-html/pam.html

    by Andrew G. Morgan, morgan.AT.kernel.org

添加新的认证模块

--------------------------------------------

    openwebmail可以直接使用各种认证模块,包括auth_unix.pl, auth_ldap.pl, auth_mysql, auth_mysql_vmail.pl,auth_pgsql, auth_pop3.plauth_pam.pl。万一发现这些模块不能适应自己的需要,你可以写一个属于你自己的新的认证模块。

openwebmail添加新的认证模块:

1.为新的认证模块选择一个所写名字例如:xyz

2.auth_xyz.pl 文件添加下面的4个定义的函数:

   ($realname, $uid, $gid, $homedir)=get_userinfo($domain, $user);

   @userlist=get_userlist($domain);

   $retcode=check_userpassword($domain, $user, $password);

   $retcode=change_userpassword($domain, $user, $oldpassword, $newpassword);

   这里的$retcode意思使:

    -1 : 功能不支持

    -2 : 参数格式错误

    -3 : 认证系统内部错误

    -4 : 密码错误

   可以参开auth_unix.p或者 auth_pam.pl 来编写

3.修改openwebmail.conf中的参数为auth_xyz.pl

4. 测试你的新认证模块:)

注:如果你希望你的认证模块包含在下一个版本的opernwebmail中,请提交把它提交给openwebmail.AT.turtle.ee.ncku.edu.tw.

添加新的语言支持

-----------------------------

    在openwebmail添加新的语言支持非常简单:

1. 选择一个你语言的所写,例如:xy

注:你也可以参考下面的URL地址来选择

    http://i18n.kde.org/stats/gui/i18n-table-KDE_2_2_BRANCH.html

    http://babel.alis.com/langues/iso639.en.htm

    http://www.unicode.org/unicode/onlinedat/languages.html

2. cd cgi-bin/openwebmail/etc.

   cp lang/en lang/xy

   cp -R templates/en templates/xy

3.lang/xytemplates/xy/* 中的所有文件从英文翻译成你自己的语言

4. 将你的语言添加到openwebmail-shared.pl中的 %languagenames中,然后在openwebmail.conf中设置你的语言为xy

注:如果你希望你的翻译包含在下一版的openwebmail中的话,请将它提交给openwebmail.AT.turtle.ee.ncku.edu.tw.

添加更多的背景

--------------------------------------------

    如果想在openwebmail中为你的用户添加更多的背景图片,只要把它们复制到%ow_htmldir%/images/backgrounds,然后用户就可以在他们的属性菜单里选择这些图片作为背景了

注:如果你想和其他人共享你美妙的背景,请将他们提交给openwebmail.AT.turtle.ee.ncku.edu.tw 

设计自己的OPENWEBMAIL图标

---------------------------------------

    如果你对openwebmail中的图标设计很感兴趣,你必须

1. %ow_htmldir%/images/iconsets/目录创建一个子目录,例如:MyIconSet

  注:%ow_htmldir%openwebmail查找html对象的路径,该路径在openwebmail.conf定义

2. %ow_htmldir%/images/iconsets/Default复制所有的图片到MyIconSet

3. 按照你的需要修改 %ow_htmldir%/images/iconsets/MyIconSet 中的图片

注:如果你希望你的新图标可以包含在下一版本的openwebmail中请将它们提交给openwebmail.AT.turtle.ee.ncku.edu.tw

测试

-----     

1. 改变工作路径到openwebmailcgi目录(例如:/usr/local/www/cgi-bin/openwebmail)

   检查这些文件的属主以及权限是否为:

   ~/openwebmail.pl             - owner=root, group=mail, mode=4755

   ~/openwebmail-main.pl        - owner=root, group=mail, mode=4755

   ~/openwebmail-read.pl        - owner=root, group=mail, mode=4755

   ~/openwebmail-viewatt.pl     - owner=root, group=mail, mode=4755

   ~/openwebmail-send.pl        - owner=root, group=mail, mode=4755

   ~/openwebmail-spell.pl       - owner=root, group=mail, mode=4755

   ~/openwebmail-prefs.pl       - owner=root, group=mail, mode=4755

   ~/openwebmail-folder.pl      - owner=root, group=mail, mode=4755

   ~/checkmail.pl               - owner=root, group=mail, mode=4755

   ~/vacation.pl                - owner=root, group=mail, mode=0755

   ~/etc                        - owner=root, group=mail, mode=755

   ~/etc/sessions               - owner=root, group=mail, mode=770

   ~/etc/users                  - owner=root, group=mail, mode=770

   /var/log/openwebmail.log     - owner=root, group=mail, mode=660

2. 通过访问http://your_server/cgi-bin/openwebmail/openwebmail.pl来测试

如果有任何问题请于阅读faq.txt.,最新版本的FAQ可以从http://turtle.ee.ncku.edu.tw/openwebmail/download/doc/faq.txt获得。

TODO

----

    我们在下一步工作中要实现:.

1. web日历

2. web硬盘

3. 共享目录

4. mod_perl兼容

人们所感兴趣的功能:

1. maildir支持

2. 在线签收

3. 日志分析

03/14/2002

openwebmail.AT.turtle.ee.ncku.edu.tw

冷风的openwebmail.conf文件


# Open WebMail configuration file
#
# This file contains just the overrides from openwebmail.conf.default
# please make all changes to this file.
#
# This file sets options for all domains and all users.
# To set options on per domain basis, please put them in sites.conf/domainname
# To set options on per user basis, please put them in users.conf/username
#
domainnames chinalinuxpub.com
auth_module auth_pam.pl
mailspooldir /var/spool/mail
dbm_ext db
dbmopen_ext none
timeoffset +0800
ow_cgidir /home/linuxpub/cgi-bin/openwebmail
ow_htmldir /home/linuxpub/data/openwebmail
logfile /var/log/openwebmail.log
spellcheck /usr/bin/aspell
default_iconset Cool3D.English
default_confirmmsgmovecopy no
default_moveoldmsgfrominbox no
default_language zh_CN.GB2312
vacationpipe /home/linuxpub/cgi-bin/openwebmail/vacation.pl -d -t60s

<default_signature>
--
Linux技术中坚站 (http://www.chinalinuxpub.com)
</default_signature>

了解更多详情,参与讨论,请进入GBUNIX论坛

http://www.gbunix.com/bbs/index.php
责任编辑: trotter

相关文章
用 Linux 打造路由器 - 07-15 01:46 pm - 点击: 517

发表评论 查看评论 加入收藏 Email给朋友 打印本文
给该文章评分
1 2 3 4 5 6 7 8 9 10
平均得分 0, 共 0 人评分
1 2 3 4 5 6 7 8 9 10
发表评论
标题:
内容:
声明:本站资讯均来自互联网,所有文章版权归原作者和出版者所有,如涉及版权问题,请来信告知!
Copyright © 2002-2004 GBunix.com. All rights reserved.