博客首页
注册
建议与交流
排行榜
加入友情链接
推荐
投诉
搜索:
帮助
wangqh_2008
超越梦想
wangqh2008.cublog.cn
管理博客
发表文章
留言
收藏夹
· AIX
· blog_address
· 软件收藏
· 视频教程,文档
· 生活
· 数据库
}
· db2
· mysql
· oracle
· postsql
· sqlserver
· FreeBSD
· HR
· 外语学习
}
· 日语
· 英语
· IBM websphere
· 网络
}
· cisco
· d-link
· 无线网络
· 常用技巧
· 常见故障
· 方案
· 华为
· linux
}
· CVS
· FTP
· http
· mantis
· pell
· shell
· 安装
· 常用网址下载
· 常用服务配置
· 常用技巧
· 学用Lotus
· 娱乐游戏
· 邮件相关
}
· exchange
· extmail
· postfix
· qmail
· sendmail
· 其他
· 音乐
· slaris
· VPN
· windows
}
· 日常维护
· Vista
· windows2003server
· windows2008server
· windows7
· xp
· 安装
· 常用服务配置
· 培训
· 企业应用
· 汽车驾驶
· 安全相关
}
· 防火墙
· 笔记本杂谈
· 备份与恢复
· 常用链接
· 常用网络地址收藏
· 存储
· 电话系统
· 方案文档下载
· 服务集群
· 负载均衡
· 租房网站
博客圈
音乐
相册
· softbrain
文章
· EPM ESM
· 生活
· 数据库
}
· DB2
· mysql
· oracle
· postsql
· sqlserver
· 常见问题解决方案
· 网络技术
}
· 3com
· cisco
· D-Link
· 网络基础知识
· 无线网络
· TP-Link
· VPN
· 北电
· 常见问题解决方案
· 华为
· mail服务器
}
· exchange
· extmail
· iredmail
· postfix邮件系统
· postfix反垃圾反病毒
· qmail邮件系统
· sendmail邮件系统
· 学习
· 娱乐
· 娱乐与游戏
· 应用服务器
}
· 论坛
· cvs服务器
· OA
· 硬件故障与检测
· VOIP
· websphere
· 企业应用
}
· dabases
· linux
· network
· windows
· 开源监控与IT管理
· 汽车驾驶
· 安全相关
· 备份与恢复
· 操作系统
}
· AIX
· FreeBSD
· linux
· solaris
· windows VISTA
· windows2003server
· windows2008server
· windows7
· windowsxp
· 常见问题解决方案
· 存储
· 电脑装机指南
· 电话系统
· 防火墙
}
· cisco防火墙
· netcsreen
· 方案
· 负载均衡
· 集群
· 健身
· 经验与技巧
首页
关于作者
姓名:jerry 职业: 年龄: 位置:AM地 个性介绍: MSN:wangqh_2008@hotmail.com
||
<<
>>
||
我的分类
文章列表 - mail服务器
经验: 维护Exchange Server 2003 邮件服务器
<DIV> <DIV id=threadtitle> <H1>经验: 维护Exchange Server 2003 邮件服务器</H1></DIV> <DIV class=t_msgfontfix> <TABLE cellSpacing=0 cellPadding=0> <TBODY> <TR> <TD class=t_msgfont id=postmessage_7154464><FONT style="FONT-SIZE: 12px">前段时间一直有网友在问的问题.<BR>问题一:<BR>随着时间增长,邮件<SPAN class=t_tag onclick=tagshow(event) href="tag.php?name=%B7%FE%CE%F1%C6%F7">服务器</SPAN>邮箱存储占用的空间会不断加大,就算在客户端把邮件删除,可服务器存储邮件占用的空间还是没有减少,这是怎么回事?<BR>问题二:<BR>我的邮件服务器已经好几年啦,怎么样才能把邮箱<SPAN class=t_tag onclick=tagshow(event) href="tag.php?name=%D3%C3%BB%A7">用户</SPAN>比较老的邮件<SPAN class=t_tag onclick=tagshow(event) href="tag.php?name=%D7%D4%B6%AF">自动</SPAN>删除,不让它占用服务器的空间?<BR><BR>就是由这两个问题写了篇文章:<BR>我的办法是做收件人策略+备份,减少邮件存储与及日志<SPAN class=t_tag onclick=tagshow(event) href="tag.php?name=%CE%C4%BC%FE">文件</SPAN>占用服务器空间.(这个<SPAN class=t_tag onclick=tagshow(event) href="tag.php?name=%CA%FD%BE%DD%BF%E2">数据库</SPAN>文件和日志文件是占空间的主要文件).<BR><BR>环境如下:<BR>一台服务器作为DC(contoso.msft)+EXCHANGE,一台加入域(contoso,msft)的客户端.<BR><BR><IMG id=img_0.9757822263003224 style="CURSOR: pointer" height=171 alt="" src="http://blog.ixpub.net/attachments/2008/11/14637836_200811061012021KawG.gif" width=600><BR>环境已搭建好,为了测试自动删除过期邮件,空间占用问题,先给用户发封大邮件,让用户占用服务器空间.<BR>在域内,用户c给用户m(用户实验前已建立)发封大邮件(邮件带附件).<BR>在发之前先检查<SPAN class=t_tag onclick=tagshow(event) href="tag.php?name=%CA%FD%BE%DD">数据</SPAN>库以及日志占用空间大小.<BR><BR><IMG id=img_0.11651958839011855 height=523 alt="" src="http://blog.ixpub.net/attachments/2008/11/14637836_200811061012022Ovtw.gif" width=502><BR><BR>内网邮箱用户互发邮件,占用服务器存储空间.<BR><BR><IMG id=img_0.5728858699094733 height=404 alt="" src="http://blog.ixpub.net/attachments/2008/11/14637836_200811061012023TPIx.gif" width=492><BR><BR><IMG id=img_0.3441184317516142 height=417 alt="" src="http://blog.ixpub.net/attachments/2008/11/14637836_200811061012024x5fo.gif" width=465><BR><BR>检查邮箱,服务器占用空间.(服务器一下涨了好多)<BR><IMG id=img_0.06725197508025254 style="CURSOR: pointer" height=343 alt="" src="http://blog.ixpub.net/attachments/2008/11/14637836_2008110610120258myP.gif" width=600><BR><IMG height=470 alt="" src="http://blog.ixpub.net/attachments/2008/11/14637836_200811061012026OoVt.gif" width=496><BR><IMG height=481 alt="" src="http://blog.ixpub.net/attachments/2008/11/14637836_200811061012027R4pF.gif" width=376><BR>这时可把邮件认为是老邮件,建立收件人邮箱<SPAN class=t_tag onclick=tagshow(event) href="tag.php?name=%B9%DC%C0%ED">管理</SPAN>器策略来管理邮件.<BR>如把2天前的大于是10240k的邮件删除.<BR><IMG height=345 alt="" src="http://blog.ixpub.net/attachments/2008/11/14637836_2008110610120287lKB.gif" width=564><BR>把策略用于用户c和m.<BR>策略<SPAN class=t_tag onclick=tagshow(event) href="tag.php?name=%C9%E8%D6%C3">设置</SPAN>如下:<BR><IMG height=424 alt="" src="http://blog.ixpub.net/attachments/2008/11/14637836_2008110610120292FHU.gif" width=481><BR>让策略立刻生效.<BR><IMG style="CURSOR: pointer" height=287 alt="" src="http://blog.ixpub.net/attachments/2008/11/14637836_2008110610120210W5GZ.gif" width=600><BR><IMG height=483 alt="" src="http://blog.ixpub.net/attachments/2008/11/14637836_2008110610120211dDbU.gif" width=534><BR>验证结果.把时间手工调整一下,如改到3天后.<BR>当前时间,以及3天后时间.邮箱大小变化情况.<BR><IMG height=371 alt="" src="http://blog.ixpub.net/attachments/2008/11/14637836_2008110610120212GdAH.gif" width=577><BR><BR><IMG style="CURSOR: pointer" height=432 alt="" src="http://blog.ixpub.net/attachments/2008/11/14637836_20081106101202138mLf.gif" width=600><BR><BR>客户端邮件已被删除,所以在服务看邮箱存储占用空间大小已经减少.<BR>过期邮件已处理完毕,下面来释放空间.<BR>这时候存储在物理磁盘的空间并没有减少,主要由数据库文件和日志文件组成.<BR>可通过碎片整理和压缩来减少数据库空间,通过备份来删除日志文件.<BR><BR><IMG height=367 alt="" src="http://blog.ixpub.net/attachments/2008/11/14637836_2008110610120214BfnB.gif" width=545><BR><BR>做碎片整理和压缩数据库,做的是脱机数据库整理.<BR><BR>参考文章:<BR><BR><FONT color=#0000ff>http://support.microsoft.com/kb/328804/zh-cn</FONT><BR><BR><FONT color=#0000ff>http://support.microsoft.com/kb/192185/zh-cn</FONT><BR><BR>先检查数据库大小.主要由priv1.edb和priv1.stm构成.<BR><BR><IMG height=411 alt="" src="http://blog.ixpub.net/attachments/2008/11/14637836_20081106101202155ZK7.gif" width=537><BR><BR>1. 在 Exchange <SPAN class=t_tag onclick=tagshow(event) href="tag.php?name=%CF%B5%CD%B3">系统</SPAN>管理器中,右键单击要进行碎片整理的信息存储,然后单击卸除存储。 <BR>2. 在<SPAN class=t_tag onclick=tagshow(event) href="tag.php?name=%C3%FC%C1%EE">命令</SPAN>提示符处,更改至 Exchsrvr\Bin 文件夹,然后键入 eseutil /d 命令、数据库开关以及要使用的任何选项。 <BR>例如,以下命令在邮箱存储数据库上运行标准的碎片整理实用<SPAN class=t_tag onclick=tagshow(event) href="tag.php?name=%B9%A4%BE%DF">工具</SPAN>: <BR>C:\program files\exchsrvr\bin> eseutil /d c:\progra~1\exchsrvr\mdbdata\priv1.edb<BR><BR><IMG height=331 alt="" src="http://blog.ixpub.net/attachments/2008/11/14637836_2008110610120216EHZu.gif" width=524><BR><BR><IMG style="CURSOR: pointer" height=280 alt="" src="http://blog.ixpub.net/attachments/2008/11/14637836_2008110610120217FlSA.gif" width=600><BR><BR><IMG style="CURSOR: pointer" height=491 alt="" src="http://blog.ixpub.net/attachments/2008/11/14637836_2008110610120218VVhK.gif" width=600><BR><BR>结果.<BR><BR><IMG height=306 alt="" src="http://blog.ixpub.net/attachments/2008/11/14637836_2008110610120219kq2E.gif" width=447><BR><BR><IMG height=404 alt="" src="http://blog.ixpub.net/attachments/2008/11/14637836_2008110610120220fl83.gif" width=422><BR><BR>现在空间大小主要是由日志文件占用.通过备份可以清除日志文件,用于释放更多的空间.<BR><BR>参考文章:<BR><BR><FONT color=#0000ff>http://www.5dmail.net/bbs/viewthread.php?tid=55926&extra=page%3D1%26amp%3Bfilter%3Ddigest</FONT><BR><BR>由楼上的图可看出没备份前空间占用情况.<BR><BR>调出ntbackup,对Exchange 的”Information Store“存储组的所有数据库备份.<BR><BR><IMG style="CURSOR: pointer" height=428 alt="" src="http://blog.ixpub.net/attachments/2008/11/14637836_2008110610120221OpRO.gif" width=600><BR><BR>结果log文件减少.空出磁盘空间.<BR><BR><IMG height=490 alt="" src="http://blog.ixpub.net/attachments/2008/11/14637836_2008110610120222o28m.gif" width=437><BR><BR>在这里浅谈了邮件管理和空间占用的问题,希望能对存在这问题的朋友有所帮助...</FONT><BR><STRONG>附件:</STRONG><BR></TD></TR></TBODY></TABLE></DIV></DIV>
查看全文
发表于:2009-03-25 ┆
阅读(98)
┆
评论(0)
http://hi.chinaunix.net/?uid-133135.html
<DIV> <DIV id=wrap> <DIV id=header> <DIV id=spacename> <DIV id=xspace-spacename><STRONG><FONT size=4>MichaelBibby的个人空间</FONT></STRONG> <P><A class=xspace-copyurl title=复制地址 onclick="javascript:setCopy('http://hi.chinaunix.net/?133135');" href="javascript:;">copy</A> <A class=xspace-add2fav title=加入收藏 onclick="javascript:addBookmark('MichaelBibby的个人空间','http://hi.chinaunix.net/?133135');return false;" href="http://hi.chinaunix.net/?133135">Bookmark</A> http://hi.chinaunix.net/?133135 </P></DIV></DIV> <DIV id=menu> <UL id=xspace-menu> <LI><A class=xspace-blog href="http://hi.chinaunix.net/?uid-133135-action-spacelist-type-blog">日志</A> </LI> <LI><A class=xspace-image href="http://hi.chinaunix.net/?uid-133135-action-spacelist-type-image">相册</A> </LI> <LI><A class=xspace-file href="http://hi.chinaunix.net/?uid-133135-action-spacelist-type-file">软件</A> </LI> <LI><A class=xspace-link href="http://hi.chinaunix.net/?uid-133135-action-spacelist-type-link">书签</A> </LI> <LI><A class=xspace-video href="http://hi.chinaunix.net/?uid-133135-action-spacelist-type-video">视频</A> </LI> <LI><A class=xspace-friend href="http://hi.chinaunix.net/?uid-133135-action-spacelist-type-friend">好友</A> </LI> <LI><A class=xspace-mybbs href="http://hi.chinaunix.net/?uid-133135-action-spacelist-type-bbs">论坛</A> </LI> <LI><A class=xspace-guestbook href="http://hi.chinaunix.net/?uid-133135-action-viewpro">留言</A> </LI> <LI><A class=xspace-more href="http://hi.chinaunix.net/?uid-133135-action-spacelist-type-model">更多</A> </LI></UL></DIV></DIV> <DIV class=xspace-layout1 id=content> <DIV class=mainarea-side id=mainarea> <DIV id=xspace-guide><A class=xspace-spacecp href="http://hi.chinaunix.net/batch.manage.php?uid=133135" target=_blank>空间管理</A> 您的位置: <A href="http://hi.chinaunix.net/" target=_blank><FONT color=#000066>ChinaUnix个人空间</FONT></A> » <A href="http://hi.chinaunix.net/?uid-133135"><FONT color=#000066>MichaelBibby的个人空间</FONT></A> » <A href="http://hi.chinaunix.net/?uid-133135"><FONT color=#000066>空间首页</FONT></A> </DIV> <DIV id=mythread> <H3 class=xspace-blocktitle><A class=more href="http://hi.chinaunix.net/?uid-133135-action-spacelist-type-bbs">更多</A>我的主题</H3> <UL class=xspace-itemlist> <LI class=xspace-loglist> <H4 class=xspace-entrytitle><A href="http://bbs.chinaunix.net/viewthread.php?tid=1332707" target=_blank><FONT color=#000066>开源邮件方案之 iRedMail-0.3.2 及 iRedOS-0.1.2 正式版发布</FONT></A></H4> <P class=xspace-smalltxt><A class=xspace-smalltxt href="http://bbs.chinaunix.net/redirect.php?tid=1332707&goto=lastpost#lastpost" target=_blank>2008-12-12 13:34:34</A> / <A class=xspace-smalltxt href="http://bbs.chinaunix.net/forumdisplay.php?fid=14" target=_blank>Mail服务器</A></P> <DIV class=xspace-itemmessage id=xspace-item-t1332707>Hi, all.iRedMail-0.3.2 稳定版发布了。下载地址:http://code.google.com/p/iredmail/downloads/listiRedOS-0.1.2 的 ISO 镜像也已就绪,您可以从以下地址下载:http://www.iredmail.org/iRedOS/0.3.2 主要是基于 0.3.1 做了一些 bug 修正,完善已有组件的功能,并更新了少量软件包。升级文档我们将会.</DIV> <P class=xspace-itemlinks><A href="http://bbs.chinaunix.net/viewthread.php?tid=1332707" target=_blank><FONT color=#000066>查看(520)</FONT></A> <A href="http://bbs.chinaunix.net/post.php?action=reply&fid=14&tid=1332707" target=_blank><FONT color=#000066>评论(16)</FONT></A> </P></LI> <LI class=xspace-loglist> <H4 class=xspace-entrytitle><A href="http://bbs.chinaunix.net/viewthread.php?tid=1325030" target=_blank><FONT color=#000066>iRedOS-0.1.2-beta1 发布,请大家帮忙测试</FONT></A></H4> <P class=xspace-smalltxt><A class=xspace-smalltxt href="http://bbs.chinaunix.net/redirect.php?tid=1325030&goto=lastpost#lastpost" target=_blank>2008-12-02 20:33:04</A> / <A class=xspace-smalltxt href="http://bbs.chinaunix.net/forumdisplay.php?fid=14" target=_blank>Mail服务器</A></P> <DIV class=xspace-itemmessage id=xspace-item-t1325030>Hi, all.iRedOS-0.1.2-beta1 发布了。下载地址:http://www.iredmail.org/iRedOS/0.1.2/iRedOS-0.1.2 包含 iRedMail-0.3.2 的最新测试版本,并修正了 iRedOS-0.1.1里无法自行设置网络和主机名的问题。以下是 0.3.2-beta1 及发布之后修正的一些问题:* 增加补丁用于让 ExtMail 自行创建用户的 ma.</DIV> <P class=xspace-itemlinks><A href="http://bbs.chinaunix.net/viewthread.php?tid=1325030" target=_blank><FONT color=#000066>查看(215)</FONT></A> <A href="http://bbs.chinaunix.net/post.php?action=reply&fid=14&tid=1325030" target=_blank><FONT color=#000066>评论(3)</FONT></A> </P></LI> <LI class=xspace-loglist> <H4 class=xspace-entrytitle><A href="http://bbs.chinaunix.net/viewthread.php?tid=1322889" target=_blank><FONT color=#000066>请帮忙测试:用于 ExtMail 的自动创建用户邮箱补丁</FONT></A></H4> <P class=xspace-smalltxt><A class=xspace-smalltxt href="http://bbs.chinaunix.net/redirect.php?tid=1322889&goto=lastpost#lastpost" target=_blank>2008-11-29 18:38:58</A> / <A class=xspace-smalltxt href="http://bbs.chinaunix.net/forumdisplay.php?fid=14" target=_blank>Mail服务器</A></P> <DIV class=xspace-itemmessage id=xspace-item-t1322889>Hi, all.如果你只使用 ExtMail 而没有使用 ExtMan,相信你在添加新用户之后立即登录 ExtMail,都会无法登录并得到类似的错误信息:Can't chdir to /home/vmail/a.cn/www/, no such file or directory.这是由于 ExtMail 并不自动建立用户邮箱目录导致的。这个补丁的作用就是让 ExtMail 在检测到用户邮箱不存在的时候自.</DIV> <P class=xspace-itemlinks><A href="http://bbs.chinaunix.net/viewthread.php?tid=1322889" target=_blank><FONT color=#000066>查看(290)</FONT></A> <A href="http://bbs.chinaunix.net/post.php?action=reply&fid=14&tid=1322889" target=_blank><FONT color=#000066>评论(2)</FONT></A> </P></LI> <LI class=xspace-loglist> <H4 class=xspace-entrytitle><A href="http://bbs.chinaunix.net/viewthread.php?tid=1320907" target=_blank><FONT color=#000066>开源邮件方案 iRedMail-0.3.2-beta1 发布。希望大家帮忙测试</FONT></A></H4> <P class=xspace-smalltxt><A class=xspace-smalltxt href="http://bbs.chinaunix.net/redirect.php?tid=1320907&goto=lastpost#lastpost" target=_blank>2008-11-27 10:27:28</A> / <A class=xspace-smalltxt href="http://bbs.chinaunix.net/forumdisplay.php?fid=14" target=_blank>Mail服务器</A></P> <DIV class=xspace-itemmessage id=xspace-item-t1320907>Hi, all.iRedMail-0.3.2-beta1 发布了。下载地址:http://code.google.com/p/iredmail/downloads/list0.3.2-beta1 主要是基于 0.3.1 做了一些 bug 修正,完善已有组件的功能,并更新了少量软件包。iRedOS 将会在 iRedMail-0.3.2 正式版发布的时候同时提供下载。之前的版本可以从以下地址下载:htt.</DIV> <P class=xspace-itemlinks><A href="http://bbs.chinaunix.net/viewthread.php?tid=1320907" target=_blank><FONT color=#000066>查看(543)</FONT></A> <A href="http://bbs.chinaunix.net/post.php?action=reply&fid=14&tid=1320907" target=_blank><FONT color=#000066>评论(19)</FONT></A> </P></LI> <LI class=xspace-loglist> <H4 class=xspace-entrytitle><A href="http://bbs.chinaunix.net/viewthread.php?tid=1317777" target=_blank><FONT color=#000066>iRedMail 开源邮件服务解决方案开通官方 QQ 群</FONT></A></H4> <P class=xspace-smalltxt><A class=xspace-smalltxt href="http://bbs.chinaunix.net/redirect.php?tid=1317777&goto=lastpost#lastpost" target=_blank>2008-11-23 18:19:29</A> / <A class=xspace-smalltxt href="http://bbs.chinaunix.net/forumdisplay.php?fid=14" target=_blank>Mail服务器</A></P> <DIV class=xspace-itemmessage id=xspace-item-t1317777>Hi, all.iRedMail 开源邮件服务解决方案项目开通了官方的 QQ 群,欢迎大家加入:75161448。iRedMail 项目主页:http://code.google.com/p/iredmail/</DIV> <P class=xspace-itemlinks><A href="http://bbs.chinaunix.net/viewthread.php?tid=1317777" target=_blank><FONT color=#000066>查看(378)</FONT></A> <A href="http://bbs.chinaunix.net/post.php?action=reply&fid=14&tid=1317777" target=_blank><FONT color=#000066>评论(2)</FONT></A> </P></LI> <LI class=xspace-loglist> <H4 class=xspace-entrytitle><A href="http://bbs.chinaunix.net/viewthread.php?tid=1302374" target=_blank><FONT color=#000066>提供 OpenBSD 4.4 镜像站点:http://www.iredmail.org/openbsd/</FONT></A></H4> <P class=xspace-smalltxt><A class=xspace-smalltxt href="http://bbs.chinaunix.net/redirect.php?tid=1302374&goto=lastpost#lastpost" target=_blank>2008-11-02 14:17:06</A> / <A class=xspace-smalltxt href="http://bbs.chinaunix.net/forumdisplay.php?fid=5" target=_blank>BSD</A></P> <DIV class=xspace-itemmessage id=xspace-item-t1302374>Hi, all.这里提供 OpenBSD 4.4 镜像站点:http://www.iredmail.org/openbsd/服务器及带宽资源是由 zhujibo@gmail 赞助给 iRedMail 开源邮件服务解决方案项目的,在此感谢 zhujibo@gmail。^_^目前只提供 i386, amd64 两个平台,packages 还在同步中。</DIV> <P class=xspace-itemlinks><A href="http://bbs.chinaunix.net/viewthread.php?tid=1302374" target=_blank><FONT color=#000066>查看(763)</FONT></A> <A href="http://bbs.chinaunix.net/post.php?action=reply&fid=5&tid=1302374" target=_blank><FONT color=#000066>评论(10)</FONT></A> </P></LI> <LI class=xspace-loglist> <H4 class=xspace-entrytitle><A href="http://bbs.chinaunix.net/viewthread.php?tid=1297919" target=_blank><FONT color=#000066>紧急:快帮忙 Kevlo 测试 scim 输入法的几个 ports</FONT></A></H4> <P class=xspace-smalltxt><A class=xspace-smalltxt href="http://bbs.chinaunix.net/redirect.php?tid=1297919&goto=lastpost#lastpost" target=_blank>2008-10-27 20:07:45</A> / <A class=xspace-smalltxt href="http://bbs.chinaunix.net/forumdisplay.php?fid=5" target=_blank>BSD</A></P> <DIV class=xspace-itemmessage id=xspace-item-t1297919>Hi, all.台湾的 OpenBSD 开发人员 Kevlo 制作了 scim 的 ports,并已发布到 ports@ 邮件列表,恳请各位 OpenBSD 爱好者尽快帮忙测试,并将测试结果发到邮件列表里,这样才能使 ports 尽快进去官方的 ports tree。地址在以下链接的第三页:http://www.openbsdonly.org/viewtopic.php?f=17&t=607&st=0&sk=t&sd=a.</DIV> <P class=xspace-itemlinks><A href="http://bbs.chinaunix.net/viewthread.php?tid=1297919" target=_blank><FONT color=#000066>查看(316)</FONT></A> <A href="http://bbs.chinaunix.net/post.php?action=reply&fid=5&tid=1297919" target=_blank><FONT color=#000066>评论(3)</FONT></A> </P></LI> <LI class=xspace-loglist> <H4 class=xspace-entrytitle><A href="http://bbs.chinaunix.net/viewthread.php?tid=1296709" target=_blank><FONT color=#000066>在 OpenBSD 4.4 上搭建中文语言环境</FONT></A></H4> <P class=xspace-smalltxt><A class=xspace-smalltxt href="http://bbs.chinaunix.net/redirect.php?tid=1296709&goto=lastpost#lastpost" target=_blank>2008-10-25 21:58:30</A> / <A class=xspace-smalltxt href="http://bbs.chinaunix.net/forumdisplay.php?fid=5" target=_blank>BSD</A></P> <DIV class=xspace-itemmessage id=xspace-item-t1296709>文档整理中:http://code.google.com/p/openbsdonly/wiki/ChineseEnv_OpenBSD_44欢迎大家补充。^_^</DIV> <P class=xspace-itemlinks><A href="http://bbs.chinaunix.net/viewthread.php?tid=1296709" target=_blank><FONT color=#000066>查看(1329)</FONT></A> <A href="http://bbs.chinaunix.net/post.php?action=reply&fid=5&tid=1296709" target=_blank><FONT color=#000066>评论(13)</FONT></A> </P></LI> <LI class=xspace-loglist> <H4 class=xspace-entrytitle><A href="http://bbs.chinaunix.net/viewthread.php?tid=1295621" target=_blank><FONT color=#000066>文泉驿字体进入 OpenBSD ports tree,呼吁测试 scim</FONT></A></H4> <P class=xspace-smalltxt><A class=xspace-smalltxt href="http://bbs.chinaunix.net/redirect.php?tid=1295621&goto=lastpost#lastpost" target=_blank>2008-10-24 12:12:25</A> / <A class=xspace-smalltxt href="http://bbs.chinaunix.net/forumdisplay.php?fid=5" target=_blank>BSD</A></P> <DIV class=xspace-itemmessage id=xspace-item-t1295621>Hi, all.台湾的 OpenBSD 开发人员 Kevlo 已经将文泉驿字体提交进 ports tree,在此希望大家帮忙测试。并且希望大家帮忙测试中文输入法。详细信息请看 OpenBSDonly.org 的帖子:http://www.openbsdonly.org/viewtopic.php?f=17&t=607&start=0&st=0&sk=t&sd=a文档整理中:- 在 OpenBSD 4.4 上搭建中文.</DIV> <P class=xspace-itemlinks><A href="http://bbs.chinaunix.net/viewthread.php?tid=1295621" target=_blank><FONT color=#000066>查看(760)</FONT></A> <A href="http://bbs.chinaunix.net/post.php?action=reply&fid=5&tid=1295621" target=_blank><FONT color=#000066>评论(11)</FONT></A> </P></LI> <LI class=xspace-loglist> <H4 class=xspace-entrytitle><A href="http://bbs.chinaunix.net/viewthread.php?tid=1294002" target=_blank><FONT color=#000066>开源邮件服务解决方案 iRedMail-0.3.1,iRedOS-0.1.1 稳定版(bug fix)发布</FONT></A></H4> <P class=xspace-smalltxt><A class=xspace-smalltxt href="http://bbs.chinaunix.net/redirect.php?tid=1294002&goto=lastpost#lastpost" target=_blank>2008-10-22 12:48:51</A> / <A class=xspace-smalltxt href="http://bbs.chinaunix.net/forumdisplay.php?fid=14" target=_blank>Mail服务器</A></P> <DIV class=xspace-itemmessage id=xspace-item-t1294002>Hi, All.iRedMail-0.3.1 稳定版和 iRedOS-0.1.1 稳定版发布,适用于生产环境。同时,iRedMail 和 iRedOS 进入维护状态,Bibby 已全力以赴进行管理后台的规划和开发。管理后台功能需求征集:http://www.iredmail.org/bbs/viewthread.php?tid=257&extra=page%3D1备注:iRedOS 是基于 CentOS 5.2 裁减,并加入.</DIV> <P class=xspace-itemlinks><A href="http://bbs.chinaunix.net/viewthread.php?tid=1294002" target=_blank><FONT color=#000066>查看(1753)</FONT></A> <A href="http://bbs.chinaunix.net/post.php?action=reply&fid=14&tid=1294002" target=_blank><FONT color=#000066>评论(23)</FONT></A> </P></LI></UL></DIV></DIV> <DIV class=sidearea id=sideleft> <DIV class=xspace-sideblock id=avatar> <DIV id=xspace-avatar><IMG class=xspace-imgstyle style="HEIGHT: 150px" alt=MichaelBibby src="http://hi.chinaunix.net/images/base/space_noface.gif"> <P><A href="http://hi.chinaunix.net/?uid-133135-action-viewpro-showpro-1"><FONT color=#000066>MichaelBibby</FONT></A></P> <P class=xspace-selfintro><FONT color=#000066></FONT></P></DIV></DIV> <DIV class=xspace-sideblock id=action> <H3 class=xspace-blocktitle>用户菜单</H3> <UL id=xspace-action> <LI><A class=xspace-message href="http://hi.chinaunix.net/?uid-133135-action-viewpro"><FONT color=#000066>给我留言</FONT></A> </LI> <LI><A class=xspace-addfriend onclick="javascript:joinfriend('133135');" href="javascript:;"><FONT color=#000066>加入好友</FONT></A> </LI> <LI><A class=xspace-sendpm href="http://bbs.chinaunix.net/pm.php?action=send&uid=133135" target=_blank><FONT color=#000066>发短消息</FONT></A> </LI> <LI><A class=xspace-profile href="http://hi.chinaunix.net/?uid-133135-action-viewpro-showpro-1"><FONT color=#000066>我的介绍</FONT></A> </LI> <LI><A class=xspace-profile href="http://bbs.chinaunix.net/viewpro.php?uid=133135"><FONT color=#000066>论坛资料</FONT></A> </LI> <LI><A class=xspace-ctrlpannel href="http://hi.chinaunix.net/batch.manage.php?uid=133135"><FONT color=#000066>空间管理</FONT></A> </LI></UL></DIV> <DIV class=xspace-sideblock id=calendar> <H3 class=xspace-blocktitle>日历</H3> <TABLE id=xspace-calendar cellSpacing=2 cellPadding=2 width="100%" summary=xspace-Calendar border=0> <TBODY> <TR> <TD align=middle colSpan=7> <TABLE class=xspace-datenav cellSpacing=3 cellPadding=3 summary="xspace-Date nav"> <TBODY> <TR> <TD align=middle><A href="http://hi.chinaunix.net/?action-spacelist-uid-133135-starttime-1228060800-endtime-1230739200"><FONT color=#000066>«</FONT></A></TD> <TD noWrap align=middle><A href="http://hi.chinaunix.net/?action-spacelist-uid-133135-starttime-1230739200-endtime-1233417600"><FONT color=#000066>2009-01-11</FONT></A></TD> <TD align=middle> </TD></TR></TBODY></TABLE></TD></TR> <TR class=xspace-week align=middle> <TD>日</TD> <TD>一</TD> <TD>二</TD> <TD>三</TD> <TD>四</TD> <TD>五</TD> <TD>六</TD></TR> <TR align=middle> <TD> </TD> <TD> </TD> <TD> </TD> <TD> </TD> <TD>1</TD> <TD>2</TD> <TD>3</TD></TR> <TR align=middle> <TD>4</TD> <TD>5</TD> <TD>6</TD> <TD>7</TD> <TD>8</TD> <TD>9</TD> <TD>10</TD></TR> <TR align=middle> <TD>11</TD> <TD>12</TD> <TD>13</TD> <TD>14</TD> <TD>15</TD> <TD>16</TD> <TD>17</TD></TR> <TR align=middle> <TD>18</TD> <TD>19</TD> <TD>20</TD> <TD>21</TD> <TD>22</TD> <TD>23</TD> <TD>24</TD></TR> <TR align=middle> <TD>25</TD> <TD>26</TD> <TD>27</TD> <TD>28</TD> <TD>29</TD> <TD>30</TD> <TD>31</TD></TR></TBODY></TABLE></DIV> <DIV class=xspace-sideblock id=track> <H3 class=xspace-blocktitle>我的回复</H3> <UL class=xspace-list> <LI><A href="http://bbs.chinaunix.net/viewthread.php?tid=1352549" target=_blank><FONT color=#000066>如何解决dovecot默认domian的认证问题?</FONT></A> <LI><A href="http://bbs.chinaunix.net/viewthread.php?tid=1350857" target=_blank><FONT color=#000066>防范自己发给自己的垃圾邮件</FONT></A> <LI><A href="http://bbs.chinaunix.net/viewthread.php?tid=1350292" target=_blank><FONT color=#000066>金笛邮件的反垃圾邮件网管技术</FONT></A> <LI><A href="http://bbs.chinaunix.net/viewthread.php?tid=1344841" target=_blank><FONT color=#000066>postfix+dovecot+mysql+cyrus-sasl+openssl+centos</FONT></A> <LI><A href="http://bbs.chinaunix.net/viewthread.php?tid=1343947" target=_blank><FONT color=#000066>求各位达人提供一个mail服务器解决方案</FONT></A> <LI><A href="http://bbs.chinaunix.net/viewthread.php?tid=1339340" target=_blank><FONT color=#000066>RHEL5中,如何限制某个域、某些用户访问dovecot的pop3s、imaps?</FONT></A> <LI><A href="http://bbs.chinaunix.net/viewthread.php?tid=1338111" target=_blank><FONT color=#000066>我现在的状况是.....</FONT></A> <LI><A href="http://bbs.chinaunix.net/viewthread.php?tid=1336233" target=_blank><FONT color=#000066>即时通讯(IM)服务</FONT></A> <LI><A href="http://bbs.chinaunix.net/viewthread.php?tid=1336194" target=_blank><FONT color=#000066>邮件系统我认为是最复杂应用服务之一.所以建议大家尽力用开源或是破解的如kerio</FONT></A> <LI><A href="http://bbs.chinaunix.net/viewthread.php?tid=1335623" target=_blank><FONT color=#000066>openbsd推荐cwm窗口管理</FONT></A></LI></UL></DIV> <DIV class=xspace-sideblock id=track> <H3 class=xspace-blocktitle>最新来客</H3> <UL class=xspace-list> <LI class="xspace-avatarlist xspace-imgstyle"><A href="http://hi.chinaunix.net/?uid-759047" target=_blank><IMG alt="759047曾经在2008-12-17 09:23:46访问过你的空间" src="http://hi.chinaunix.net/images/base/space_noface.gif"></A> <P><A href="http://hi.chinaunix.net/?uid-759047" target=_blank alt=""><FONT color=#000066>759047</FONT></A></P></LI> <LI class="xspace-avatarlist xspace-imgstyle"><A href="http://hi.chinaunix.net/?uid-780250" target=_blank><FONT color=#000066><IMG alt="780250曾经在2008-12-15 23:18:47访问过你的空间" src="http://hi.chinaunix.net/images/base/space_noface.gif"></FONT></A> <P><A href="http://hi.chinaunix.net/?uid-780250" target=_blank alt=""><FONT color=#000066>780250</FONT></A></P></LI></UL></DIV> <DIV class=xspace-sideblock id=infomation> <H3 class=xspace-blocktitle>数据统计</H3> <UL class=xspace-list> <LI>访问量: 60 <LI>建立时间: 2008-05-31 <LI>更新时间: </LI></UL></DIV> <DIV class=xspace-sideblock id=rss> <H3 class=xspace-blocktitle>RSS订阅</H3> <UL class=xspace-list> <LI class=xspace-logo><A href="http://hi.chinaunix.net/?uid-133135-action-rss-type-"><IMG alt=RSS订阅 src="http://hi.chinaunix.net/images/base/rss.gif" border=0></A> </LI></UL></DIV></DIV></DIV></DIV> <DIV id=xspace-footer> <P id=xspace-footer-ad></P> <P id=xspace-footer_menu><A href="http://hi.chinaunix.net/batch.login.php?action=logout"><FONT color=#000066>清空Cookie</FONT></A> - <A href="mailto:admin2@staff.chinaunix.net"><FONT color=#000066>联系我们</FONT></A> - <A href="http://hi.chinaunix.net/" target=_blank><FONT color=#000066>ChinaUnix个人空间</FONT></A> - <A href="http://bbs.chinaunix.net/" target=_blank><FONT color=#000066>交流论坛</FONT></A> - <A href="http://hi.chinaunix.net/?action/spaces"><FONT color=#000066>空间列表</FONT></A> - <A href="http://hi.chinaunix.net/archiver/" target=_blank><FONT color=#000066>站点存档</FONT></A> - <A href="http://hi.chinaunix.net/?action/register" target=_blank><FONT color=#000066>升级自己的空间</FONT></A> </P> <P id=xspace-copyright>Powered by <A href="http://www.supesite.com/" target=_blank><STRONG><FONT color=#003366>X-Space</FONT></STRONG></A> <STRONG><FONT color=#ff9900>4.0Final</FONT></STRONG> © 2001-2008 <A href="http://www.comsenz.com/" target=_blank><FONT color=#000066>Comsenz Inc.</FONT></A> <BR>Processed in 0.077416 second(s), 8 queries, Gzip enabled<BR><A href="http://www.miibeian.gov.cn/" target=_blank><FONT color=#000066>京ICP证041476号</FONT></A><BR></P></DIV> <DIV id=toolbarshowbtn><A onmouseover=showtoolbar(); href="javascript:;">Open Toolbar</A></DIV> <DIV id=toolbarframe><IFRAME src="http://hi.chinaunix.net/batch.toolbar.php" frameBorder=0 width="100%" scrolling=no></IFRAME></DIV></DIV>
查看全文
发表于:2009-01-11 ┆
阅读(163)
┆
评论(0)
iredmail作者博客
<DIV> <TABLE style="BORDER-COLLAPSE: collapse" height=27 cellSpacing=0 cellPadding=0 width="100%" bgColor=#ffffff background=../../templates/tech/images/bg_menu.gif border=0> <TBODY> <TR> <TD width=20></TD> <TD><A class=list1 href="http://michaelbibby.cublog.cn/" target=_blank><FONT color=#0000ff><U>MichaelBibby.cublog.cn </U></FONT></A></TD> <TD align=right><A class=list1 href="http://blog.chinaunix.net/u/10604/index.php"><U><FONT color=#0000ff>首页</FONT></U></A> | <A class=list1 href="http://blog.chinaunix.net/u/10604/article.php"><U><FONT color=#0000ff>文章</FONT></U></A> | <A class=list1 href="http://blog.chinaunix.net/u/10604/photo.php"><U><FONT color=#0000ff>相册</FONT></U></A> | <A class=list1 href="http://blog.chinaunix.net/u/10604/links.php"><U><FONT color=#0000ff>收藏夹</FONT></U></A> | <A class=list1 href="http://blog.chinaunix.net/u/10604/guestbook.php"><U><FONT color=#0000ff>留言</FONT></U></A> </TD> <TD width=10></TD></TR></TBODY></TABLE> <SCRIPT language=javascript> function $(s){return document.getElementById(s);} function ShowHideDiv(divid,iImg){ if($(divid).style.display == "none"){ iImg.src="../../templates/tech/images/dot2.gif"; $(divid).style.display = "block"; iImg.title="收起"; }else{ iImg.src="../../templates/tech/images/dot4.gif"; $(divid).style.display = "none"; iImg.title="展开"; } } </SCRIPT> <TABLE style="BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width="100%" border=0> <TBODY> <TR> <TD vAlign=top align=middle width=235><BR> <TABLE style="BORDER-COLLAPSE: collapse" borderColor=#111111 cellSpacing=0 cellPadding=0 width=220 border=0> <TBODY> <TR> <TD><IMG alt="" src="http://blog.chinaunix.net/templates/tech/images/left_bg_top.gif" border=0></TD></TR> <TR> <TD align=middle bgColor=#edf2f2 height=25> <TABLE style="BORDER-COLLAPSE: collapse" borderColor=#111111 cellSpacing=0 cellPadding=0 width=200 border=0> <TBODY> <TR> <TD align=middle width=180><FONT style="FONT-SIZE: 10pt" color=#1f72d0><B>关于作者</B></FONT></TD> <TD width=20><IMG title=收起 onclick="ShowHideDiv('aboutwriter',this);return false;" src="http://blog.chinaunix.net/templates/tech/images/dot2.gif" border=0></TD></TR></TBODY></TABLE></TD></TR> <TR> <TD bgColor=#d2dee2 height=1></TD></TR> <TR> <TD bgColor=#ffffff height=1></TD></TR> <TR> <TD id=aboutwriter style="COLOR: #02368d" align=middle bgColor=#f3f6f6> <TABLE style="COLOR: #02368d; BORDER-COLLAPSE: collapse; WORD-WRAP: break-word" height=16 cellSpacing=0 cellPadding=0 width=200 border=0> <TBODY> <TR> <TD align=middle><A href="http://blog.chinaunix.net/u/10604/up_user.jpeg" target=_blank><IMG src="http://blog.chinaunix.net/u/10604/up_user_pre.jpg" border=0><FONT color=#0000ff> </FONT></A></TD></TR> <TR> <TD width=200><PRE style="MARGIN: 5px; LINE-HEIGHT: 150%" width=25>姓名:张煌彬 年龄:1984年 位置:广东深圳福田区 网站:http://www.bsdlife.org</PRE></TD></TR></TBODY></TABLE></TD></TR> <TR> <TD> <TABLE style="BORDER-RIGHT: #d2dee2 1px solid; PADDING-RIGHT: 1px; BORDER-TOP: #d2dee2 1px solid; PADDING-LEFT: 1px; PADDING-BOTTOM: 1px; BORDER-LEFT: #d2dee2 1px solid; PADDING-TOP: 1px; BORDER-BOTTOM: #d2dee2 1px solid; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=220 align=center bgColor=#ffffff border=0> <TBODY> <TR bgColor=#edf2f2 height=20> <TD title=上一年 style="FONT-SIZE: 9pt; CURSOR: hand; COLOR: #1f72d0" onclick="pushBtm('YU')" align=middle width=14>||</TD> <TD title=上一月 style="FONT-SIZE: 9pt; CURSOR: hand; COLOR: #1f72d0" onclick="pushBtm('MU')" align=middle width=14><<</TD> <TD id=YMBG style="FONT-SIZE: 9pt; COLOR: #1f72d0" noWrap align=middle>2009年1月</TD> <TD id=GZ style="FONT-SIZE: 9pt; COLOR: #1f72d0" noWrap align=middle>己丑年(牛)</TD> <TD title=下一月 style="FONT-SIZE: 9pt; CURSOR: hand; COLOR: #1f72d0" onclick="pushBtm('MD')" align=middle width=14>>></TD> <TD title=下一年 style="FONT-SIZE: 9pt; CURSOR: hand; COLOR: #1f72d0" onclick="pushBtm('YD')" align=middle width=14>||</TD></TR> <TR> <TD colSpan=6> <DIV id=ttdiv align=center width="210"> <TABLE id=datetable style="BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=216 bgColor=#f6f8f8 border=0> <TBODY> <TR style="COLOR: #a6aa97" align=middle bgColor=#edf2f2> <TD width=32 height=24>日</TD> <TD width=32>一</TD> <TD width=32>二</TD> <TD width=32>三</TD> <TD width=32>四</TD> <TD width=32>五</TD> <TD width=32>六</TD></TR> <TR align=middle> <TD noWrap><FONT class="" id=SD0 title="" face="Arial Black" color=#cdbc71 size=2></FONT><BR><FONT id=LD0 style="FONT-SIZE: 7pt"></FONT></TD> <TD noWrap><FONT class="" id=SD1 title="" face="Arial Black" color=#a6aa97 size=2></FONT><BR><FONT id=LD1 style="FONT-SIZE: 7pt"></FONT></TD> <TD noWrap><FONT class="" id=SD2 title="" face="Arial Black" color=#a6aa97 size=2></FONT><BR><FONT id=LD2 style="FONT-SIZE: 7pt"></FONT></TD> <TD noWrap><FONT class="" id=SD3 title="" face="Arial Black" color=#a6aa97 size=2></FONT><BR><FONT id=LD3 style="FONT-SIZE: 7pt"></FONT></TD> <TD noWrap><FONT class="" id=SD4 title="元旦 " style="COLOR: red" face="Arial Black" color=#a6aa97 size=2>1</FONT><BR><FONT id=LD4 style="FONT-SIZE: 7pt"><FONT color=#6fc2ff>元旦 </FONT></FONT></TD> <TD noWrap><FONT class="" id=SD5 title=初七 face="Arial Black" color=#a6aa97 size=2>2</FONT><BR><FONT id=LD5 style="FONT-SIZE: 7pt">初七</FONT></TD> <TD noWrap><FONT class="" id=SD6 title="腊八节 " face="Arial Black" color=#cdbc71 size=2>3</FONT><BR><FONT id=LD6 style="FONT-SIZE: 7pt"><FONT color=#6fc2ff>腊八节 </FONT></FONT></TD></TR> <TR align=middle> <TD noWrap><FONT class="" id=SD7 title=初九 style="COLOR: #cdbc71" face="Arial Black" color=#cdbc71 size=2>4</FONT><BR><FONT id=LD7 style="FONT-SIZE: 7pt">初九</FONT></TD> <TD noWrap><FONT class="" id=SD8 title=小寒 face="Arial Black" color=#a6aa97 size=2>5</FONT><BR><FONT id=LD8 style="FONT-SIZE: 7pt"><FONT color=limegreen>小寒</FONT></FONT></TD> <TD noWrap><FONT class="" id=SD9 title=十一 face="Arial Black" color=#a6aa97 size=2>6</FONT><BR><FONT id=LD9 style="FONT-SIZE: 7pt">十一</FONT></TD> <TD noWrap><FONT class="" id=SD10 title=十二 face="Arial Black" color=#a6aa97 size=2>7</FONT><BR><FONT id=LD10 style="FONT-SIZE: 7pt">十二</FONT></TD> <TD noWrap><FONT class="" id=SD11 title=十三 face="Arial Black" color=#a6aa97 size=2>8</FONT><BR><FONT id=LD11 style="FONT-SIZE: 7pt">十三</FONT></TD> <TD noWrap><FONT class="" id=SD12 title=十四 face="Arial Black" color=#a6aa97 size=2>9</FONT><BR><FONT id=LD12 style="FONT-SIZE: 7pt">十四</FONT></TD> <TD noWrap><FONT class="" id=SD13 title=十五 style="COLOR: #cdbc71" face="Arial Black" color=#cdbc71 size=2>10</FONT><BR><FONT id=LD13 style="FONT-SIZE: 7pt">十五</FONT></TD></TR> <TR align=middle> <TD noWrap><FONT class=todyaColor id=SD14 title=十六 style="COLOR: #cdbc71" face="Arial Black" color=#cdbc71 size=2>11</FONT><BR><FONT id=LD14 style="FONT-SIZE: 7pt">十六</FONT></TD> <TD noWrap><FONT class="" id=SD15 title=十七 face="Arial Black" color=#a6aa97 size=2>12</FONT><BR><FONT id=LD15 style="FONT-SIZE: 7pt">十七</FONT></TD> <TD noWrap><FONT class="" id=SD16 title=十八 face="Arial Black" color=#a6aa97 size=2>13</FONT><BR><FONT id=LD16 style="FONT-SIZE: 7pt">十八</FONT></TD> <TD noWrap><FONT class="" id=SD17 title=十九 face="Arial Black" color=#a6aa97 size=2>14</FONT><BR><FONT id=LD17 style="FONT-SIZE: 7pt">十九</FONT></TD> <TD noWrap><FONT class="" id=SD18 title=二十 face="Arial Black" color=#a6aa97 size=2>15</FONT><BR><FONT id=LD18 style="FONT-SIZE: 7pt">二十</FONT></TD> <TD noWrap><FONT class="" id=SD19 title=廿一 face="Arial Black" color=#a6aa97 size=2>16</FONT><BR><FONT id=LD19 style="FONT-SIZE: 7pt">廿一</FONT></TD> <TD noWrap><FONT class="" id=SD20 title=廿二 face="Arial Black" color=#cdbc71 size=2>17</FONT><BR><FONT id=LD20 style="FONT-SIZE: 7pt">廿二</FONT></TD></TR> <TR align=middle> <TD noWrap><FONT class="" id=SD21 title=廿三 style="COLOR: #cdbc71" face="Arial Black" color=#cdbc71 size=2>18</FONT><BR><FONT id=LD21 style="FONT-SIZE: 7pt">廿三</FONT></TD> <TD noWrap><FONT class="" id=SD22 title="小年 " face="Arial Black" color=#a6aa97 size=2>19</FONT><BR><FONT id=LD22 style="FONT-SIZE: 7pt"><FONT color=#6fc2ff>小年 </FONT></FONT></TD> <TD noWrap><FONT class="" id=SD23 title=大寒 face="Arial Black" color=#a6aa97 size=2>20</FONT><BR><FONT id=LD23 style="FONT-SIZE: 7pt"><FONT color=limegreen>大寒</FONT></FONT></TD> <TD noWrap><FONT class="" id=SD24 title=廿六 face="Arial Black" color=#a6aa97 size=2>21</FONT><BR><FONT id=LD24 style="FONT-SIZE: 7pt">廿六</FONT></TD> <TD noWrap><FONT class="" id=SD25 title=廿七 face="Arial Black" color=#a6aa97 size=2>22</FONT><BR><FONT id=LD25 style="FONT-SIZE: 7pt">廿七</FONT></TD> <TD noWrap><FONT class="" id=SD26 title=廿八 face="Arial Black" color=#a6aa97 size=2>23</FONT><BR><FONT id=LD26 style="FONT-SIZE: 7pt">廿八</FONT></TD> <TD noWrap><FONT class="" id=SD27 title=廿九 style="COLOR: #cdbc71" face="Arial Black" color=#cdbc71 size=2>24</FONT><BR><FONT id=LD27 style="FONT-SIZE: 7pt">廿九</FONT></TD></TR> <TR align=middle> <TD noWrap><FONT class="" id=SD28 title="除夕 " style="COLOR: red" face="Arial Black" color=#cdbc71 size=2>25</FONT><BR><FONT id=LD28 style="FONT-SIZE: 7pt"><FONT color=#6fc2ff>除夕 </FONT></FONT></TD> <TD noWrap><FONT class="" id=SD29 title="春节 " style="COLOR: red" face="Arial Black" color=#a6aa97 size=2>26</FONT><BR><FONT id=LD29 style="FONT-SIZE: 7pt"><FONT color=#6fc2ff>春节 </FONT></FONT></TD> <TD noWrap><FONT class="" id=SD30 title=初二 face="Arial Black" color=#a6aa97 size=2>27</FONT><BR><FONT id=LD30 style="FONT-SIZE: 7pt">初二</FONT></TD> <TD noWrap><FONT class="" id=SD31 title=初三 face="Arial Black" color=#a6aa97 size=2>28</FONT><BR><FONT id=LD31 style="FONT-SIZE: 7pt">初三</FONT></TD> <TD noWrap><FONT class="" id=SD32 title=初四 face="Arial Black" color=#a6aa97 size=2>29</FONT><BR><FONT id=LD32 style="FONT-SIZE: 7pt">初四</FONT></TD> <TD noWrap><FONT class="" id=SD33 title=初五 face="Arial Black" color=#a6aa97 size=2>30</FONT><BR><FONT id=LD33 style="FONT-SIZE: 7pt">初五</FONT></TD> <TD noWrap><FONT class="" id=SD34 title=初六 face="Arial Black" color=#cdbc71 size=2>31</FONT><BR><FONT id=LD34 style="FONT-SIZE: 7pt">初六</FONT></TD></TR> <TR align=middle> <TD noWrap><FONT class="" id=SD35 title="" face="Arial Black" color=#cdbc71 size=2></FONT><BR><FONT id=LD35 style="FONT-SIZE: 7pt"></FONT></TD> <TD noWrap><FONT class="" id=SD36 title="" face="Arial Black" color=#a6aa97 size=2></FONT><BR><FONT id=LD36 style="FONT-SIZE: 7pt"></FONT></TD> <TD noWrap><FONT class="" id=SD37 title="" face="Arial Black" color=#a6aa97 size=2></FONT><BR><FONT id=LD37 style="FONT-SIZE: 7pt"></FONT></TD> <TD noWrap><FONT class="" id=SD38 title="" face="Arial Black" color=#a6aa97 size=2></FONT><BR><FONT id=LD38 style="FONT-SIZE: 7pt"></FONT></TD> <TD noWrap><FONT class="" id=SD39 title="" face="Arial Black" color=#a6aa97 size=2></FONT><BR><FONT id=LD39 style="FONT-SIZE: 7pt"></FONT></TD> <TD noWrap><FONT class="" id=SD40 title="" face="Arial Black" color=#a6aa97 size=2></FONT><BR><FONT id=LD40 style="FONT-SIZE: 7pt"></FONT></TD> <TD noWrap><FONT class="" id=SD41 title="" face="Arial Black" color=#cdbc71 size=2></FONT><BR><FONT id=LD41 style="FONT-SIZE: 7pt"></FONT></TD></TR></TBODY></TABLE></DIV></TD></TR> <TR> <TD colSpan=6 height=1></TD></TR></TBODY></TABLE> <SCRIPT src="../../templates/tech/mdate.js"></SCRIPT> <SCRIPT language=javascript> var arrArtdate=new Array("20051119","20051126","20051127","20051130","20051201","20051202","20051205","20051217","20060102","20060103","20060119","20060210","20060211","20060224","20060225","20060317","20060324","20060507","20060509","20060512","20060513","20060516","20060517","20060615","20060803","20070409","20070411","20070429","20070517",""); initial("ttdiv"); </SCRIPT> </TD></TR> <TR> <TD bgColor=#d2dee2 height=1></TD></TR> <TR> <TD bgColor=#ffffff height=1></TD></TR> <TR> <TD align=middle bgColor=#edf2f2 height=25> <TABLE style="BORDER-COLLAPSE: collapse" borderColor=#111111 cellSpacing=0 cellPadding=0 width=200 border=0> <TBODY> <TR> <TD align=middle width=180><FONT style="FONT-SIZE: 10pt" color=#1f72d0><B>我的分类</B></FONT></TD> <TD width=20><IMG title=收起 onclick="ShowHideDiv('lefttree',this);return false;" src="http://blog.chinaunix.net/templates/tech/images/dot2.gif" border=0></TD></TR></TBODY></TABLE></TD></TR> <TR> <TD bgColor=#d2dee2 height=1></TD></TR> <TR> <TD bgColor=#ffffff height=1></TD></TR> <TR> <TD id=lefttree style="COLOR: #02368d" bgColor=#f3f6f6> <DIV> <DIV> <TABLE cellSpacing=0 cellPadding=0 border=0> <TBODY> <TR> <TD vAlign=center noWrap><A onclick="javascript: ContentsTree.OnNodeClick(1,true);" href="javascript:void(0)"><IMG id=signContentsTree1 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/Minus.gif" width=19></A><A class=listtree onclick="javascript: ContentsTree.OnNodeClick(1,false);" href="http://blog.chinaunix.net/u/10604/article.php"><IMG id=iconContentsTree1 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/OpenFolder.gif" width=19></A></TD> <TD vAlign=center noWrap><A class=listtree onclick="javascript: ContentsTree.OnNodeClick(1,false);" href="http://blog.chinaunix.net/u/10604/article.php"><FONT color=#0000ff><U>我的文章分类</U></FONT></A></TD></TR></TBODY></TABLE></DIV> <DIV id=divContentsTree1 style="DISPLAY: block"> <DIV> <TABLE cellSpacing=0 cellPadding=0 border=0> <TBODY> <TR> <TD vAlign=center noWrap><FONT color=#0000ff><U><IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/TreeBlank.gif" width=19></U></FONT><A onclick="javascript: ContentsTree.OnNodeClick(4,true);" href="javascript:void(0)"><FONT color=#0000ff><IMG id=signContentsTree4 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/Plus.gif" width=19></FONT></A><A class=listtree onclick="javascript: ContentsTree.OnNodeClick(4,false);" href="http://blog.chinaunix.net/u/10604/article.php?frmid=23570"><FONT color=#0000ff><U><IMG id=iconContentsTree4 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/ClosedFolder.gif" width=19></U></FONT></A></TD> <TD vAlign=center noWrap><A class=listtree onclick="javascript: ContentsTree.OnNodeClick(4,false);" href="http://blog.chinaunix.net/u/10604/article.php?frmid=23570"><FONT color=#0000ff><U>心情日记</U></FONT></A></TD></TR></TBODY></TABLE></DIV> <DIV id=divContentsTree4 style="DISPLAY: none"><FONT color=#0000ff><U></U></FONT></DIV> <DIV> <TABLE cellSpacing=0 cellPadding=0 border=0> <TBODY> <TR> <TD vAlign=center noWrap><FONT color=#0000ff><U><IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/TreeBlank.gif" width=19></U></FONT><A onclick="javascript: ContentsTree.OnNodeClick(5,true);" href="javascript:void(0)"><FONT color=#0000ff><IMG id=signContentsTree5 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/Plus.gif" width=19></FONT></A><A class=listtree onclick="javascript: ContentsTree.OnNodeClick(5,false);" href="http://blog.chinaunix.net/u/10604/article.php?frmid=22495"><FONT color=#0000ff><U><IMG id=iconContentsTree5 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/ClosedFolder.gif" width=19></U></FONT></A></TD> <TD vAlign=center noWrap><A class=listtree onclick="javascript: ContentsTree.OnNodeClick(5,false);" href="http://blog.chinaunix.net/u/10604/article.php?frmid=22495"><FONT color=#0000ff><U>人生哲学</U></FONT></A></TD></TR></TBODY></TABLE></DIV> <DIV id=divContentsTree5 style="DISPLAY: none"><FONT color=#0000ff><U></U></FONT></DIV> <DIV> <TABLE cellSpacing=0 cellPadding=0 border=0> <TBODY> <TR> <TD vAlign=center noWrap><FONT color=#0000ff><U><IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/TreeBlank.gif" width=19></U></FONT><A onclick="javascript: ContentsTree.OnNodeClick(6,true);" href="javascript:void(0)"><FONT color=#0000ff><IMG id=signContentsTree6 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/Plus.gif" width=19></FONT></A><A class=listtree onclick="javascript: ContentsTree.OnNodeClick(6,false);" href="http://blog.chinaunix.net/u/10604/article.php?frmid=22535"><FONT color=#0000ff><U><IMG id=iconContentsTree6 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/ClosedFolder.gif" width=19></U></FONT></A></TD> <TD vAlign=center noWrap><A class=listtree onclick="javascript: ContentsTree.OnNodeClick(6,false);" href="http://blog.chinaunix.net/u/10604/article.php?frmid=22535"><FONT color=#0000ff><U>FreeBSD</U></FONT></A></TD></TR></TBODY></TABLE></DIV> <DIV id=divContentsTree6 style="DISPLAY: none"><FONT color=#0000ff><U></U></FONT></DIV> <DIV> <TABLE cellSpacing=0 cellPadding=0 border=0> <TBODY> <TR> <TD vAlign=center noWrap><FONT color=#0000ff><U><IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/TreeBlank.gif" width=19></U></FONT><A onclick="javascript: ContentsTree.OnNodeClick(7,true);" href="javascript:void(0)"><FONT color=#0000ff><IMG id=signContentsTree7 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/Plus.gif" width=19></FONT></A><A class=listtree onclick="javascript: ContentsTree.OnNodeClick(7,false);" href="http://blog.chinaunix.net/u/10604/article.php?frmid=20461"><FONT color=#0000ff><U><IMG id=iconContentsTree7 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/ClosedFolder.gif" width=19></U></FONT></A></TD> <TD vAlign=center noWrap><A class=listtree onclick="javascript: ContentsTree.OnNodeClick(7,false);" href="http://blog.chinaunix.net/u/10604/article.php?frmid=20461"><FONT color=#0000ff><U>NetBSD</U></FONT></A></TD></TR></TBODY></TABLE></DIV> <DIV id=divContentsTree7 style="DISPLAY: none"><FONT color=#0000ff><U></U></FONT></DIV> <DIV> <TABLE cellSpacing=0 cellPadding=0 border=0> <TBODY> <TR> <TD vAlign=center noWrap><FONT color=#0000ff><U><IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/TreeBlank.gif" width=19></U></FONT><A onclick="javascript: ContentsTree.OnNodeClick(8,true);" href="javascript:void(0)"><FONT color=#0000ff><IMG id=signContentsTree8 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/Plus.gif" width=19></FONT></A><A class=listtree onclick="javascript: ContentsTree.OnNodeClick(8,false);" href="http://blog.chinaunix.net/u/10604/article.php?frmid=17342"><FONT color=#0000ff><U><IMG id=iconContentsTree8 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/ClosedFolder.gif" width=19></U></FONT></A></TD> <TD vAlign=center noWrap><A class=listtree onclick="javascript: ContentsTree.OnNodeClick(8,false);" href="http://blog.chinaunix.net/u/10604/article.php?frmid=17342"><FONT color=#0000ff><U>OpenBSD</U></FONT></A></TD></TR></TBODY></TABLE></DIV> <DIV id=divContentsTree8 style="DISPLAY: none"><FONT color=#0000ff><U></U></FONT></DIV> <DIV> <TABLE cellSpacing=0 cellPadding=0 border=0> <TBODY> <TR> <TD vAlign=center noWrap><FONT color=#0000ff><U><IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/TreeBlank.gif" width=19></U></FONT><A onclick="javascript: ContentsTree.OnNodeClick(9,true);" href="javascript:void(0)"><FONT color=#0000ff><IMG id=signContentsTree9 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/Plus.gif" width=19></FONT></A><A class=listtree onclick="javascript: ContentsTree.OnNodeClick(9,false);" href="http://blog.chinaunix.net/u/10604/article.php?frmid=19064"><FONT color=#0000ff><U><IMG id=iconContentsTree9 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/ClosedFolder.gif" width=19></U></FONT></A></TD> <TD vAlign=center noWrap><A class=listtree onclick="javascript: ContentsTree.OnNodeClick(9,false);" href="http://blog.chinaunix.net/u/10604/article.php?frmid=19064"><FONT color=#0000ff><U>OpenBSD FAQ</U></FONT></A></TD></TR></TBODY></TABLE></DIV> <DIV id=divContentsTree9 style="DISPLAY: none"><FONT color=#0000ff><U></U></FONT></DIV> <DIV> <TABLE cellSpacing=0 cellPadding=0 border=0> <TBODY> <TR> <TD vAlign=center noWrap><FONT color=#0000ff><U><IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/TreeBlank.gif" width=19></U></FONT><A onclick="javascript: ContentsTree.OnNodeClick(10,true);" href="javascript:void(0)"><FONT color=#0000ff><IMG id=signContentsTree10 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/Plus.gif" width=19></FONT></A><A class=listtree onclick="javascript: ContentsTree.OnNodeClick(10,false);" href="http://blog.chinaunix.net/u/10604/article.php?frmid=19040"><FONT color=#0000ff><U><IMG id=iconContentsTree10 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/ClosedFolder.gif" width=19></U></FONT></A></TD> <TD vAlign=center noWrap><A class=listtree onclick="javascript: ContentsTree.OnNodeClick(10,false);" href="http://blog.chinaunix.net/u/10604/article.php?frmid=19040"><FONT color=#0000ff><U>Python</U></FONT></A></TD></TR></TBODY></TABLE></DIV> <DIV id=divContentsTree10 style="DISPLAY: none"><FONT color=#0000ff><U></U></FONT></DIV> <DIV> <TABLE cellSpacing=0 cellPadding=0 border=0> <TBODY> <TR> <TD vAlign=center noWrap><FONT color=#0000ff><U><IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/TreeBlank.gif" width=19></U></FONT><A onclick="javascript: ContentsTree.OnNodeClick(11,true);" href="javascript:void(0)"><FONT color=#0000ff><IMG id=signContentsTree11 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/Plus.gif" width=19></FONT></A><A class=listtree onclick="javascript: ContentsTree.OnNodeClick(11,false);" href="http://blog.chinaunix.net/u/10604/article.php?frmid=19787"><FONT color=#0000ff><U><IMG id=iconContentsTree11 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/ClosedFolder.gif" width=19></U></FONT></A></TD> <TD vAlign=center noWrap><A class=listtree onclick="javascript: ContentsTree.OnNodeClick(11,false);" href="http://blog.chinaunix.net/u/10604/article.php?frmid=19787"><FONT color=#0000ff><U>Server</U></FONT></A></TD></TR></TBODY></TABLE></DIV> <DIV id=divContentsTree11 style="DISPLAY: none"><FONT color=#0000ff><U></U></FONT></DIV> <DIV> <TABLE cellSpacing=0 cellPadding=0 border=0> <TBODY> <TR> <TD vAlign=center noWrap><FONT color=#0000ff><U><IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/TreeBlank.gif" width=19></U></FONT><A onclick="javascript: ContentsTree.OnNodeClick(12,true);" href="javascript:void(0)"><FONT color=#0000ff><IMG id=signContentsTree12 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/Minus.gif" width=19></FONT></A><A class=listtree onclick="javascript: ContentsTree.OnNodeClick(12,false);" href="http://blog.chinaunix.net/u/10604/article.php?frmid=19218"><FONT color=#0000ff><U><IMG id=iconContentsTree12 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/OpenFolder.gif" width=19></U></FONT></A></TD> <TD vAlign=center noWrap><A class=listtree onclick="javascript: ContentsTree.OnNodeClick(12,false);" href="http://blog.chinaunix.net/u/10604/article.php?frmid=19218"><FONT color=#800080><U>Shell</U></FONT></A></TD></TR></TBODY></TABLE></DIV> <DIV id=divContentsTree12 style="DISPLAY: block"><FONT color=#800080><U></U></FONT></DIV> <DIV> <TABLE cellSpacing=0 cellPadding=0 border=0> <TBODY> <TR> <TD vAlign=center noWrap><FONT color=#800080><U><IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/TreeBlank.gif" width=19></U></FONT><A onclick="javascript: ContentsTree.OnNodeClick(13,true);" href="javascript:void(0)"><FONT color=#800080><IMG id=signContentsTree13 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/Plus.gif" width=19></FONT></A><A class=listtree onclick="javascript: ContentsTree.OnNodeClick(13,false);" href="http://blog.chinaunix.net/u/10604/article.php?frmid=19233"><FONT color=#800080><U><IMG id=iconContentsTree13 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/ClosedFolder.gif" width=19></U></FONT></A></TD> <TD vAlign=center noWrap><A class=listtree onclick="javascript: ContentsTree.OnNodeClick(13,false);" href="http://blog.chinaunix.net/u/10604/article.php?frmid=19233"><FONT color=#0000ff><U>Tools and Tips</U></FONT></A></TD></TR></TBODY></TABLE></DIV> <DIV id=divContentsTree13 style="DISPLAY: none"><FONT color=#0000ff><U></U></FONT></DIV></DIV> <DIV> <TABLE cellSpacing=0 cellPadding=0 border=0> <TBODY> <TR> <TD vAlign=center noWrap><A onclick="javascript: ContentsTree.OnNodeClick(2,true);" href="javascript:void(0)"><FONT color=#0000ff><IMG id=signContentsTree2 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/Minus.gif" width=19></FONT></A><A class=listtree onclick="javascript: ContentsTree.OnNodeClick(2,false);" href="http://blog.chinaunix.net/u/10604/photo.php"><FONT color=#0000ff><U><IMG id=iconContentsTree2 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/OpenFolder.gif" width=19></U></FONT></A></TD> <TD vAlign=center noWrap><A class=listtree onclick="javascript: ContentsTree.OnNodeClick(2,false);" href="http://blog.chinaunix.net/u/10604/photo.php"><FONT color=#0000ff><U>我的图片分类</U></FONT></A></TD></TR></TBODY></TABLE></DIV> <DIV id=divContentsTree2 style="DISPLAY: block"><FONT color=#0000ff><U></U></FONT></DIV> <DIV> <TABLE cellSpacing=0 cellPadding=0 border=0> <TBODY> <TR> <TD vAlign=center noWrap><A onclick="javascript: ContentsTree.OnNodeClick(3,true);" href="javascript:void(0)"><FONT color=#0000ff><IMG id=signContentsTree3 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/Minus.gif" width=19></FONT></A><A class=listtree onclick="javascript: ContentsTree.OnNodeClick(3,false);" href="http://blog.chinaunix.net/u/10604/links.php"><FONT color=#0000ff><U><IMG id=iconContentsTree3 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/OpenFolder.gif" width=19></U></FONT></A></TD> <TD vAlign=center noWrap><A class=listtree onclick="javascript: ContentsTree.OnNodeClick(3,false);" href="http://blog.chinaunix.net/u/10604/links.php"><FONT color=#0000ff><U>我的链接分类</U></FONT></A></TD></TR></TBODY></TABLE></DIV> <DIV id=divContentsTree3 style="DISPLAY: block"> <DIV> <TABLE cellSpacing=0 cellPadding=0 border=0> <TBODY> <TR> <TD vAlign=center noWrap><FONT color=#0000ff><U><IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/TreeBlank.gif" width=19></U></FONT><A onclick="javascript: ContentsTree.OnNodeClick(14,true);" href="javascript:void(0)"><FONT color=#0000ff><IMG id=signContentsTree14 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/Plus.gif" width=19></FONT></A><A class=listtree onclick="javascript: ContentsTree.OnNodeClick(14,false);" href="http://blog.chinaunix.net/u/10604/links.php?frmid=3780"><FONT color=#0000ff><U><IMG id=iconContentsTree14 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=19 alt="" src="http://blog.chinaunix.net/templates/tech/images/ClosedFolder.gif" width=19></U></FONT></A></TD> <TD vAlign=center noWrap><A class=listtree onclick="javascript: ContentsTree.OnNodeClick(14,false);" href="http://blog.chinaunix.net/u/10604/links.php?frmid=3780"><U><FONT color=#0000ff>BSD</FONT></U></A></TD></TR></TBODY></TABLE></DIV> <DIV id=divContentsTree14 style="DISPLAY: none"><U><FONT color=#0000ff></FONT></U></DIV></DIV></DIV></TD></TR> <TR> <TD><U><FONT color=#0000ff><IMG alt="" src="http://blog.chinaunix.net/templates/tech/images/left_bg_bottom.gif" border=0></FONT></U></TD></TR></TBODY></TABLE></TD> <TD width=10><U><FONT color=#0000ff></FONT></U></TD> <TD vAlign=top align=middle><BR> <TABLE style="BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width="100%" border=0> <TBODY> <TR> <TD width=11 height=11><U><FONT color=#0000ff><IMG alt="" src="http://blog.chinaunix.net/templates/tech/images/g_left_top.gif" border=0></FONT></U></TD> <TD width="99%" bgColor=#dddddd height=11><U><FONT color=#0000ff></FONT></U></TD> <TD width=11 height=11><U><FONT color=#0000ff><IMG alt="" src="http://blog.chinaunix.net/templates/tech/images/g_right_top.gif" border=0></FONT></U></TD></TR> <TR> <TD vAlign=top align=middle width="100%" bgColor=#dddddd colSpan=3> <TABLE style="BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width="96%" border=0> <TBODY> <TR height=25> <TD width=10><U><FONT color=#0000ff></FONT></U></TD> <TD width=485><FONT color=#6cb743><B>文章列表 - Shell</B></FONT> </TD></TR> <TR> <TD colSpan=3 height=2></TD></TR></TBODY></TABLE> <TABLE style="BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width="96%" border=0> <TBODY> <TR> <TD width=7 height=7><IMG alt="" src="http://blog.chinaunix.net/templates/tech/images/w_left_top.gif" border=0></TD> <TD width="100%" bgColor=#f3f3f3></TD> <TD width=7 height=7><IMG alt="" src="http://blog.chinaunix.net/templates/tech/images/w_right_top.gif" border=0></TD></TR> <TR> <TD align=middle bgColor=#f3f3f3 colSpan=3> <TABLE style="TABLE-LAYOUT: fixed; BORDER-COLLAPSE: collapse; WORD-WRAP: break-word" cellSpacing=0 cellPadding=0 width="100%" bgColor=#f3f3f3 border=0> <TBODY> <TR height=25> <TD align=middle width=25><IMG height=8 alt="" src="http://blog.chinaunix.net/templates/tech/images/dot.gif" width=8 border=0></TD> <TD width="90%"><A class=list1 href="http://blog.chinaunix.net/u/10604/showart.php?id=60090" target=""><FONT style="FONT-SIZE: 10pt" color=#02368d><B><U>ANSI控制码的说明 </U></B></FONT></A></TD> <TD align=middle width=25><U><IMG title=收起 onclick="ShowHideDiv('art60090',this);" src="http://blog.chinaunix.net/templates/tech/images/dot2.gif" border=0></U> </TD></TR> <TR> <TD width=25></TD> <TD style="MARGIN: 5px; LINE-HEIGHT: 120%" colSpan=2> <DIV id=art60090 style="MARGIN-TOP: 5px; HEIGHT: 100%"><A href="http://bbs.chinaunix.net/viewthread.php?tid=661031&extra=page%3D1"><FONT color=#0000ff>http://bbs.chinaunix.net/viewthread.php?tid=661031&extra=page%3D1</FONT></A> <P> <P><SPAN style="FONT-SIZE: 13px">ANSI控制码的说明<BR>例如:<BR> echo -ne "33[32m" 可以将字符的显示颜色改为绿色<BR> echo -ne "33[3;1H" 可以将光标移到第3行第1列处</SPAN></P> <P><SPAN style="FONT-SIZE: 13px">具体的摘抄一些如下:<BR>33[0m 关闭所有属性<BR>33[1m 设置高亮度<BR>33[…… </SPAN></P></DIV></TD></TR> <TR height=20> <TD align=right colSpan=3><A class=list1 href="http://blog.chinaunix.net/u/10604/showart.php?id=60090" target=""><U><FONT style="FONT-SIZE: 10pt" color=#02368d><B>查看全文</B></FONT><FONT color=#0000ff> </FONT></U></A></TD></TR> <TR height=20> <TD><U><FONT color=#0000ff></FONT></U></TD> <TD align=right colSpan=2>发表于:2005-12-05 10:42:45 ┆ <A class=list1 href="http://blog.chinaunix.net/u/10604/showart.php?id=60090" target=""><U><FONT color=#0000ff>阅读(598) </FONT></U></A>┆ <A class=list1 href="http://blog.chinaunix.net/u/10604/showart.php?id=60090" target=""><FONT color=#0000ff><U>评论(0) </U></FONT></A></TD></TR></TBODY></TABLE></TD></TR> <TR> <TD width=7 height=7><FONT color=#0000ff><U><IMG alt="" src="http://blog.chinaunix.net/templates/tech/images/w_left_buttom.gif" border=0></U></FONT></TD> <TD bgColor=#f3f3f3><FONT color=#0000ff><U></U></FONT></TD> <TD width=7 height=7><FONT color=#0000ff><U><IMG alt="" src="http://blog.chinaunix.net/templates/tech/images/w_right_buttom.gif" border=0></U></FONT></TD></TR></TBODY></TABLE><BR> <TABLE style="BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width="96%" border=0> <TBODY> <TR> <TD width=7 height=7><FONT color=#0000ff><U><IMG alt="" src="http://blog.chinaunix.net/templates/tech/images/w_left_top.gif" border=0></U></FONT></TD> <TD width="100%" bgColor=#f3f3f3><FONT color=#0000ff><U></U></FONT></TD> <TD width=7 height=7><FONT color=#0000ff><U><IMG alt="" src="http://blog.chinaunix.net/templates/tech/images/w_right_top.gif" border=0></U></FONT></TD></TR> <TR> <TD align=middle bgColor=#f3f3f3 colSpan=3> <TABLE style="TABLE-LAYOUT: fixed; BORDER-COLLAPSE: collapse; WORD-WRAP: break-word" cellSpacing=0 cellPadding=0 width="100%" bgColor=#f3f3f3 border=0> <TBODY> <TR height=25> <TD align=middle width=25><FONT color=#0000ff><U><IMG height=8 alt="" src="http://blog.chinaunix.net/templates/tech/images/dot.gif" width=8 border=0></U></FONT></TD> <TD width="90%"><A class=list1 href="http://blog.chinaunix.net/u/10604/showart.php?id=59573" target=""><FONT style="FONT-SIZE: 10pt" color=#02368d><B><U>(转帖)Screen </U></B></FONT></A></TD> <TD align=middle width=25><U><IMG title=收起 onclick="ShowHideDiv('art59573',this);" src="http://blog.chinaunix.net/templates/tech/images/dot2.gif" border=0></U> </TD></TR> <TR> <TD width=25></TD> <TD style="MARGIN: 5px; LINE-HEIGHT: 120%" colSpan=2> <DIV id=art59573 style="MARGIN-TOP: 5px; HEIGHT: 100%"> <P>screen your screen<BR>文:林思敬<BR>電子郵件:<A href="mailto:becks.lin@ec-base.com"><FONT color=#0000ff>becks.lin@ec-base.com</FONT></A></P> <P><A href="http://www.winterxy.com/blog/000128.html"><FONT color=#0000ff>http://www.winterxy.com/blog/000128.html</FONT></A></P> <P><FONT color=#0000ff></FONT> <P>前言<BR>screen 是什么</P> <P>根据其man介绍,screen是个多元化多功能的全屏窗口管理器,每个虚拟终端都可以为你提供DEC VT100 terminal的功能, 也许你会问:DEC VT100 terminal又是什么?如果你登陆过某些字符界面的BBS,或许你会记得在注册时,其要求你输入你的终端机型别,而一般预设就是我…… </P></DIV></TD></TR> <TR height=20> <TD align=right colSpan=3><A class=list1 href="http://blog.chinaunix.net/u/10604/showart.php?id=59573" target=""><U><FONT style="FONT-SIZE: 10pt" color=#02368d><B>查看全文</B></FONT><FONT color=#0000ff> </FONT></U></A></TD></TR> <TR height=20> <TD><U><FONT color=#0000ff></FONT></U></TD> <TD align=right colSpan=2>发表于:2005-12-01 14:05:09 ┆ <A class=list1 href="http://blog.chinaunix.net/u/10604/showart.php?id=59573" target=""><U><FONT color=#0000ff>阅读(422) </FONT></U></A>┆ <A class=list1 href="http://blog.chinaunix.net/u/10604/showart.php?id=59573" target=""><FONT color=#0000ff><U>评论(2) </U></FONT></A></TD></TR></TBODY></TABLE></TD></TR> <TR> <TD width=7 height=7><FONT color=#0000ff><U><IMG alt="" src="http://blog.chinaunix.net/templates/tech/images/w_left_buttom.gif" border=0></U></FONT></TD> <TD bgColor=#f3f3f3><FONT color=#0000ff><U></U></FONT></TD> <TD width=7 height=7><FONT color=#0000ff><U><IMG alt="" src="http://blog.chinaunix.net/templates/tech/images/w_right_buttom.gif" border=0></U></FONT></TD></TR></TBODY></TABLE><BR> <TABLE style="BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width="96%" border=0> <TBODY> <TR> <TD width=7 height=7><FONT color=#0000ff><U><IMG alt="" src="http://blog.chinaunix.net/templates/tech/images/w_left_top.gif" border=0></U></FONT></TD> <TD width="100%" bgColor=#f3f3f3><FONT color=#0000ff><U></U></FONT></TD> <TD width=7 height=7><FONT color=#0000ff><U><IMG alt="" src="http://blog.chinaunix.net/templates/tech/images/w_right_top.gif" border=0></U></FONT></TD></TR> <TR> <TD align=middle bgColor=#f3f3f3 colSpan=3> <TABLE style="TABLE-LAYOUT: fixed; BORDER-COLLAPSE: collapse; WORD-WRAP: break-word" cellSpacing=0 cellPadding=0 width="100%" bgColor=#f3f3f3 border=0> <TBODY> <TR height=25> <TD align=middle width=25><FONT color=#0000ff><U><IMG height=8 alt="" src="http://blog.chinaunix.net/templates/tech/images/dot.gif" width=8 border=0></U></FONT></TD> <TD width="90%"><A class=list1 href="http://blog.chinaunix.net/u/10604/showart.php?id=59490" target=""><FONT style="FONT-SIZE: 10pt" color=#02368d><B><U>一个自动ftp的脚本 </U></B></FONT></A></TD> <TD align=middle width=25><U><IMG title=收起 onclick="ShowHideDiv('art59490',this);" src="http://blog.chinaunix.net/templates/tech/images/dot2.gif" border=0></U> </TD></TR> <TR> <TD width=25></TD> <TD style="MARGIN: 5px; LINE-HEIGHT: 120%" colSpan=2> <DIV id=art59490 style="MARGIN-TOP: 5px; HEIGHT: 100%"> <P>简单,但实用</P> <P> <P>#!/bin/sh</P> <P>ftp -i -n<<EOF<BR />open 192.168.0.5 # 打开ftp服务器192.168.0.5<BR>user USERNAME PASSWORD # 用于登录服务器的用户名和密码<BR>bin &nbs…… </P></DIV></TD></TR> <TR height=20> <TD align=right colSpan=3><A class=list1 href="http://blog.chinaunix.net/u/10604/showart.php?id=59490" target=""><U><FONT style="FONT-SIZE: 10pt" color=#02368d><B>查看全文</B></FONT><FONT color=#0000ff> </FONT></U></A></TD></TR> <TR height=20> <TD><U><FONT color=#0000ff></FONT></U></TD> <TD align=right colSpan=2>发表于:2005-11-30 17:20:23 ┆ <A class=list1 href="http://blog.chinaunix.net/u/10604/showart.php?id=59490" target=""><U><FONT color=#0000ff>阅读(416) </FONT></U></A>┆ <A class=list1 href="http://blog.chinaunix.net/u/10604/showart.php?id=59490" target=""><U><FONT color=#0000ff>评论(0) </FONT></U></A></TD></TR></TBODY></TABLE></TD></TR> <TR> <TD width=7 height=7><U><FONT color=#0000ff><IMG alt="" src="http://blog.chinaunix.net/templates/tech/images/w_left_buttom.gif" border=0></FONT></U></TD> <TD bgColor=#f3f3f3><U><FONT color=#0000ff></FONT></U></TD> <TD width=7 height=7><U><FONT color=#0000ff><IMG alt="" src="http://blog.chinaunix.net/templates/tech/images/w_right_buttom.gif" border=0></FONT></U></TD></TR></TBODY></TABLE><BR> <TABLE style="BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width="96%" border=0> <TBODY> <TR> <TD width=7 height=7><U><FONT color=#0000ff><IMG alt="" src="http://blog.chinaunix.net/templates/tech/images/w_left_top.gif" border=0></FONT></U></TD> <TD width="100%" bgColor=#f3f3f3><U><FONT color=#0000ff></FONT></U></TD> <TD width=7 height=7><U><FONT color=#0000ff><IMG alt="" src="http://blog.chinaunix.net/templates/tech/images/w_right_top.gif" border=0></FONT></U></TD></TR> <TR> <TD id=pagelist align=middle bgColor=#f3f3f3 colSpan=3>共有文章3篇 第(1/1)页 首页 上一页 <FONT color=#ff0000>1</FONT> 下一页 末页</TD></TR> <TR> <TD width=7 height=7><IMG alt="" src="http://blog.chinaunix.net/templates/tech/images/w_left_buttom.gif" border=0></TD> <TD bgColor=#f3f3f3></TD> <TD width=7 height=7><IMG alt="" src="http://blog.chinaunix.net/templates/tech/images/w_right_buttom.gif" border=0></TD></TR></TBODY></TABLE></TD></TR> <TR> <TD width=11 height=11><IMG alt="" src="http://blog.chinaunix.net/templates/tech/images/g_left_bottom.gif" border=0></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV>
查看全文
发表于:2009-01-11 ┆
阅读(190)
┆
评论(0)
centos/redhat 上安装邮件系统(extmail) V0.1
<DIV> <H1>在centos/redhat 上安装邮件系统(extmail) V0.1 </H1><BR>Author:fengyong 2008-08-31 <P class=STYLE1>请尊重作者劳动,复制转载此文档时,请保留或添加文档来源。版权:开源易有(<A href="http://www.yiyou.org/"><FONT color=#800080>http://www.yiyou.org</FONT></A>)</P> <H2>一、简介:</H2><BR>本文以最简单,最方便的方法在centos 5.2 上安装一个全功能的邮件系统,此文适合REDHAT所有系列,在文中,能用RPM 安装的,我们将采用rpm 安装,如果rpm没有的,我们将创建自己的rpm。部分软件简介:<BR>1、AMP ---apache(web服务) 、mysql(数据库)、php(非必需) 的简称<BR>2、postfix --mta 邮件系统核心<BR>3、courier-authlib--一个为courier-imap,maildrop,sasl2 提供用户信息的后台进程序<BR>4、courier-imap --提供pop3,pop3s,imap,imaps 服务的程序<BR>5、amavisd-new --提供内容过滤<BR>6、clamav -- 著名的杀毒软件<BR>7、extmail --一个著名的webmail程序<BR>8、extman --与extmail集成的后台管理程序<BR>9、slockd --一个基于smtp阶段的反垃圾邮件程序<BR>10、vhmgr --由本文作者编写,用于管理apache,ftp,mysql 的虚拟主机管理程序。<BR><BR>安装环境:<BR>centos 5.2 <BR>域名机器名:mail.yiyou.org<BR>域名:yiyou.org<BR> <H2>二、安装系统</H2>安装系统时,选择“customize software selection”(自定义安装),在package group selection 对话框里选择:<BR><PRE>[*]base [*]devlopment libraries [*]development tools [*]editors [*]text-base internet </PRE>其它不选择。<BR>在setup agnet(或进入系统后运行setup) 里选择firewall configuration 将security level 与SELinux 改为disabled,目的是为了避免在安装调试时产生不必要的麻烦,在系统安装完成后,可以自己去调试安全部分,在这里将不作详细介绍。 <BR>配置yum,在本文中使用的是网通线路,所以选择了http://mirrors.ta139.com/ 作为安装镜像。<BR><PRE>[root@localhost ~]# cd /etc/yum.repos.d/ [root@localhost yum.repos.d]# wget http://mirrors.ta139.com/CentOS-Base.repo.ta139 [root@localhost yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo.bak [root@localhost yum.repos.d]# mv CentOS-Base.repo.ta139 CentOS-Base.repo </PRE><BR> <H2>三、安装软件</H2><BR> <H3>1、安装AMP</H3><BR><PRE> [root@localhost ~]# yum -y install httpd httpd-devel mysql mysql-devel mysql-server php php-xml php-cli php-pdo php-mbstring php-mcrypt php-gd php-common php-devel php-mysql </PRE>修改启动配置并启动<BR><PRE>[root@localhost ~]# chkconfig --level 345 mysqld on [root@localhost ~]# chkconfig --level 345 httpd on [root@localhost ~]# service mysqld start [root@localhost ~]# service httpd start </PRE> <H3>2、安装phpmyadmin</H3>注意:可以选择自己需要的版本<BR><PRE>[root@localhost ~]# wget http://nchc.dl.sourceforge.net/sourceforge/phpmyadmin/phpMyAdmin-2.11.9-all-languages-utf-8-only.tar.bz2 [root@localhost ~]# tar xjf phpMyAdmin-2.11.9-all-languages-utf-8-only.tar.bz2 [root@localhost ~]# mv phpMyAdmin-2.11.9-all-languages-utf-8-only /var/www/html/phpmyadmin [root@localhost phpmyadmin]# cp config.sample.inc.php config.inc.php </PRE>编辑config.inc.php 改为下面,字符串是任意的。 <PRE>$cfg['blowfish_secret'] = 'skssiwksksie'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */ </PRE>进入phpmyadmin 请马上修改mysql root 用户的密码。<BR> <H3>3、导入extman 后台数据库</H3>将extmail/extman/slockd 上传到服务器,可以使用ftp/winscp 上传<BR><PRE>[root@localhost ~]# tar zxf extman-0.2.5b1.tar.gz [root@localhost ~]# cd extman-0.2.5b1/docs/ [root@localhost docs]# mysql -uroot -p <extmail.sql Enter password: [root@localhost docs]# mysql -uroot -p <init.sql Enter password: </PRE>如何使用了phpmyadmin改了root 密码,记得输入密码,如果密码为空,请按回车。<BR> <H3>4、RPM 简介</H3>下面我们将采用rpm 的方式安装软件<BR>/usr/src/redhat/SPEC spec 文件夹,通常是rpm文件夹<BR>/usr/src/redhat/RPMS 是生成rpm 的文件,下面还有i368,i486 等子文件夹,一般我们用i386 架构<BR>/usr/src/redhat/SOURCE 源文件文件夹<BR>为了安装时切换目录的方便,我们将目录存放到一个shell变量里。<BR><PRE>[root@localhost ~]# export RPMS=/usr/src/redhat/RPMS [root@localhost ~]# export SOURCE=/usr/src/redhat/SOURCES [root@localhost ~]# export SPEC=/usr/src/redhat/SPECS </PRE>在下面安装过程中,大家要记住cd $RPMS 与cd /usr/src/redhat/RPMS 的目的是一样的,只是shell变量的替换。<BR> <H3>5、安装authlib</H3> <H4>A、安装依懒的包</H4><PRE>[root@localhost ~]# yum -y install postgresql-devel expect libtool-ltdl-devel [root@localhost ~]# wget http://prdownloads.sourceforge.net/courier/courier-authlib-0.61.0.tar.bz2 [root@localhost ~]# tar xjf courier-authlib-0.61.0.tar.bz2 [root@localhost ~]# cd courier-authlib-0.61.0 [root@localhost courier-authlib-0.61.0]# cp courier-authlib.spec $SPEC [root@localhost courier-authlib-0.61.0]# cd .. [root@localhost ~]# cp courier-authlib-0.61.0.tar.bz2 $SOURCE [root@localhost ~]# cd $SPEC [root@localhost SPECS]# rpmbuild -bb courier-authlib.spec (创建rpm文件) </PRE> <H4>B、安装生成的rpm</H4><PRE>[root@localhost SPECS]# cd $RPMS/i386 [root@localhost i386]# rpm -ivh courier-authlib-0.61.0-1.i386.rpm [root@localhost i386]# rpm -ivh courier-authlib-devel-0.61.0-1.i386.rpm [root@localhost i386]# rpm -ivh courier-authlib-mysql-0.61.0-1.i386.rpm </PRE> <H4>C、配置authlibdaemon</H4><PRE>[root@localhost i386]# cd /etc/authlib/ [root@localhost authlib]# mv authdaemonrc authdaemonrc.bak [root@localhost authlib]# vim authdaemonrc </PRE><B>输入下面的内容:</B> <PRE>authmodulelist="authmysql" authmodulelistorig="authmysql" daemons=10 authdaemonvar=/var/spool/authdaemon DEBUG_LOGIN=2 DEFAULTOPTIONS="wbnodsn=1" LOGGEROPTS="" </PRE><B>D、配置authmysqlrc</B> <PRE>[root@localhost authlib]# mv authmysqlrc authmysqlrc.bak [root@localhost authlib]# vim authmysqlrc </PRE><B>输入下面的内容:</B> <PRE>MYSQL_SERVER localhost MYSQL_USERNAME extmail MYSQL_PASSWORD extmail MYSQL_PORT 0 MYSQL_SOCKET /var/lib/mysql/mysql.sock MYSQL_OPT 0 MYSQL_DATABASE extmail MYSQL_SELECT_CLAUSE SELECT username,password,"",uidnumber,gidnumber,\ CONCAT('/home/data/domains/',homedir), \ CONCAT('/home/data/domains/',maildir), \ quota, \ name \ FROM mailbox \ WHERE username = '$(local_part)@$(domain)' </PRE> <H4>E、启动authlib</H4><PRE>[root@localhost ~]# service courier-authlib start Starting Courier authentication services: authdaemond [root@localhost ~]# chmod 777 /var/spool/authdaemon/ </PRE> <H3>6、安装courier-imap</H3>由于courier-imap 不能用root身份生成rpm那么我们新建一个普通用户,并创建一个rpm环境<BR><PRE>[root@localhost ~]# useradd yiyou </PRE>软件包依懒需要安装openldap-server,rpm创建完成后可以删除<BR><PRE>[root@localhost ~]# yum -y install openldap-servers [root@localhost ~]# su - yiyou [yiyou@localhost ~]$ mkdir -p rpm/{BUILD,RPMS,SOURCES,SPECS,SRPMS} [yiyou@localhost ~]$ vim ~/.rpmmacros </PRE>输入内容: <PRE>%_topdir /home/yiyou/rpm </PRE><PRE>[yiyou@localhost ~]$ wget http://prdownloads.sourceforge.net/courier/courier-imap-4.4.1.tar.bz2 [yiyou@localhost ~]$ cp courier-imap-4.4.1.tar.bz2 rpm/SOURCES/ [yiyou@localhost ~]$ tar xjf courier-imap-4.4.1.tar.bz2 [yiyou@localhost ~]$ cd courier-imap-4.4.1 [yiyou@localhost courier-imap-4.4.1]$ cp courier-imap.spec ../rpm/SPECS/ [yiyou@localhost courier-imap-4.4.1]$ cd ../rpm/SPECS/ </PRE>编辑courier-imap.spec 将下面的内容: <PRE>%if %suse_version BuildPreReq: rpm >= 3.0.5 /usr/bin/sed openldap2 openldap2-devel %([ %{suse_version} -gt 819 ] && echo /usr/include/fam.h) %else BuildPreReq: rpm >= 4.0.2 sed /usr/include/fam.h openldap-devel openldap-servers %endif </PRE>改为:<BR><PRE>%if %suse_version BuildPreReq: rpm >= 3.0.5 /usr/bin/sed openldap2 openldap2-devel %else BuildPreReq: rpm >= 4.0.2 sed openldap-devel openldap-servers %endif </PRE>创建rpm <PRE>[yiyou@localhost SPECS]$ rpmbuild -bb courier-imap.spec </PRE>完成rpm后,输入exit退出当前用户。<BR><PRE>[root@localhost ~]# rpm -ivh /home/yiyou/rpm/RPMS/i386/courier-imap-4.4.1-1.i386.rpm [root@localhost ~]# service courier-imap start </PRE> <H3>7、安装cyrus-sasl</H3> <H4>A、安装SRPM</H4><PRE>[root@localhost ~]# wget ftp://194.199.20.114/linux/fedora/updates/8/SRPMS/cyrus-sasl-2.1.22-8.fc8.src.rpm [root@localhost ~]# rpm -ivh cyrus-sasl-2.1.22-8.fc8.src.rpm [root@localhost ~]# cd $SPEC </PRE>编辑cyrus-sasl.spec 将下面:<BR><PRE># Bundling copy of Berkeley DB, for sasldb support. topdir=`pwd` pushd db-%{db_version}/build_unix ../dist/configure \ --with-mutex=UNIX/fcntl --disable-shared --enable-static --with-pic \ --with-uniquename=_cyrus_sasl_sasldb_rh \ --prefix=${topdir}/db-instroot \ --includedir=${topdir}/db-instroot/include \ --libdir=${topdir}/db-instroot/lib </PRE>改为:<BR><PRE># Bundling copy of Berkeley DB, for sasldb support. topdir=`pwd` pushd db-%{db_version}/build_unix ../dist/configure \ --with-mutex=UNIX/fcntl --disable-shared --enable-static --with-pic \ --with-uniquename=_cyrus_sasl_sasldb_rh \ --prefix=${topdir}/db-instroot \ --includedir=${topdir}/db-instroot/include \ --libdir=${topdir}/db-instroot/lib \ --with-authdaemond=/var/spool/authdaemon </PRE> <H4>B、生成rpm</H4><PRE>[root@localhost SPECS]# rpmbuild -bb cyrus-sasl.spec [root@localhost RPMS]# cd $RPMS/i386 [root@localhost i386]# rpm -e --nodeps cyrus-sasl-devel cyrus-sasl-plain cyrus-sasl cyrus-sasl-lib (如果这些包存在) [root@localhost i386]# rpm -ihv cyrus-sasl-lib-2.1.22-8.i386.rpm [root@localhost i386]# rpm -ihv cyrus-sasl-2.1.22-8.i386.rpm [root@localhost i386]# rpm -ihv cyrus-sasl-plain-2.1.22-8.i386.rpm </PRE> <H4>C、配置sasl2</H4>创建/usr/lib/sasl2/smtpd.conf 文件,输入下面的内容: <PRE>pwcheck_method:authdaemond log_level:3 mech_list:PLAIN LOGIN authdaemond_path:/var/spool/authdaemon/socket </PRE> <H3>8、安装postfix</H3> <H4>A、下载软件包</H4><PRE>[root@localhost i386]# cd [root@localhost ~]# wget http://ftp.wl0.org/official/2.5/SRPMS/postfix-2.5.4-2.src.rpm [root@localhost ~]# rpm -ivh postfix-2.5.4-2.src.rpm [root@localhost ~]# cd $SPEC </PRE>编辑postfix.spec 修改下面的选项 <PRE>%define distribution rhel-5.0 %define with_mysql_redhat 1 %define with_sasl 2 %define with_vda 1 </PRE> <H4>B、创建rpm </H4><PRE>[root@localhost SPECS]# rpmbuild -bb postfix.spec [root@localhost RPMS]# cd $RPMS/i386 [root@localhost i386]# rpm -ivh postfix-2.5.4-2.rhel4.i386.rpm </PRE> <H4>C、切换mta </H4><PRE>[root@localhost i386]# alternatives --config mta (选择2,postfix) [root@localhost i386]# rpm -e sendmail [root@localhost i386]# cd /usr/sbin/ [root@localhost sbin]# mv sendmail sendmail.bak [root@localhost sbin]# newaliases [root@localhost sbin]# ln -s sendmail.postfix sendmail </PRE> <H4>D、配置postfix </H4><PRE>[root@localhost ~]# cd /etc/postfix/ [root@localhost postfix]# mv main.cf main.cf.bak [root@localhost postfix]# vim main.cf </PRE>输入下面的内容: <PRE>queue_directory = /var/spool/postfix command_directory = /usr/sbin daemon_directory = /usr/libexec/postfix data_directory = /var/lib/postfix mail_owner = postfix unknown_local_recipient_reject_code = 550 debug_peer_level = 2 debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5 sendmail_path = /usr/sbin/sendmail.postfix newaliases_path = /usr/bin/newaliases.postfix mailq_path = /usr/bin/mailq.postfix setgid_group = postdrop html_directory = /usr/share/doc/postfix-2.5.2-documentation/html manpage_directory = /usr/share/man sample_directory = /etc/postfix readme_directory = /usr/share/doc/postfix-2.5.2-documentation/readme alias_database = hash:/etc/postfix/aliases alias_maps = hash:/etc/postfix/aliases myhostname = mail.yiyou.org mydomain = yiyou.org mydestination = $myhostname smtpd_banner = yiyou.org ESMTP Mail System message_size_limit = 14680064 virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf virtual_mailbox_base = /home/data/domains virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql_virtual_limit_maps.cf virtual_transport = maildrop: maildrop_destination_recipient_limit = 1 #sasl smtpd_sasl_auth_enable = yes smtpd_sasl2_auth_enable = yes smtpd_sasl_security_options = noanonymous broken_sasl_auth_clients = yes smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_unauth_pipelining, reject_invalid_hostname </PRE>复制extman/docs 目录的cf 文件到/etc/postfix <PRE>[root@localhost postfix]# cp /root/extman-0.2.5b1/docs/mysql_virtual_* . </PRE>因为配置文件的用户、密码与数据库时一样,所以不用修改。 <PRE>[root@localhost postfix]# service postfix start </PRE> <H3>9、安装maildrop </H3> <H4>A、下载生成RPM</H4><PRE>[root@localhost postfix]# cd [root@localhost ~]# wget http://prdownloads.sourceforge.net/courier/maildrop-2.0.4.tar.bz2 [root@localhost ~]# cp maildrop-2.0.4.tar.bz2 $SOURCE [root@localhost ~]# tar xjf maildrop-2.0.4.tar.bz2 [root@localhost ~]# cd maildrop-2.0.4 [root@localhost maildrop-2.0.4]# cp maildrop.spec $SPEC [root@localhost maildrop-2.0.4]# cd $SPEC </PRE>编辑maildrop.spec 把下面: <PRE>BuildRequires: /usr/include/fam.h gdbm-devel pcre-devel </PRE>改为: <PRE>BuildRequires: gdbm-devel pcre-devel </PRE>把下面: <PRE>%configure --with-devel --enable-userdb --enable-maildirquota \ --enable-syslog=1 --enable-trusted-users='root mail daemon postmaster qmaild mmdf' \ --enable-restrict-trusted=0 \ --enable-sendmail=/usr/sbin/sendmail </PRE>改为: <PRE>%configure --with-devel --enable-userdb --enable-maildirquota \ --enable-syslog=1 --enable-trusted-users='root mail daemon postmaster qmaild mmdf' \ --enable-restrict-trusted=0 --enable-sendmail=/usr/sbin/sendmail \ --enable-authlib </PRE> <H4>B、创建安装maildrop rpm </H4><PRE>[root@localhost SPECS]# yum -y install pcre-devel [root@localhost SPECS]# rpmbuild -bb maildrop.spec [root@localhost SPECS]# cd $RPMS/i386 [root@localhost i386]# rpm -ivh maildrop-2.0.4-1.i386.rpm </PRE> <H4>C、添加虚似用户及创建目录 </H4><PRE>[root@localhost i386]# cd [root@localhost ~]# groupadd -g 1000 vgroup [root@localhost ~]# useradd -g 1000 -u 1000 -s /sbin/nologin -d /dev/null vuser </PRE>编辑/etc/postfix/master.cf ,加入下面的内容: <PRE>maildrop unix - n n - - pipe flags=DRhu user=vuser argv=/usr/bin/maildrop -d ${user}@${nexthop} ${recipient} ${user} ${extension} ${nexthop} </PRE> <H4>D、创建邮件存储目录 </H4><PRE>[root@localhost ~]# mkdir -p /home/data/domains/extmail.org/postmaster [root@localhost ~]# maildirmake /home/data/domains/extmail.org/postmaster/Maildir [root@localhost ~]# chown -R vuser:vgroup /home/data/domains/ </PRE> <H4>E、测试maildrop </H4><PRE>[root@localhost ~]# echo "test" | maildrop -V 10 -d postmaster@extmail.org maildrop: authlib: groupid=1000 maildrop: authlib: userid=1000 maildrop: authlib: logname=postmaster@extmail.org, home=/home/data/domains/extmail.org/postmaster, mail=/home/data/domains/extmail.org/postmaster/Maildir/ maildrop: Changing to /home/data/domains/extmail.org/postmaster Message start at 0 bytes, envelope sender=postmaster@extmail.org maildrop: Attempting .mailfilter maildrop: Delivery complete. </PRE>出现上以信息说明authlib,maildrop 工作正常<BR> <H4>F、测试pop3</H4><PRE>[root@localhost ~]# telnet localhost 110 Trying 127.0.0.1... Connected to localhost.localdomain (127.0.0.1). Escape character is '^]'. +OK Hello there. user postmaster@extmail.org +OK Password required. pass extmail +OK logged in. list +OK POP3 clients that break here, they violate STD53. 1 6 . retr 1 +OK 6 octets follow. test . quit +OK Bye-bye. Connection closed by foreign host. </PRE> <H4>G、测试postfix </H4><PRE>[root@localhost ~]# perl -MMIME::Base64 -e 'print encode_base64("postmaster\@extmail.org");' cG9zdG1hc3RlckBleHRtYWlsLm9yZw== [root@localhost ~]# perl -MMIME::Base64 -e 'print encode_base64("extmail");' ZXh0bWFpbA== [root@localhost ~]# service postfix restart (重启一下) [root@localhost ~]# telnet localhost 25 Trying 127.0.0.1... Connected to localhost.localdomain (127.0.0.1). Escape character is '^]'. 220 yiyou.org ESMTP Mail System ehlo test.com 250-mail.yiyou.org 250-PIPELINING 250-SIZE 14680064 250-VRFY 250-ETRN 250-AUTH LOGIN PLAIN 250-AUTH=LOGIN PLAIN 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN auth login 334 VXNlcm5hbWU6 cG9zdG1hc3RlckBleHRtYWlsLm9yZw== 334 UGFzc3dvcmQ6 ZXh0bWFpbA== 235 2.7.0 Authentication successful quit 221 2.0.0 Bye Connection closed by foreign host </PRE> <H3>10、安装amavisd-new</H3>编辑/etc/yum.repos.d/CentOS-Base.repo 加入下面的内容: <PRE>[dag] name=Dag RPM Repostory for Red Hat Enterprise Linux baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag gpgcheck=1 enabled=1 gpgkey=http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt </PRE><PRE>[root@localhost ~]# yum -y install clamav clamav-db clamd clamav-devel amavisd-new </PRE>编辑/etc/amavisd.conf,修改下面的内容 <PRE>$mydomain = 'yiyou.org'; # a convenient default for other settings </PRE>把下面内容去掉注释,并修改为下面 <PRE> ['ClamAV-clamd', \&ask_daemon, ["CONTSCAN {}\n", "/tmp/clamd.socket"], qr/\bOK$/, qr/\bFOUND$/, qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ], </PRE><PRE>[root@localhost ~]# usermod -G amavis clamav [root@localhost ~]# service clamd start </PRE>在/etc/postfix/master.cf 增加下面的内容: <PRE>smtp-amavis unix - - n - 4 smtp -o smtp_data_done_timeout=1200 -o smtp_send_xforward_command=yes -o disable_dns_lookups=yes 127.0.0.1:10025 inet n - n - - smtpd -o content_filter= -o local_recipient_maps= -o relay_recipient_maps= -o smtpd_restriction_classes= -o smtpd_helo_restrictions= -o smtpd_sender_restrictions= -o smtpd_recipient_restrictions=permit_mynetworks,reject -o mynetworks=127.0.0.0/8 -o strict_rfc821_envelopes=yes -o smtpd_error_sleep_time=0 -o smtpd_soft_error_limit=1001 -o smtpd_hard_error_limit=1000 -o receive_override_options=no_header_body_checks </PRE>在/etc/postfix/main.cf 加入下面的内容 <PRE>content_filter = smtp-amavis:[localhost]:10024 </PRE><PRE>[root@localhost ~]# service postfix reload </PRE> <H3>11、安装extman/extmail</H3> <H4>A、配置apache</H4>修改/etc/httpd/conf/httpd.conf,将下面的选项改为: <PRE>User vuser Group vgroup </PRE><PRE>[root@localhost ~]# cd /etc/httpd/conf.d/ [root@localhost conf.d]# vim extmail.conf </PRE>输入下面的内容: <PRE>Alias /extman/cgi/ /var/www/extsuite/extman/cgi/ Alias /extman /var/www/extsuite/extman/html/ <Location "/extman/cgi"> SetHandler cgi-script Options +ExecCGI </Location> # config for ExtMail Alias /extmail/cgi/ /var/www/extsuite/extmail/cgi/ Alias /extmail /var/www/extsuite/extmail/html/ <Location "/extmail/cgi"> SetHandler cgi-script Options +ExecCGI </Location> </PRE><PRE>[root@localhost ~]# mkdir /var/www/extsuite [root@localhost ~]# tar zxf extmail-1.0.5b1.tar.gz [root@localhost ~]# cp -r extmail-1.0.5b1 /var/www/extsuite/extmail [root@localhost ~]# cp -r extman-0.2.5b1 /var/www/extsuite/extman </PRE> <H4>B、配置extmail参数 </H4><PRE>[root@localhost ~]# cd /var/www/extsuite/extmail/ [root@localhost extmail]# cp webmail.cf.default webmail.cf </PRE>修改webmail.cf 下面的选项 <PRE>SYS_SESS_DIR = /tmp/extmail SYS_MAILDIR_BASE = /home/data/domains SYS_MYSQL_USER = extmail SYS_MYSQL_PASS = extmail </PRE> <H4>C、配置extman参数 </H4><PRE>[root@localhost extmail]# cd /var/www/extsuite/extman/ </PRE>修改webman.cf 下面的选项: <PRE>SYS_MAILDIR_BASE = /home/data/domains </PRE> <H4>D、创建session 目录 </H4><PRE>[root@localhost extman]# mkdir /tmp/{extman,extmail} [root@localhost extman]# chown vuser:vgroup /tmp/ext* </PRE> <H4>E、配置后台日志分析工具 </H4><PRE>[root@localhost addon]# cd /var/www/extsuite/extman/addon/ [root@localhost addon]# cp -r mailgraph_ext /usr/local/ </PRE>将下面的内容加入/etc/rc.local <PRE>/usr/local/mailgraph_ext/mailgraph-init start /usr/local/mailgraph_ext/qmonitor-init start </PRE>安装所依懒的软件包 <PRE>[root@localhost mailgraph_ext]# yum -y install rrdtool perl-rrdtool perl-GD perl-File-Tail </PRE> <H4>F、启动后台进程 </H4><PRE>[root@localhost mailgraph_ext]# /usr/local/mailgraph_ext/qmonitor-init start Starting queue statistics grapher: qmonitor [root@localhost mailgraph_ext]# /usr/local/mailgraph_ext/mailgraph-init start Starting mail statistics grapher: mailgraph_ext </PRE> <H4>G、访问extmail/extman</H4>打开浏览器,输入http://your_ip_address/extmail 注意:your_ip_address 为你实际的ip<BR>第一个测试用户为:postmaster 密码:extmail 域:extmail<BR><BR>打开浏览器,输入http://your_ip_address/extman <BR>extman root 用户为:root@extmail.org 密码为:extmail*123*<BR>注意:进入系统后要修改密码及找回密码的提示问题、答案。<BR> <H3>12、安装slockd</H3>slockd 是一个基于策略的垃圾邮件软件,很多用户反映使用后,反垃圾效果非常明显,但是有部分用户由于对该软件的使用,特性不了解,而产生了很多麻烦。<BR>所在在此建议,如果你对该软件不了解,或者系统里的垃圾邮件少,可以暂时不安装。 <PRE>[root@localhost ~]# tar zxf slockd-0.2beta1.tar.gz [root@localhost ~]# cp -r slockd-0.2beta1 /usr/local/slockd [root@localhost ~]# cd /usr/local/slockd </PRE>将下面的内容加入/etc/rc.local <PRE>/usr/local/slockd/slockd-init start </PRE>[root@localhost slockd]# vim config/main.cf (编辑slockd/config/main.cf)修改下面的内容 <PRE>setsid 1 (去掉注释,让程序成为后台进程) </PRE>修改/etc/postfix/main.cf 将原先的内容: <PRE>smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_unauth_pipelining, reject_invalid_hostname </PRE>改为: <PRE>smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_unauth_pipelining, reject_invalid_hostname, check_policy_service inet:127.0.0.1:10030 </PRE>重载postfix 配置文件 <PRE>[root@localhost slockd]# service postfix reload </PRE> <H3>13、安装vhmgr </H3>vhostmgr 是一款虚似主机管理软件,可以对apache,pure-ftp,mysql 进行管理,是管理员的好帮手。<BR>vhostmgr 有如下特点:<BR>a、只需要安装一个apache,ftp<BR>b、apache 不需要以root 运行。用普通用户身份运行就行了。<BR>c、可以通过web 进行重读配置文件,系统关机,等操作<BR>d、采用apache+cgi 方式运行,容易配置,安装、使用文档详细。<BR>e、如果你是一个管理员,每为一个用户添加主机而麻烦,使用该软件将为你节省大量时间。<BR>f、开通apache,ftp,mysql 都是即时生效。<BR>更多功能,更多方便,使用后才知道!!!<BR>g、支持freebsd ,linux 等多种系统<BR><BR>vhmgr 还有一个重要特点:<FONT color=#ff0000><SPAN class=STYLE1>开源并完全免费使用。</SPAN><BR><BR></FONT><A href="http://www.yiyou.org/56vhostmgr_001beta.html"><FONT color=#0000ff>软件地址</FONT></A><BR><BR>为了不重复劳功,将不再次叙述。<BR><BR>apache 改变运行id 后,php session功能将会出现问题,因为session 的存储目录权限没有跟着改变为新的,只要执行下面的命令即可解决问题。<BR><PRE>[root@localhost slockd]# chown -R vuser:vgroup /var/lib/php/session/ </PRE> <P><SPAN class=STYLE1><FONT color=#ff0000>请尊重作者劳动,复制此文档时,请保留或添加文档来源。版权:开源易有(</FONT><A href="http://www.yiyou.org/"><FONT color=#800080>http://www.yiyou.org</FONT></A><FONT color=#ff0000>)</FONT></SPAN></P></DIV>
查看全文
发表于:2009-01-03 ┆
阅读(147)
┆
评论(0)
(zh CN)OpenBSD(4.1)+Postfix+OpenLDAP+Cyrus-SASL+Co
<DIV> <H1 class=firstHeading>(zh CN)OpenBSD(4.1)+Postfix+OpenLDAP+Cyrus-SASL+Courier</H1> <DIV id=bodyContent> <H3 id=siteSub>From OpenBSD-Wiki</H3> <DIV id=contentSub></DIV> <DIV id=jump-to-nav>Jump to: <A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#column-one"><FONT color=#800080>navigation</FONT></A>, <A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#searchInput"><FONT color=#800080>search</FONT></A></DIV><!-- start content --> <TABLE style="BORDER-RIGHT: #ffcc00 1px solid; BORDER-TOP: #ffcc00 1px solid; BORDER-LEFT: #ffcc00 1px solid; BORDER-BOTTOM: #ffcc00 1px solid; BACKGROUND-COLOR: #ffcc00" width=225> <TBODY> <TR> <TD style="BORDER-RIGHT: #ffcc00 1px solid; BORDER-TOP: #ffcc00 1px solid; BORDER-LEFT: #ffcc00 1px solid; BORDER-BOTTOM: #ffcc00 1px solid; BACKGROUND-COLOR: #ffff66"><FONT size=-1>Written for: OpenBSD Version 4.1</FONT> </TD></TR></TBODY></TABLE> <TABLE style="BORDER-RIGHT: #a604b5 1px solid; BORDER-TOP: #a604b5 1px solid; BORDER-LEFT: #a604b5 1px solid; BORDER-BOTTOM: #a604b5 1px solid; BACKGROUND-COLOR: #a604b5" width=225> <TBODY> <TR> <TD style="BORDER-RIGHT: #a604b5 1px solid; BORDER-TOP: #a604b5 1px solid; BORDER-LEFT: #a604b5 1px solid; BORDER-BOTTOM: #a604b5 1px solid; BACKGROUND-COLOR: #f476ff"><FONT size=-1>Language: zh_CN</FONT> </TD> <TD style="BORDER-RIGHT: #a604b5 1px solid; BORDER-TOP: #a604b5 1px solid; BORDER-LEFT: #a604b5 1px solid; BORDER-BOTTOM: #a604b5 1px solid; BACKGROUND-COLOR: #f476ff"><FONT size=-1>语言:简体中文</FONT> </TD></TR></TBODY></TABLE> <P><A class=image title="image: Tip.png" href="http://openbsd-wiki.org/index.php?title=Image:Tip.png"><IMG height=32 alt="image: Tip.png" src="http://openbsd-wiki.org/images/4/45/Tip.png" width=32 border=0></A> 本文档已不再更新,请查看用于 OpenBSD 4.2 -release 的新版本文档: </P> <UL> <LI><A class="external text" title=http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.2%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.2%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier" rel=nofollow><FONT color=#0000ff>(zh_CN)OpenBSD(4.2)+Postfix+OpenLDAP+Cyrus-SASL+Courier</FONT></A> </LI></UL> <TABLE class=toc id=toc summary=Contents> <TBODY> <TR> <TD> <DIV id=toctitle> <H2>Contents</H2><SPAN class=toctoggle>[<A class=internal id=togglelink href="javascript:toggleToc()"><FONT color=#0000ff>hide</FONT></A>]</SPAN></DIV> <UL> <LI class=toclevel-1><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#First_of_all"><FONT color=#800080><SPAN class=tocnumber>1</SPAN> <SPAN class=toctext>First of all</SPAN></FONT></A> <LI class=toclevel-1><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#Overview"><FONT color=#800080><SPAN class=tocnumber>2</SPAN> <SPAN class=toctext>Overview</SPAN></FONT></A> <UL> <LI class=toclevel-2><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#Author"><FONT color=#800080><SPAN class=tocnumber>2.1</SPAN> <SPAN class=toctext>Author</SPAN></FONT></A> <LI class=toclevel-2><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#About_OpenBSD"><FONT color=#800080><SPAN class=tocnumber>2.2</SPAN> <SPAN class=toctext>About OpenBSD</SPAN></FONT></A> <LI class=toclevel-2><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#OS_.26_Packages"><FONT color=#800080><SPAN class=tocnumber>2.3</SPAN> <SPAN class=toctext>OS & Packages</SPAN></FONT></A> <LI class=toclevel-2><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#Features"><FONT color=#800080><SPAN class=tocnumber>2.4</SPAN> <SPAN class=toctext>Features</SPAN></FONT></A> <LI class=toclevel-2><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#Architecture"><FONT color=#800080><SPAN class=tocnumber>2.5</SPAN> <SPAN class=toctext>Architecture</SPAN></FONT></A> <LI class=toclevel-2><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#Todo"><FONT color=#800080><SPAN class=tocnumber>2.6</SPAN> <SPAN class=toctext>Todo</SPAN></FONT></A> <UL> <LI class=toclevel-3><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#System_administration"><FONT color=#800080><SPAN class=tocnumber>2.6.1</SPAN> <SPAN class=toctext>System administration</SPAN></FONT></A> <LI class=toclevel-3><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#Apache"><FONT color=#800080><SPAN class=tocnumber>2.6.2</SPAN> <SPAN class=toctext>Apache</SPAN></FONT></A> <LI class=toclevel-3><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#OpenLDAP"><FONT color=#800080><SPAN class=tocnumber>2.6.3</SPAN> <SPAN class=toctext>OpenLDAP</SPAN></FONT></A> <LI class=toclevel-3><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#PF"><FONT color=#800080><SPAN class=tocnumber>2.6.4</SPAN> <SPAN class=toctext>PF</SPAN></FONT></A> <LI class=toclevel-3><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#HA"><FONT color=#800080><SPAN class=tocnumber>2.6.5</SPAN> <SPAN class=toctext>HA</SPAN></FONT></A> </LI></UL> <LI class=toclevel-2><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#Credits"><FONT color=#800080><SPAN class=tocnumber>2.7</SPAN> <SPAN class=toctext>Credits</SPAN></FONT></A> </LI></UL> <LI class=toclevel-1><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#Apache.2BPHP"><FONT color=#800080><SPAN class=tocnumber>3</SPAN> <SPAN class=toctext>Apache+PHP</SPAN></FONT></A> <UL> <LI class=toclevel-2><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#Apache_2"><FONT color=#800080><SPAN class=tocnumber>3.1</SPAN> <SPAN class=toctext>Apache</SPAN></FONT></A> <UL> <LI class=toclevel-3><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#.E5.90.AF.E7.94.A8_Apache"><FONT color=#800080><SPAN class=tocnumber>3.1.1</SPAN> <SPAN class=toctext>启用 Apache</SPAN></FONT></A> <LI class=toclevel-3><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#Apache_.E7.9A.84.E5.90.AF.E5.8A.A8.E4.B8.8E.E5.81.9C.E6.AD.A2"><FONT color=#800080><SPAN class=tocnumber>3.1.2</SPAN> <SPAN class=toctext>Apache 的启动与停止</SPAN></FONT></A> </LI></UL> <LI class=toclevel-2><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#.E5.AE.89.E8.A3.85_PHP.EF.BC.9Aphp5-core"><FONT color=#800080><SPAN class=tocnumber>3.2</SPAN> <SPAN class=toctext>安装 PHP:php5-core</SPAN></FONT></A> <LI class=toclevel-2><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#PHP_Extensions"><FONT color=#800080><SPAN class=tocnumber>3.3</SPAN> <SPAN class=toctext>PHP Extensions</SPAN></FONT></A> <UL> <LI class=toclevel-3><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#php5-ldap"><FONT color=#800080><SPAN class=tocnumber>3.3.1</SPAN> <SPAN class=toctext>php5-ldap</SPAN></FONT></A> <LI class=toclevel-3><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#php5-imap"><FONT color=#800080><SPAN class=tocnumber>3.3.2</SPAN> <SPAN class=toctext>php5-imap</SPAN></FONT></A> </LI></UL></LI></UL> <LI class=toclevel-1><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#OpenLDAP_2"><FONT color=#800080><SPAN class=tocnumber>4</SPAN> <SPAN class=toctext>OpenLDAP</SPAN></FONT></A> <UL> <LI class=toclevel-2><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#.E5.AE.89.E8.A3.85_OpenLDAP"><FONT color=#800080><SPAN class=tocnumber>4.1</SPAN> <SPAN class=toctext>安装 OpenLDAP</SPAN></FONT></A> <LI class=toclevel-2><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#.E9.85.8D.E7.BD.AE_OpenLDAP"><FONT color=#800080><SPAN class=tocnumber>4.2</SPAN> <SPAN class=toctext>配置 OpenLDAP</SPAN></FONT></A> <UL> <LI class=toclevel-3><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#authldap.schema"><FONT color=#800080><SPAN class=tocnumber>4.2.1</SPAN> <SPAN class=toctext>authldap.schema</SPAN></FONT></A> <LI class=toclevel-3><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#.2Fetc.2Fopenldap.2Fslapd.conf"><FONT color=#800080><SPAN class=tocnumber>4.2.2</SPAN> <SPAN class=toctext>/etc/openldap/slapd.conf</SPAN></FONT></A> <LI class=toclevel-3><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#.E5.90.AF.E5.8A.A8_OpenLDAP"><FONT color=#800080><SPAN class=tocnumber>4.2.3</SPAN> <SPAN class=toctext>启动 OpenLDAP</SPAN></FONT></A> <LI class=toclevel-3><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#.2Fetc.2Frc.conf.local"><FONT color=#800080><SPAN class=tocnumber>4.2.4</SPAN> <SPAN class=toctext>/etc/rc.conf.local</SPAN></FONT></A> <LI class=toclevel-3><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#.2Fetc.2Frc.local"><FONT color=#800080><SPAN class=tocnumber>4.2.5</SPAN> <SPAN class=toctext>/etc/rc.local</SPAN></FONT></A> <UL> <LI class=toclevel-4><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#reboot"><FONT color=#800080><SPAN class=tocnumber>4.2.5.1</SPAN> <SPAN class=toctext>reboot</SPAN></FONT></A> </LI></UL> <LI class=toclevel-3><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#.E5.88.9D.E5.A7.8B.E5.8C.96_LDAP"><FONT color=#800080><SPAN class=tocnumber>4.2.6</SPAN> <SPAN class=toctext>初始化 LDAP</SPAN></FONT></A> <UL> <LI class=toclevel-4><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#LDAP_.E6.A0.91.E7.BB.93.E6.9E.84"><FONT color=#800080><SPAN class=tocnumber>4.2.6.1</SPAN> <SPAN class=toctext>LDAP 树结构</SPAN></FONT></A> <LI class=toclevel-4><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#root_entry:_dc.3Dbibby.2Cdc.3Dorg"><FONT color=#800080><SPAN class=tocnumber>4.2.6.2</SPAN> <SPAN class=toctext>root entry: dc=bibby,dc=org</SPAN></FONT></A> <LI class=toclevel-4><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#cn.3DManager.2Cdc.3Dbibby.2Cdc.3Dorg"><FONT color=#800080><SPAN class=tocnumber>4.2.6.3</SPAN> <SPAN class=toctext>cn=Manager,dc=bibby,dc=org</SPAN></FONT></A> <LI class=toclevel-4><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#o.3Ddomains.2Cdc.3Dbibby.2Cdc.3Dorg"><FONT color=#800080><SPAN class=tocnumber>4.2.6.4</SPAN> <SPAN class=toctext>o=domains,dc=bibby,dc=org</SPAN></FONT></A> <LI class=toclevel-4><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#o.3DdomainX.com.2Co.3Ddomains.2Cdc.3Dbibby.2Cdc.3Dorg"><FONT color=#800080><SPAN class=tocnumber>4.2.6.5</SPAN> <SPAN class=toctext>o=domainX.com,o=domains,dc=bibby,dc=org</SPAN></FONT></A> <LI class=toclevel-4><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#cn.3Dbibby.2Co.3Ddomain1.com.2Co.3Ddomains.2Cdc.3Dbibby.2Cdc.3Dorg"><FONT color=#800080><SPAN class=tocnumber>4.2.6.6</SPAN> <SPAN class=toctext>cn=bibby,o=domain1.com,o=domains,dc=bibby,dc=org</SPAN></FONT></A> </LI></UL></LI></UL> <LI class=toclevel-2><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#phpLDAPadmin"><FONT color=#800080><SPAN class=tocnumber>4.3</SPAN> <SPAN class=toctext>phpLDAPadmin</SPAN></FONT></A> <UL> <LI class=toclevel-3><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#.E5.AE.89.E8.A3.85_phpLDAPadmin"><FONT color=#800080><SPAN class=tocnumber>4.3.1</SPAN> <SPAN class=toctext>安装 phpLDAPadmin</SPAN></FONT></A> <LI class=toclevel-3><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#.E7.99.BB.E5.BD.95_phpLDAPadmin"><FONT color=#800080><SPAN class=tocnumber>4.3.2</SPAN> <SPAN class=toctext>登录 phpLDAPadmin</SPAN></FONT></A> </LI></UL></LI></UL> <LI class=toclevel-1><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#Postfix"><FONT color=#800080><SPAN class=tocnumber>5</SPAN> <SPAN class=toctext>Postfix</SPAN></FONT></A> <UL> <LI class=toclevel-2><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#Cyrus-SASL.EF.BC.9Asmtpd_.E8.AE.A4.E8.AF.81"><FONT color=#800080><SPAN class=tocnumber>5.1</SPAN> <SPAN class=toctext>Cyrus-SASL:smtpd 认证</SPAN></FONT></A> <UL> <LI class=toclevel-3><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#.2Fusr.2Flocal.2Flib.2Fsasl2.2Fsmtpd.conf"><FONT color=#800080><SPAN class=tocnumber>5.1.1</SPAN> <SPAN class=toctext>/usr/local/lib/sasl2/smtpd.conf</SPAN></FONT></A> <LI class=toclevel-3><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#.2Fetc.2Fsaslauthd.conf"><FONT color=#800080><SPAN class=tocnumber>5.1.2</SPAN> <SPAN class=toctext>/etc/saslauthd.conf</SPAN></FONT></A> <LI class=toclevel-3><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#.2Fetc.2Frc.conf.local_2"><FONT color=#800080><SPAN class=tocnumber>5.1.3</SPAN> <SPAN class=toctext>/etc/rc.conf.local</SPAN></FONT></A> <LI class=toclevel-3><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#.2Fetc.2Frc.local_2"><FONT color=#800080><SPAN class=tocnumber>5.1.4</SPAN> <SPAN class=toctext>/etc/rc.local</SPAN></FONT></A> <LI class=toclevel-3><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#.E6.B5.8B.E8.AF.95_SASL_.E8.AE.A4.E8.AF.81"><FONT color=#800080><SPAN class=tocnumber>5.1.5</SPAN> <SPAN class=toctext>测试 SASL 认证</SPAN></FONT></A> <LI class=toclevel-3><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#.2Fvar.2Flog.2Fauthlog"><FONT color=#800080><SPAN class=tocnumber>5.1.6</SPAN> <SPAN class=toctext>/var/log/authlog</SPAN></FONT></A> </LI></UL> <LI class=toclevel-2><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#.E5.AE.89.E8.A3.85_Postfix"><FONT color=#800080><SPAN class=tocnumber>5.2</SPAN> <SPAN class=toctext>安装 Postfix</SPAN></FONT></A> <UL> <LI class=toclevel-3><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#.E5.AE.89.E8.A3.85.E5.90.8E.E7.9A.84.E5.88.9D.E6.AD.A5.E9.85.8D.E7.BD.AE"><FONT color=#800080><SPAN class=tocnumber>5.2.1</SPAN> <SPAN class=toctext>安装后的初步配置</SPAN></FONT></A> </LI></UL> <LI class=toclevel-2><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#.E9.85.8D.E7.BD.AE_Postfix"><FONT color=#800080><SPAN class=tocnumber>5.3</SPAN> <SPAN class=toctext>配置 Postfix</SPAN></FONT></A> <UL> <LI class=toclevel-3><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#.2Fetc.2Fpostfix.2Fmain.cf"><FONT color=#800080><SPAN class=tocnumber>5.3.1</SPAN> <SPAN class=toctext>/etc/postfix/main.cf</SPAN></FONT></A> <UL> <LI class=toclevel-4><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#Generic"><FONT color=#800080><SPAN class=tocnumber>5.3.1.1</SPAN> <SPAN class=toctext>Generic</SPAN></FONT></A> <LI class=toclevel-4><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#.E8.99.9A.E6.8B.9F.E5.9F.9F"><FONT color=#800080><SPAN class=tocnumber>5.3.1.2</SPAN> <SPAN class=toctext>虚拟域</SPAN></FONT></A> <UL> <LI class=toclevel-5><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#.2Fetc.2Fpostfix.2Ftransport"><FONT color=#800080><SPAN class=tocnumber>5.3.1.2.1</SPAN> <SPAN class=toctext>/etc/postfix/transport</SPAN></FONT></A> <LI class=toclevel-5><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#virtual_mailbox.2Fuid.2Fgid"><FONT color=#800080><SPAN class=tocnumber>5.3.1.2.2</SPAN> <SPAN class=toctext>virtual mailbox/uid/gid</SPAN></FONT></A> </LI></UL> <LI class=toclevel-4><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#SASL_.E7.94.A8.E6.88.B7.E8.AE.A4.E8.AF.81"><FONT color=#800080><SPAN class=tocnumber>5.3.1.3</SPAN> <SPAN class=toctext>SASL 用户认证</SPAN></FONT></A> </LI></UL></LI></UL> <LI class=toclevel-2><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#.E6.B5.8B.E8.AF.95_Postfix_.E7.9A.84_SMTP_.E5.8A.9F.E8.83.BD"><FONT color=#800080><SPAN class=tocnumber>5.4</SPAN> <SPAN class=toctext>测试 Postfix 的 SMTP 功能</SPAN></FONT></A> <LI class=toclevel-2><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#Debug"><FONT color=#800080><SPAN class=tocnumber>5.5</SPAN> <SPAN class=toctext>Debug</SPAN></FONT></A> </LI></UL> <LI class=toclevel-1><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#Courier"><FONT color=#800080><SPAN class=tocnumber>6</SPAN> <SPAN class=toctext>Courier</SPAN></FONT></A> <UL> <LI class=toclevel-2><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#.E5.AE.89.E8.A3.85_courier-.2A"><FONT color=#800080><SPAN class=tocnumber>6.1</SPAN> <SPAN class=toctext>安装 courier-*</SPAN></FONT></A> <UL> <LI class=toclevel-3><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#courier-authlib-ldap"><FONT color=#800080><SPAN class=tocnumber>6.1.1</SPAN> <SPAN class=toctext>courier-authlib-ldap</SPAN></FONT></A> <LI class=toclevel-3><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#courier-imap"><FONT color=#800080><SPAN class=tocnumber>6.1.2</SPAN> <SPAN class=toctext>courier-imap</SPAN></FONT></A> <LI class=toclevel-3><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#courier-pop3"><FONT color=#800080><SPAN class=tocnumber>6.1.3</SPAN> <SPAN class=toctext>courier-pop3</SPAN></FONT></A> </LI></UL> <LI class=toclevel-2><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#.E9.85.8D.E7.BD.AE_Courier-IMAP.2FPOP3"><FONT color=#800080><SPAN class=tocnumber>6.2</SPAN> <SPAN class=toctext>配置 Courier-IMAP/POP3</SPAN></FONT></A> <UL> <LI class=toclevel-3><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#.2Fetc.2Fcourier.2Fauthdaemonrc"><FONT color=#800080><SPAN class=tocnumber>6.2.1</SPAN> <SPAN class=toctext>/etc/courier/authdaemonrc</SPAN></FONT></A> <LI class=toclevel-3><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#.2Fetc.2Fcourier.2Fauthldaprc"><FONT color=#800080><SPAN class=tocnumber>6.2.2</SPAN> <SPAN class=toctext>/etc/courier/authldaprc</SPAN></FONT></A> <LI class=toclevel-3><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#.2Fetc.2Frc.conf.local_3"><FONT color=#800080><SPAN class=tocnumber>6.2.3</SPAN> <SPAN class=toctext>/etc/rc.conf.local</SPAN></FONT></A> <LI class=toclevel-3><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#.2Fetc.2Frc.local_3"><FONT color=#800080><SPAN class=tocnumber>6.2.4</SPAN> <SPAN class=toctext>/etc/rc.local</SPAN></FONT></A> <LI class=toclevel-3><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#.E6.B5.8B.E8.AF.95_POP3.2FIMAP"><FONT color=#800080><SPAN class=tocnumber>6.2.5</SPAN> <SPAN class=toctext>测试 POP3/IMAP</SPAN></FONT></A> <LI class=toclevel-3><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#Debug_2"><FONT color=#800080><SPAN class=tocnumber>6.2.6</SPAN> <SPAN class=toctext>Debug</SPAN></FONT></A> </LI></UL></LI></UL> <LI class=toclevel-1><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#WebMail"><FONT color=#800080><SPAN class=tocnumber>7</SPAN> <SPAN class=toctext>WebMail</SPAN></FONT></A> <UL> <LI class=toclevel-2><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#SquerrilMail"><FONT color=#800080><SPAN class=tocnumber>7.1</SPAN> <SPAN class=toctext>SquerrilMail</SPAN></FONT></A> <UL> <LI class=toclevel-3><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#Plugins"><FONT color=#800080><SPAN class=tocnumber>7.1.1</SPAN> <SPAN class=toctext>Plugins</SPAN></FONT></A> <UL> <LI class=toclevel-4><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#change_ldappass"><FONT color=#800080><SPAN class=tocnumber>7.1.1.1</SPAN> <SPAN class=toctext>change_ldappass</SPAN></FONT></A> </LI></UL></LI></UL> <LI class=toclevel-2><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#Extmail"><FONT color=#800080><SPAN class=tocnumber>7.2</SPAN> <SPAN class=toctext>Extmail</SPAN></FONT></A> </LI></UL> <LI class=toclevel-1><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#Resource_Links"><FONT color=#800080><SPAN class=tocnumber>8</SPAN> <SPAN class=toctext>Resource Links</SPAN></FONT></A> <UL> <LI class=toclevel-2><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#LDAP"><FONT color=#800080><SPAN class=tocnumber>8.1</SPAN> <SPAN class=toctext>LDAP</SPAN></FONT></A> <LI class=toclevel-2><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#Postfix_2"><FONT color=#800080><SPAN class=tocnumber>8.2</SPAN> <SPAN class=toctext>Postfix</SPAN></FONT></A> </LI></UL> <LI class=toclevel-1><A href="http://openbsd-wiki.org/index.php?title=(zh_CN)OpenBSD(4.1)%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#Revision"><FONT color=#800080><SPAN class=tocnumber>9</SPAN> <SPAN class=toctext>Revision</SPAN></FONT></A> </LI></UL> <UL></UL></TD></TR></TBODY></TABLE> <SCRIPT type=text/javascript> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </SCRIPT> <A name=First_of_all></A> <H1><SPAN class=editsection>[<A title="Edit section: First of all" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=1"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>First of all</SPAN></H1> <P>如果您发现该文档有任何错误、笔误,请直接联系我(<A class="external text" title=mailto:michaelbibby@gmail.com href="mailto:michaelbibby@gmail.com" rel=nofollow><FONT color=#0000ff>Mail</FONT></A>),或者在 <A class="external text" title=http://openbsd-wiki.org/index.php?title=Talk:%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier href="http://openbsd-wiki.org/index.php?title=Talk:%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier" rel=nofollow><FONT color=#0000ff>Discussion</FONT></A> 页面留言,而不要直接编辑本页。 </P><A name=Overview></A> <H1><SPAN class=editsection>[<A title="Edit section: Overview" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=2"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>Overview</SPAN></H1><A name=Author></A> <H2><SPAN class=editsection>[<A title="Edit section: Author" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=3"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>Author</SPAN></H2> <UL> <LI>Contact me: <A class="external text" title=mailto:michaelbibby@gmail.com href="mailto:michaelbibby@gmail.com" rel=nofollow><FONT color=#0000ff>Michael Bibby(张煌彬)</FONT></A> <LI>From: <A class="external free" title=http://www.OpenBSDonly.org/ href="http://www.openbsdonly.org/" rel=nofollow><FONT color=#0000ff>http://www.OpenBSDonly.org/</FONT></A> ,不做普及者!做开路人! <LI>Copyright: 本文档欢迎自由转载,但是请务必保留作者及出处等信息。 </LI></UL><A name=About_OpenBSD></A> <H2><SPAN class=editsection>[<A title="Edit section: About OpenBSD" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=4"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>About OpenBSD</SPAN></H2> <UL> <LI>OpenBSD: "Only two remote holes in the default install, in more than 10 years!" <LI>购买 OpenBSD 光盘是支持 OpenBSD 持续发展的重要途径。 <LI>用于实践、实验本文档的最佳方法是购买一套 OpenBSD 光盘,欢迎您通过 <A class="external free" title=http://www.openbsd.org/orders.html#china href="http://www.openbsd.org/orders.html#china" rel=nofollow><FONT color=#0000ff>http://www.openbsd.org/orders.html#china</FONT></A> 页面的联系方式与我联系。价格: <UL> <LI>CD(4.2 -release,2007.11.01 发布):¥180 <LI>T-Shirt: ¥140 </LI></UL></LI></UL><A name=OS_.26_Packages></A> <H2><SPAN class=editsection>[<A title="Edit section: OS & Packages" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=5"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>OS & Packages</SPAN></H2> <P>本邮件服务器基于 OpenBSD 4.1 -stable 平台搭建,使用到了以下软件: </P><PRE>courier-authlib-0.58p2 courier-authlib-ldap-0.58p1 courier-imap-4.1.1p0 courier-pop3-4.1.1 cyrus-sasl-2.1.21p3-ldap openldap-client-2.3.33 openldap-server-2.3.33p1 php5-core-5.1.6p0 php5-imap-5.1.6p1 php5-ldap-5.1.6p1 phpldapadmin-1.0.1p0 postfix-2.3.7-sasl2-ldap </PRE> <P>以下是作为依赖包被安装的: </P><PRE>c-client-4.64p2 expat-2.0.0 gdbm-1.8.3p0 gettext-0.14.6 libiconv-1.9.2p3 libltdl-1.5.22p1 libxml-2.6.26p0 pcre-6.4p1 cyrus-sasl-2.1.21p3 </PRE> <P>以上软件包都可以在 OpenBSD 官方站点下载到: <A class="external free" title=ftp://ftp.openbsd.org/pub/OpenBSD/4.1/packages/i386/ href="ftp://ftp.openbsd.org/pub/OpenBSD/4.1/packages/i386/" rel=nofollow><FONT color=#0000ff>ftp://ftp.openbsd.org/pub/OpenBSD/4.1/packages/i386/</FONT></A> </P> <P><A class=image title="image: Note.png" href="http://openbsd-wiki.org/index.php?title=Image:Note.png"><IMG height=36 alt="image: Note.png" src="http://openbsd-wiki.org/images/c/cc/Note.png" width=36 border=0></A> 只有 postfix 软件包是使用 ports 编译的,所以你需要下载源码包:postfix-2.3.7.tar.gz。其余软件包都使用 binary packages 直接安装。 </P> <P><A class=image title="image: Tip.png" href="http://openbsd-wiki.org/index.php?title=Image:Tip.png"><IMG height=32 alt="image: Tip.png" src="http://openbsd-wiki.org/images/4/45/Tip.png" width=32 border=0></A> 您可以从离自己较近的镜像站点下载。镜像站点的列表可以在 <A class="external free" title=http://www.openbsd.org/ftp.html href="http://www.openbsd.org/ftp.html" rel=nofollow><FONT color=#0000ff>http://www.openbsd.org/ftp.html</FONT></A> 页面找到。 </P><A name=Features></A> <H2><SPAN class=editsection>[<A title="Edit section: Features" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=6"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>Features</SPAN></H2> <P>目前本文档中的内容所实现的功能有: </P> <UL> <LI>Apache(+PHP):Done. <LI>OpenLDAP(+phpLDAPadmin)安装与配置:Done. <LI>虚拟域:Done. <LI>虚拟用户(LDAP)通过 SASL 认证,使用 Postfix(SMTP) 发送邮件到虚拟域:Done. <LI>POP3/IMAP:Done. </LI></UL><A name=Architecture></A> <H2><SPAN class=editsection>[<A title="Edit section: Architecture" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=7"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>Architecture</SPAN></H2> <P>架构图: </P> <P><A class=image title="image: Arch.png" href="http://openbsd-wiki.org/index.php?title=Image:Arch.png"><IMG height=400 alt="image: Arch.png" src="http://openbsd-wiki.org/images/3/32/Arch.png" width=531 border=0></A> </P> <P>注:本架构图来自 <A class="external text" title=http://wanderingbarque.com/howtos/mailserver/mailserver.html href="http://wanderingbarque.com/howtos/mailserver/mailserver.html" rel=nofollow><FONT color=#0000ff>Secure Virtual Mailserver HOWTO: Postfix + OpenLDAP + Dovecot + Jamm + SASL + SquirrelMail</FONT></A>。针对本文档,只需要将 Dovecot 替换成 Courier-IMAP/Courier-POP3 即可。 </P><A name=Todo></A> <H2><SPAN class=editsection>[<A title="Edit section: Todo" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=8"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>Todo</SPAN></H2> <UL> <LI>更详尽的注释 </LI></UL><A name=System_administration></A> <H3><SPAN class=editsection>[<A title="Edit section: System administration" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=9"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>System administration</SPAN></H3> <UL> <LI>为什么建议不要修改 /etc/rc.conf,而是修改 /etc/rc.conf.local(rc.conf(8),DESCRIPTION 的第二段文字) </LI></UL><A name=Apache></A> <H3><SPAN class=editsection>[<A title="Edit section: Apache" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=10"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>Apache</SPAN></H3> <UL> <LI>增加虚拟主机,为 WebMail 做准备 <LI>修改 /etc/hosts,为 WebMail 做准备 <LI>WebMail(<A class="external text" title=mailto:michaelbibby@gmail.com href="mailto:michaelbibby@gmail.com" rel=nofollow><FONT color=#0000ff>Tell me which one you prefer</FONT></A>) </LI></UL><A name=OpenLDAP></A> <H3><SPAN class=editsection>[<A title="Edit section: OpenLDAP" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=11"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>OpenLDAP</SPAN></H3> <UL> <LI>OpenLDAP 安全(/etc/openldap/slapd.conf) <UL> <LI>attr=userPassword 限制 </LI></UL></LI></UL><A name=PF></A> <H3><SPAN class=editsection>[<A title="Edit section: PF" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=12"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>PF</SPAN></H3> <UL> <LI>Package Filter Rules </LI></UL><A name=HA></A> <H3><SPAN class=editsection>[<A title="Edit section: HA" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=13"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>HA</SPAN></H3> <UL> <LI>High Availability: CARP </LI></UL><A name=Credits></A> <H2><SPAN class=editsection>[<A title="Edit section: Credits" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=14"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>Credits</SPAN></H2> <P>目前为止,这篇文档实现的功能还只是最基本的 SMTP/POP3/IMAP 功能,虽然还根本无法用于生产环境,但是已经初具雏型。 </P> <P><BR>在测试和编写文档的过程中得到了一些朋友的帮助和支持,在此要特别感谢: </P> <UL> <LI><A class="external text" title=http://www.openbsd.org href="http://www.openbsd.org/" rel=nofollow><FONT color=#0000ff>OpenBSD</FONT></A>:我个人最喜欢的 OS。人不能没有个性,而如果你使用的 OS 也极富个性,则在除了使用之外更多了一层喜爱。 <LI><A class="external text" title=http://www.google.com href="http://www.google.com/" rel=nofollow><FONT color=#0000ff>Google</FONT></A>:没有你,我无法完整这篇文档。在学习 Linux/*BSD 的路上,你帮的忙可算是最大。 <LI><A class="external text" title=http://openbsd-wiki.org href="http://openbsd-wiki.org/" rel=nofollow><FONT color=#0000ff>OpenBSD-wiki.org</FONT></A>:本文档是基于该网站上的 <A class="external text" title=http://openbsd-wiki.org/index.php?title=HowTo_Virtual_Domain_Guide_for_v4.0 href="http://openbsd-wiki.org/index.php?title=HowTo_Virtual_Domain_Guide_for_v4.0" rel=nofollow><FONT color=#0000ff>HowTo Virtual Domain Guide for v4.0</FONT></A> 完成的。 </LI></UL> <P><BR>另外还要特别感谢 <A class="external free" title=http://www.OpenBSDonly.org href="http://www.openbsdonly.org/" rel=nofollow><FONT color=#0000ff>http://www.OpenBSDonly.org</FONT></A> 上的: </P> <UL> <LI>congli:一直以来,在学习 FreeBSD/OpenBSD 的过程中都得到了 congli 大哥的许多帮助,真的非常感谢。 <LI>atyu30:你的需求激励着我前进,是压力,也是动力。 </LI></UL> <P><BR>很高兴在学习 OpenBSD 的同时,有这么多的朋友一路同行。 </P><A name=Apache.2BPHP></A> <H1><SPAN class=editsection>[<A title="Edit section: Apache+PHP" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=15"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>Apache+PHP</SPAN></H1> <P>在本文中,将需要用到 phpLDAPadmin 来管理 OpenLDAP,而 phpLDAPadmin 是一个使用 PHP 编写的程序,所以需要搭建 Apache+PHP 来支持 phpLDAPadmin。 </P><A name=Apache_2></A> <H2><SPAN class=editsection>[<A title="Edit section: Apache" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=16"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>Apache</SPAN></H2><A name=.E5.90.AF.E7.94.A8_Apache></A> <H3><SPAN class=editsection>[<A title="Edit section: 启用 Apache" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=17"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>启用 Apache</SPAN></H3> <P>OpenBSD 的基本系统中已经带了 Apache-1.3.x(在 4.1 -release 中是 1.3.29),所以只需要将它启用即可。 </P> <P>编辑 /etc/rc.conf.local 文件,加入以下内容: </P><PRE>httpd_flags="" </PRE> <P>Apahce 的所有文件都放在 /var/www/ 目录下,以下是几个主要的目录及其用途: </P><PRE>/var/www/ |- cgi-bin/ <-- 存放 CGI 程序的主要目录 |- conf/ <-- 存放配置文件的目录 |- htdocs/ <-- 存放 Web 文件的目录 |- logs/ <-- 存放 apache 服务器的日志文件 |- users/ <-- 用于提供给系统用户作个人主页的目录 </PRE><A name=Apache_.E7.9A.84.E5.90.AF.E5.8A.A8.E4.B8.8E.E5.81.9C.E6.AD.A2></A> <H3><SPAN class=editsection>[<A title="Edit section: Apache 的启动与停止" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=18"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>Apache 的启动与停止</SPAN></H3> <P>Apache 使用 apachectl 程序来启动和停止: </P><PRE># apachectl start # apachectl stop </PRE><A name=.E5.AE.89.E8.A3.85_PHP.EF.BC.9Aphp5-core></A> <H2><SPAN class=editsection>[<A title="Edit section: 安装 PHP:php5-core" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=19"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>安装 PHP:php5-core</SPAN></H2><PRE># pkg_add php5-core-5.1.6p0.tgz php5-core-5.1.6p0:libiconv-1.9.2p3: complete php5-core-5.1.6p0:expat-2.0.0: complete php5-core-5.1.6p0:gettext-0.14.6: complete php5-core-5.1.6p0:libxml-2.6.26p0: complete php5-core-5.1.6p0: complete --- php5-core-5.1.6p0 ------------------- To finish the install, enable the php5 module with: /usr/local/sbin/phpxs -s To enable parsing of PHP scripts, add the following to /var/www/conf/httpd.conf: AddType application/x-httpd-php .php Copy the config file below into /var/www/conf/php.ini /usr/local/share/examples/php5/php.ini-recommended Don't forget that the default OpenBSD httpd is chrooted into /var/www by default, so you may need to create support directories such as /var/www/tmp for PHP to work correctly. </PRE> <P>根据提示,执行: </P><PRE># /usr/local/sbin/phpxs -s [activating module `php5' in /var/www/conf/httpd.conf] cp /usr/local/lib/php/libphp5.so /usr/lib/apache/modules/libphp5.so chmod 755 /usr/lib/apache/modules/libphp5.so cp /var/www/conf/httpd.conf /var/www/conf/httpd.conf.bak cp /var/www/conf/httpd.conf.new /var/www/conf/httpd.conf rm /var/www/conf/httpd.conf.new You should copy the sample configuration files from /usr/local/share/examples/php5 to /var/www/conf/php.ini # </PRE> <P>复制 PHP 的配置文件 php.ini: </P><PRE># cp /usr/local/share/examples/php5/php.ini-recommended /var/www/conf/php.ini </PRE> <P>编辑 Apache 的配置文件(/var/www/conf/httpd.conf),让它能够识别和解析 PHP 文件: </P><PRE># [..snip..] # 在 DirectoryIndex 参数中加上 PHP 的索引文件:index.php。 # index.php 和 index.html 的先后顺序决定了 apache 在进入一个目录的时候先读取哪个文件。 DirectoryIndex index.php index.html # 将以下一行内容的注释符号给去掉: AddType application/x-httpd-php .php </PRE> <P>重启 apache 之后,它就能够识别和解析 PHP 文件了: </P><PRE># apachectl stop # apachectl start </PRE> <P>现在可以创建一个 PHP 文件,测试 PHP 是否已经可以正确识别: </P><PRE># vi /var/www/htdocs/index.php <?php phpinfo(); ?> </PRE> <P>使用 Web 浏览器访问你的服务器首页的 index.php 文件: <A class="external free" title=http://your_server_IP/index.php href="http://your_server_ip/index.php" rel=nofollow><FONT color=#0000ff>http://your_server_IP/index.php</FONT></A> ,如果能够看到和以下截图类似的 PHP 信息,则表示 apache 已经可以正确识别和解析 PHP 文件。 </P> <P><A class=image title="image: Phpinfo_openbsd_mail_server.png" href="http://openbsd-wiki.org/index.php?title=Image:Phpinfo_openbsd_mail_server.png"><IMG height=331 alt="image: Phpinfo_openbsd_mail_server.png" src="http://openbsd-wiki.org/images/0/0a/Phpinfo_openbsd_mail_server.png" width=619 border=0></A> </P><A name=PHP_Extensions></A> <H2><SPAN class=editsection>[<A title="Edit section: PHP Extensions" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=20"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>PHP Extensions</SPAN></H2> <P>为了支持整个邮件服务器,我们还需要安装以下 PHP 扩展: </P> <UL> <LI>php5-ldap:用于 phpLDAPadmin <LI>php5-imap:用于 WebMail </LI></UL> <P>以下组件是可选的: </P> <UL> <LI>php5-bz2 <LI>php5-gd </LI></UL> <P>模块在安装完成后需要重启 apache 才能生效。 </P><A name=php5-ldap></A> <H3><SPAN class=editsection>[<A title="Edit section: php5-ldap" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=21"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>php5-ldap</SPAN></H3><PRE># pkg_add php5-ldap-5.1.6p1.tgz php5-ldap-5.1.6p1:cyrus-sasl-2.1.21p3: complete php5-ldap-5.1.6p1:openldap-client-2.3.33: complete php5-ldap-5.1.6p1: complete --- php5-ldap-5.1.6p1 ------------------- Enable this module in php.ini using the following command: /usr/local/sbin/phpxs -a ldap # # /usr/local/sbin/phpxs -a ldap Activating extension : ldap # </PRE> <P>注意:这里将 cyrus-sasl 作为依赖包给装上了,但是因为它不支持 LDAP,所以我们在后面需要将它替换掉。 </P><A name=php5-imap></A> <H3><SPAN class=editsection>[<A title="Edit section: php5-imap" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=22"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>php5-imap</SPAN></H3><PRE># pkg_add php5-imap-5.1.6p1.tgz php5-imap-5.1.6p1:c-client-4.64p2: complete php5-imap-5.1.6p1: complete --- php5-imap-5.1.6p1 ------------------- Enable this module in php.ini using the following command: /usr/local/sbin/phpxs -a imap # # /usr/local/sbin/phpxs -a imap Activating extension : imap # </PRE> <P>安装完成后重启 Apache,在刚才创建的 index.php 文件里应该能看到类似的内容: </P> <P><A class=image title="image: Imap_ldap_openbsd_mail_server.png" href="http://openbsd-wiki.org/index.php?title=Image:Imap_ldap_openbsd_mail_server.png"><IMG height=360 alt="image: Imap_ldap_openbsd_mail_server.png" src="http://openbsd-wiki.org/images/2/29/Imap_ldap_openbsd_mail_server.png" width=618 border=0></A> </P><A name=OpenLDAP_2></A> <H1><SPAN class=editsection>[<A title="Edit section: OpenLDAP" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=23"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>OpenLDAP</SPAN></H1><A name=.E5.AE.89.E8.A3.85_OpenLDAP></A> <H2><SPAN class=editsection>[<A title="Edit section: 安装 OpenLDAP" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=24"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>安装 OpenLDAP</SPAN></H2> <P>packages 里的 openldap-server 只支持使用 ldbm 作为 backend。但是在这里我们不考虑 ldbm 与 bdb 这两种数据库作为 backend 的性能区别,所以直接使用 packages 安装。 </P><PRE># pkg_add openldap-server-2.3.33p1.tgz openldap-server-2.3.33p1: complete # </PRE><A name=.E9.85.8D.E7.BD.AE_OpenLDAP></A> <H2><SPAN class=editsection>[<A title="Edit section: 配置 OpenLDAP" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=25"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>配置 OpenLDAP</SPAN></H2><A name=authldap.schema></A> <H3><SPAN class=editsection>[<A title="Edit section: authldap.schema" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=26"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>authldap.schema</SPAN></H3> <P>这里将使用 courier 提供的 authldap.schema 这个 schema,用于与 Postfix 的整合。 </P><PRE># cd /root # # ftp "http://courier.cvs.sourceforge.net/*checkout*/courier/libs/authlib/authldap.schema" Trying 66.35.250.84... Requesting http://courier.cvs.sourceforge.net/*checkout*/courier/libs/authlib/authldap.schema Successfully retrieved file. # # cp authldap.schema /etc/openldap/schema/courier.schema </PRE> <P>注:在 courier-authlib-ldap 这个包中也包含有 authldap.schema 文件,可以直接代替这里的版本。 </P><A name=.2Fetc.2Fopenldap.2Fslapd.conf></A> <H3><SPAN class=editsection>[<A title="Edit section: /etc/openldap/slapd.conf" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=27"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>/etc/openldap/slapd.conf</SPAN></H3> <P>OpenLDAP 的主配置文件是 <B>/etc/openldap/slapd.conf</B>。在这里,我们需要添加和修改一些内容: </P><PRE>include /etc/openldap/schema/core.schema # 添加以下这些 schema include /etc/openldap/schema/corba.schema include /etc/openldap/schema/cosine.schema include /etc/openldap/schema/inetorgperson.schema include /etc/openldap/schema/nis.schema # 这是为了与 Postfix 整合所需要的 include /etc/openldap/schema/courier.schema pidfile /var/run/openldap/slapd.pid argsfile /var/run/openldap/slapd.args # 日志级别,用于调试。不建议在生产环境中使用调试模式,可能降低服务器性能。 loglevel 256 # ... skip many lines here ... # 如果是直接使用 packages 安装的 openldap,那么只能使用 ldbm 作为 backend。 #database bdb database ldbm suffix "dc=bibby,dc=org" rootdn "cn=Manager,dc=bibby,dc=org" rootpw {SSHA}mHzQL7t4YG/a6g5mt2YPLE/+ErmekI34 directory /var/openldap-data </PRE> <UL> <LI>默认的配置文件只使用(<B>include</B>)了一个 schema(core.schema),这里添加了其它个较常用的 schema: </LI></UL> <OL> <LI>corba.schema <LI>cosine.schema <LI>inetorgperson.schema <LI>nis.schema <LI>courier.schema </LI></OL> <P><BR><A class=image title="image: Danger.png" href="http://openbsd-wiki.org/index.php?title=Image:Danger.png"><IMG height=32 alt="image: Danger.png" src="http://openbsd-wiki.org/images/b/bb/Danger.png" width=32 border=0></A> schema 文件的<B>先后顺序非常重要</B>,因为后面定义的属性的值,会覆盖前面加载的 schema 中定义的。 </P> <P><BR></P> <UL> <LI><B>pidfile/argsfile</B>:这里的 <B>pidfile</B> 和 <B>argsfile</B> 的路径都没有采用默认的 <B>/var/run/</B>,因为我们将以 <B>_openldap:_openldap</B> 这个用户和用户组的身份来运行 openldap 服务,而 <B>/var/run/</B> 目录的权限不允许 <B>_openldap</B> 用户创建 pid 文件,所以这里采用新建 <B>/var/run/openldap/</B> 目录,并将该目录的 owner 设置为 <B>_openldap:_openldap</B> 的方式,使得 <B>_openldap</B> 用户能够将 pid 文件存放在这个目录下。 </LI></UL> <UL> <LI><B>loglevel</B>:这是定义 OpenLDAP 的日志级别。不建议在实际生产环境中使用调试模式,因为大量的日志,需要频繁地使用~I/O,对~LDAP~服务器的性能有一定影响。 </LI></UL> <P><A class=image title="image: Tip.png" href="http://openbsd-wiki.org/index.php?title=Image:Tip.png"><IMG height=32 alt="image: Tip.png" src="http://openbsd-wiki.org/images/4/45/Tip.png" width=32 border=0></A> OpenLDAP 默认将所有日志信息发送到 syslogd 的 'local4' 这个日志级别。所以,为了便于调试,可以将所有日志单独存放在某个日志文件里,比如:<B>/var/log/openldap</B>。修改 <B>/etc/syslog.conf</B>,增加一行: </P><PRE># File: part of /etc/syslog.conf # Notice: run 'touch /var/log/openldap' first. local4.* /var/log/openldap </PRE> <P>再手动创建 /var/log/openldap 这个文件,并通知 syslog 程序重新读取配置文件: </P><PRE># touch /var/log/openldap # kill -HUP $(cat /var/run/syslog.pid) </PRE> <UL> <LI><B>database</B>:这是定义 OpenLDAP 使用哪种数据库作为 backend,用来存储数据。 </LI></UL> <P><A class=image title="image: Warnning.png" href="http://openbsd-wiki.org/index.php?title=Image:Warnning.png"><IMG height=32 alt="image: Warnning.png" src="http://openbsd-wiki.org/images/3/3f/Warnning.png" width=32 border=0></A> 注意:如果是使用 packages 直接安装的 openldap-server,将只能使用 ldbm 作为 backend。 </P> <UL> <LI><B>suffix</B>:这是定义 LDAP 树的前缀。 <LI><B>rootdn</B>:这是定义用来管理整个 LDAP 的管理员账号。 <LI><B>rootpw</B>:这是设定 rootdn 的密码。 </LI></UL> <P><A class=image title="image: Note.png" href="http://openbsd-wiki.org/index.php?title=Image:Note.png"><IMG height=36 alt="image: Note.png" src="http://openbsd-wiki.org/images/c/cc/Note.png" width=36 border=0></A> 这里的 rootpw 後面的是使用 slappasswd 生成的密码,默认是使用 SSHA 这个加密算法的: </P><PRE># slappasswd New password: Re-enter new password: {SSHA}mHzQL7t4YG/a6g5mt2YPLE/+ErmekI34 </PRE> <P>可以用 <B>-h</B> 参数指定 <B>slappasswd</B> 使用其它的加密算法。比如: </P><PRE># slappasswd -h {MD5} </PRE> <UL> <LI><B>directory</B>:这是定义 OpenLDAP 的数据都存放在哪个目录下。 </LI></UL> <P>创建目录并设置权限: </P><PRE># mkdir /var/run/openldap # chown -R _openldap:_openldap /var/run/openldap # chown -R _openldap:_openldap /var/openldap-data # chmod -R 700 /var/openldap-data </PRE><A name=.E5.90.AF.E5.8A.A8_OpenLDAP></A> <H3><SPAN class=editsection>[<A title="Edit section: 启动 OpenLDAP" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=28"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>启动 OpenLDAP</SPAN></H3> <P>都配置好了,现在可以启动 OpenLDAP 了: </P><PRE># /usr/local/libexec/slapd -u _openldap -g _openldap -d 256 & [1] 7558 # @(#) $OpenLDAP: slapd 2.3.33 (Mar 6 2007 20:51:09) $ @i386.ports.openbsd.org:/usr/obj/i386/openldap-2.3.33/build-i386/servers/slapd WARNING: No dynamic config support for database ldbm. slapd starting # </PRE> <P>这时候在 /var/log/openldap 里应该已经有一些信息了,不妨现在查看一下: </P><PRE># tail /var/log/openldap Sep 20 22:07:00 mail slapd[5496]: @(#) $OpenLDAP: slapd 2.3.33 (Mar 6 2007 20:51:09) $ @i386.ports.openbsd.org:/usr/obj/i386/openldap-2.3.33/build-i386/servers/slapd Sep 20 22:07:01 mail slapd[5496]: WARNING: No dynamic config support for database ldbm. Sep 20 22:07:01 mail slapd[5496]: slapd starting </PRE> <P>用 ps 命令确认一下 OpenLDAP 服务器是否确实在运行着: </P><PRE># ps aux | grep 'openldap' _openldap 7558 0.0 1.9 6876 4944 p0 S 8:52AM 0:00.17 /usr/local/libexec/slapd -u _openldap -g ... </PRE> <P>如果看到有类似的输出,则表示确实在跑着。 </P><A name=.2Fetc.2Frc.conf.local></A> <H3><SPAN class=editsection>[<A title="Edit section: /etc/rc.conf.local" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=29"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>/etc/rc.conf.local</SPAN></H3> <P>在 <B>/etc/rc.conf.local</B> 中加入以下内容: </P><PRE>openldap_flags="-u _openldap -g _openldap" </PRE><A name=.2Fetc.2Frc.local></A> <H3><SPAN class=editsection>[<A title="Edit section: /etc/rc.local" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=30"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>/etc/rc.local</SPAN></H3> <P>在 <B>/etc/rc.local</B> 中加入以下内容: </P><PRE># Start OpenLDAP daemon. if [ X"${openldap_flags}" != X"NO" ]; then echo -n ' OpenLDAP' mkdir /var/run/openldap chown -R _openldap:_openldap /var/run/openldap /usr/local/libexec/slapd ${openldap_flags} fi </PRE><A name=reboot></A> <H4><SPAN class=editsection>[<A title="Edit section: reboot" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=31"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>reboot</SPAN></H4> <P>到这里就已经配置好了 OpenLDAP 服务器,建议重启以检查一下是否正常运行。 </P><A name=.E5.88.9D.E5.A7.8B.E5.8C.96_LDAP></A> <H3><SPAN class=editsection>[<A title="Edit section: 初始化 LDAP" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=32"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>初始化 LDAP</SPAN></H3><A name=LDAP_.E6.A0.91.E7.BB.93.E6.9E.84></A> <H4><SPAN class=editsection>[<A title="Edit section: LDAP 树结构" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=33"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>LDAP 树结构</SPAN></H4> <P>这是我们规划好的 LDAP 树结构,请根据自己的需要进行调整: </P><PRE>dc=bibby,dc=org |- cn=Manager |- o=domains |- o=domain1.com |- cn=bibby(mail=bibby@domain1.com) |- o=domain2.com </PRE><A name=root_entry:_dc.3Dbibby.2Cdc.3Dorg></A> <H4><SPAN class=editsection>[<A title="Edit section: root entry: dc=bibby,dc=org" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=34"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>root entry: dc=bibby,dc=org</SPAN></H4> <P>将以下代码保存为一个文件,例如 root.ldif。 </P><PRE>dn: dc=bibby,dc=org objectclass: dcObject objectclass: organization dc: bibby o: bibby </PRE> <P>请先确认 OpenLDAP 已经正在运行,再使用 OpenLDAP 提供的 ldapadd 工具将这个 root dn 添加进去,之后在 phpLDAPadmin 里就能看到这个 dn 了: </P><PRE># ldapadd -x -D "cn=Manager,dc=bibby,dc=org" -W -f root.ldif Enter LDAP Password: adding new entry "dc=bibby,dc=org" # </PRE> <P>简单解释: </P> <UL> <LI><B>-x</B>:使用认证; <LI><B>-D</B>:指定使用哪个 dn 来操作; <LI><B>-W</B>:提示输入密码; <LI><B>-f</B>:指定要添加的 entry 的内容从文件中读入; </LI></UL> <P>详细解释请参考以下命令的输出信息: </P><PRE># ldapadd -h </PRE><PRE># man ldapadd </PRE> <P>看看结果: </P><PRE># ldapsearch -x -D 'cn=Manager,dc=bibby,dc=org' -b 'dc=bibby,dc=org' -W Enter LDAP Password: # extended LDIF # # LDAPv3 # base <dc=bibby,dc=org> with scope subtree # filter: (objectclass=*) # requesting: ALL # # bibby.org dn: dc=bibby,dc=org objectClass: dcObject objectClass: organization dc: bibby o: bibby # search result search: 2 result: 0 Success # numResponses: 2 # numEntries: 1 # </PRE> <P>看到刚才添加的 dn 了吧? </P> <P>简单解释: </P> <UL> <LI><B>-b</B>:要查找哪个 dn 下的内容(base dn for search); </LI></UL> <P>更详细信息请参考以下命令的输出信息: </P><PRE># ldapsearch -h </PRE><PRE># man ldapsearch </PRE><A name=cn.3DManager.2Cdc.3Dbibby.2Cdc.3Dorg></A> <H4><SPAN class=editsection>[<A title="Edit section: cn=Manager,dc=bibby,dc=org" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=35"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>cn=Manager,dc=bibby,dc=org</SPAN></H4> <P>将以下内容保存为 manager.ldif 文件后使用 ldapadd 添加: </P><PRE>dn: cn=Manager,dc=bibby,dc=org objectClass: organizationalRole cn: Manager </PRE><A name=o.3Ddomains.2Cdc.3Dbibby.2Cdc.3Dorg></A> <H4><SPAN class=editsection>[<A title="Edit section: o=domains,dc=bibby,dc=org" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=36"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>o=domains,dc=bibby,dc=org</SPAN></H4> <P>将以下内容保存为 base_ou.ldif 文件后使用 ldapadd 添加: </P><PRE>dn: o=domains,dc=bibby,dc=org objectClass: Organization o: domains </PRE> <P>Postfix 查找用户将从 o=domains,dc=bibby,dc=org 开始查询。 </P><A name=o.3DdomainX.com.2Co.3Ddomains.2Cdc.3Dbibby.2Cdc.3Dorg></A> <H4><SPAN class=editsection>[<A title="Edit section: o=domainX.com,o=domains,dc=bibby,dc=org" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=37"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>o=domainX.com,o=domains,dc=bibby,dc=org</SPAN></H4> <P>下面则是针对每个不同的域设置的一个子结点。 </P> <P>将以下内容复制保存后,使用 ldapadd 添加: </P><PRE>dn: o=domain1.com,o=domains,dc=bibby,dc=org objectClass: Organization o: domain1.com </PRE><PRE>dn: o=domain2.com,o=domains,dc=bibby,dc=org objectClass: Organization o: domain2.com </PRE><A name=cn.3Dbibby.2Co.3Ddomain1.com.2Co.3Ddomains.2Cdc.3Dbibby.2Cdc.3Dorg></A> <H4><SPAN class=editsection>[<A title="Edit section: cn=bibby,o=domain1.com,o=domains,dc=bibby,dc=org" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=38"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>cn=bibby,o=domain1.com,o=domains,dc=bibby,dc=org</SPAN></H4><PRE>dn: cn=bibby,o=domain1.com,o=domains,dc=bibby,dc=org homeDirectory: /home/vmail/domains mail: bibby@domain1.com objectClass: CourierMailAccount objectClass: organizationalPerson objectClass: top mailbox: domain1.com/bibby/.maildir/ userPassword: {MD5}e41hj20lJ7j0XSksFgCEuw== uid: bibby cn: bibby sn: bibby </PRE> <P>这里已经设置了邮箱的路径,即: </P><PRE>/home/vmail/domains/domain1.com/bibby/.maildir/ </PRE> <P>这里也设置了用户的初始密码: </P><PRE>userPassword: {MD5}e41hj20lJ7j0XSksFgCEuw== </PRE> <P>这里的初始密码也是用 slappasswd 工具生成的。 </P><A name=phpLDAPadmin></A> <H2><SPAN class=editsection>[<A title="Edit section: phpLDAPadmin" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=39"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>phpLDAPadmin</SPAN></H2><A name=.E5.AE.89.E8.A3.85_phpLDAPadmin></A> <H3><SPAN class=editsection>[<A title="Edit section: 安装 phpLDAPadmin" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=40"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>安装 phpLDAPadmin</SPAN></H3><PRE># pkg_add phpldapadmin-1.0.1p0.tgz phpldapadmin-1.0.1p0: complete --- phpldapadmin-1.0.1p0 ------------------- phpLDAPAdmin has been installed into /var/www/phpldapadmin-1.0.1 Edit /var/www/phpldapadmin-1.0.1/config/config.php to configure phpLDAPAdmin You should point this to the DocumentRoot of your web-server: # ln -s ../phpldapadmin-1.0.1 /var/www/htdocs/phpldapadmin (make sure you use a relative symlink since Apache is chrooted) For jpeg photos to work properly, you must do this: # mkdir /var/www/tmp # chown www:daemon /var/www/tmp # chmod 1755 /var/www/tmp Where tmp is the $jpeg_temp_dir configured in config.php You can ensure you have a working install by accessing: http://<localhost>/phpldapadmin/index.php </PRE> <P>将 phpldapadmin 做一个符号链接到 /var/www/htdocs 目录: </P><PRE># cd /var/www/htdocs # ln -s ../phpldapadmin-1.0.1 phpldapadmin </PRE> <P>另外,由于 apache 默认是被 chroot 在 /var/www 目录下的,所以如果程序需要访问 /tmp 目录,则必须为它设置 /var/www/tmp 目录: </P><PRE># mkdir /var/www/tmp # chown www:daemon /var/www/tmp # chmod 1755 /var/www/tmp </PRE><A name=.E7.99.BB.E5.BD.95_phpLDAPadmin></A> <H3><SPAN class=editsection>[<A title="Edit section: 登录 phpLDAPadmin" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=41"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>登录 phpLDAPadmin</SPAN></H3> <P>现在可以访问: <A class="external free" title=http://IP/phpldapadmin/ href="http://ip/phpldapadmin/" rel=nofollow><FONT color=#0000ff>http://IP/phpldapadmin/</FONT></A> 作测试了。用户名为 /etc/openldap/slapd.conf 中设置的 dn 的值: </P><PRE>cn=Manager,dc=bibby,dc=org </PRE> <P>密码就是在 /etc/openldap/slapd.conf 里的 rootpw,当然,输入的肯定不是 '{SSHA}XXXXXXXXX' 那一大串,而是用 slappasswd 生成加密字符串时的密码。如下图所示: </P> <P><A class=image title="image: Phpldapadmin_login_openbsd_mail_server.png" href="http://openbsd-wiki.org/index.php?title=Image:Phpldapadmin_login_openbsd_mail_server.png"><IMG height=324 alt="image: Phpldapadmin_login_openbsd_mail_server.png" src="http://openbsd-wiki.org/images/6/68/Phpldapadmin_login_openbsd_mail_server.png" width=657 border=0></A> </P><A name=Postfix></A> <H1><SPAN class=editsection>[<A title="Edit section: Postfix" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=42"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>Postfix</SPAN></H1><A name=Cyrus-SASL.EF.BC.9Asmtpd_.E8.AE.A4.E8.AF.81></A> <H2><SPAN class=editsection>[<A title="Edit section: Cyrus-SASL:smtpd 认证" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=43"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>Cyrus-SASL:smtpd 认证</SPAN></H2> <P>在安装 php5-ldap 组件时,cyrus-sasl2 已经作为依赖的包被安装上了。但是这里却需要 SASL2 能够支持 LDAP,所以这时候只好使用 cyrus-sasl2...-ldap 包来替换掉它: </P><PRE># pkg_add -r cyrus-sasl-2.1.21p3-ldap.tgz cyrus-sasl-2.1.21p3-ldap (extracting): complete cyrus-sasl-2.1.21p3 (deleting): complete cyrus-sasl-2.1.21p3-ldap (installing): complete Clean shared items: complete --- cyrus-sasl-2.1.21p3 ------------------- You should also run rm -rf /var/sasl2/* # # rm -rf /var/sasl2/* </PRE><A name=.2Fusr.2Flocal.2Flib.2Fsasl2.2Fsmtpd.conf></A> <H3><SPAN class=editsection>[<A title="Edit section: /usr/local/lib/sasl2/smtpd.conf" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=44"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>/usr/local/lib/sasl2/smtpd.conf</SPAN></H3><PRE>pwcheck_method: saslauthd mech_list: plain login </PRE><A name=.2Fetc.2Fsaslauthd.conf></A> <H3><SPAN class=editsection>[<A title="Edit section: /etc/saslauthd.conf" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=45"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>/etc/saslauthd.conf</SPAN></H3><PRE>ldap_servers: ldap://127.0.0.1/ ldap_search_base: o=domains,dc=bibby,dc=org ldap_timeout: 10 ldap_filter: mail=%u@%r </PRE><A name=.2Fetc.2Frc.conf.local_2></A> <H3><SPAN class=editsection>[<A title="Edit section: /etc/rc.conf.local" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=46"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>/etc/rc.conf.local</SPAN></H3><PRE>saslauthd_flags="-a ldap -O /etc/saslauthd.conf -m /var/spool/postfix/var/sasl2/" </PRE> <P>注意,这里是大写字母 -O,而不是数字0。 </P> <P><BR>如果需要调试 SASL 认证,请在命令行下使用 -d 参数执行 saslauthd: </P><PRE># /usr/local/sbin/saslauthd -a ldap -O /etc/saslauthd.conf -m /var/spool/postfix/var/sasl2/ -d & </PRE> <P><A class=image title="image: Warnning.png" href="http://openbsd-wiki.org/index.php?title=Image:Warnning.png"><IMG height=32 alt="image: Warnning.png" src="http://openbsd-wiki.org/images/3/3f/Warnning.png" width=32 border=0></A> 注意:-d 参数请不要用在 /etc/rc.conf.local 文件中,这个参数只适合在命令行下执行。 </P> <P><A class=image title="image: Note.png" href="http://openbsd-wiki.org/index.php?title=Image:Note.png"><IMG height=36 alt="image: Note.png" src="http://openbsd-wiki.org/images/c/cc/Note.png" width=36 border=0></A> 添加的 -m 参数是参考了这个贴子:<A class="external text" title=http://archives.neohapsis.com/archives/openbsd/2005-04/0854.html href="http://archives.neohapsis.com/archives/openbsd/2005-04/0854.html" rel=nofollow><FONT color=#0000ff>postfix-2.2.0-sasl2-ldap / cyrus-sasl-2.1.20p3-ldap on OpenBSD 3.7</FONT></A> </P><A name=.2Fetc.2Frc.local_2></A> <H3><SPAN class=editsection>[<A title="Edit section: /etc/rc.local" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=47"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>/etc/rc.local</SPAN></H3><PRE># Start the SASL2 auth daemon if [ X"${saslauthd_flags}" != X"NO" ] ; then echo -n ' saslauthd' mkdir -p /var/spool/postfix/var/sasl2 2>/dev/null /usr/local/sbin/saslauthd ${saslauthd_flags} fi </PRE><A name=.E6.B5.8B.E8.AF.95_SASL_.E8.AE.A4.E8.AF.81></A> <H3><SPAN class=editsection>[<A title="Edit section: 测试 SASL 认证" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=48"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>测试 SASL 认证</SPAN></H3> <P>将 /etc/saslauthd.conf 中的 ldap_filter 的值修改为: </P><PRE>ldap_filter: mail=%u </PRE> <P>之后可以使用 testsaslauthd 进行测试: </P><PRE># mkdir -p /var/spool/postfix/var/sasl2 # /usr/local/sbin/saslauthd -a ldap -O /etc/saslauthd.conf -m /var/spool/postfix/var/sasl2 -d & # # testsaslauthd -f /var/spool/postfix/var/sasl2/mux -u bibby@domain1.com -p password 0: OK "Success." # </PRE> <P><A class=image title="image: Note.png" href="http://openbsd-wiki.org/index.php?title=Image:Note.png"><IMG height=36 alt="image: Note.png" src="http://openbsd-wiki.org/images/c/cc/Note.png" width=36 border=0></A> 因为 OpenBSD 下的 Postfix 被 chroot 在 /var/spool/postfix 底下,所以不能用默认的 /var/sasl2/ 目录,而应该用 /var/spool/postfix/var/sasl2/。 </P><A name=.2Fvar.2Flog.2Fauthlog></A> <H3><SPAN class=editsection>[<A title="Edit section: /var/log/authlog" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=49"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>/var/log/authlog</SPAN></H3> <P>SASL 的日志都会记录在该日志文件中:<B>/var/log/authlog</B>。 </P><A name=.E5.AE.89.E8.A3.85_Postfix></A> <H2><SPAN class=editsection>[<A title="Edit section: 安装 Postfix" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=50"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>安装 Postfix</SPAN></H2> <P>为了让 Postfix 支持 OpenLDAP 作为后台存储用户信息,也支持 SASL 认证,只好通过 ports 编译来加入我们需要的功能。 </P> <P>先用 packages 安装依赖包: </P><PRE># pkg_add pcre-6.4p1.tgz pcre-6.4p1: complete # </PRE> <P>在编译 postfix: </P><PRE># cd /usr/ports/mail/postfix/stable/ # FLAVOR="sasl2 ldap" make package ===> Checking files for postfix-2.3.7-sasl2-ldap `/usr/ports/distfiles/postfix/postfix-2.3.7.tar.gz' is up to date. >> Checksum OK for postfix/postfix-2.3.7.tar.gz. (sha1) ===> postfix-2.3.7-sasl2-ldap depends on: pcre-* - found ===> postfix-2.3.7-sasl2-ldap depends on: cyrus-sasl-* - found ===> postfix-2.3.7-sasl2-ldap depends on: openldap-client-2.* - found ===> Verifying specs: pcre sasl2 ldap.>=2 lber pcre sasl2 ldap.>=2 lber c crypto ssl c crypto ssl ===> found pcre.1.0 sasl2.2.21 ldap.9.1 lber.9.1 c.40.3 crypto.13.0 ssl.11.0 ===> Extracting for postfix-2.3.7-sasl2-ldap ===> Patching for postfix-2.3.7-sasl2-ldap ===> Configuring for postfix-2.3.7-sasl2-ldap [...snip...] ===> Building package for postfix-2.3.7-sasl2-ldap Create /usr/ports/packages/i386/all/postfix-2.3.7-sasl2-ldap.tgz Link to /usr/ports/packages/i386/ftp/postfix-2.3.7-sasl2-ldap.tgz # </PRE> <P>安装 postfix: </P><PRE># pkg_add /usr/ports/packages/i386/all/postfix-2.3.7-sasl2-ldap.tgz postfix-2.3.7-sasl2-ldap: complete --- postfix-2.3.7-sasl2-ldap ------------------- -> Creating /etc/mailer.conf.postfix -> Creating Postfix spool directory and chroot area under /var/spool/postfix Warning: you still need to edit myorigin/mydestination/mynetworks parameter settings in /etc/postfix/main.cf. See also http://www.postfix.org/STANDARD_CONFIGURATION_README.html for information about dialup sites or about sites inside a firewalled network. BTW: Check your /etc/mail/aliases file and be sure to set up aliases that send mail for root and postmaster to a real person, then run /usr/local/sbin/newaliases. +--------------- | Configuration files has been installed in /etc/postfix. | Please update these files to meet your needs. +--------------- +--------------- | Postfix can be set up to replace sendmail entirely. Please read the | documentation at file:/usr/local/share/doc/postfix/html/index.html or | http://www.postfix.org/ carefully before you decide to do this! | | To replace sendmail with postfix you have to install a new mailer.conf | using the following command: | | /usr/local/sbin/postfix-enable | | If you want to restore sendmail, this is done using the following command: | | /usr/local/sbin/postfix-disable +--------------- # </PRE><A name=.E5.AE.89.E8.A3.85.E5.90.8E.E7.9A.84.E5.88.9D.E6.AD.A5.E9.85.8D.E7.BD.AE></A> <H3><SPAN class=editsection>[<A title="Edit section: 安装后的初步配置" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=51"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>安装后的初步配置</SPAN></H3> <P>根据提示,执行命令替换掉系统里的 sendmail: </P><PRE># /usr/local/sbin/postfix-enable </PRE> <P>修改参数让 postfix 在系统启动时自动启动: </P><PRE># echo 'sendmail_flags="-bd"' >> /etc/rc.conf.local </PRE> <P>为 postfix 添加 syslogd 参数: </P><PRE># echo 'syslogd_flags="-a /var/spool/postfix/dev/log"' >> /etc/rc.conf.local </PRE> <UL> <LI>将 crontab 里的定时任务也去掉(在行首加上注释符号'#' 即可): </LI></UL><PRE># crontab -e #*/30 * * * * /usr/sbin/sendmail -L sm-msp-queue -Ac -q </PRE><A name=.E9.85.8D.E7.BD.AE_Postfix></A> <H2><SPAN class=editsection>[<A title="Edit section: 配置 Postfix" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=52"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>配置 Postfix</SPAN></H2><A name=.2Fetc.2Fpostfix.2Fmain.cf></A> <H3><SPAN class=editsection>[<A title="Edit section: /etc/postfix/main.cf" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=53"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>/etc/postfix/main.cf</SPAN></H3><A name=Generic></A> <H4><SPAN class=editsection>[<A title="Edit section: Generic" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=54"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>Generic</SPAN></H4> <P>根据自己的需要,配置以下参数: </P><PRE># File: /etc/postfix/main.cf # myhostname,表示邮件服务器都主机名,通常和系统的 hostname 一致。 myhostname = mail.bibby.org # 邮件服务器所在的域。 mydomain = bibby.org myorigin = $myhostname # inet_interfaces,指定邮件服务器将监听从哪些网络接口进来的服务请求 inet_interfaces = all # mydestination,非常重要的一个参数。告诉邮件服务器,需要将哪些邮件接收下来。 # 在这里表示所有邮件接收人的地址为以下域名结尾的都会被本邮件服务器给收下来: # - @localhost # - @mail.bibby.org # - @domain1.com # - @domain2.com # 其中,domain1.com, domain2.com 都是我们做的虚拟域。 mydestination = $myhostname, localhost, domain1.com, domain2.com mynetworks = 127.0.0.0/8 # 这里指定别名(alias)文件的位置。 # 如果使用 /etc/postfix/aliases 文件,还需要执行这个命令: # # postalias hash:/etc/postfix/aliases # 也可以直接指定为 sendmail 所使用的 aliases 文件: # alias_maps = hash:/etc/aliases # 如果使用 /etc/aliases,还需要执行这个命令: # # /usr/local/sbin/newaliases alias_maps = hash:/etc/postfix/aliases # 邮箱格式将使用 Maildir 格式,而不是 mbox。 home_mailbox = .maildir/ </PRE> <P><A class=image title="image: Note.png" href="http://openbsd-wiki.org/index.php?title=Image:Note.png"><IMG height=36 alt="image: Note.png" src="http://openbsd-wiki.org/images/c/cc/Note.png" width=36 border=0></A> 这里的 /etc/postfix/aliases 文件已由 postfix 提供了,但是还需要多执行一个 postalias 命令来生成 postfix 需要的数据库: </P><PRE># postalias hash:/etc/postfix/aliases </PRE> <P><A class=image title="image: Note.png" href="http://openbsd-wiki.org/index.php?title=Image:Note.png"><IMG height=36 alt="image: Note.png" src="http://openbsd-wiki.org/images/c/cc/Note.png" width=36 border=0></A> 如果需要使用 Sendmail 的 aliases 文件(/etc/aliases),则还需要执行 /usr/local/sbin/newaliases 命令: </P><PRE># /usr/local/sbin/newaliases </PRE><A name=.E8.99.9A.E6.8B.9F.E5.9F.9F></A> <H4><SPAN class=editsection>[<A title="Edit section: 虚拟域" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=55"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>虚拟域</SPAN></H4> <P>以下内容是通过 LDAP 获取虚拟域和虚拟用户的部分: </P><PRE># LDAP Config. transport_maps = hash:/etc/postfix/transport virtual_minimum_uid = 1002 virtual_uid_maps = static:1002 virtual_gid_maps = static:1002 virtual_mailbox_base = /home/vmail/domains virtual_mailbox_maps = ldap:accounts accounts_server_host = 127.0.0.1 #accounts_server_port = 389 accounts_search_base = o=domains,dc=bibby,dc=org accounts_query_filter = (&(mail=%s)(objectClass=CourierMailAccount)) accounts_result_attribute = mailbox accounts_bind = no accountsmap_server_host = 127.0.0.1 #accountsmap_server_port = 389 accountsmap_search_base = o=domains,dc=bibby,dc=org accountsmap_query_filter = (&(mail=%s)(objectClass=CourierMailAccount)) accountsmap_result_attribute = mail accountsmap_bind = no virtual_maps = ldap:aliases aliases_server_host = 127.0.0.1 #aliases_server_port = 389 aliases_search_base = o=domains,dc=bibby,dc=org aliases_query_filter = (&(mail=%s)(objectClass=CourierMailAlias)) aliases_result_attribute = maildrop aliases_bind = no local_recipient_maps = $alias_maps $virtual_mailbox_maps </PRE> <P><A class=image title="image: Warnning.png" href="http://openbsd-wiki.org/index.php?title=Image:Warnning.png"><IMG height=32 alt="image: Warnning.png" src="http://openbsd-wiki.org/images/3/3f/Warnning.png" width=32 border=0></A> 请将这里的 o=domains,dc=bibby,dc=org 替换成你自己设置好的 LDAP 结构。 </P> <P><A class=image title="image: Warnning.png" href="http://openbsd-wiki.org/index.php?title=Image:Warnning.png"><IMG height=32 alt="image: Warnning.png" src="http://openbsd-wiki.org/images/3/3f/Warnning.png" width=32 border=0></A> 请留意这里的这几个参数和值: </P> <UL> <LI>transport_maps = hash:/etc/postfix/transport <LI>virtual_mailbox_base = /home/vmail/domains <LI>virtual_minimum_uid = 1002 <LI>virtual_uid_maps = static:1002 <LI>virtual_gid_maps = static:1002 </LI></UL><A name=.2Fetc.2Fpostfix.2Ftransport></A> <H5><SPAN class=editsection>[<A title="Edit section: /etc/postfix/transport" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=56"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>/etc/postfix/transport</SPAN></H5> <UL> <LI>transport_maps = hash:/etc/postfix/transport </LI></UL> <P>Postfix 会从 transport_maps 参数指定的文件中查找虚拟域,所以我们需要在 /etc/postfix/transport 文件中加入我们的虚拟域的信息: </P><PRE>domain1.com virtual: domain2.com virtual: </PRE> <P>编辑完后还需要执行以下命令,否则 Postfix 会报错: </P><PRE># /usr/local/sbin/postmap /etc/postfix/transport </PRE> <P>另外,为了 Postfix 能够解析 domainX.com 的域名,这里将使用 /etc/hosts 文件来负责解析: </P><PRE>127.0.0.1 domain1.com www.domain1.com mail.domain1.com 127.0.0.1 domain2.com www.domain2.com mail.domain2.com </PRE> <P><A class=image title="image: Note.png" href="http://openbsd-wiki.org/index.php?title=Image:Note.png"><IMG height=36 alt="image: Note.png" src="http://openbsd-wiki.org/images/c/cc/Note.png" width=36 border=0></A> 域名解析属于 DNS 服务器的工作,如果您需要让互联网上的其它服务器能够解析你的域名,请设置您的 DNS 服务器。 </P><A name=virtual_mailbox.2Fuid.2Fgid></A> <H5><SPAN class=editsection>[<A title="Edit section: virtual mailbox/uid/gid" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=57"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>virtual mailbox/uid/gid</SPAN></H5> <UL> <LI>virtual_mailbox_base = /home/vmail/domains <LI>virtual_minimum_uid = 1002 <LI>virtual_uid_maps = static:1002 <LI>virtual_gid_maps = static:1002 </LI></UL> <P>这里我们将创建一个新的用户 vmail,用它的 HOME 目录来存放所有域、所有用户的邮件。这里的 UID/GID 都是指 vmail 这个用户的 UID/GID。 </P> <P>创建 vmail 用户和组: </P><PRE># adduser Use option ``-silent'' if you don't want to see all warnings and questions. Reading /etc/shells Check /etc/master.passwd Check /etc/group Ok, let's go. Don't worry about mistakes. There will be a chance later to correct any input. Enter username []: vmail # 输入用户名 Enter full name []: virtual mail holder # 对这个用户的一些描述,可不填 Enter shell csh ksh nologin sh [ksh]: nologin # 使用 nologin 作为 shell,强烈建议 Uid [1000]: 1002 # 指定 UID 号 Login group vmail [vmail]: Login group is ``vmail''. Invite vmail into other groups: guest no [no]: Login class authpf daemon default staff [default]: Enter password []: # 这里直接回车,因为我们不希望 vmail 用户能够登录系统 Set the password so that user cannot logon? (y/n) [n]: y # 输入 y Name: vmail Password: **** Fullname: virtual mail holder Uid: 1002 Gid: 1002 (vmail) Groups: vmail Login Class: default HOME: /home/vmail Shell: /sbin/nologin OK? (y/n) [y]: # 回车即可创建 vmail 用户 </PRE> <P>接下来创建用于存放虚拟域所有用户邮件的目录,并设置权限: </P><PRE># mkdir -p /home/vmail/domains/ # chown -R vmail:vmail /home/vmail/domains # rm -f /home/vmail/.* </PRE> <P>这里的 /home/vmail/domains 下存放所有以虚拟域的域名命名的目录,用于存放各个域内用户的邮件: </P> <UL> <LI>/home/vmail/domains/domain1.com <LI>/home/vmail/domains/domain2.com </LI></UL> <P>所以在 /etc/postfix/main.cf 中设置: </P><PRE>virtual_mailbox_base = /home/vmail/domains </PRE> <P><A class=image title="image: Tip.png" href="http://openbsd-wiki.org/index.php?title=Image:Tip.png"><IMG height=32 alt="image: Tip.png" src="http://openbsd-wiki.org/images/4/45/Tip.png" width=32 border=0></A> 默认情况下,adduser 工具会将 vmail 组的 GID 设置为和 UID 一样。 </P> <P><A class=image title="image: Note.png" href="http://openbsd-wiki.org/index.php?title=Image:Note.png"><IMG height=36 alt="image: Note.png" src="http://openbsd-wiki.org/images/c/cc/Note.png" width=36 border=0></A> 注意这里的 HOME 目录:/home/vmail。这个目录将用于存放所有域用户的邮件,所以可能需要较大空间,请根据自己的实际情况进行规划。 </P> <P><A class=image title="image: Tip.png" href="http://openbsd-wiki.org/index.php?title=Image:Tip.png"><IMG height=32 alt="image: Tip.png" src="http://openbsd-wiki.org/images/4/45/Tip.png" width=32 border=0></A> 如果需要修改 vmail 用户的 HOME 目录,请使用 vipw 命令修改 /etc/passwd 文件: </P><PRE># vipw </PRE> <P>也可以在使用 adduser 命令时加上 -home 参数: </P><PRE># adduser -home /path/to/vmail/home/dir </PRE> <P>它会将 HOME 目录设置为:/path/to/vmail/home/dir/username。 </P> <P><A class=image title="image: Note.png" href="http://openbsd-wiki.org/index.php?title=Image:Note.png"><IMG height=36 alt="image: Note.png" src="http://openbsd-wiki.org/images/c/cc/Note.png" width=36 border=0></A> 你可能注意到了,我们并没有创建这样的目录: </P><PRE>/home/vmail/domains/domain1.com /home/vmail/domains/domain2.com </PRE> <P>因为 Postfix 会自动创建它,所以这里我们不需要创建。 </P><A name=SASL_.E7.94.A8.E6.88.B7.E8.AE.A4.E8.AF.81></A> <H4><SPAN class=editsection>[<A title="Edit section: SASL 用户认证" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=58"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>SASL 用户认证</SPAN></H4> <P>以下内容是通过 SASL 进行用户认证的部分,将它加到 /etc/postfix/main.cf 中: </P><PRE># For SASL auth smtpd_sasl_auth_enable = yes smtpd_sasl_local_domain = smtpd_sasl_security_options = noanonymous broken_sasl_auth_clients = yes smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination </PRE> <P><A class=image title="image: Tip.png" href="http://openbsd-wiki.org/index.php?title=Image:Tip.png"><IMG height=32 alt="image: Tip.png" src="http://openbsd-wiki.org/images/4/45/Tip.png" width=32 border=0></A> 关于如何在 OpenBSD 的 postfix 中配置 sasl 认证,可以在 <B>/usr/local/share/doc/postfix/readme/SASL_README</B> 文件中找到配置的详细信息。 </P> <P><BR>到此,Postfix 的配置就已经完成了,建议您重启系统以进行 Postfix 的 SMTP 测试。 </P><PRE># reboot </PRE><A name=.E6.B5.8B.E8.AF.95_Postfix_.E7.9A.84_SMTP_.E5.8A.9F.E8.83.BD></A> <H2><SPAN class=editsection>[<A title="Edit section: 测试 Postfix 的 SMTP 功能" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=59"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>测试 Postfix 的 SMTP 功能</SPAN></H2> <P>默认情况下,SMTP 服务使用 25 端口监听服务请求。 </P><PRE># telnet localhost 25 Trying ::1... Connected to localhost. Escape character is '^]'. 220 mail.bibby.org ESMTP Postfix #<-- 看到这个就表示 Postfix 在监听 25 端口 helo localhost #<-- 执行 250 mail.bibby.org mail from: bibby@domain1.com #<-- 执行,from 表示发件人 250 2.1.0 Ok rcpt to: bibby@domain1.com #<-- 执行,to 表示收件人 250 2.1.5 Ok data #<-- 执行,data 表示邮件正文 354 End data with <CR><LF>.<CR><LF> hello. #<-- 从这里开始输入邮件正文 Contact me: michaelbibby#gmail.com . #<-- 一个点加回车,表示邮件正文编写完毕 250 2.0.0 Ok: queued as A47D0197B4 #<-- 这里是这封邮件在队列中的编号,您看到的可能和这里的不一样 quit #<-- 执行,退出 telnet 221 2.0.0 Bye Connection closed by foreign host. # </PRE> <P><A class=image title="image: Tip.png" href="http://openbsd-wiki.org/index.php?title=Image:Tip.png"><IMG height=32 alt="image: Tip.png" src="http://openbsd-wiki.org/images/4/45/Tip.png" width=32 border=0></A> 在输入以下两句命令时,Postfix 会查询 LDAP,所以可能会比较慢: </P><PRE>mail from: bibby@domain1.com rcpt to: bibby@domain1.com </PRE> <P>如果这里出现问题,请查看 Postfix 的日志文件以查找问题所在:/var/log/maillog,主要问题应该是在 /etc/postfix/main.cf 文件中 LDAP 的设置上。 </P> <P>这是在 Postfix 的邮件日志(/var/log/maillog)里的内容: </P><PRE>Sep 21 21:15:02 mail postfix/smtpd[2536]: connect from localhost[::1] Sep 21 21:15:21 mail postfix/smtpd[2536]: 4486F197B4: client=localhost[::1] Sep 21 21:15:28 mail postfix/cleanup[25905]: 4486F197B4: message-id=<20070921131521.4486F197B4@mail.bibby.org> Sep 21 21:15:28 mail postfix/qmgr[27062]: 4486F197B4: from=<bibby@domain1.com>, size=333, nrcpt=1 (queue active ) Sep 21 21:15:28 mail postfix/virtual[26736]: 4486F197B4: to=<bibby@domain1.com>, relay=virtual, delay=14, delay s=14/0.05/0/0.01, dsn=2.0.0, status=sent (delivered to maildir) Sep 21 21:15:28 mail postfix/qmgr[27062]: 4486F197B4: removed Sep 21 21:15:30 mail postfix/smtpd[2536]: disconnect from localhost[::1] </PRE> <P>看起来邮件是顺利投递出去了。看看文件系统上是否有邮件文件: </P><PRE># ls /home/vmail/domains/domain1.com/bibby/.maildir/new/ 1190380785.V0If18bM813706.mail.bibby.org </PRE> <P><BR>呵,看来邮件已经正确投递了,看看邮件里的内容是否和刚才发出去的一样: </P><PRE># cat /home/vmail/domains/domain1.com/bibby/.maildir/new/1190380785.V0If18bM813706.mail.bibby.org Return-Path: <bibby@domain1.com> X-Original-To: bibby@domain1.com Delivered-To: bibby@domain1.com Received: from localhost (localhost [IPv6:::1]) by mail.bibby.org (Postfix) with SMTP id 83AC8197B4 for <bibby@domain1.com>; Fri, 21 Sep 2007 21:21:18 +0800 (HKT) Message-Id: <20070921132123.83AC8197B4@mail.bibby.org> Date: Fri, 21 Sep 2007 21:21:18 +0800 (HKT) From: bibby@domain1.com To: undisclosed-recipients:; hello. Contact me: michaelbibby#gmail.com # </PRE> <P>呵,这下放心了。 </P> <P>到此为止,SMTP 服务正常工作。接下来的任务是 POP3/IMAP。 </P><A name=Debug></A> <H2><SPAN class=editsection>[<A title="Edit section: Debug" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=60"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>Debug</SPAN></H2> <P>如果在这里出现了错误,建议给 /etc/postfix/master.cf (第九行)中的 smtpd 加上 -v 参数: </P><PRE>smtp inet n - - - - smtpd -v </PRE><A name=Courier></A> <H1><SPAN class=editsection>[<A title="Edit section: Courier" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=61"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>Courier</SPAN></H1><A name=.E5.AE.89.E8.A3.85_courier-.2A></A> <H2><SPAN class=editsection>[<A title="Edit section: 安装 courier-*" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=62"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>安装 courier-* </SPAN></H2> <P>安装以下软件包: </P> <UL> <LI>courier-authlib <LI>courier-authlib-ldap <LI>courier-imap <LI>courier-pop3 </LI></UL><A name=courier-authlib-ldap></A> <H3><SPAN class=editsection>[<A title="Edit section: courier-authlib-ldap" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=63"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>courier-authlib-ldap</SPAN></H3><PRE># pkg_add courier-authlib-ldap-0.58p1.tgz courier-authlib-ldap-0.58p1:libltdl-1.5.22p1: complete courier-authlib-ldap-0.58p1:courier-authlib-0.58p2: complete courier-authlib-ldap-0.58p1: complete --- courier-authlib-0.58p2 ------------------- Sample configuration files are installed in /etc/courier/. # </PRE><A name=courier-imap></A> <H3><SPAN class=editsection>[<A title="Edit section: courier-imap" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=64"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>courier-imap</SPAN></H3><PRE># pkg_add courier-imap-4.1.1p0.tgz courier-imap-4.1.1p0:gdbm-1.8.3p0: complete courier-imap-4.1.1p0: complete --- courier-imap-4.1.1p0 ------------------- Example config files for Courier-IMAP have been installed in /usr/local/share/examples/courier-imap and copied also to /etc/courier/courier-imap, edit them to your site's needs. Pay particular attention to the details in imapd.cnf, and read ssl(8) if necessary. You MUST set the CN in imapd.cnf to the hostname by which your IMAP server is accessed, or else clients will complain. When this is done, you can use the 'mkimapdcert' script to automatically generate a server certificate, which is installed into /etc/ssl/private/imapd.pem To control the daemon use /usr/local/libexec/imapd.rc and /usr/local/libexec/imapd-ssl.rc, and to run the authdaemon, place the following in /etc/rc.local: mkdir -p /var/run/courier /usr/local/sbin/authdaemond start </PRE><A name=courier-pop3></A> <H3><SPAN class=editsection>[<A title="Edit section: courier-pop3" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=65"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>courier-pop3</SPAN></H3><PRE># pkg_add courier-pop3-4.1.1.tgz courier-pop3-4.1.1: complete --- courier-pop3-4.1.1 ------------------- You now need to edit appropriately the Courier-POP3 configuration files installed in /etc/courier/courier-imap from defaults placed in /usr/local/share/examples/courier-imap. To use POP3-SSL, be sure to read ssl(8) and run the mkpop3dcert script if you require a self-signed certificate. # </PRE><A name=.E9.85.8D.E7.BD.AE_Courier-IMAP.2FPOP3></A> <H2><SPAN class=editsection>[<A title="Edit section: 配置 Courier-IMAP/POP3" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=66"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>配置 Courier-IMAP/POP3</SPAN></H2><A name=.2Fetc.2Fcourier.2Fauthdaemonrc></A> <H3><SPAN class=editsection>[<A title="Edit section: /etc/courier/authdaemonrc" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=67"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>/etc/courier/authdaemonrc</SPAN></H3> <P>告诉 Courier,使用 LDAP 进行认证: </P><PRE>authmodulelist="authldap" authmodulelistorig="authldap" </PRE><A name=.2Fetc.2Fcourier.2Fauthldaprc></A> <H3><SPAN class=editsection>[<A title="Edit section: /etc/courier/authldaprc" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=68"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>/etc/courier/authldaprc</SPAN></H3><PRE># 指定 LDAP 服务器 LDAP_URI ldap://127.0.0.1:389 # 指定从 LDAP 树的哪个子树开始查找 LDAP_BASEDN o=domains,dc=bibby,dc=org #LDAP_BINDDN 这一行需要注释掉 #LDAP_BINDPW 这一行需要注释掉 LDAP_AUTHBIND 1 LDAP_GLOB_UID vmail LDAP_GLOB_GID vmail LDAP_FULLNAME sn </PRE> <P>这里很奇怪的一个问题是,我用该配置文件的示例来写 LDAP_URI 居然报错,提示连接不上 LDAP 服务器: </P><PRE>LDAP_URI ldaps://127.0.0.1 </PRE> <P>而改用 ldap://127.0.0.1:389 却可以。 </P><A name=.2Fetc.2Frc.conf.local_3></A> <H3><SPAN class=editsection>[<A title="Edit section: /etc/rc.conf.local" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=69"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>/etc/rc.conf.local</SPAN></H3><PRE>imapd_flags="" pop3d_flags="" authdaemond_flags="" </PRE><A name=.2Fetc.2Frc.local_3></A> <H3><SPAN class=editsection>[<A title="Edit section: /etc/rc.local" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=70"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>/etc/rc.local</SPAN></H3><PRE># Start the IMAP daemon if [ X"${imapd_flags}" != X"NO" ]; then echo -n ' imap' mkdir /var/run/courier 2>/dev/null /usr/local/libexec/imapd.rc start fi # Start the POP3 daemon if [ X"${pop3d_flags}" != X"NO" ]; then echo -n ' pop3' mkdir /var/run/courier 2>/dev/null /usr/local/libexec/pop3d.rc start fi # Start SASL authdaemond. if [ X"${authdaemond_flags}" != X"NO" ]; then echo -n ' authdaemond' mkdir /var/run/courier-auth 2>/dev/null /usr/local/sbin/authdaemond start fi </PRE> <P>到此,建议重启系统以测试配置。 </P><PRE># reboot </PRE><A name=.E6.B5.8B.E8.AF.95_POP3.2FIMAP></A> <H3><SPAN class=editsection>[<A title="Edit section: 测试 POP3/IMAP" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=71"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>测试 POP3/IMAP</SPAN></H3> <P>重启之后建议使用 Thunderbird 等邮件客户端进行 SMTP/POP3/IMAP 功能的测试。 </P> <P>收发邮件的用户名,填的应该是邮件地址。比如:bibby@domain1.com,而不是:bibby。 </P><A name=Debug_2></A> <H3><SPAN class=editsection>[<A title="Edit section: Debug" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=72"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>Debug</SPAN></H3> <P>在 /etc/courier/authdaemonrc 中有一个关于调试的参数: </P><PRE>##NAME: DEBUG_LOGIN:0 # # Dump additional diagnostics to syslog # # DEBUG_LOGIN=0 - turn off debugging # DEBUG_LOGIN=1 - turn on debugging # DEBUG_LOGIN=2 - turn on debugging + log passwords too DEBUG_LOGIN=0 </PRE> <P>如果需要调试,可以将 DEBUG_LOGIN 的值设置为 1 或者 2。 </P><A name=WebMail></A> <H1><SPAN class=editsection>[<A title="Edit section: WebMail" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=73"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>WebMail</SPAN></H1><A name=SquerrilMail></A> <H2><SPAN class=editsection>[<A title="Edit section: SquerrilMail" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=74"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>SquerrilMail</SPAN></H2> <UL> <LI>从 <A class="external text" title=http://www.squirrelmail.org/download.php href="http://www.squirrelmail.org/download.php" rel=nofollow><FONT color=#0000ff>SquerrilMail</FONT></A> 官方网站的下载页面下载最新版本。 <LI>解压到服务器的 /var/www/htdocs/ 目录: </LI></UL><PRE># bzip2 -d squirrelmail-1.4.10a.tar.bz2 # tar xf squirrelmail-1.4.10a.tar # mv squirrelmail-1.4.10a /var/www/htdocs/mail/ </PRE> <UL> <LI>修改权限: </LI></UL><PRE># chown -R www:www /var/www/htdocs/mail/ </PRE> <UL> <LI>创建目录,用于存放邮件附件等数据: </LI></UL><PRE># mkdir -p /var/www/squirrelmail/data # mkdir /var/www/squirrelmail/attachments # chown www:www /var/www/squirrelmail/data # chgrp www /var/www/squirrelmail/attachments # chmod 730 /var/www/squirrelmail/attachments </PRE> <UL> <LI>配置 SquirrelMail: </LI></UL><PRE># /var/www/htdocs/mail/config/conf.pl </PRE> <P>这里有几个参数需要修改: </P> <UL> <LI> <UL> <LI>Organization Preferences --> Organization Name <LI>Server Settings --> Domain <LI>General Options --> Data Directory (/squirrelmail/data/) <LI>General Options --> Attachment Directory (/squirrelmail/attachments/) <LI>Set pre-defined settings for specific IMAP servers --> courier </LI></UL></LI></UL> <P>因为 Apache 默认是被 chroot 在 /var/www/ 目录下,所以这里的 Data Directory 和 Attachment Directory 目录必须这么写。 </P> <UL> <LI>使用 configtest.php 页面帮助检查设置是否正确: <A class="external free" title=http://your_server_ip/mail/src/configtest.php href="http://your_server_ip/mail/src/configtest.php" rel=nofollow><FONT color=#0000ff>http://your_server_ip/mail/src/configtest.php</FONT></A> </LI></UL> <P><BR>OK,如果没有什么问题的话,现在就可以登录 WebMail 了: <A class="external free" title=http://your_server_ip/mail/ href="http://your_server_ip/mail/" rel=nofollow><FONT color=#0000ff>http://your_server_ip/mail/</FONT></A> </P> <P><A class=image title="image: Squirrelmail_login_openbsd_mail_server.png" href="http://openbsd-wiki.org/index.php?title=Image:Squirrelmail_login_openbsd_mail_server.png"><IMG height=287 alt="image: Squirrelmail_login_openbsd_mail_server.png" src="http://openbsd-wiki.org/images/0/0a/Squirrelmail_login_openbsd_mail_server.png" width=411 border=0></A> </P><A name=Plugins></A> <H3><SPAN class=editsection>[<A title="Edit section: Plugins" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=75"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>Plugins</SPAN></H3><A name=change_ldappass></A> <H4><SPAN class=editsection>[<A title="Edit section: change_ldappass" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=76"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>change_ldappass</SPAN></H4> <UL> <LI>Download <A class="external text" title=http://www.squirrelmail.org/plugin_view.php?id=26 href="http://www.squirrelmail.org/plugin_view.php?id=26" rel=nofollow><FONT color=#0000ff>'change_ldappass'</FONT></A> </LI></UL><A name=Extmail></A> <H2><SPAN class=editsection>[<A title="Edit section: Extmail" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=77"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>Extmail</SPAN></H2> <UL> <LI>Contact me if you have well documented article of extmail on OpenBSD: <A class="external text" title=mailto:michaelbibby@gmail.com href="mailto:michaelbibby@gmail.com" rel=nofollow><FONT color=#0000ff>Bibby(张煌彬)</FONT></A> </LI></UL><A name=Resource_Links></A> <H1><SPAN class=editsection>[<A title="Edit section: Resource Links" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=78"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>Resource Links</SPAN></H1><A name=LDAP></A> <H2><SPAN class=editsection>[<A title="Edit section: LDAP" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=79"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>LDAP</SPAN></H2> <UL> <LI><A class="external text" title=http://www.openldap.org href="http://www.openldap.org/" rel=nofollow><FONT color=#0000ff>OpenLDAP</FONT></A> <LI><A class="external text" title=http://www.5dmail.net/html/2003-10-24/2003102492328.htm href="http://www.5dmail.net/html/2003-10-24/2003102492328.htm" rel=nofollow><FONT color=#0000ff>什么是 LDAP</FONT></A> </LI></UL><A name=Postfix_2></A> <H2><SPAN class=editsection>[<A title="Edit section: Postfix" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=80"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>Postfix</SPAN></H2> <UL> <LI><A class="external text" title=http://www.postfix.org href="http://www.postfix.org/" rel=nofollow><FONT color=#800080>Postfix</FONT></A> <LI><A class="external text" title=http://www.chinalinuxpub.com/read.php?wid=519 href="http://www.chinalinuxpub.com/read.php?wid=519" rel=nofollow><FONT color=#0000ff>Postfix 配置文件 main.cf 中常用参数介绍</FONT></A> </LI></UL><A name=Revision></A> <H1><SPAN class=editsection>[<A title="Edit section: Revision" href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier&action=edit&section=81"><FONT color=#0000ff>edit</FONT></A>]</SPAN> <SPAN class=mw-headline>Revision</SPAN></H1> <UL> <LI>2007.10.18:指出了 SASL 的日志文件的位置。 Thanks to atyu30. <LI>2007.10.15:在 <A class="external text" title=http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#Generic href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier#Generic" rel=nofollow><FONT color=#0000ff>配置 Postfix 的 main.cf(Generic)</FONT></A> 部分,明确指出需要执行 postalias 命令,生成 alias 数据库。Thanks to atyu30. <LI>修正 slapd.conf 的配置参数 database 的默认值为 ldbm。感谢 <A class="external text" title=http://www.openbsdonly.org href="http://www.openbsdonly.org/" rel=nofollow><FONT color=#0000ff>OpenBSDonly.org</FONT></A> 上的 atyu30. <LI>去掉 OpenLDAP 在 /etc/rc.conf.local 文件中的参数定义里多余的一个 '&' 符号。 </LI></UL><!-- Saved in parser cache with key etherpun_openbsdwiki-mw_:pcache:idhash:1489-0!1!0!!en!2 and timestamp 20080415031319 --> <DIV class=printfooter>Retrieved from "<A href="http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier"><FONT color=#0000ff>http://openbsd-wiki.org/index.php?title=%28zh_CN%29OpenBSD%284.1%29%2BPostfix%2BOpenLDAP%2BCyrus-SASL%2BCourier</FONT></A>"</DIV> <DIV id=catlinks> <P class=catlinks><A title=Special:Categories href="http://openbsd-wiki.org/index.php?title=Special:Categories"><FONT color=#0000ff>Categories</FONT></A>: <SPAN dir=ltr><A title=Category:4.1 href="http://openbsd-wiki.org/index.php?title=Category:4.1"><FONT color=#0000ff>4.1</FONT></A></SPAN> | <SPAN dir=ltr><A title=Category:Chinese href="http://openbsd-wiki.org/index.php?title=Category:Chinese"><FONT color=#0000ff>Chinese</FONT></A></SPAN> | <SPAN dir=ltr><A title="Category:Zh CN" href="http://openbsd-wiki.org/index.php?title=Category:Zh_CN"><FONT color=#0000ff>Zh CN</FONT></A></SPAN> | <SPAN dir=ltr><A title=Category:Mail href="http://openbsd-wiki.org/index.php?title=Category:Mail"><FONT color=#0000ff>Mail</FONT></A></SPAN> | <SPAN dir=ltr><A class=new title=Category:Postfix href="http://openbsd-wiki.org/index.php?title=Category:Postfix&action=edit"><FONT color=#0000ff>Postfix</FONT></A></SPAN></P></DIV></DIV></DIV>
查看全文
发表于:2008-04-15 ┆
阅读(699)
┆
评论(0)
下载mailman程序并安装
<DIV> <TABLE class=t_msg cellSpacing=0 cellPadding=4 bgColor=#f0f3fa border=0> <TBODY> <TR> <TD class=line style="PADDING-TOP: 10px" vAlign=top height="100%"> <DIV class=t_msgfont id=message8111099><B>推荐结合我们推出的免费邮件系统解决方案使用,本案例已经在实际环境中验证通过,其中域名部分请按照您的实际情况修改</B><BR><A href="http://bbs.freesinno.com/viewtopic.php?f=10&t=15" target=_blank><FONT color=#0000ff>http://bbs.freesinno.com/viewtopic.php?f=10&t=15</FONT></A><BR><BR><FONT size=150><B>下载mailman程序并安装</B></FONT><BR># cd /tmp<BR># wget <A href="http://jaist.dl.sourceforge.net/sourceforge/mailman/mailman-2.1.9.tgz" target=_blank><FONT color=#0000ff>http://jaist.dl.sourceforge.net/ ... n/mailman-2.1.9.tgz</FONT></A><BR># tar xvf mailman-2.1.9.tgz<BR># cd mailman-2.1.9<BR># ./configure --prefix=/opt/FreeSInno/Mail/mailman \<BR>--with-username=freesinno.com \<BR>--with-groupname=freesinno.com \<BR>--with-mail-gid=1111 \<BR>--with-cgi-gid=1111 \<BR>--with-mailhost=lists.freesinno.com \<BR>--with-urlhost=lists.freesinno.com<BR># make<BR># make install<BR><BR><FONT size=150><B>配置mailman</B></FONT><BR># cd /opt/FreeSInno/Mail/mailman<BR># touch data/aliases<BR># touch data/virtual-mailman<BR># vi Mailman/mm_cfg.py<BR>增加如下部分<BR><BR> <DIV class=msgbody> <DIV class=msgheader> <DIV class=right><A class=smalltxt onclick="copycode($('code0'));" href="http://bbs.chinaunix.net/thread-1068668-1-1.html###"><FONT color=#800080>[Copy to clipboard]</FONT></A> <A class=smalltxt onclick="toggle_collapse('code0');" href="http://bbs.chinaunix.net/thread-1068668-1-1.html###"><FONT color=#800080>[ <SPAN id=code0_symbol>-</SPAN> ]</FONT></A></DIV>CODE:</DIV> <DIV class=msgborder id=code0 style="font-family:Fixdays">DEFAULT_EMAIL_HOST = 'lists.freesinno.com'<BR>DEFAULT_URL_HOST = 'lists.freesinno.com'<BR>DEFAULT_URL_PATTERN = 'http://%s/mailman/'<BR>MTA = 'Postfix'<BR>POSTFIX_STYLE_VIRTUAL_DOMAINS = ['lists.freesinno.com','freesinno.com']<BR>add_virtualhost('lists.freesinno.com','freesinno.com')<BR>DEFAULT_SERVER_LANGUAGE = 'zh_CN'</DIV></DIV><BR># 执行配置自动检查和修复<BR># ./bin/check_perms -f<BR># ./bin/genaliases<BR># 创建邮件列表mailman<BR># ./bin/newlist mailman<BR>Enter the email of the person running the list: (<FONT color=#404000>这里输入邮件列表所有者的邮件地址</FONT>)<BR>Initial public password: (<FONT color=#404000>这里输入管理密码</FONT>)<BR>Hit enter to notify public owner...(<FONT color=#404000>回车</FONT>)<BR># 把用户添加到邮件列表里测试一下,建一个文本文件,比如members.txt,一行一个邮件地址,然后执行如下命令<BR># ./bin/add_members -n members.txt mailman<BR><BR># 修改mailman管理界面的管理员密码,以便通过界面认证后能够通过界面创建和操作邮件列表<BR># ./bin/mmsitepass<BR><FONT size=150><B>配置Postfix</B></FONT><BR># vi /etc/postfix/main.cf<BR><BR> <DIV class=msgbody> <DIV class=msgheader> <DIV class=right><A class=smalltxt onclick="copycode($('code1'));" href="http://bbs.chinaunix.net/thread-1068668-1-1.html###"><FONT color=#800080>[Copy to clipboard]</FONT></A> <A class=smalltxt onclick="toggle_collapse('code1');" href="http://bbs.chinaunix.net/thread-1068668-1-1.html###"><FONT color=#800080>[ <SPAN id=code1_symbol>-</SPAN> ]</FONT></A></DIV>CODE:</DIV> <DIV class=msgborder id=code1 style="font-family:Fixdays">#myorigin = $mydomain #建议注释掉myorigin(不注释该行mailman将无法使用,原因暂时不明)<BR>virtual_alias_domains = lists.freesinno.com<BR>recipient_delimiter = +<BR>owner_request_special = no<BR>alias_maps = hash:/opt/FreeSInno/Mail/mailman/data/aliases<BR>virtual_alias_maps = hash:/opt/FreeSInno/Mail/mailman/data/virtual-mailman,mysql:/opt/FreeSInno/Mail/postfix/etc/mysql_virtual_alias_maps.cf<BR>transport_maps = hash:/etc/postfix/transport</DIV></DIV><BR># vi /etc/postfix/transport<BR><BR> <DIV class=msgbody> <DIV class=msgheader> <DIV class=right><A class=smalltxt onclick="copycode($('code2'));" href="http://bbs.chinaunix.net/thread-1068668-1-1.html###"><FONT color=#800080>[Copy to clipboard]</FONT></A> <A class=smalltxt onclick="toggle_collapse('code2');" href="http://bbs.chinaunix.net/thread-1068668-1-1.html###"><FONT color=#800080>[ <SPAN id=code2_symbol>-</SPAN> ]</FONT></A></DIV>CODE:</DIV> <DIV class=msgborder id=code2 style="font-family:Fixdays">insert into transport set domain='lists.freesinno.com',destination='local:';</DIV></DIV><BR># /opt/FreeSInno/Mail/postfix/sbin/postmap /etc/postfix/transport<BR><BR><FONT size=150><B>配置mailman的web配置,这里以httpd.conf的虚拟主机为例</B></FONT><BR># vi /opt/FreeSInno/LAMPP/etc/apache/wwwconf/maillists.conf<BR><BR> <DIV class=msgbody> <DIV class=msgheader> <DIV class=right><A class=smalltxt onclick="copycode($('code3'));" href="http://bbs.chinaunix.net/thread-1068668-1-1.html###"><FONT color=#800080>[Copy to clipboard]</FONT></A> <A class=smalltxt onclick="toggle_collapse('code3');" href="http://bbs.chinaunix.net/thread-1068668-1-1.html###"><FONT color=#800080>[ <SPAN id=code3_symbol>-</SPAN> ]</FONT></A></DIV>CODE:</DIV> <DIV class=msgborder id=code3 style="font-family:Fixdays"><VirtualHost *:80><BR>ServerName lists.freesinno.com<BR>ScriptAlias /mailman "/opt/FreeSInno/Mail/mailman/cgi-bin"<BR><Directory "/opt/FreeSInno/Mail/mailman/cgi-bin"><BR>AllowOverride None<BR>Options none<BR>Order allow,deny<BR>Allow from all<BR></Directory><BR>Alias /pipermail "/opt/FreeSInno/Mail/mailman/archives/public"<BR><Directory "/opt/FreeSInno/Mail/mailman/archives/"><BR>AllowOverride None<BR>Options +FollowSymlinks<BR>Order allow,deny<BR>Allow from all<BR></Directory><BR>CustomLog "| /opt/FreeSInno/LAMPP/share/cronolog/sbin/cronolog /opt/FreeSInno/LAMPP/apache/logs/maillists/access_log.%Y%m%d" combined<BR></VirtualHost></DIV></DIV><BR><FONT size=150><B>配置完成,重启httpd、postfix、mailman即可</B></FONT><BR>使用以下链接登录mailman的管理员界面<BR><A href="http://lists.freesinno.com/mailman/admin" target=_blank><FONT color=#0000ff>http://lists.freesinno.com/mailman/admin</FONT></A><BR>使用以下链接查看当前主机的所有邮件列表<BR><A href="http://lists.freesinno.com/pipermail" target=_blank><FONT color=#0000ff>http://lists.freesinno.com/pipermail</FONT></A><BR><BR>本帖转自:<A href="http://bbs.freesinno.com/viewtopic.php?f=10&t=25" target=_blank><FONT color=#0000ff>http://bbs.freesinno.com/viewtopic.php?f=10&t=25</FONT></A><BR><BR>[<I> 本帖最后由 copywu 于 2008-3-21 14:51 编辑 </I>]</DIV><BR style="CLEAR: both"><FONT style="FONT: 12px song, Verdana; COLOR: #000000"><BR><BR></FONT></TD></TR> <TR> <TD>您对本贴的看法:<A href="http://bbs.chinaunix.net/postappraise.php?action=sustain&fid=14&tid=1068668&pid=8111099&page=1&extra=page%3D1"><FONT color=#0000ff>鲜花[0]</FONT></A> <A href="http://bbs.chinaunix.net/postappraise.php?action=oppose&fid=14&tid=1068668&pid=8111099&page=1&extra=page%3D1"><FONT color=#0000ff>臭蛋[0]</FONT></A></TD></TR> <TR> <TD vAlign=bottom><BR>__________________________________<BR><BR>提供专业网络监控告警解决方案<BR>http://www.freesinno.com<BR><BR>Demo<BR>http://demo.freesinno.com<BR></TD></TR></TBODY></TABLE></DIV>
查看全文
发表于:2008-04-03 ┆
阅读(378)
┆
评论(0)
邮件服务器文挡学习列表
<DIV><BR>邮件服务器文挡学习列表</DIV> <DIV><BR>主要是linux下的邮件服务器的配置使用<BR>还有exchange2003等<BR> </DIV> <DIV> </DIV> <DIV> </DIV> <DIV> <BR>Qmail<BR>QMAIL下的主要配置文件<BR>[url] <A href="http://www.ixpub.net/615228.html[/url">http://www.ixpub.net/615228.html[/url</A>]<BR>Qmail郵件隊列工作原理 <BR>[url] <A href="http://www.ixpub.net/615234.html[/url">http://www.ixpub.net/615234.html[/url</A>]<BR>QMAIL 完全攻略 <BR><A href="http://www.ixpub.net/611827.html">http://www.ixpub.net/611827.html</A><BR>Life with qmail -- 中文版(英文版本2 Jan 2006) <BR><A href="http://www.ixpub.net/615388.html">http://www.ixpub.net/615388.html</A><BR>Qmail常见问题解决办法 <BR><A href="http://www.ixpub.net/611989.html">http://www.ixpub.net/611989.html</A><BR> </DIV> <DIV> </DIV> <DIV> </DIV> <DIV><BR>qmail邮件系统<BR>(一)qmail邮件系统Qmail系统的介绍和准备工作 <BR><A href="http://www.ixpub.net/619287.html">http://www.ixpub.net/619287.html</A><BR>(二)qmail邮件系统安装 <BR><A href="http://www.ixpub.net/619288.html">http://www.ixpub.net/619288.html</A><BR>(三)qmail邮件系统qmail的工作原理和配置文件的设置 <BR><A href="http://www.ixpub.net/619289.html">http://www.ixpub.net/619289.html</A><BR>(四)qmail邮件系统ucspi-tcp的原理和设置 <BR><A href="http://www.ixpub.net/619290.html">http://www.ixpub.net/619290.html</A><BR>(五)vpopmail和qmailadmin对用户的管理 <BR><A href="http://www.ixpub.net/619291.html">http://www.ixpub.net/619291.html</A><BR>(六)qmail的日志和管理 ( 1 2 )<BR><A href="http://www.ixpub.net/619292.html">http://www.ixpub.net/619292.html</A><BR> </DIV> <DIV> </DIV> <DIV><BR>思爱普天地 </DIV> <DIV>Linux邮件服务器配置<BR><A href="http://www.ixpub.net/619280.html">http://www.ixpub.net/619280.html</A><BR>安装内容过滤反垃圾邮件 <BR><A href="http://www.ixpub.net/619285.html">http://www.ixpub.net/619285.html</A><BR>OUTLOOK EXPRESS出错信息代码表 <BR><A href="http://www.ixpub.net/619284.html">http://www.ixpub.net/619284.html</A><BR>Exchange.Server.2003.技术参考指南<BR><A href="http://www.ixpub.net/618879.html">http://www.ixpub.net/618879.html</A><BR> </DIV> <DIV> </DIV> <DIV> </DIV> <DIV><BR>邮件基础知识<BR>Email邮件头揭密(基础知识) <BR><A href="http://www.ixpub.net/619281.html">http://www.ixpub.net/619281.html</A><BR> </DIV> <DIV> </DIV> <DIV> </DIV> <DIV>邮件常见问题解析<BR>邮件群发的事故处理 <BR><A href="http://www.ixpub.net/619286.html">http://www.ixpub.net/619286.html</A><BR>关于Postfix 的FAQ 整理 <BR><A href="http://www.ixpub.net/618508.html">http://www.ixpub.net/618508.html</A><BR> </DIV>
查看全文
发表于:2008-04-02 ┆
阅读(357)
┆
评论(0)
MAIL工作原理
<DIV><STRONG><FONT size=2>smtp协议的基本结构</FONT></STRONG> <DIV><SPAN class=421132407-22032007><BR><FONT size=2>smtp (simple mail transfer protocol)协议是为了保证电子邮件的可靠和高效传送。tcp/ip 协议的应用层中包含有smtp协议,但事实上它与传输系统和机制无关,仅要求一个可靠的数据流通道。它可以工作在tcp上,也可以工作在ncp, nits 等协议上。在tcp上,它使用端口25进行传输。smtp的一个重要特点是可以在可交互的通信系统中转发邮件。 <BR><BR>1. smtp的模型 <BR>smtp提供了一种邮件传输的机制,当收件方和发件方都在一个网络上时,可以把邮件直传给对方;当双方不在同一个网络上时,需要通过一个或几个中间服务器转发。smtp首先由发件方提出申请,要求与接收方smtp建立双向的通信渠道,收件方可以是最终收件人也可以是中间转发的服务器。收件方服务器确认可以建立连接后,双发就可以开始通信。下面是smtp的模型示意图。 <BR clear=all></FONT> <DIV><IMG alt="" src="http://www.cnfan.net/uploadfile/mail_system/uploadfile/200801/20080122100517846.jpg" border=0><BR><FONT size=2>发件方smtp向收件方发处mail命令,告知发件方的身份;如果收件方接受,就会回答ok。发件方再发出rcpt命令,告知收件人的身份,收件方smtp确认是否接收或转发,如果同意就回答ok;接下来就可以进行数据传输了。通信过程中,发件方smtp与收件方smtp 采用对话式的交互方式,发件方提出要求,收件方进行确认,确认后才进行下一步的动作。整个过程由发件方控制,有时需要确认几回才可以。 <BR></FONT><IMG alt="" src="http://www.cnfan.net/uploadfile/mail_system/uploadfile/200801/20080122100517752.jpg" border=0><BR><FONT size=2>为了保证回复命令的有效,smtp要求发件方必须提供接收方的服务器及邮箱。邮件的命令和答复有严格的语法定义,并且回复具有相应的数字代码。所有的命令由ascii码组成。命令代码是大小写无关的,如mail和 mail ﹑mail是等效的。 <BR><BR>2. smtp的基本命令 <BR>smtp定义了14个命令,它们是: <BR><BR>helo <SPAN class=421132407-22032007> </SPAN>mail from: <SPAN class=421132407-22032007> </SPAN>rcpt to: <SPAN class=421132407-22032007> </SPAN>data <SPAN class=421132407-22032007> </SPAN>rset <SPAN class=421132407-22032007> </SPAN>send from: <SPAN class=421132407-22032007> </SPAN>soml from: <SPAN class=421132407-22032007> </SPAN>saml from: <SPAN class=421132407-22032007> </SPAN>vrfy <SPAN class=421132407-22032007> </SPAN>expn <SPAN class=421132407-22032007> </SPAN>help [ ] <SPAN class=421132407-22032007> </SPAN>noop <SPAN class=421132407-22032007> </SPAN>quit <SPAN class=421132407-22032007> </SPAN>turn </FONT></DIV> <DIV><BR><FONT size=2>其中使得smtp工作的基本的命令有7个,分别为:helo﹑mail﹑rcpt﹑data﹑rest﹑noop和quit.下面分别介绍如下。 <BR><BR><FONT color=#808080><FONT color=#000000>helo--发件方问候收件方,后面是发件人的服务器地址或标识。收件方回答ok时标识自己的身份。问候和确认过程表明两台机器可以进行通信,同时状态参量被复位,缓冲区被清空。 <BR><BR>mail--这个命令用来开始传送邮件,它的后面跟随发件方邮件地址(返回邮件地址)。它也用来当邮件无法送达时,发送失败通知。为保证邮件的成功发送,发件方的地址应是被对方或中间转发方同意接受的。这个命令会清空有关的缓冲区,为新的邮件做准备。 <BR><BR>rcpt --这个命令告诉收件方收件人的邮箱。当有多个收件人时,需要多次使用该命令,每次只能指明一个人。如果接收方服务器不同意转发这个地址的邮件,它必须报550错误代码通知发件方。如果服务器同意转发,它要更改邮件发送路径,把最开始的目的地(该服务器)换成下一个服务器。 <BR><BR>data--收件方把该命令之后的数据作为发送的数据。数据被加入数据缓冲区中,以单独一行是"."的行结束数据。结束行对于接收方同时意味立即开始缓冲区内的数据传送,传送结束后清空缓冲区。如果传送接受,接收方回复ok。 <BR><BR>rest--这个命令用来通知收件方复位,所有已存入缓冲区的收件人数据,发件人数据和待传送的数据都必须清除,接收放必须回答ok. <BR><BR>noop--这个命令不影响任何参数,只是要求接收放回答ok, 不会影响缓冲区的数据。 <BR><BR>quit--smtp要求接收放必须回答ok,然后中断传输;在收到这个命令并回答ok前,收件方不得中断连接,即使传输出现错误。发件方在发出这个命令并收到ok答复前,也不得中断连接。</FONT> <BR></FONT><BR></FONT><FONT color=#808080><FONT size=2>下面是smtp答复中用到的代码和含义: <BR><BR>500 syntax error, command unrecognized <BR>[this may include errors such as command line too long] <BR>501 syntax error in parameters or arguments <BR>502 command not implemented <BR>503 bad sequence of commands <BR>504 command parameter not implemented <BR>211 system status, or system help reply <BR>214 help message <BR>[information on how to use the receiver or the meaning of a <BR>particular non-standard command; this reply is useful only to the human user] <BR>220 service ready <BR>221 service closing transmission channel <BR>421 service not available, closing transmission channel <BR>[this may be a reply to any command if the service knows it must shut down] <BR>250 requested mail action okay, completed <BR>251 user not local; will forward to <BR>450 requested mail action not taken: mailbox unavailable <BR>[e.g., mailbox busy] <BR>550 requested action not taken: mailbox unavailable <BR>[e.g., mailbox not found, no access] <BR>451 requested action aborted: error in processing <BR>551 user not local; please try <BR>452 requested action not taken: insufficient system storage <BR>552 requested mail action aborted: exceeded storage allocation <BR>553 requested action not taken: mailbox name not allowed <BR>[e.g., mailbox syntax incorrect] <BR>354 start mail input; end with . <BR>554 transaction failed</FONT> </FONT></DIV><FONT size=2> <DIV><BR>最后,让我们看一个rfc821中给出的例子。这封信是smith在主机alpha.arpa 发给主机beta.arpa上的 <BR>jones,green和 brown.并且假定两台主机在同一个网络上。 <BR><BR>s: mail from: <BR>r: 250 ok <BR>s: rcpt to: <BR>r: 250 ok <BR>s: rcpt to: <BR>r: 550 no such user here <BR>s: rcpt to: <BR>r: 250 ok <BR>s: data <BR>r: 354 start mail input; end with . <BR>s: blah blah blah... <BR>s: ...etc. etc. etc. <BR>s: . <BR>r: 250 ok <BR>邮件最后被对方接受。 <BR></DIV> <DIV><BR><BR><STRONG>电子邮件的工作原理</STRONG> <BR><BR><BR>电子邮件与普通邮件有类似的地方,发信者注明收件人的姓名与地址(即邮件地址),发送方服务器把邮件传到收件方服务器,收件方服务器再把邮件发到收件人的邮箱中。如下图所示: <BR></DIV></FONT> <DIV><IMG alt="" src="http://www.cnfan.net/uploadfile/mail_system/uploadfile/200801/20080122100517433.jpg" border=0><BR><FONT size=2>更进一步的解释涉及到以下几个概念: <BR><BR>mua -- mail user agent, 邮件用户代理,帮助用户读写邮件。比如我们常用的outlook,foxmail程序就是; <BR><BR>mta -- mail transport agent, 邮件传输代理,负责把邮件由一个服务器传到另一个服务,比如你公司的邮件服务器,你使用sina信箱来发邮件拿sina的邮件服务器就是;<BR><BR>器或邮件投递代理; <BR><BR>mda -- mail delivery agent, 邮件投递代理,把邮件放到用户的邮箱里,比如你发给对方邮件地址,那对方邮件地址对应的邮件服务器就是,由此可见<U>你的邮件服务器在你接收邮件的时候就是mda,在你发送邮件的时候它就是mta。 <BR></U><BR>整个邮件传输过程如下: <BR><BR>目前使用的smtp 协议是存储转发协议,意味着它允许邮件通过一系列的服务器发送到最终目的地。服务器在一个队列中存储到达的邮件,等待发送到下一个目的地。下一个目的地可以是本地用户,或者是另一个邮件服务器,如下图所示。 </FONT></DIV> <DIV><IMG alt="" src="http://www.cnfan.net/uploadfile/mail_system/uploadfile/200801/20080122100517866.gif" border=0><BR><FONT size=2>如果下游的服务器暂时不可用,mta 就暂时在队列中保存信件,并在以后尝试发送。 <BR><BR><BR><STRONG>电子邮件的信头结构及分析 </STRONG></FONT></DIV><FONT size=2><STRONG> <DIV><BR></DIV> <DIV><FONT size=2></FONT> </DIV> <DIV><FONT size=2><SPAN class=421132407-22032007>6.</SPAN> hi, jack <BR><BR>7. this mail is to explain you the mail format <BR><BR>8. - - - - <BR><BR>9. thanks <BR><BR>10. bob <BR><BR>其中, 1~~4 行称作信件信头(message header) 6~~10行描述信件要表达的内容,称为信体 (message body)。第5行是空行,根据rfc822的要求,信头和信体之间必须加入一空行。[i]信头通常包含字段from, to, subject 和date,有的邮件还包含cc,bcc等字段。 <BR><BR>2. 邮件的信头 <BR><BR>事实上,邮件在传输过程中,服务器要把它打包成一个数据对象,包括上面的信件和一个信封。邮件的投递是依靠信封上的地址或信封信头(envelop address 或envelop header),而不是上面讲的信件上的地址。 <BR><BR>从表面上看,一封邮件是从发件人的机器直接传送到收件人的机器,但通常这并不正确,一封邮件发送和接受过程至少要经过四台计算机。参考下图所示。用户通常在自己的电脑前编写阅读邮件,我们把它叫做客户端 (client 1~~4 )。大部分组织里,都是用一台专门的机器处理邮件,称作邮件服务器 (smtp1, smtp2). 如果用户是从家里拨号上网,那末邮件服务器是isp 提供的。 <BR></FONT></DIV> <DIV><IMG alt="" src="http://www.cnfan.net/uploadfile/mail_system/uploadfile/200801/20080122100522786.gif" border=0><BR><FONT size=2>当某个用户在自己的电脑 client1 前编写完一个邮件,然后把它发送到他的isp 的邮件服务器smtp1。此时她的机器已经完成了所有的工作,但邮件服务器smtp1还必须想法把邮件发送到目的地。smtp1 通过阅读信头或信封上的地址,找到收件认得邮件服务器smtp2, 然后与该服务器建立连接,把邮件发到收件人的服务器上,等待收件人来取阅。 <BR><BR>下面我们将通过一个例子说明整个邮件传送过程及邮件的信头变化。假设发件人的名字叫 sender, email地址是 </FONT><A title=mailto:sender@domain1.com?subject= href="mailto:sender@domain1.com?subject=" target=""><FONT title=mailto:sender@domain1.com?subject= color=#0000ff size=2>sender@domain1.com</FONT></A><FONT size=2>使用的电脑名字叫 client1, ip 地址是 [111.11.1.1] (假设的地址)。 收件人的名字叫 receipt, email 地址是 receipt@domain2.com, 使用的电脑的名字叫 client2,ip 地址是 [222.22.2.2] (假设的地址)。当邮件编辑完传送给其邮件服务器mail.domain1.com 时,邮件的信头格式为: <BR><BR>from: </FONT><A title=mailto:sender@domain1.com?subject= href="mailto:sender@domain1.com?subject=" target=""><FONT title=mailto:sender@domain1.com?subject= color=#0000ff size=2>sender@domain1.com</FONT></A><FONT size=2> <BR><BR>to: </FONT><A title=mailto:receipt@domain2.com?subject= href="mailto:receipt@domain2.com?subject=" target=""><FONT title=mailto:receipt@domain2.com?subject= color=#0000ff size=2>receipt@domain2.com</FONT></A><FONT size=2> <BR><BR>date: tue, mar 18 1998 15:36:24 gmt <BR><BR>x-mailer:sendmail 8.9.0 <BR><BR>subject: greetings <BR><BR>当邮件服务器 mail.domain1.com 把邮件传到接收方的服务器 mail.domain2.com 时,接受方服务器会在信头上记录下有关的计算机信息,邮件的信头变成: <BR><BR>received: from client1.domain1.com (client1.domain1.com [111.11.1.1]) by mail.domain1.com (8.8.5) id 004a21; tue, mar 18 1998 15:3 7:24 gmt <BR><BR>from: </FONT><A title=mailto:sender@domain1.com?subject= href="mailto:sender@domain1.com?subject=" target=""><FONT title=mailto:sender@domain1.com?subject= color=#0000ff size=2>sender@domain1.com</FONT></A><FONT size=2> <BR><BR>to: </FONT><A title=mailto:receipt@domain2.com?subject= href="mailto:receipt@domain2.com?subject=" target=""><FONT title=mailto:receipt@domain2.com?subject= color=#0000ff size=2>receipt@domain2.com</FONT></A><FONT size=2> <BR><BR>date: tue, mar 18 1998 15:36:24 gmt <BR><BR>message-id: <BR><BR>x-mailer:sendmail 8.9.0 <BR><BR>subject: greetings <BR><BR>当收件人服务器mail.domain2.com 把邮件接收并存初下来,等待收件人来阅读时,邮件的信头将会再加入一条记录: <BR><BR>received: from mail.domain1.com (mail.domain1.com [111.11.1.0] ) by mail.domain2.com (8.8.5/8.7.2) with esmtp id laa20869; tue, mar 18 1998 15:39:44 gmt <BR><BR>received: from client1.domain1.com (client1.domain1.com [111.11.1.1]) by mail.domain1.com (8.8.5) id 004a21; tue, mar 18 1998 15:37:24 gmt <BR><BR>from: </FONT><A title=mailto:sender@domain1.com?subject= href="mailto:sender@domain1.com?subject=" target=""><FONT title=mailto:sender@domain1.com?subject= color=#0000ff size=2>sender@domain1.com</FONT></A><FONT size=2> <BR><BR>to: </FONT><A title=mailto:receipt@domain2.com?subject= href="mailto:receipt@domain2.com?subject=" target=""><FONT title=mailto:receipt@domain2.com?subject= color=#0000ff size=2>receipt@domain2.com</FONT></A><FONT size=2> <BR><BR>date: tue, mar 18 1998 15:36:24 gmt <BR><BR>message-id: <BR><BR>x-mailer:sendmail 8.9.0 <BR><BR>subject: greetings <BR><BR>上面整个记录就将是收件人看到的完整的邮件信头。让我们逐行看一下信头中各行的含义: <BR><BR>received: from mail.domain1.com (mail.domain1.com [111.11.1.0] ) by mail.domain2.com (8.8.5/8.7.2) with esmtp id laa20869; tue, mar 18 1998 15:39:44 gmt <BR><BR>这封信是从一台自称为 mail.domain1.com 的机器上接收的;这台机器的ip 地址是[111.11.1.0],真实名字就是标称名字 mail.domain1.com; 接收方的机器名称是 mail.domain2.com, 运行的邮件服务器是 sendmail, 版本(8.8.5/8.7.2) 。接收方机器给邮件的编号是esmtp id laa20869, 接收到的时间是 tue, mar 18 1998 15:39:44 gmt。 <BR><BR>received: from client1.domain1.com (client1.domain1.com [111.11.1.1]) by mail.domain1.com (8.8.5) id 004a21; tue, mar 18 1998 15:37:24 gmt <BR><BR>这条记录表明信件是由机器client1.domain1.com ( ip 地址是 [111.11.1.1]) 在tue, mar 18 1998 15:37:24 gmt交给mail.domain1.com,并赋给编号id 004a21。 <BR><BR>from,to ,date和subject 都易于理解,分别指明发件人,收件人,信件编辑日期及信件主题。 <BR><BR>message-id: <BR><BR>这是由发件方邮件服务器赋给这封邮件的编号。与其它编号不同,这个编号自始至终跟随邮件。 </FONT></DIV></STRONG></FONT></SPAN></DIV></DIV>
查看全文
发表于:2008-03-24 ┆
阅读(502)
┆
评论(0)
Linux9下Mail服务器架设攻略
<DIV> <H1>Linux9下Mail服务器架设攻略</H1> <UL> <LI class="li1 t_c">2007-12-03 22:16:44 作者:<A class=member_url href="http://www.cnfan.net/member/member.php?username=阿军"><FONT color=#000099>IT168</FONT></A> 来源:<A href="" target=_blank><FONT color=#000099>IT168</FONT></A> 浏览次数:<SPAN id=hits>68</SPAN> 文字大小:【<A href="javascript:fontZoom(16)"><FONT color=#000099>大</FONT></A>】【<A href="javascript:fontZoom(14)"><FONT color=#000099>中</FONT></A>】【<A href="javascript:fontZoom(12)"><FONT color=#000099>小</FONT></A>】 </LI></UL> <DIV class=content id=content> <DIV class=contbox><STRONG>简介:</STRONG>我们以Red Hat Linux 9.0为例。在linux下可供选择的邮件服务器套件有Sendmail和Qmail。Qmail比较注重安全问题,如果你需要一个安全的邮件网关,那它是一个不错的可选方案;而Sendmail在稳定性、可移植性、及确保 ...</DIV> <P><STRONG>关键字:</STRONG> <A href="http://mail.cnfan.net//search.php?searchtype=keywords&keywords=Linux9&search=1" target=_blank><FONT color=#000099>Linux9</FONT></A> <A href="http://mail.cnfan.net//search.php?searchtype=keywords&keywords=Mail&search=1" target=_blank><FONT color=#000099>Mail</FONT></A> <A href="http://mail.cnfan.net//search.php?searchtype=keywords&keywords=%B7%FE%CE%F1%C6%F7&search=1" target=_blank><FONT color=#000099>服务器</FONT></A> <A href="http://mail.cnfan.net//search.php?searchtype=keywords&keywords=%BC%DC%C9%E8%B9%A5%C2%D4&search=1" target=_blank><FONT color=#000099>架设攻略</FONT></A> </P> <SCRIPT language=javascript src="http://www.cnfan.net/data//11.js"></SCRIPT> <TABLE height=36 cellSpacing=1 cellPadding=0 width=548 align=center bgColor=#cfd1d1 border=0> <TBODY> <TR> <TD style="FONT-WEIGHT: bold; PADDING-TOP: 3px" align=right width=64 bgColor=#fef8d4> <DIV align=center>热点:</DIV></TD> <TD width=377 bgColor=#ffffff> <TABLE height=28 cellSpacing=0 cellPadding=0 width=377 border=0> <TBODY> <TR> <TD width=12> </TD> <TD width=365><B><FONT color=#0033cc><A href="http://www.testinside.com/" target=_blank><FONT color=#0033cc size=2>Ctrix,HP,EMC,CIW,Oracle,Comptia,IBM,Certification Exams Questions;Bootcamp Braindumps-TestInside</FONT></A></FONT></B></TD></TR></TBODY></TABLE></TD> <TD width=103 bgColor=#ffffff> <DIV align=right><A href="http://www.cnfan.net/" target=_blank><IMG alt=中国网络 src="http://www.cnfan.net/img/cnfan.gif" border=0></A></DIV></TD></TR></TBODY></TABLE> <DIV style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; FLOAT: right; PADDING-BOTTOM: 5px; PADDING-TOP: 0px"></DIV> <P>我们以Red Hat <A class=keylink href="http://os.cnfan.net/list_20.html" target=_blank><FONT color=#000099>Linux</FONT></A> 9.0为例。在linux下可供选择的邮件服务器套件有Sendmail和Qmail。Qmail比较注重安全问题,如果你需要一个安全的邮件网关,那它是一个不错的可选方案;而Sendmail在稳定性、可移植性、及确保没有bug方面具有一定特色,且可以在网络中搜索到大量的使用资料,因此<A class=keylink href="http://os.cnfan.net/list_20.html" target=_blank><FONT color=#000099>Linux</FONT></A>下一般都选用此系统搭建,本文也是基于Sendmail为例。 </P> <P><STRONG>一. 安装Sendmail。</STRONG></P> <P>完全安装Red Hat <A class=keylink href="http://os.cnfan.net/list_20.html" target=_blank><FONT color=#000099>Linux</FONT></A> 9.0时,Sendmail就会自动内置,版本号为8.12.8-4。如果你不确定<A class=keylink href="http://os.cnfan.net/list_20.html" target=_blank><FONT color=#000099>Linux</FONT></A>是否已经安装有sendmail,可以输入以下命令查看:</P> <P>[root@ahpeng root] rpm –qa grep sendmail</P> <P>如果确定没有安装,请在图形界面下依次选择单击“主菜单-系统设置-添加删除应用程序”,然后在打开的“软件包管理”窗口里选中“邮件服务器”选项,点“更新”后按照提示安装即可。</P> <P>另一种办法是:直接插入<A class=keylink href="http://os.cnfan.net/list_20.html" target=_blank><FONT color=#000099>Linux</FONT></A>第1张安装光盘,选择/RedHat/RPMS目录下的sendmail-8.12.8-4.i386.rpm安装包,之后运行[root@ahpeng RPMS] # rpm -ivh sendmail-8.12.8-4.i386.rpm即可开始安装,再用此方法在第3张安装光盘的同目录下依次安装sendmail-cf.8.12.8-4.i386.rpm、sendmail-doc. 8.12.8-4.i386.rpm。</P> <P><STRONG>二. 启动Sendmail服务系统。</STRONG></P> <P>笔者建议使用带参数的Sendmail命令控制邮件服务器的运行:[root@ahpeng root]# <BR>sendmail -bd –q12h,后跟的参数解释如下:<BR>-b:设定Sendmail服务运行于后台。<BR>-d:指定Sendmail以Daemon(守护进程)方式运行。<BR>-q:设定当Sendmail无法成功发送邮件时,就将邮件保存在队列里,并指定保存时间。上面的12h表示保留12小时。<BR>此外,要检测Sendmail服务器是否正常运行,可以使用命令行:[root@ahpeng root] # /etc/rc.d/init.d/sendmail status。<BR><STRONG>三. 配置Sendmail。</STRONG></P> <P>sendmail.cf的配置语法比较难懂,一般资料上都是采用m4宏处理程序来生成所需的sendmail.cf文件(使用m4编译工具一般不容易出错,还可避免某些带有安全漏洞的宏对服务器造成的破坏)。其配置文件位于/etc/mail/sendmail.cf,在创建的过程中还需要一个模板文件,<A class=keylink href="http://os.cnfan.net/list_20.html" target=_blank><FONT color=#000099>Linux</FONT></A>自带有一个模板文件,位于/etc/mail/sendmail.mc。故可以直接通过修改sendmail.mc模板来达到定制sendmail.cf文件的目的,而不必去死啃哪些难理解的配置命令。配置步骤为:</P> <P>第一步:用模板文件sendmail.mc生成sendmail.cf配置文件,并导出到/etc/mail/目录下,使用命令行为:m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf</P> <P>第二步:再用[root@ahpeng root] /etc/rc.d/init.d/sendmail restart命令行重启sendmail。<BR>至此,邮件服务系统配置完成,已经正常工作。接下来就是创建具体的帐户了。</P> <P><STRONG>四. 建立电子邮件新帐号。</STRONG></P> <P>此步骤相对简单,只需在<A class=keylink href="http://os.cnfan.net/list_20.html" target=_blank><FONT color=#000099>Linux</FONT></A>里新增一个用户即可。依次进入“主菜单-系统设置-用<BR>户和组群”选项,接着打开“Red Hat用户管理器”对话框,点“添加用户”按钮,在接着出现的“创建新用户”窗口中输入用户名及密码即可,如图所示:<BR></P> <P> <TABLE align=center> <TBODY> <TR> <TD><IMG class=fit-image onmousewheel="javascript:return big(this)" style="ZOOM: 90%" alt="" src="http://www.cnfan.net/uploadfile/mail_system/uploadfile/200712/20071203101644970.jpg" onload="javascript:if(this.width>498)this.style.width=498;" border=1></TD></TR> <TR> <TD align=middle>创建mail使用帐号</TD></TR></TBODY></TABLE></P> <P><BR>命令行方式为:[root@ahpeng root]#adduser mailA -p Pass,表示创建了一个mailA的帐号,密码为Pass。</P> <P><STRONG>五. 限制单个用户邮箱容量。</STRONG><BR>如果对用户的邮件容量不加限制,服务器的硬盘是不堪重负的。这可以使用“邮件限额”功能来实现:因为电子邮件的暂存空间是位于/var/spool/mail目录下的,所以只需通过磁盘配额设定每一个邮件帐户在此目录下能使用的最大空间即可。</P> <P><STRONG>六. 单一用户设定多个邮件地址。</STRONG></P> <P>使用别名(alias)可以解决这个问题。别名是sendmail最重要的功能之一。它在aliases这个文本文件中定义,aliases文件的位置由sendmail.cf指定,一般位于/etc目录下。比如前面我们建立的mailA用户要拥有2个邮件地址:<A class=10 href="mailto:mailA@yourdomain.com"><FONT color=#000000>mailA@yourdomain.com</FONT></A>和<A class=10 href="mailto:mailB@yourdomain.com"><FONT color=#000000>mailB@yourdomain.com</FONT></A>,可以这样设置:</P> <P>首先,新增一个账号mailC,然后用<A class=keylink href="http://os.cnfan.net/list_20.html" target=_blank><FONT color=#000099>Linux</FONT></A>的文本编辑器打开/etc/aliases,在里面加上:dearpeter: mailC和truepeter: mailC这两个命令行;然后在命令窗口运行newaliases命令,以要求Sendmail重新读取/etc/aliases文件。如果正确无误,会出现一段回应消息,表示配置成功。这样就可以使用2个地址给mailC发信,而mailC则只需用其中一个账号就可接收寄给以上2个地址的所有邮件。</P> <P>经过以上步骤后,应该就可以用Outlook Express正常发送邮件了,但这时还不能用Outlook Express从服务器端收取邮件的,因为sendmail默认状态并不具备POP3功能,我们还得自己安装并启用它。</P> <P>1. POP3(IMAP)服务器安装。</P> <P>第一步:用以下命令行检查系统是否安装:<BR>[root@ahpeng root]# rpm -qa imap<BR>imap-2001a-18</P> <P>第二步:插入第2张安装光盘,使用下面的命令行开始安装:<BR>[root@ahpeng root]#cd /mnt/cdrom/RedHat/RPMS<BR>[root@ahpeng root]#rpm -ivh imap-2001a-18.i386.rpm</P> <P>2. 启用POP3(IMAP)服务。</P> <P>POP3服务:请先修改/etc/xinetd.d/ipop3文件,将其中的“disable=yes”改为“disable=no”后保存;然后重新启动xinetd程序来读取这个修改过的配置文件,使之生效:<BR>[root@ahpeng root]#/etc/rc.d/init.d/xinetd reload</P> <P>启动IMAP服务的步骤跟POP3一样,只是IMAP的配置文件为/etc/xinetd.d/imap罢了。经过这些折腾,你的<A class=keylink href="http://os.cnfan.net/list_20.html" target=_blank><FONT color=#000099>Linux</FONT></A>已经是一台邮件服务器了!大家学会了吗?</P> <SCRIPT type=text/javascript><!-- google_ad_client = "pub-1295960146753136"; google_ad_width = 300; google_ad_height = 250; google_ad_format = "300x250_as"; google_ad_type = "text_image"; google_ad_channel = ""; google_ui_features = "rc:6"; //--> </SCRIPT> <SCRIPT src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type=text/javascript> </SCRIPT> </DIV></DIV>
查看全文
发表于:2008-03-24 ┆
阅读(268)
┆
评论(0)
基于FreeBSD和Postfix的邮件系统与邮件列表的web mail安装
<DIV> <TABLE style="BORDER-TOP: medium none; MARGIN-BOTTOM: 1px" borderColor=#000000 cellSpacing=0 cellPadding=4 width="98%" align=center bgColor=#f0f3fa border=1> <TBODY> <TR style="HEIGHT: 100%"> <TD style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px" vAlign=top width="82%"> <TABLE class=t_msg cellSpacing=0 cellPadding=4 bgColor=#f0f3fa border=0> <TBODY> <TR> <TD class=line style="PADDING-TOP: 10px" vAlign=top height="100%"> <DIV class=t_msgfont id=message4476650><B>基于FreeBSD和Postfix的邮件系统与邮件列表的web mail安装 </B><BR><BR><BR>――――――――――――――――――――――――――――――――――<BR>新增“邮件列表”mailman的安装和设置<BR>新增“邮件流量监控”mailscanner-mrtg的安装和设置<BR>新增php对zend的支持安装<BR>新增使用mailscanner来对进出邮件进行监管。new<BR>修正上一个版本的一些理解性和文件性错误。<BR>主要增强了原来的userinfo数据表。请使用igenus for postfix2.01的用户及时更新。<BR>主要“加强”了病毒过滤和垃圾邮件过滤,更加节约系统资源,使系统配置更简单化。<BR>本文首次使用APF来加强对垃圾邮件的过滤。<BR>垃圾邮件过滤基本上达到了95%的成功率<BR>本文首次使用MailScanner+Clamav配合对邮件病毒进行过滤。<BR>经过严格病毒邮件测试成功率达到了100%。<BR>翻译了病毒邮件提示为中文提示,让系统更加的人性化。<BR>在文档安装过程中加入更详细的说明<BR>在文档软件安装过程中配备了图像,让安装更加的容易。<BR>修正了很多文字性的错误.....<BR>演示:<BR><A href="http://mail.toping.net/" target=_blank><FONT color=#0000ff>http://mail.toping.net</FONT></A><BR>用户名:<A href="mailto:demo@toping.net"><FONT color=#0000ff>demo@toping.net</FONT></A><BR>密 码:demo<BR>――――――――――――――――――――――――――――――――――<BR>FreeBSD+Postfix+Cyrus-sasl+Courier-imap+igenus+spamassassin+Clamav+mailscanner+mailscanner-mrtg+mailman<BR>杨廷勇<BR><BR>Copyright © 2004、2005、2006<BR><BR>本文介绍使用FreeBSD+Postfix+Cyrus-sasl+Courier-imap+igenus+spamassassin+Clamav+mailscanner+mailscanner-mrtg+mailman<BR>来架构一个具有多域名,有邮件列表、webmail、防病毒、防垃圾邮件、web管理界面的邮件系统。<BR>Jacky, $Revision: 4.51 bate $Date: 2005-12-03<BR><BR>系统主要采用MailScanner+clamav+Spamd+APF来对病毒过滤和垃圾邮件过滤。<BR><BR>本文在4.10、5.3、5.4、6.0上安装测试通过,病毒过滤放弃采用amavisd。主要采用执行效率更高的MailSanner来对邮件过滤和垃圾邮件过滤,配置更容易,并且降低了系统开消。让系统更加稳定,经过严格病毒邮件测试成功率达到了100%。垃圾邮件过滤基本上达到了95%的成功率。<BR><BR>Table of Contents <BR>Chapter 1. 系统安装<BR>1.1 安装MySQL<BR>1.2 安装Apache<BR>1.3 安装PHP<BR>1.4 安装zend<BR>1.5 安装openssl<BR>1.6 安装phpMyAdmin<BR>1.7 通过phpMyadmin设置数据库<BR>1.8安装Courier-imap<BR>1.9安装 postfix 和 cyrus-sasl<BR>1.10 安装expect<BR>Chapter 2. 配置邮件服务器<BR>2.1 配置rc.conf<BR>2.2 配置postfix 和 cyrus-sasl<BR>2.3 配置Courier-imap<BR>Chapter 3. 手动设置第一个用户并测试<BR>Chapter 4. 安装postfix管理工具<BR>4.1安装本人开发的postfix管理工具<BR>4.2 用户登录测试<BR>Chapter 5. 防病毒与防垃圾邮件<BR>5.1 安装Clamav<BR>5.2 安装MailScanner<BR>5.3 安装配置Spamassassin<BR>5.4修改Postfix设定档main.cf<BR>5.5修改mailscanner.conf<BR>5.6新增MailScanner所要用到的资料夹<BR>5.7把病毒提示信息改为中文<BR>5.8MailScanner监管进出邮件<BR>5.9 邮件流量监控(mailscanner-mrtg)安装与设置<BR>5.10.安装APF防垃圾邮件<BR>Chapter 6. 安装webmail <BR>Chapter 7邮件列表(mailman)<BR>Chapter 8. 查看系统状态<BR><BR>Chapter 1. 系统安装<BR><BR>安装之前:因用户数据都保存在/var目录下,因此安装FreeBSD时/var的空间应尽量大。FreeBSD的版本为5.3,按最小化安装,软件包只安装cvsup,安装结束后用cvsup更新ports树。在文档中假设服务器的ip地址为192.168.0.2,域名为toping.net,主机名为mail.toping.net。<BR><BR>请兄弟们仔细一些,注意空格和TAB。<BR><BR>祝兄弟们好运。本人水平有限。如果发现文章中有什么错误和不当的地方请发邮件:<A href="mailto:scyz@toping.net"><FONT color=#0000ff>scyz@toping.net</FONT></A>。我会在第一时间给予答复。<BR><BR><BR>1.1 安装MySQL<BR>mail# cd /usr/ports/databases/mysql40-server<BR>mail# make install clean<BR><BR>编辑/etc/rc.conf,加入<BR>mysql_enable="YES" <BR><BR>1.2 安装Apache<BR>mail# cd /usr/ports/www/apache2<BR>mail# make install clean<BR><BR>编辑/etc/rc.conf,加入<BR>Apache2_enable="YES" <BR><BR>1.3 安装PHP<BR>mail# cd /usr/ports/www/mod_php4<BR>mail# make install clean<BR><BR>我的选择:(注意别选DEBUG,否则会和ZEND有冲突)<BR>[X] APACHE2 Use apache 2.x instead of apache 1.3.x<BR><BR>安装需要的PHP扩展模块<BR>mail# cd /usr/ports/lang/php4-extensions<BR>mail# make install clean<BR><BR>我选择了下面的模块:<BR><BR>[X] BCMATH bc style precision math functions <BR>[X] BZ2 bzip2 library support <BR>[X] CALENDAR calendar conversion support <BR>[X] CRACK crack support <BR>[X] CTYPE ctype functions<BR>[X] CURL CURL support<BR>[X] FTP FTP support<BR>[X] GD GD library support<BR>[X] GETTEXT gettext library support <BR>[X] FILEINFO fileinfo support<BR>[X] IMAP IMAP support<BR>[X] MBSTRING multibyte string support <BR>[X] MCAL Modular Calendar Access Library support <BR>[X] MCRYPT Encryption support <BR>[X] MCVE MCVE support <BR>[X] MHASH Crypto-hashing support <BR>[X] MYSQL MySQL database support<BR>[X] PCRE Perl Compatible Regular Expression support <BR>[X] POSIX POSIX-like functions<BR>[X] SESSION session support <BR>[X] TOKENIZER tokenizer support <BR>[X] XML XML support <BR>[X] ZLIB ZLIB support<BR><BR>最后在编辑/usr/local/etc/apache2/httpd.conf最后加入:<BR>DirectoryIndex index.html index.html.var index.php<BR><BR>#注:在DirectoryIndex这里加入index.php,是为了让apache支持首页为index.php的首页文件<BR><BR>AddType application/x-httpd-php .php<BR>AddType application/x-httpd-php-source .phps<BR><BR>Group www、User www修改为: Group postfix、User postfix<BR>注:以上这一步要在postfix安装后再操作<BR><BR>1.4.安装zend<BR>mail# cd /usr/ports/devel/ZendOptimizer<BR>mail# make install clean<BR><BR>因为版权的问题,他不会自动下载。这里你需要到他的官方网站去下载ZendOptimizer-2.5.10a-freebsd4.3-i386.tar.gz到/usr/ports/distfiles目录下面后再安装。<BR>下载地址:<BR><A href="http://downloads.zend.com/optimizer/2.5.10/ZendOptimizer-2.5.10a-freebsd4.3-i386.tar.gz" target=_blank><FONT color=#0000ff>http://downloads.zend.com/optimi ... ebsd4.3-i386.tar.gz</FONT></A><BR><BR>完成后在/usr/local/etc/php.ini中加入:<BR>[Zend]<BR>zend_optimizer.optimization_level=15<BR>zend_extension_manager.optimizer="/usr/local/lib/php/20020429/Optimizer"<BR>zend_extension_manager.optimizer_ts="/usr/local/lib/php/20020429/Optimizer_TS"<BR>zend_extension="/usr/local/lib/php/20020429/ZendExtensionManager.so"<BR>zend_extension_ts="/usr/local/lib/php/20020429/ZendExtensionManager_TS.so"<BR><BR>重启apache安装完成。<BR><BR>1.5 安装openssl<BR>mail# cd /usr/ports/security/openssl<BR>mail# make install clean<BR><BR>1.6 安装phpMyAdmin<BR>mail# cd /usr/ports/databases/phpmyadmin<BR>mail# make fetch<BR>注:(在这里建议直接下载后复制安装)<BR><BR>mail# cd /usr/ports/distfiles<BR>mail# tar –zxvf PhpMyadmin-x.tar.gz<BR>mail# mv /usr/local/www/phpMyAdmin-x /usr/local/www/data/dbadmin<BR><BR>修改/usr/local/www/data/dbadmin/config.inc.php<BR>$cfg['PmaAbsoluteUri'] = 'http://192.168.0.2/dbadmin/';<BR>$cfg['Servers'][$i]['auth_type'] = 'http'; // Authentication method (config, http or cookie based)?<BR>注:指定phpmyadmin的认证方式为http方式。<BR><BR>在浏览器输入<A href="http://192.168./" target=_blank><FONT color=#0000ff>http://192.168.</FONT></A> 0.2/dbadmin/,首次进行登入的用户名为root密码为空,登入后可以修改你的密码。<BR><BR>1.7 通过phpMyadmin设置数据库<BR><BR>建立postfix数据库(注意:数据库名称为postfix):<BR><BR>mail# mysql –u root –p<BR>mysql# CREATE DATABASE `postfix` ; <BR>mysql# use postfix;<BR><BR>下面为sql语句:<BR><BR>CREATE TABLE domaininfo (<BR> domain_id int(5) NOT NULL auto_increment,<BR> domain varchar(25) NOT NULL default '',<BR> alias varchar(30) default NULL,<BR> passwd varchar(35) NOT NULL default '',<BR> usernum int(5) NOT NULL default '0',<BR> quota int(11) NOT NULL default '0',<BR> des varchar(30) default NULL,<BR> expire date NOT NULL default '0000-00-00',<BR> active tinyint(1) NOT NULL default '1',<BR> create_time datetime default NULL,<BR> PRIMARY KEY (domain_id),<BR> UNIQUE KEY domain (domain),<BR> KEY domain_id (domain_id)<BR>) TYPE=MyISAM COMMENT='domain information';<BR><BR>INSERT INTO domaininfo VALUES (1,'admin',NULL,'$1$.j3.t12.$I7MGf7ZD2HrWwUWQF88Mg1',0,0,'Super Admin','0000-00-00',1,'0000-00-00 00:00:00');<BR><BR>CREATE TABLE userinfo (<BR>id int(11) NOT NULL auto_increment,<BR>userid varchar(20) NOT NULL default '',<BR>domain_id int(5) NOT NULL default '0',<BR>address varchar(50) NOT NULL default '',<BR>alias varchar(60) default NULL,<BR>passwd varchar(35) NOT NULL default '',<BR>realname varchar(20) default NULL,<BR>quota int(11) NOT NULL default '0',<BR>active tinyint(1) NOT NULL default '0',<BR>homedir varchar(60) NOT NULL default '',<BR>maildir varchar(60) NOT NULL default '',<BR>create_time datetime NOT NULL default '0000-00-00 00:00:00',<BR>`fax` varchar(20) NOT NULL default '',<BR>`telephone` varchar(15) NOT NULL default '',<BR>`sex` int(1) NOT NULL default '0',<BR>`year` int(4) NOT NULL default '0',<BR>`MONTH` int(2) NOT NULL default '0',<BR>`DAY` int(2) NOT NULL default '0',<BR>`education` varchar(4) NOT NULL default '',<BR>`marital` int(1) NOT NULL default '0',<BR>`occupation` varchar(15) NOT NULL default '',<BR>`companyname` varchar(30) NOT NULL default '',<BR>`province` varchar(6) NOT NULL default '',<BR>PRIMARY KEY (id),<BR>UNIQUE KEY address (address)<BR>) TYPE=InnoDB COMMENT='User Information';<BR><BR>注:对于初学者,建议以上操作都在phpmyadmin中操作更加的简便,如果后面要使用igenus请导入原来igenus的sql。<BR><BR>建立数据库用户并授以相应的权限<BR><BR>mail# mysql –u root –p<BR>mysql# use mysql;<BR>mysql# INSERT INTO user (host,user,password) VALUES('localhost','postfix','');<BR>mysql# update user set password=password('postfix') where User='postfix';<BR>mysql# GRANT ALL ON postfix.* TO postfix@localhost IDENTIFIED BY "postfix";<BR>注:这里加用户名和密码都为:postfix。并授权对postfix数据库进行操作<BR><BR>[<I> 本帖最后由 scyzxp 于 2005-12-4 10:49 编辑 </I>]</DIV><BR style="CLEAR: both"><FONT style="FONT: 12px song,Verdana; COLOR: rgb(0,0,0); font-size-adjust: none; font-stretch: normal; x-system-font: none"><BR><BR></FONT></TD></TR> <TR> <TD>您对本贴的看法:<A href="http://bbs.chinaunix.net/postappraise.php?action=sustain&fid=14&tid=661822&pid=4476650&page=1&extra="><FONT color=#0000ff>鲜花[0]</FONT></A> <A href="http://bbs.chinaunix.net/postappraise.php?action=oppose&fid=14&tid=661822&pid=4476650&page=1&extra="><FONT color=#0000ff>臭蛋[0]</FONT></A></TD></TR> <TR> <TD vAlign=bottom><BR>__________________________________<BR><BR>------------------------------------------------<BR>Postfix技术专业支持论坛<BR><BR>Igenus for Postfix 支持论坛<BR><BR>http://www.thismail.org/bbs<BR>--------------------------------<BR></TD></TR> <TR class=t_infoline> <TD class=line style="PADDING-RIGHT: 5px; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; PADDING-TOP: 5px"><A href="http://www.cuug.com/" target=_blank><FONT color=red>做DBA,拿高薪,从</FONT><FONT color=blue>CUUG</FONT><FONT color=red>开始</FONT></A> | <A href="http://www.uplooking.com/" target=_blank><FONT color=blue>京/沪/深三地任选5万年薪就业!</FONT></A> | <A href="http://www.unix-center.net/?p=71" target=_blank><FONT color=blue>学Solaris 10 红宝书教程 得iPod大奖</FONT></A> | <A href="http://ad.cn.doubleclick.net/clk;180009591;24299149;m?http://www-306.ibm.com/software/cn/rational/offerings/testing/webapplicationsecurity/" target=_blank><FONT color=red>对黑客防在先 守在后--IBM WatchFire</FONT></A> </TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE> <TABLE style="MARGIN-BOTTOM: 1px" borderColor=#000000 cellSpacing=0 cellPadding=4 width="98%" align=center bgColor=#fafbfc border=1> <TBODY> <TR style="HEIGHT: 100%"> <TD vAlign=top width="18%"><A name=pid4476655></A><A href="http://bbs.chinaunix.net/profile-uid-206108.html" target=_blank><FONT face=Fixedsys color=#0000ff>scyzxp</FONT></A> <IMG alt=帅哥 src="http://bbs.chinaunix.net/images/default/icon_minigender_male.gif" border=0> <BR> <DIV class=smalltxt>光明使者<BR><BR><BR><BR><IMG src="http://bbs.chinaunix.net/images/default/level/pips5.gif"><BR>UID:206108<BR>注册:2004-12-8<BR>最后登录: 2008-02-12<BR>帖子:<A href="http://search.chinaunix.net/bbs.php?stype=author&q=scyzxp" target=_blank><U><FONT color=#0000ff>824</FONT></U></A><BR>精华:<A href="http://bbs.chinaunix.net/digest.php?authorid=206108"><U><FONT color=#0000ff>2</FONT></U></A> <BR><BR>可用积分:637 <BR>信誉积分:<A title=信誉分默认为100分,发表悬赏帖,并采纳正确答案后,信誉分增加,不采纳则将可能减少><U>100 </U></A><BR>专家积分:<A title=专家积分通过正确回答悬赏帖,并被提问者采纳后获得><U>0</U></A> (本版)<BR><!-- 总积分:<a title="总积分=可用积分+信誉积分+专家积分"><u>737</u></a><br> --><BR>状态:<FONT color=#999999>...离线...</FONT> </DIV><BR>[<A href="http://bbs.chinaunix.net/profile-uid-206108.html" alt="查看此会员的个人资料"><B><FONT color=#0000ff>资料</FONT></B></A>] [<A href="http://bbs.chinaunix.net/pm.php?action=send&uid=206108" target=_blank alt="给此会员发送站内短信"><B><FONT color=#0000ff>站内短信</FONT></B></A>] [<A href="http://blog.chinaunix.net/dir.php?uid=206108" target=_blank alt="进入此会员的CU博客"><B><FONT color=#0000ff>Blog</FONT></B></A>] <BR><BR><BR></TD> <TD style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px" vAlign=top width="82%"> <TABLE class=t_msg cellSpacing=0 cellPadding=4 bgColor=#fafbfc border=0> <TBODY> <TR> <TD> <DIV> <DIV class=right style="PADDING-TOP: 4px"><SPAN class=bold> <A href="http://bbs.chinaunix.net/post.php?action=reply&fid=14&tid=661822&repquote=4476655&extra="><FONT color=#0000ff>[引用]</FONT></A> <A href="http://bbs.chinaunix.net/misc.php?action=report&fid=14&tid=661822&pid=4476655&page=1"><FONT color=#0000ff>[报告]</FONT></A> <A onclick="fastreply('回复 #2 scyzxp 的帖子')" href="http://bbs.chinaunix.net/viewthread.php?tid=661822#"><FONT color=#0000ff>[回复]</FONT></A> <A title="评分 0" href="http://bbs.chinaunix.net/misc.php?action=viewratings&tid=661822&pid=4476655"></A><A onclick=scroll(0,0) href="http://bbs.chinaunix.net/viewthread.php?tid=661822#"><IMG alt=顶部 src="http://bbs.chinaunix.net/images/default/top.gif" border=0></A> </SPAN></DIV> <DIV style="PADDING-TOP: 4px"><A class=bold title=复制帖子链接到剪贴板 onclick="setcopy('http://bbs.chinaunix.net/viewthread.php?tid=661822&page=1#pid4476655', '已经复制到剪贴板')" href="http://bbs.chinaunix.net/viewthread.php?tid=661822#"><FONT color=#0000ff>2楼</FONT></A> 发表于 2005-12-4 10:45 </DIV></DIV></TD></TR> <TR> <TD class=line style="PADDING-TOP: 10px" vAlign=top height="100%"> <DIV style="FLOAT: right" align=right></DIV> <DIV class=t_msgfont id=message4476655>1.8 安装Courier-imap<BR>mail# cd /usr/ports/mail/courier-imap<BR>mail# make install clean<BR>我的选择:<BR>[X] OPENSSL Build with OpenSSL support<BR>[X] AUTH_MYSQL MySQL support<BR><BR>在/etc/rc.conf中加入:<BR>courier_authdaemond_enable="YES"<BR>courier_imap_pop3d_enable="YES"<BR>courier_imap_imapd_enable="YES"<BR><BR>mail# cd /usr/local/etc/courier-imap<BR>mail# cp imapd.cnf.dist imapd.cnf<BR>mail# cp pop3d.cnf.dist pop3d.cnf <BR>mail# /usr/local/etc/rc.d/courier-authdaemond.sh start<BR><BR>注:此时会在/var/run/authdaemond/下产生socket,如果没有下面这一步下面的认证无法通过。<BR><BR>mail# chmod +x /var/run/authdaemond<BR><BR>1.9 安装 postfix 和 cyrus-sasl<BR>mail# cd /usr/ports/security/cyrus-sasl2<BR>mail# make install WITH_AUTHDAEMON=yes<BR>mail# make clean<BR><BR>创建/usr/local/lib/sasl2/smtpd.conf<BR><BR>pwcheck_method: authdaemond<BR>log_level: 3<BR>mech_list: PLAIN LOGIN<BR>authdaemond_path:/var/run/authdaemond/socket<BR><BR>更详细的参数设置请看:<BR><A href="http://www.toping.net/viewthread.php?tid=330&fpage=6" target=_blank><FONT color=#0000ff>http://www.toping.net/viewthread.php?tid=330&fpage=6</FONT></A><BR><BR>至此,认证部分基本完成。<BR><BR>安装postfix<BR>mail# cd /usr/ports/mail/postfix<BR>mail# make install clean<BR>我的选择:<BR><BR><BR>回答下面的两问题:<BR>You need user "postfix" added to group "mail".[是否将postfix用户加到mail用户组]<BR>Would you like me to add it [y]? y<BR>Would you like to activate Postfix in /etc/mail/mailer.conf [n]? n<BR><BR>在/etc/rc.conf中加入postfix启动所需的启动选项<BR>在/etc/rc.conf中加入:<BR><BR>sendmail_enable="YES"<BR>sendmail_flags="-bd"<BR>sendmail_pidfile="/var/spool/postfix/pid/master.pid"<BR>sendmail_procname="/usr/local/libexec/postfix/master"<BR>sendmail_outbound_enable="NO"<BR>sendmail_submit_enable="NO"<BR>sendmail_msp_queue_enable="NO"<BR><BR>设置postfix启动所需<BR>mail# ln -s /usr/local/sbin/sendmail /usr/sbin/sendmail<BR><BR>注:如果/usr/sbin/sendmail存在就删了再做上链接,如果升级内核和升级系统后要重新做这一步。<BR><BR>mail# echo ‘postfix: root’ >> /etc/aliases<BR>mail# /usr/local/bin/newaliases<BR>mail# chown postfix:postfix /etc/opiekeys<BR><BR>1.10 安装expect<BR>用于Web客户端建立邮件用户<BR>mail# cd /usr/ports/lang/expect<BR>mail# make install clean<BR><BR>Chapter 2. 配置邮件服务器<BR><BR>本节主要讲述各种服务的参数配置。<BR><BR>2.1 配置rc.conf,编辑/etc/rc.conf<BR><BR>下面是前面所装软件都加入了启动选项的rc.conf配置:<BR><BR>mysql_enable="YES"<BR>apache2_enable="YES"<BR>courier_authdaemond_enable="YES"<BR>courier_imap_pop3d_enable="YES"<BR>courier_imap_imapd_enable="YES"<BR>sendmail_enable="YES"<BR>sendmail_flags="-bd"<BR>sendmail_pidfile="/var/spool/postfix/pid/master.pid"<BR>sendmail_procname="/usr/local/libexec/postfix/master"<BR>sendmail_outbound_enable="NO"<BR>sendmail_submit_enable="NO"<BR>sendmail_msp_queue_enable="NO"<BR><BR>2.2 配置postfix 和 cyrus-sasl<BR>(1)修改/usr/local/etc/postfix/main.cf,在文件最后加入以下内容<BR>mail# ee /usr/local/etc/postfix/main.cf<BR>smtpd_helo_required = yes<BR>strict_rfc821_envelopes = yes<BR>smtpd_etrn_restrictions = permit_mynetworks, reject<BR>#=====================BASE=====================<BR>myhostname = mail.toping.net<BR>mydomain = toping.net<BR>mydestination = $myhostname<BR>local_recipient_maps =<BR>command_directory = /usr/local/sbin<BR>local_transport = virtual<BR>#=====================MySQL=====================<BR>virtual_alias_maps = mysql:/usr/local/etc/postfix/mysql_virtual_alias_maps.cf<BR>virtual_gid_maps = static:125<BR>virtual_mailbox_base = /<BR>virtual_mailbox_domains = mysql:/usr/local/etc/postfix/mysql_virtual_domains_maps.cf<BR>virtual_mailbox_limit = 51200000<BR>virtual_mailbox_maps = mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_maps.cf<BR>virtual_minimum_uid = 125<BR>virtual_transport = virtual<BR>virtual_uid_maps = static:125<BR>#=====================Quota=====================<BR>virtual_create_maildirsize = yes<BR>virtual_mailbox_extended = yes<BR>virtual_mailbox_limit_maps = mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_limit_maps.cf<BR>virtual_mailbox_limit_override = yes<BR>virtual_maildir_limit_message = Sorry, the user's maildir has overdrawn his diskspace quota, please try again later.<BR>virtual_overquota_bounce = yes<BR>#====================SASL=====================<BR>smtpd_sasl_auth_enable = yes<BR>smtpd_sasl_security_options = noanonymous<BR>broken_sasl_auth_clients = yes<BR>smtpd_delay_reject=yes <BR>smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,permit_auth_destination,reject <BR>smtpd_client_restrictions = permit_sasl_authenticated<BR><BR>更详细的参数设置请看论坛:<BR><A href="http://www.toping.net/viewthread.php?tid=550&fpage=2" target=_blank><FONT color=#0000ff>http://www.toping.net/viewthread.php?tid=550&fpage=2</FONT></A><BR><BR>(4)编辑/usr/local/etc/postfix/mysql_virtual_alias_maps.cf<BR>mail# ee /usr/local/etc/postfix/mysql_virtual_alias_maps.cf<BR>user = postfix<BR>password = postfix<BR>hosts = localhost<BR>dbname = postfix<BR>query = SELECT alias FROM userinfo WHERE address='%s' AND active = 1<BR><BR>(5)编辑/usr/local/etc/postfix/mysql_virtual_domains_maps.cf<BR>mail# ee /usr/local/etc/postfix/mysql_virtual_domains_maps.cf<BR>user = postfix<BR>password = postfix<BR>hosts = localhost<BR>dbname = postfix<BR>query = SELECT domain FROM domaininfo WHERE domain='%s'<BR><BR>(6)编辑/usr/local/etc/postfix/mysql_virtual_mailbox_maps.cf<BR>mail# ee /usr/local/etc/postfix/mysql_virtual_mailbox_maps.cf<BR>user = postfix<BR>password = postfix<BR>hosts = localhost<BR>dbname = postfix<BR>query = SELECT maildir FROM userinfo WHERE address='%s' AND active = 1<BR><BR>(7)编辑/usr/local/etc/postfix/mysql_virtual_mailbox_limit_maps.cf<BR>mail# ee /usr/local/etc/postfix/mysql_virtual_mailbox_limit_maps.cf<BR>user = postfix<BR>password = postfix<BR>hosts = localhost<BR>dbname = postfix<BR>query = SELECT quota FROM userinfo WHERE address='%s'<BR><BR>2.3 配置Courier-imap<BR><BR>(1)修改Courier相关设置,/usr/local/etc/courier-imap/imapd:<BR><BR>IMAP_CAPABILITY="IMAP4rev1 CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA" <BR><BR>(2)修改/usr/local/etc/courier-imap/pop3d<BR><BR>POP3AUTH="LOGIN CRAM-MD5 CRAM-SHA1"<BR><BR>(3)编辑修改/usr/local/etc/authlib/authmysqlrc<BR>mail# mv /usr/local/etc/authlib/authmysqlrc /usr/local/etc/authlib/authmysqlrc_bak<BR>mail# ee /usr/local/etc/authlib/authmysqlrc<BR>MYSQL_SERVER localhost //数据库主机地址<BR>MYSQL_USERNAME postfix //数据库用户名<BR>MYSQL_PASSWORD postfix //数据库密码<BR>MYSQL_PORT 0<BR>MYSQL_OPT 0<BR>MYSQL_DATABASE postfix //数据库名称<BR>MYSQL_USER_TABLE userinfo<BR>MYSQL_CRYPT_PWFIELD passwd<BR>MYSQL_UID_FIELD '125'<BR>MYSQL_GID_FIELD '125'<BR>MYSQL_LOGIN_FIELD address<BR>MYSQL_HOME_FIELD homedir<BR>MYSQL_NAME_FIELD realname<BR>MYSQL_MAILDIR_FIELD maildir<BR>MYSQL_QUOTA_FIELD quota<BR>注:这里得用tab键来跳格<BR><BR>(4)编辑/usr/local/etc/authlib/authdaemonrc<BR>mail# mv /usr/local/etc/authlib/authdaemonrc /usr/local/etc/authlib/authdaemonrc_bak<BR>mail# ee /usr/local/etc/authlib/authdaemonrc<BR>authmodulelist="authmysql"<BR>authmodulelistorig="authmysql"<BR>version="authdaemond.mysql"<BR>daemons=5<BR>authdaemonvar=/var/run/authdaemond<BR>subsystem=mail<BR>DEBUG_LOGIN=0<BR>DEFAULTOPTIONS="wbnodsn=1"<BR><BR>重启服务器</DIV><BR style="CLEAR: both"><FONT style="FONT: 12px song,Verdana; COLOR: rgb(0,0,0); font-size-adjust: none; font-stretch: normal; x-system-font: none"><BR><BR></FONT></TD></TR> <TR> <TD>您对本贴的看法:<A href="http://bbs.chinaunix.net/postappraise.php?action=sustain&fid=14&tid=661822&pid=4476655&page=1&extra="><FONT color=#0000ff>鲜花[0]</FONT></A> <A href="http://bbs.chinaunix.net/postappraise.php?action=oppose&fid=14&tid=661822&pid=4476655&page=1&extra="><FONT color=#0000ff>臭蛋[0]</FONT></A></TD></TR> <TR> <TD vAlign=bottom><BR>__________________________________<BR><BR>------------------------------------------------<BR>Postfix技术专业支持论坛<BR><BR>Igenus for Postfix 支持论坛<BR><BR>http://www.thismail.org/bbs<BR>--------------------------------<BR></TD></TR> <TR class=t_infoline> <TD class=line style="PADDING-RIGHT: 5px; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; PADDING-TOP: 5px"><A href="http://www.cuug.com/" target=_blank><FONT color=red>做DBA,拿高薪,从</FONT><FONT color=blue>CUUG</FONT><FONT color=red>开始</FONT></A> | <A href="http://www.uplooking.com/" target=_blank><FONT color=blue>京/沪/深三地任选5万年薪就业!</FONT></A> | <A href="http://www.unix-center.net/?p=71" target=_blank><FONT color=blue>学Solaris 10 红宝书教程 得iPod大奖</FONT></A> | <A href="http://ad.cn.doubleclick.net/clk;180009591;24299149;m?http://www-306.ibm.com/software/cn/rational/offerings/testing/webapplicationsecurity/" target=_blank><FONT color=red>对黑客防在先 守在后--IBM WatchFire</FONT></A> </TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE> <TABLE style="MARGIN-BOTTOM: 1px" borderColor=#000000 cellSpacing=0 cellPadding=4 width="98%" align=center bgColor=#f0f3fa border=1> <TBODY> <TR style="HEIGHT: 100%"> <TD vAlign=top width="18%"><A name=pid4476658></A><A href="http://bbs.chinaunix.net/profile-uid-206108.html" target=_blank><FONT face=Fixedsys color=#0000ff>scyzxp</FONT></A> <IMG alt=帅哥 src="http://bbs.chinaunix.net/images/default/icon_minigender_male.gif" border=0> <BR> <DIV class=smalltxt>光明使者<BR><BR><BR><BR><IMG src="http://bbs.chinaunix.net/images/default/level/pips5.gif"><BR>UID:206108<BR>注册:2004-12-8<BR>最后登录: 2008-02-12<BR>帖子:<A href="http://search.chinaunix.net/bbs.php?stype=author&q=scyzxp" target=_blank><U><FONT color=#0000ff>824</FONT></U></A><BR>精华:<A href="http://bbs.chinaunix.net/digest.php?authorid=206108"><U><FONT color=#0000ff>2</FONT></U></A> <BR><BR>可用积分:637 <BR>信誉积分:<A title=信誉分默认为100分,发表悬赏帖,并采纳正确答案后,信誉分增加,不采纳则将可能减少><U>100 </U></A><BR>专家积分:<A title=专家积分通过正确回答悬赏帖,并被提问者采纳后获得><U>0</U></A> (本版)<BR><!-- 总积分:<a title="总积分=可用积分+信誉积分+专家积分"><u>737</u></a><br> --><BR>状态:<FONT color=#999999>...离线...</FONT> </DIV><BR>[<A href="http://bbs.chinaunix.net/profile-uid-206108.html" alt="查看此会员的个人资料"><B><FONT color=#0000ff>资料</FONT></B></A>] [<A href="http://bbs.chinaunix.net/pm.php?action=send&uid=206108" target=_blank alt="给此会员发送站内短信"><B><FONT color=#0000ff>站内短信</FONT></B></A>] [<A href="http://blog.chinaunix.net/dir.php?uid=206108" target=_blank alt="进入此会员的CU博客"><B><FONT color=#0000ff>Blog</FONT></B></A>] <BR><BR><BR></TD> <TD style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px" vAlign=top width="82%"> <TABLE class=t_msg cellSpacing=0 cellPadding=4 bgColor=#f0f3fa border=0> <TBODY> <TR> <TD> <DIV> <DIV class=right style="PADDING-TOP: 4px"><SPAN class=bold> <A href="http://bbs.chinaunix.net/post.php?action=reply&fid=14&tid=661822&repquote=4476658&extra="><FONT color=#0000ff>[引用]</FONT></A> <A href="http://bbs.chinaunix.net/misc.php?action=report&fid=14&tid=661822&pid=4476658&page=1"><FONT color=#0000ff>[报告]</FONT></A> <A onclick="fastreply('回复 #3 scyzxp 的帖子')" href="http://bbs.chinaunix.net/viewthread.php?tid=661822#"><FONT color=#0000ff>[回复]</FONT></A> <A title="评分 0" href="http://bbs.chinaunix.net/misc.php?action=viewratings&tid=661822&pid=4476658"></A><A onclick=scroll(0,0) href="http://bbs.chinaunix.net/viewthread.php?tid=661822#"><IMG alt=顶部 src="http://bbs.chinaunix.net/images/default/top.gif" border=0></A> </SPAN></DIV> <DIV style="PADDING-TOP: 4px"><A class=bold title=复制帖子链接到剪贴板 onclick="setcopy('http://bbs.chinaunix.net/viewthread.php?tid=661822&page=1#pid4476658', '已经复制到剪贴板')" href="http://bbs.chinaunix.net/viewthread.php?tid=661822#"><FONT color=#0000ff>3楼</FONT></A> 发表于 2005-12-4 10:45 </DIV></DIV></TD></TR> <TR> <TD class=line style="PADDING-TOP: 10px" vAlign=top height="100%"> <DIV style="FLOAT: right" align=right></DIV> <DIV class=t_msgfont id=message4476658>Chapter 3.手动设置第一个用户并测试 <BR><BR>本章介绍如何开通用户,并且测试系统是否正常。<BR><BR>注:增加用户时请到这里生成加密后的密码后直接插入到数据库中就可以了。<BR><A href="http://www.toping.net/soft" target=_blank><FONT color=#0000ff>http://www.toping.net/soft</FONT></A><BR>mail# mysql<BR>mysql> use postfix;<BR>mysql> show tables;<BR>+-------------------+<BR>| Tables_in_postfix |<BR>+-------------------+<BR>| address |<BR>| admin |<BR>| card |<BR>| domaininfo |<BR>| lastauth |<BR>| logs |<BR>| message |<BR>| personal |<BR>| scheduler |<BR>| stow |<BR>| userinfo |<BR>| vpopmail |<BR>+-------------------+<BR>12 rows in set (0.00 sec)<BR><BR>增加域名和管理员<BR><BR>mysql> desc domaininfo;<BR>+-------------+-------------+------+-----+------------+----------------+<BR>| Field | Type | Null | Key | Default | Extra |<BR>+-------------+-------------+------+-----+------------+----------------+<BR>| domain_id | int(5) | | PRI | NULL | auto_increment |<BR>| domain | varchar(25) | | UNI | | |<BR>| alias | varchar(30) | YES | | NULL | |<BR>| passwd | varchar(35) | | | | |<BR>| usernum | int(5) | | | 0 | |<BR>| quota | int(11) | | | 0 | |<BR>| des | varchar(30) | YES | | NULL | |<BR>| expire | date | | | 0000-00-00 | |<BR>| active | tinyint(1) | | | 1 | |<BR>| create_time | datetime | YES | | NULL | |<BR>+-------------+-------------+------+-----+------------+----------------+<BR>10 rows in set (0.00 sec)<BR><BR>mysql> INSERT INTO `domaininfo` VALUES (7, 'toping.net', NULL, '$1$jNXThQXq$KPjm.WE2f2yX5rceY48vX. ', 50, 500, NULL, '0000-00-00', 1, '2005-04-19 23:19:11');<BR>Query OK, 1 row affected (0.00 sec)<BR><BR>注:这里的toping.net的管理密码为:admin123<BR><BR>mysql> desc userinfo;<BR>+-------------+-------------+------+-----+---------------------+----------------+<BR>| Field | Type | Null | Key | Default | Extra |<BR>+-------------+-------------+------+-----+---------------------+----------------+<BR>| id | int(11) | | PRI | NULL | auto_increment |<BR>| userid | varchar(20) | | | | |<BR>| domain_id | int(5) | | | 0 | |<BR>| address | varchar(50) | | UNI | | |<BR>| alias | varchar(60) | YES | | NULL | |<BR>| passwd | varchar(35) | | | | |<BR>| realname | varchar(20) | YES | | NULL | |<BR>| quota | int(11) | | | 0 | |<BR>| active | tinyint(1) | | | 0 | |<BR>| homedir | varchar(60) | | | | |<BR>| maildir | varchar(60) | | | | |<BR>| create_time | datetime | | | 0000-00-00 00:00:00 | |<BR>| fax | varchar(20) | | | | |<BR>| telephone | varchar(15) | | | | |<BR>| sex | int(1) | | | 0 | |<BR>| year | int(4) | | | 0 | |<BR>| MONTH | int(2) | | | 0 | |<BR>| DAY | int(2) | | | 0 | |<BR>| education | varchar(4) | | | | |<BR>| marital | int(1) | | | 0 | |<BR>| occupation | varchar(15) | | | | |<BR>| companyname | varchar(30) | | | | |<BR>| province | varchar(6) | | | | |<BR>+-------------+-------------+------+-----+---------------------+----------------+<BR>23 rows in set (0.00 sec) <BR><BR>mysql> INSERT INTO `userinfo` VALUES (8, 'webmaster', 7, '<A href="mailto:webmaster@toping.net"><FONT color=#0000ff>webmaster@toping.net</FONT></A>', NULL,'$1$4DLQeNkz$QKCAQqg244XwvLl2SD11f0', 'webmaster', 209715200, 1, '/var/mail/toping.net/webmaster/', '/var/mail/toping.net/webmaster/Maildir/', '2005-04-20 23:45:17', '', '', 0, 0, 0, 0, '', 0, '', '', '');<BR><BR>注:这里的webmaster用户的邮箱密码为:000000<BR><BR>mysql>quit<BR><BR>设置用户的目录与权限:<BR>Mail# mkdir -p /var/mail/toping.net/webmaster<BR>Mail# /usr/local/bin/maildirmake /var/mail/toping.net/webmaster/Maildir<BR>Mail# chmod -R 777 /var/mail/toping.net/<BR>Mail# chown -R postfix:postfix /var/mail/toping.net<BR><BR>至此用户设置完毕,这里只使用一个域名,同理可以设置多个域名。<BR><BR>Chapter 4.安装postfix管理工具<BR><BR>本节主要介绍如何安装和使用本人开发的postfix管理工具。<BR><BR>4.1安装本人开发的postfix管理工具来设置第一个域名和用户<BR>上传管理工具到网站目录<BR>后修改include/config.inc.php中的<BR>define(DOMAINSDIR,"/home/vmail"); 为 define(DOMAINSDIR,"/var/mail");<BR>define(MYSQL_HOST, 'localhost'); 为 您的MySQL服务器的主机名<BR>define(MYSQL_USER, 'root'); 为 您的MySQL的用户名<BR>define(MYSQL_PASS, 'mypasswd'); 为 您的MySQL的密码<BR>define(MYSQL_DATA, 'postfix'); 为 您的邮件服务器的数据库<BR><BR>修改完成后运行:<A href="http://mail.toping.net/webadmin/index.php" target=_blank><FONT color=#0000ff>http://mail.toping.net/webadmin/index.php</FONT></A><BR><BR>完装完成!!<BR><BR>4.2 用户登录测试<BR><BR>用户登录测试<BR><BR>安装p5-MIME-Base64<BR>mail# cd /usr/ports/converters/p5-MIME-Base64/<BR>mail# make install clean<BR><BR>通过p5-MIME-Base64来取得用户名和密码的base64编码<BR>mail# perl -MMIME::Base64 -e 'print encode_base64("webmaster\@toping.net");'<BR>d2VibWFzdGVyQHRvcGluZy5uZXQ=<BR>mail# perl -MMIME::Base64 -e 'print encode_base64("000000");'<BR>MDAwMDAw<BR><BR>测试发送邮件(端口:25):<BR><BR>mail# telnet 127.0.0.1 25<BR>Trying 127.0.0.1...<BR>Connected to 0.<BR>Escape character is '^]'.<BR>220 mail.toping.net ESMTP Postfix<BR>ehlo mail<BR>250-mail.toping.net<BR>250-PIPELINING<BR>250-SIZE 4194304<BR>250-VRFY<BR>250-ETRN<BR>250-AUTH NTLM LOGIN PLAIN OTP<BR>250-AUTH=NTLM LOGIN PLAIN OTP<BR>250 8BITMIME<BR>auth login<BR>334 VXNlcm5hbWU6<BR>d2VibWFzdGVyQHRvcGluZy5uZXQ= //此为用户名id:<A href="mailto:webmaster@toping.net"><FONT color=#0000ff>webmaster@toping.net</FONT></A><BR>334 UGFzc3dvcmQ6<BR>MDAwMDAw //此为用户密码password:000000<BR>235 Authentication successful<BR>MAIL FROM:<<A href="mailto:webmaster@toping.net"><FONT color=#0000ff>webmaster@toping.net</FONT></A>> //告诉服务器发件人的Email地址<BR>250 Ok<BR>RCPT TO:<<A href="mailto:webmaster@toping.net"><FONT color=#0000ff>webmaster@toping.net</FONT></A>> //告诉服务器收件人的地址<BR>250 OK<BR>DATA //告诉服务器开始写信<BR>354 End data with <CR><LF>.<CR><LF><BR>SUBJECT:test //subject后面填写的是邮件的主题<BR>test<BR>. //换行后输入.后按回车,表示信件内容书写完毕<BR>250 Ok: queued as 58DC71D5<BR>quit //发送信件,结束对话,退出SMTP服务器<BR>221 Bye<BR>Connection closed by foreign host<BR><BR>测试收取邮件(端口:110):<BR><BR>mail# telnet 127.0.0.1 110<BR>Trying 127.0.0.1...<BR>Connected to 0<BR>Escape character is '^]'<BR>+OK Hello there<BR>user <A href="mailto:webmaster@toping.net"><FONT color=#0000ff>webmaster@toping.net</FONT></A><BR>+OK Password required<BR>pass 000000<BR>+OK logged in<BR>list<BR>+OK POP3 clients that break here, they violate STD53<BR>1 2217<BR>retr 1 //返回第一封信的全部内容<BR>+OK 2217 octets follow.<BR>Return-Path: <<A href="mailto:webmaster@toping.net"><FONT color=#0000ff>webmaster@toping.net</FONT></A>><BR>X-Original-To: <A href="mailto:webmaster@toping.net"><FONT color=#0000ff>webmaster@toping.net</FONT></A><BR>Delivered-To: <A href="mailto:webmaster@toping.net"><FONT color=#0000ff>webmaster@toping.net</FONT></A><BR>Received: from mail (localhost.toping.net [127.0.0.1])<BR> by mail.toping.net (Postfix) with ESMTP id 58DC71D5<BR> for <<A href="mailto:webmaster@toping.net"><FONT color=#0000ff>webmaster@toping.net</FONT></A>>; Mon, 9 Aug 2004 21:11:20 +0800 (CST)<BR>SUBJECT:test<BR>Message-Id: <<A href="mailto:20040809131120.58DC71D5@mail.toping.net"><FONT color=#0000ff>20040809131120.58DC71D5@mail.toping.net</FONT></A>><BR>Date: Mon, 9 Aug 2004 21:11:20 +0800 (CST)<BR>From: <A href="mailto:webmaster@toping.net"><FONT color=#0000ff>webmaster@toping.net</FONT></A><BR>To: undisclosed-recipients:;<BR>test<BR>.<BR>dele 1 //删除<BR>+OK Deleted<BR>quit<BR>+OK Bye-bye<BR>Connection closed by foreign host<BR><BR>也可以使用任何其它的邮件客户端程序来测试,如foxmail、Outlook Express等等。</DIV><BR style="CLEAR: both"><FONT style="FONT: 12px song,Verdana; COLOR: rgb(0,0,0); font-size-adjust: none; font-stretch: normal; x-system-font: none"><BR><BR></FONT></TD></TR> <TR> <TD>您对本贴的看法:<A href="http://bbs.chinaunix.net/postappraise.php?action=sustain&fid=14&tid=661822&pid=4476658&page=1&extra="><FONT color=#0000ff>鲜花[0]</FONT></A> <A href="http://bbs.chinaunix.net/postappraise.php?action=oppose&fid=14&tid=661822&pid=4476658&page=1&extra="><FONT color=#0000ff>臭蛋[0]</FONT></A></TD></TR> <TR> <TD vAlign=bottom><BR>__________________________________<BR><BR>------------------------------------------------<BR>Postfix技术专业支持论坛<BR><BR>Igenus for Postfix 支持论坛<BR><BR>http://www.thismail.org/bbs<BR>--------------------------------<BR></TD></TR> <TR class=t_infoline> <TD class=line style="PADDING-RIGHT: 5px; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; PADDING-TOP: 5px"><A href="http://www.cuug.com/" target=_blank><FONT color=red>做DBA,拿高薪,从</FONT><FONT color=blue>CUUG</FONT><FONT color=red>开始</FONT></A> | <A href="http://www.uplooking.com/" target=_blank><FONT color=blue>京/沪/深三地任选5万年薪就业!</FONT></A> | <A href="http://www.unix-center.net/?p=71" target=_blank><FONT color=blue>学Solaris 10 红宝书教程 得iPod大奖</FONT></A> | <A href="http://ad.cn.doubleclick.net/clk;180009591;24299149;m?http://www-306.ibm.com/software/cn/rational/offerings/testing/webapplicationsecurity/" target=_blank><FONT color=red>对黑客防在先 守在后--IBM WatchFire</FONT></A> </TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE> <TABLE style="MARGIN-BOTTOM: 1px" borderColor=#000000 cellSpacing=0 cellPadding=4 width="98%" align=center bgColor=#fafbfc border=1> <TBODY> <TR style="HEIGHT: 100%"> <TD vAlign=top width="18%"><A name=pid4476663></A><A href="http://bbs.chinaunix.net/profile-uid-206108.html" target=_blank><FONT face=Fixedsys color=#0000ff>scyzxp</FONT></A> <IMG alt=帅哥 src="http://bbs.chinaunix.net/images/default/icon_minigender_male.gif" border=0> <BR> <DIV class=smalltxt>光明使者<BR><BR><BR><BR><IMG src="http://bbs.chinaunix.net/images/default/level/pips5.gif"><BR>UID:206108<BR>注册:2004-12-8<BR>最后登录: 2008-02-12<BR>帖子:<A href="http://search.chinaunix.net/bbs.php?stype=author&q=scyzxp" target=_blank><U><FONT color=#0000ff>824</FONT></U></A><BR>精华:<A href="http://bbs.chinaunix.net/digest.php?authorid=206108"><U><FONT color=#0000ff>2</FONT></U></A> <BR><BR>可用积分:637 <BR>信誉积分:<A title=信誉分默认为100分,发表悬赏帖,并采纳正确答案后,信誉分增加,不采纳则将可能减少><U>100 </U></A><BR>专家积分:<A title=专家积分通过正确回答悬赏帖,并被提问者采纳后获得><U>0</U></A> (本版)<BR><!-- 总积分:<a title="总积分=可用积分+信誉积分+专家积分"><u>737</u></a><br> --><BR>状态:<FONT color=#999999>...离线...</FONT> </DIV><BR>[<A href="http://bbs.chinaunix.net/profile-uid-206108.html" alt="查看此会员的个人资料"><B><FONT color=#0000ff>资料</FONT></B></A>] [<A href="http://bbs.chinaunix.net/pm.php?action=send&uid=206108" target=_blank alt="给此会员发送站内短信"><B><FONT color=#0000ff>站内短信</FONT></B></A>] [<A href="http://blog.chinaunix.net/dir.php?uid=206108" target=_blank alt="进入此会员的CU博客"><B><FONT color=#0000ff>Blog</FONT></B></A>] <BR><BR><BR></TD> <TD style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px" vAlign=top width="82%"> <TABLE class=t_msg cellSpacing=0 cellPadding=4 bgColor=#fafbfc border=0> <TBODY> <TR> <TD> <DIV> <DIV class=right style="PADDING-TOP: 4px"><SPAN class=bold> <A href="http://bbs.chinaunix.net/post.php?action=reply&fid=14&tid=661822&repquote=4476663&extra="><FONT color=#0000ff>[引用]</FONT></A> <A href="http://bbs.chinaunix.net/misc.php?action=report&fid=14&tid=661822&pid=4476663&page=1"><FONT color=#0000ff>[报告]</FONT></A> <A onclick="fastreply('回复 #4 scyzxp 的帖子')" href="http://bbs.chinaunix.net/viewthread.php?tid=661822#"><FONT color=#0000ff>[回复]</FONT></A> <A title="评分 0" href="http://bbs.chinaunix.net/misc.php?action=viewratings&tid=661822&pid=4476663"></A><A onclick=scroll(0,0) href="http://bbs.chinaunix.net/viewthread.php?tid=661822#"><IMG alt=顶部 src="http://bbs.chinaunix.net/images/default/top.gif" border=0></A> </SPAN></DIV> <DIV style="PADDING-TOP: 4px"><A class=bold title=复制帖子链接到剪贴板 onclick="setcopy('http://bbs.chinaunix.net/viewthread.php?tid=661822&page=1#pid4476663', '已经复制到剪贴板')" href="http://bbs.chinaunix.net/viewthread.php?tid=661822#"><FONT color=#0000ff>4楼</FONT></A> 发表于 2005-12-4 10:47 </DIV></DIV></TD></TR> <TR> <TD class=line style="PADDING-TOP: 10px" vAlign=top height="100%"> <DIV style="FLOAT: right" align=right></DIV> <DIV class=t_msgfont id=message4476663>Chapter 5. 防病毒与防垃圾邮件<BR><BR>本章介绍病毒与垃圾邮件的防范。 <BR><BR>5.1 安装Clamav<BR>mail# cd /usr/ports/security/clamav<BR>mail# make install clean <BR><BR>我的选择:<BR>[X] MILTER Compile the milter interface <BR>[X] CURL Support URL downloading<BR>[X] LIBUNRAR Support for external Unrar library <BR><BR>要想clamav能自动的启动请在/etc/rc.conf中加入:<BR>clamav_clamd_enable="YES"<BR>clamav_freshclam_enable="YES"<BR><BR>重启服务器<BR><BR>测试杀毒<BR>mail# clamscan -r -i /usr/local/www/data<BR><BR>----------- SCAN SUMMARY -----------<BR>Known viruses: 41293<BR>Engine version: 0.87.1<BR>Scanned directories: 53<BR>Scanned files: 602<BR>Infected files: 0<BR>Data scanned: 41.51 MB<BR>Time: 18.294 sec (0 m 18 s)<BR><BR>升级病毒库<BR>mail# freshclam<BR>ClamAV update process started at Sun Dec 4 01:10:02 2005<BR>main.cvd is up to date (version: 34, sigs: 39625, f-level: 5, builder: tkojm)<BR>daily.cvd is up to date (version: 1200, sigs: 1669, f-level: 6, builder: tomek) <BR><BR>5.2 安装MailScanner<BR>mail# cd /usr/ports/mail/mailscanner<BR>mail# make install<BR><BR>第一次执行安装因此需执行make initial-config以建立基本配置文件 <BR><BR>mail# make initial-config<BR>mail# make clean<BR><BR>5.3 安装SpamAssassin<BR>mail# cd /usr/ports/mail/p5-Mail-SpamAssassin<BR>mail# make install clean<BR><BR>我的选择:<BR>[X] AS_ROOT Run spamd as root (recommended) <BR>[X] DOMAINKEYS DomainKeys support<BR>[X] SSL Build with SSL support for spamd/spamc<BR>[X] MYSQL Add MySQL support<BR>[X] RAZOR Add Vipul's Razor support<BR>[X] SPF_QUERY Add SPF query support<BR>[X] RELAY_COUNTRY Relay country support<BR>[X] TOOLS Install SpamAssassin tools <BR><BR>5.4修改Postfix设定档main.cf<BR>mail# ee /usr/local/etc/postfix/main.cf<BR>#header_checks = regexp:/usr/local/etc/postfix/header_checks //默认值<BR>header_checks = regexp:/usr/local/etc/postfix/header_checks //把注释去掉<BR><BR>编辑/usr/local/etc/postfix/header_checks<BR>mail# ee /usr/local/etc/postfix/header_checks<BR>/^Received:/ HOLD //新加入<BR><BR>5.5修改mailscanner.conf<BR>mail# ee /usr/local/etc/MailScanner/MailScanner.conf<BR>#Run As User = //默认值<BR>Run As User = postfix //修改后<BR>#Run As Group = //默认值<BR>Run As Group = postfix //修改后 <BR>#Incoming Queue Dir = /var/spool/mqueue.in //默认值<BR>Incoming Queue Dir = /var/spool/postfix/hold //修改后<BR>#Outgoing Queue Dir = /var/spool/mqueue //默认值<BR>Outgoing Queue Dir = /var/spool/postfix/incoming //修改后<BR>#MTA = sendmail //默认值<BR>MTA = postfix //修改后<BR>#Virus Scanners = none //默认值<BR>Virus Scanners = clamav //修改后<BR>#Use SpamAssassin = no //默认值<BR>Use SpamAssassin = yes //修改后<BR><BR>5.6新增MailScanner所要用到的资料夹<BR>mail# mkdir /var/spool/MailScanner<BR>mail# mkdir /var/spool/MailScanner/incoming<BR>mail# mkdir /var/spool/MailScanner/quarantine<BR>mail# chown postfix:postfix /var/spool/MailScanner/incoming<BR>mail# chown postfix:postfix /var/spool/MailScanner/quarantine<BR>mail# touch /usr/local/etc/MailScanner/rules/bounce.rules //新建一个空白文件,要不然会出错。<BR>mail# chmod –R 777 /var/spool/postfix<BR>mail#cp /usr/local/etc/MailScanner/mcp/10_example.cf.sample /usr/local/etc/MailScanner/mcp/10_example.cf<BR>mail#cp /usr/local/etc/MailScanner/mcp/mcp.spam.assassin.prefs.conf.sample /usr/local/etc/MailScanner/mcp/mcp.spam.assassin.prefs.conf<BR>注:这里的倒数一、二行实际操作中为一行<BR><BR>重新启动服务器<BR><BR>测试病毒过滤:<BR><BR>mail# telnet localhost 25<BR>Trying ::1...<BR>telnet: connect to address ::1: Connection refused<BR>Trying 127.0.0.1...<BR>Connected to localhost.<BR>Escape character is '^]'.<BR>220 mail.toping.net ESMTP Postfix<BR>mail from:webmaster@toping.net<BR>250 Ok<BR>rcpt to:webmaster@toping.net<BR>250 Ok<BR>data<BR>354 End data with <CR><LF>.<CR><LF><BR>Subject:Virus test<BR><BR>X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*<BR><BR>.<BR>250 Ok: queued as F0C221CC20 //出现F0C221CC20这行表示mailscanner运行成功了<BR>quit<BR>221 Bye<BR>Connection closed by foreign host.<BR><BR>5.7把病毒提示信息改为中文<BR><BR>预设系统提示信息为英文,可以下载我修改的中文包。<BR><BR><A href="http://mail.toping.net/mailscanner/cn.rar" target=_blank><FONT color=#0000ff>http://mail.toping.net/mailscanner/cn.rar</FONT></A><BR><BR>注:把下载下来的文件解压后放到/usr/local/share/MailScanner/reports/cn下面去<BR><BR>mail# ee /usr/local/etc/MailScanner/MailScanner.conf<BR>#%report-dir% = /usr/local/share/MailScanner/reports/en //默认值(加载英文)<BR>%report-dir% = /usr/local/share/MailScanner/reports/cn //修改后为读取中文<BR><BR>5.8.用MailScanner来监管进出邮件<BR>mail# ee MailScanner.conf<BR>Archive Mail = %rules-dir%/archive.rules <BR>mail# ee archive.rules<BR><BR>方法一:互相备份, 以上这样并不会造成 loop <BR>FromOrTo: <A href="mailto:a@toping.net"><FONT color=#0000ff>a@toping.net</FONT></A> yes forward <A href="mailto:b@toping.net"><FONT color=#0000ff>b@toping.net</FONT></A><BR>FromOrTo: <A href="mailto:b@toping.net"><FONT color=#0000ff>b@toping.net</FONT></A> yes forward <A href="mailto:a@toping.net"><FONT color=#0000ff>a@toping.net</FONT></A><BR><BR>方法二:可以 forward 到复数信箱 <BR>FromOrTo: <A href="mailto:a@toping.net"><FONT color=#0000ff>a@toping.net</FONT></A> yes forward <A href="mailto:b@toping.net"><FONT color=#0000ff>b@toping.net</FONT></A> <A href="mailto:c@toping.net"><FONT color=#0000ff>c@toping.net</FONT></A> <A href="mailto:d@toping.net"><FONT color=#0000ff>d@toping.net</FONT></A> <BR><BR>方法三:同时备份到一个或多个档案及一个或多个信箱<BR>FromOrTo: <A href="mailto:a@toping.net"><FONT color=#0000ff>a@toping.net</FONT></A> yes forward /var/spool/MailScanner/archive/a_user_backup.mbx /var/spool/MailScanner/archive/a_user_backup.mbx <A href="mailto:b@toping.net"><FONT color=#0000ff>b@toping.net</FONT></A> <A href="mailto:scyz2@163.com"><FONT color=#0000ff>scyz2@163.com</FONT></A> <BR>注:以上为一行,该档案要先建立且确定该档案拥有者与 MailScanner.conf 的 Run As User = XXXXXXX 相同 <BR><BR>方法四:备份到数据夹及多个信箱或档案<BR>FromOrTo: <A href="mailto:a@toping.net"><FONT color=#0000ff>a@toping.net</FONT></A> yes forward /var/spool/MailScanner/archive/ <A href="mailto:b@toping.net"><FONT color=#0000ff>b@toping.net</FONT></A> <A href="mailto:scyz2@163.com"><FONT color=#0000ff>scyz2@163.com</FONT></A> /var/spool/MailScanner/archive/a_user_backup.mbx <BR>注:以上为一行,权限同SAMPLE3;注意事项, 他会依日期再分数据夹, 日期数据夹内的文件名称 mail queue ID, 格式为 postfix mail queue 格式<BR><BR>更详细的mailscanner.cf的参数请看论坛:<BR><BR><A href="http://www.toping.net/viewthread.php?tid=533&fpage=2" target=_blank><FONT color=#0000ff>http://www.toping.net/viewthread.php?tid=533&fpage=2</FONT></A><BR><BR>5.9.安装MailScanner-mrtg<BR>mail# cd /usr/ports/mail/ mailscanner-mrtg<BR>mail# make install clean<BR><BR>mailscanner-mrtg相关设置<BR>mail# cd /usr/local/etc/mailscanner-mrtg //切换至mailscanner-mrtg 目录<BR>mail# cp mailscanner-mrtg.conf.sample mailscanner-mrtg.conf<BR>mail# cp mailscanner-mrtg.cfg.sample mailscanner-mrtg.cfg<BR>mail# chmod 644 mailscanner-mrtg.conf //更改权限为可修改<BR>mail# chmod 644 mailscanner-mrtg.cfg //更改权限为可修改<BR>mail# ee mailscanner-mrtg.conf //修改mailscanner-mrtg.conf内容如下<BR>#MTA = sendmail //默认值<BR>MTA = postfix //修改后<BR>#Where the MTA puts mail before MailScanner gets it <BR>#Incoming Queue Dir = /var/spool/postfix.in/deferred/ # Postfix<BR>#Incoming Queue Dir = /var/spool/exim.in/input/ # Exim<BR>Incoming Queue Dir = /var/spool/mqueue.in/ # Sendmail //默认值<BR>Incoming Queue Dir = /var/spool/postfix/hold # Postfix //修改后<BR>#Where MailScanner puts your mail after it is scanned <BR>#Outgoing Queue Dir = /var/spool/postfix/incoming/ # Postfix<BR>#Outgoing Queue Dir = /var/spool/exim/input # Exim (?)<BR>Outgoing Queue Dir = /var/spool/mqueue/ # Sendmail //默认值<BR>Outgoing Queue Dir = /var/spool/postfix/incoming/ # Postfix //修改后(把#拿掉)<BR>#Which interfaces to monitor (comma separated list) <BR>Interfaces to Monitor = fxp0 //默认值<BR>Interfaces to Monitor = vr0 //修改后(改成您的网卡吧)<BR><BR>mail# ee /usr/local/etc/apache/httpd.conf //修改apache配置以便读取mailscanner-mrtg数据<BR>内容如下:<BR><BR>#MailScanner Setting<BR>Alias /mailscanner-mrtg/ "/usr/local/www/mailscanner-mrtg/"<BR><BR>产生MailScanner-Mrtg流量图<BR>mail# /usr/local/bin/mrtg /usr/local/etc/mailscanner-mrtg/mailscanner-mrtg.cfg <BR>mail# crontab -e <BR>*/10 * * * * /usr/local/bin/mrtg /usr/local/etc/mailscanner-mrtg/mailscanner-mrtg.cfg<BR><BR>5.10.安装APF防垃圾邮件<BR><A href="http://apf.org.cn/" target=_blank><FONT color=#0000ff>http://apf.org.cn</FONT></A><BR>下载地址:<BR><A href="http://mail.toping.net/apf/apf.rar" target=_blank><FONT color=#0000ff>http://mail.toping.net/apf/apf.rar</FONT></A><BR><BR>下载最新的APF包解压到/usr/local/etc/postfix目录。<BR><BR>这时/usr/local/etc/postfix目录里边有一个apf-posftix.pl的文件<BR>修改/usr/local/etc/postfix/master.cf<BR>mail# ee /usr/local/etc/postfix/master.cf<BR>加入:<BR>apf unix - n n - - spawn<BR> user=nobody argv=/usr/bin/perl /usr/local/etc/postfix/apf-postfix.pl<BR><BR>增加黑白名单:<BR><BR>1、IP黑名单:<BR>ip_black_list.txt<BR><BR>2、IP白名单<BR>ip_white_list.txt<BR><BR>3、域名黑名单<BR>dn_black_list.txt<BR><BR>4、域名白名单<BR>dn_white_list.txt</DIV><BR style="CLEAR: both"><FONT style="FONT: 12px song,Verdana; COLOR: rgb(0,0,0); font-size-adjust: none; font-stretch: normal; x-system-font: none"><BR><BR></FONT></TD></TR> <TR> <TD>您对本贴的看法:<A href="http://bbs.chinaunix.net/postappraise.php?action=sustain&fid=14&tid=661822&pid=4476663&page=1&extra="><FONT color=#0000ff>鲜花[0]</FONT></A> <A href="http://bbs.chinaunix.net/postappraise.php?action=oppose&fid=14&tid=661822&pid=4476663&page=1&extra="><FONT color=#0000ff>臭蛋[0]</FONT></A></TD></TR> <TR> <TD vAlign=bottom><BR>__________________________________<BR><BR>------------------------------------------------<BR>Postfix技术专业支持论坛<BR><BR>Igenus for Postfix 支持论坛<BR><BR>http://www.thismail.org/bbs<BR>--------------------------------<BR></TD></TR> <TR class=t_infoline> <TD class=line style="PADDING-RIGHT: 5px; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; PADDING-TOP: 5px"><A href="http://www.cuug.com/" target=_blank><FONT color=red>做DBA,拿高薪,从</FONT><FONT color=blue>CUUG</FONT><FONT color=red>开始</FONT></A> | <A href="http://www.uplooking.com/" target=_blank><FONT color=blue>京/沪/深三地任选5万年薪就业!</FONT></A> | <A href="http://www.unix-center.net/?p=71" target=_blank><FONT color=blue>学Solaris 10 红宝书教程 得iPod大奖</FONT></A> | <A href="http://ad.cn.doubleclick.net/clk;180009591;24299149;m?http://www-306.ibm.com/software/cn/rational/offerings/testing/webapplicationsecurity/" target=_blank><FONT color=red>对黑客防在先 守在后--IBM WatchFire</FONT></A> </TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE> <TABLE style="MARGIN-BOTTOM: 1px" borderColor=#000000 cellSpacing=0 cellPadding=4 width="98%" align=center bgColor=#f0f3fa border=1> <TBODY> <TR style="HEIGHT: 100%"> <TD vAlign=top width="18%"><A name=pid4476665></A><A href="http://bbs.chinaunix.net/profile-uid-206108.html" target=_blank><FONT face=Fixedsys color=#0000ff>scyzxp</FONT></A> <IMG alt=帅哥 src="http://bbs.chinaunix.net/images/default/icon_minigender_male.gif" border=0> <BR> <DIV class=smalltxt>光明使者<BR><BR><BR><BR><IMG src="http://bbs.chinaunix.net/images/default/level/pips5.gif"><BR>UID:206108<BR>注册:2004-12-8<BR>最后登录: 2008-02-12<BR>帖子:<A href="http://search.chinaunix.net/bbs.php?stype=author&q=scyzxp" target=_blank><U><FONT color=#0000ff>824</FONT></U></A><BR>精华:<A href="http://bbs.chinaunix.net/digest.php?authorid=206108"><U><FONT color=#0000ff>2</FONT></U></A> <BR><BR>可用积分:637 <BR>信誉积分:<A title=信誉分默认为100分,发表悬赏帖,并采纳正确答案后,信誉分增加,不采纳则将可能减少><U>100 </U></A><BR>专家积分:<A title=专家积分通过正确回答悬赏帖,并被提问者采纳后获得><U>0</U></A> (本版)<BR><!-- 总积分:<a title="总积分=可用积分+信誉积分+专家积分"><u>737</u></a><br> --><BR>状态:<FONT color=#999999>...离线...</FONT> </DIV><BR>[<A href="http://bbs.chinaunix.net/profile-uid-206108.html" alt="查看此会员的个人资料"><B><FONT color=#0000ff>资料</FONT></B></A>] [<A href="http://bbs.chinaunix.net/pm.php?action=send&uid=206108" target=_blank alt="给此会员发送站内短信"><B><FONT color=#0000ff>站内短信</FONT></B></A>] [<A href="http://blog.chinaunix.net/dir.php?uid=206108" target=_blank alt="进入此会员的CU博客"><B><FONT color=#0000ff>Blog</FONT></B></A>] <BR><BR><BR></TD> <TD style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px" vAlign=top width="82%"> <TABLE class=t_msg cellSpacing=0 cellPadding=4 bgColor=#f0f3fa border=0> <TBODY> <TR> <TD> <DIV> <DIV class=right style="PADDING-TOP: 4px"><SPAN class=bold> <A href="http://bbs.chinaunix.net/post.php?action=reply&fid=14&tid=661822&repquote=4476665&extra="><FONT color=#0000ff>[引用]</FONT></A> <A href="http://bbs.chinaunix.net/misc.php?action=report&fid=14&tid=661822&pid=4476665&page=1"><FONT color=#0000ff>[报告]</FONT></A> <A onclick="fastreply('回复 #5 scyzxp 的帖子')" href="http://bbs.chinaunix.net/viewthread.php?tid=661822#"><FONT color=#0000ff>[回复]</FONT></A> <A title="评分 0" href="http://bbs.chinaunix.net/misc.php?action=viewratings&tid=661822&pid=4476665"></A><A onclick=scroll(0,0) href="http://bbs.chinaunix.net/viewthread.php?tid=661822#"><IMG alt=顶部 src="http://bbs.chinaunix.net/images/default/top.gif" border=0></A> </SPAN></DIV> <DIV style="PADDING-TOP: 4px"><A class=bold title=复制帖子链接到剪贴板 onclick="setcopy('http://bbs.chinaunix.net/viewthread.php?tid=661822&page=1#pid4476665', '已经复制到剪贴板')" href="http://bbs.chinaunix.net/viewthread.php?tid=661822#"><FONT color=#0000ff>5楼</FONT></A> 发表于 2005-12-4 10:48 </DIV></DIV></TD></TR> <TR> <TD class=line style="PADDING-TOP: 10px" vAlign=top height="100%"> <DIV style="FLOAT: right" align=right></DIV> <DIV class=t_msgfont id=message4476665>Chapter 6. 安装webmail<BR>如何使用本人修改的iGENUS for Postfix 2.01 <BR><BR>下载地址:<BR><A href="http://mail.toping.net/igenus/igenus_for_postfix_2.01.rar" target=_blank><FONT color=#0000ff>http://mail.toping.net/igenus/igenus_for_postfix_2.01.rar</FONT></A><BR><BR>webmail使用igenus,版本是iGENUS for Postfix 2.01 <BR><BR>建议下载本人修改的iGENUS for Postfix 2.01<BR><BR>安装方法参考论坛:<BR><BR><A href="http://www.toping.net/viewthread.php?tid=174&fpage=1" target=_blank><FONT color=#0000ff>http://www.toping.net/viewthread.php?tid=174&fpage=1</FONT></A> <BR><BR>mail# cd /usr/local/www/data<BR>mail# chown -R postfix:postfix phpMyAdmin<BR>mail# cd /usr/local/etc<BR>mail# cp php.ini-dist php.ini<BR>修改/usr/local/etc/php.ini<BR><BR>webmail上传附件设置:<BR>register_globals = On<BR>max_execution_time = 30 //改为60 (增加处理脚本的时间限制)<BR>memory_limit = 8M //改为40M (这样才能发10M的附件)<BR>post_max_size = 8M //改为10M<BR>upload_max_filesize = 2M //改为10M<BR><BR>重启apache<BR><BR>mail# /usr/local/etc/rc.d/apache2.sh restart<BR><BR>Chapter 7. 安装邮件列表(MAILMAN)安装<BR><BR>本节主要讲述邮件列表mailman的安装和配置<BR><BR>设置/etc/make.conf<BR>mail# ee /etc/make.conf<BR># mail/mailman<BR>MAIL_GID="mailman"<BR><BR>安装mailman<BR>mail# portinstall -m BATCH=yes mail/mailman<BR><BR>配置apache(新加入)<BR>mail# ee /usr/local/etc/apache2/httpd.conf<BR>ScriptAlias /mailman "/usr/local/mailman/cgi-bin"<BR><BR><Directory "/usr/local/mailman/cgi-bin"><BR>AllowOverride None<BR>Options none<BR>Order allow,deny<BR>Allow from all<BR></Directory><BR>Alias /pipermail "/usr/local/mailman/archives/public"<BR><BR><Directory "/usr/local/mailman/archives/"><BR>AllowOverride None<BR>Options +FollowSymlinks<BR>Order allow,deny<BR>Allow from all<BR></Directory><BR>用check_perms<BR>mail# /usr/local/mailman/bin/check_perms -f<BR>注:加上-f参数可以修复。<BR><BR>修改/usr/local/mailman/Mailman/mm_cfg.py,加上:<BR>DEFAULT_EMAIL_HOST = 'lists.toping.net'<BR>MTA = 'Postfix'<BR>POSTFIX_STYLE_VIRTUAL_DOMAINS = ['lists.toping.net', 'toping.net']<BR><BR>添加一个邮件列表: <BR>mail# /usr/local/mailman/bin/newlist mailman<BR><BR>把用户添加到邮件列表里测试,建一个文本文件,比如maillists.txt,一行一个邮件地址,然后执行如下命令: <BR>mail# /usr/local/mailman/bin/add_members -n maillists.txt mailman <BR>mail# ee postfix/main.cf<BR>owner_request_special = no<BR>recipient_delimiter = +<BR><BR>virtual_alias_maps = hash:/usr/local/mailman/data/virtual-mailman,<BR>mysql:/usr/local/etc/postfix/mysql/mysql_virtual_alias_maps.cf<BR>alias_maps = hash:/usr/local/mailman/data/aliases,hash:/usr/local/etc/postfix/aliases<BR><BR>mail# ee Default.py<BR>DEFAULT_EMAIL_HOST = 'lists.toping.net'<BR>DEFAULT_URL_HOST = 'lists.toping.net'<BR>DEFAULT_URL_PATTERN = 'http://%s/mailman/'<BR><BR>DEFAULT_SERVER_LANGUAGE = 'zh_CN'<BR><BR>设置virtual-mailman<BR>mail# ee /usr/local/mailman/data/virtual-mailman<BR>lists.meilai.com <<A href="http://lists.meilai.com/" target=_blank><FONT color=#0000ff>http://lists.meilai.com</FONT></A>> anything<BR><BR>邮件列表的配置<BR><BR>Default.py和mm_cfg.py的配置是针对全局的,对全局配置文件的修改不会影响到已经存在的邮件列表。mailman提供了config_list这个命令来对单个邮件列表进行配置,先导出该邮件列表的配置:<BR><BR>mail# /usr/local/mailman/bin/config_list -o /tmp/config mailman<BR><BR>然后修改/tmp/config文件,里面有很多选项,可以根据自己的要求修改,比如加上回复到邮件列表的邮件头、去掉mailman自动加的边脚等等,最后把这个配置文件导回给邮件列表就可以了:<BR><BR>mail# /usr/local/mailman/bin/config_list -i /tmp/config mailman<BR><BR>下面你可以通过web去管理你的邮件列表:<BR><A href="http://lists.toping.net/mailman/admin/mailman" target=_blank><FONT color=#0000ff>http://lists.toping.net/mailman/admin/mailman</FONT></A><BR>查看邮件列表信息:<BR><A href="http://lists.toping.net/mailman/listinfo/mailman/" target=_blank><FONT color=#0000ff>http://lists.toping.net/mailman/listinfo/mailman/</FONT></A><BR>功能太强大了,这里不一一的讲解,自己去发现吧<BR><BR><BR>Chapter 7. 查看系统状态<BR><BR>本节主要讲述phpSysInfo工具的安装和配置<BR>安装phpSysInfo(2.2)<BR>mail# cd /usr/ports/www/phpSysInfo<BR>mail# make install clean<BR>mail# cd /usr/local/www/data-dist/phpSysInfo<BR>mail# cp config.php.new config.php<BR>相关网址:<BR><A href="http://:www.toping.net/" target=_blank><FONT color=#0000ff>http://:www.toping.net/</FONT></A></DIV><BR style="CLEAR: both"><FONT style="FONT: 12px song,Verdana; COLOR: rgb(0,0,0); font-size-adjust: none; font-stretch: normal; x-system-font: none"><BR><BR></FONT></TD></TR> <TR> <TD></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV>
查看全文
发表于:2008-02-13 ┆
阅读(368)
┆
评论(0)
Linux(RHAS3)+Apache+PHP+MySQL+qmail+vpopmail+iGenu
<DIV><BR> <SCRIPT>function StorePage(){d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(keyit=window.open('http://www.365key.com/storeit.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t),'keyit','scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes'));keyit.focus();}</SCRIPT> <DIV class=post> <DIV class=postTitle> <SCRIPT src="http://wz.csdn.net/javascripts/vote.js"></SCRIPT> <IFRAME style="MARGIN-TOP: 0px; FLOAT: left" border=0 marginWidth=0 frameSpacing=0 marginHeight=0 src="http://wz.csdn.net/vote.aspx?t=qmail%20total%20-%20VAN%20BLOOD%20-%20CSDNBlog&u=http%3A//blog.csdn.net/gimser/archive/2005/12/04/543152.aspx" frameBorder=0 noResize width=54 scrolling=no height=75></IFRAME><A href="http://blog.csdn.net/gimser/archive/2005/12/04/543152.aspx"><IMG height=13 src="http://blog.csdn.net/images/authorship.gif" width=15 border=0><FONT color=#800080> qmail total</FONT></A> <SCRIPT src="http://blog.csdn.net/count.aspx?ID=543152&Type=Rank"></SCRIPT> <SPAN title=文章指数:94><IMG src="http://blog.csdn.net/images/star.gif" border=0><IMG src="http://blog.csdn.net/images/star.gif" border=0><IMG src="http://blog.csdn.net/images/star.gif" border=0><IMG src="http://blog.csdn.net/images/star.gif" border=0><IMG src="http://blog.csdn.net/images/star_half.gif" border=0></SPAN> <IMG title="CSDN Blog推出文章指数概念,文章指数是对Blog文章综合评分后推算出的,综合评分项分别是该文章的点击量,回复次数,被网摘收录数量,文章长度和文章类型;满分100,每月更新一次。" alt="CSDN Blog推出文章指数概念,文章指数是对Blog文章综合评分后推算出的,综合评分项分别是该文章的点击量,回复次数,被网摘收录数量,文章长度和文章类型;满分100,每月更新一次。" src="http://blog.csdn.net/images/ask.gif" border=0> </DIV> <DIV class=postText> <DIV class=pagebody> <DIV id=navbar></DIV> <DIV class=post> <DIV class=posttext>(Linux(RHAS3)+Apache+PHP+MySQL+qmail+vpopmail+iGenus+iGenus admin+ezmlm+autorespond+qmailadmin+vqadmin+imap+qmail-scanner+maildrop+spamassassin+MRTG+isoqlog)<BR><BR><BR>功能列表<BR><BR>SMTP服务器:SMTP-AUTH认证(Plain,Login,CRAM-MD5),TLS(SSL)支持 <BR>POP3服务器:CRAM-MD5,APOP,和SSL支持 <BR>IMAP服务器:TLS(SSL)支持<BR>病毒和垃圾邮件检测 <BR>自动回复 <BR>邮件列表<BR>Web管理<BR>通过Web显示统计信息 <BR>WebMail<BR>MRTG<BR><BR><BR>--------------------------------------------------------------------------------<BR><BR>安装准备<BR><BR>安装环境 <BR><BR>这个安装过程基本上你只需要复制粘贴就可以完成.我在RedHat AS3/9.0/8.0/7.3上安装成功,其他系统还没试过.为了方便安装我在安装Redhat3.0时选了apache、php、mysql,注意mysql-devel和mysql-server开发包一定要装上.另外大家在安装LINUX时一定要装上软件开发和内核开发两个软件组,这样可以避免不必要的由于编译环境的问题而导致的安装问题,这点对于LINUX新手犹为重要。安装系统后,一般另需安装php-mysql这个包,在安装光碟第三张。AS3.0安装后,并没有mysql-server软件包,需自行下载安装,为方便大家,mysql-server软件包我已经与所有软件放在一个包中。<BR><BR>要确认下面的软件是否已经安装:<BR><BR>rpm -q httpd<BR>rpm -q php<BR>rpm -q php-mysql<BR>rpm -q mysql<BR>rpm -q mysql-server<BR>rpm -q mysql-devel<BR>rpm -q gdbm<BR>rpm -q gdbm-devel<BR>rpm -q openssl<BR>rpm -q openssl-devel<BR>rpm -q stunnel<BR>rpm -q krb5-devel<BR><BR><BR>如果你还没有安装, 请先安装它们. 你可以到安装光盘或是在这里找到它们的RPM包 http://www.rpmfind.net.<BR><BR><BR>启动mysql server: <BR># /etc/rc.d/init.d/mysqld start <BR>设置mysql root口令: <BR># mysqladmin -u root password ‘xukixu’(设置你的密码) <BR><BR>mysql的头文件和库文件分别在/usr/include/mysql和/usr/lib/mysql。 <BR>安装完Redhat3.0后,修改/etc/httpd/conf/httpd.conf,使web服务正常启用,为mysql添加root用户的密码。如果设置了防火墙,要打开服务器的www 80、smtp 25和pop3 110三个端口。<BR><BR><BR>检查DNS设置 <BR>在开始之前,确保正确设置了DNS MX记录.例如使用"domain.com"作为邮件域,对MX记录进行测试:<BR><BR>在Linux下:<BR><BR># host -t mx domain.com<BR>domain.com. mail is handled by 10 mail.domain.com.<BR># host -t a mail.domain.com<BR>mail.domain.com. has address xxx.xxx.xxx.xxx <BR><BR>在Windows下:<BR><BR>C:\>nslookup<BR>Default Server: ns.domain.com<BR>Address: xxx.xxx.xxx.xxx<BR>>set type=mx<BR>>domain.com<BR>domain.com MX preference = 10, mail exchanger = mail.domain.com<BR>mail.domain.com internet address = xxx.xxx.xxx.xxx<BR>>exit <BR><BR>卸载已有的邮件系统 <BR>确认没有SMTP/POP/IMAP服务在运行:<BR><BR>/etc/init.d/sendmail stop<BR>netstat -na | grep 25<BR>netstat -na | grep 110<BR>netstat -na | grep 143<BR>ntsysv <BR><BR>删除已有的SMTP/POP/IMAP软件:<BR><BR>rpm -e --nodeps sendmail<BR>rpm -e --nodeps postfix <BR><BR>下载软件 <BR>文中所用的软件:<BR><BR>netqmail-1.05.tar.gz<BR>daemontools-0.76.tar.gz<BR>daemontools-0.76.errno.patch<BR>autorespond-2.0.5.tar.gz<BR>toaster-scripts-0.6.tar.gz<BR>qmail-toaster-0.6-1.patch.bz2<BR>ezmlm-0.53.tar.gz<BR>ezmlm-idx-0.42.tar.gz<BR>courier-imap-2.2.2.20040207.tar.bz2<BR>igenus_2.0.2_20040901_release.tgz<BR>mysql-server-3.23.58-1.i386.rpm<BR>qmailadmin-1.2.3.tar.gz<BR>chkuser-0.6.mysql.patch <BR>ucspi-tcp-0.88.a_record.patch<BR>ucspi-tcp-0.88.errno.patch<BR>ucspi-tcp-0.88.nobase.patch<BR>ucspi-tcp-0.88.tar.gz<BR>vpopmail-5.4.7.tar.gz<BR>qmailadmin-1.2.3.tar.gz<BR>vqadmin-2.3.6.tar.gz<BR>Mail-SpamAssassin-3.0.1.tar.gz<BR>clamav-0.80.tar.gz<BR>qmail-scanner-1.22.tgz<BR>qms-analog-0.3.4.tar.gz<BR>maildrop-1.7.0.tar.bz2<BR>tnef-1.2.3.1.tar.gz<BR>qmailanalog-0.70.tar.gz<BR>qmailanalog-0.70.errno.patch<BR>qlogtools-3.1.tar.gz<BR>qlogtools_errno.patch<BR>zlib-1.1.4.tar.gz<BR>libpng-1.2.7.tar.gz<BR>gd-1.8.3.tar.gz<BR>mrtg-2.10.15.tar.gz<BR>qmailmrtg7-4.0.tar.gz<BR>igenus_admin_0.1.tgz<BR>isoqlog-2.1.1.tar.gz<BR><BR><BR>我把下文中所提到的软件打成了一个包,下载地址为:http://www.xuki.org/qmail_2.0.tar.gz;我一般把软件放在/home/pkg下面,根据个人习惯吧。<BR><BR>tar -xzf netqmail-1.05.tar.gz<BR>cd netqmail-1.05<BR>./collate.sh<BR><BR>注意:./collate.sh这一步不要忘<BR><BR><BR>--------------------------------------------------------------------------------<BR><BR>安装软件 <BR>daemontools <BR><BR>daemontools是一个收集管理UNIX进程的工具.用它来监听qmail-send,qmail-smtpd,qmail-pop3d.<BR><BR>#安装:<BR>cd /home/pkg<BR>tar -zxvf daemontools-0.76.tar.gz<BR>cd admin/daemontools-0.76<BR>patch -p1 < /home/pkg/netqmail-1.05/other-patches/daemontools-0.76.errno.patch<BR>package/install <BR># 验证daemontools已经正常运行:<BR>sleep 5<BR>ps ax | grep svscan <BR><BR><BR>--------------------------------------------------------------------------------<BR><BR><BR>ucspi-tcp <BR>ucspi-tcp包括tcpserver和tcpclient,一个命令行工具来建立client-server应用程序.<BR><BR>#安装:<BR>cd /home/pkg<BR>tar zxvf ucspi-tcp-0.88.tar.gz<BR>cd ucspi-tcp-0.88<BR>patch -p1 < ../ucspi-tcp-0.88.a_record.patch <BR>patch -p1 < ../ucspi-tcp-0.88.errno.patch <BR>patch -p1 < ../ucspi-tcp-0.88.nobase.patch <BR>make<BR>make setup check <BR><BR>--------------------------------------------------------------------------------<BR><BR>qmail <BR><BR>这个toaster补丁,是下面这几个补丁的组合:<BR><BR>smtp auth 0.4.2 <BR><BR>qmail-queue (to allow for virus scanners) <BR><BR>maildir++ patch <BR><BR>support oversize dns packets (not necessary if you use dnscache) <BR><BR>mfcheck (check that the envelope sender has a dns entry) <BR><BR>tarpit delay <BR><BR>qregex (regular expression matching in badmailfrom and badmailto) <BR><BR>big concurrency (set the spawn limit above 255)<BR><BR><BR>#安装:<BR><BR>mkdir /var/qmail<BR>groupadd nofiles<BR>useradd -g nofiles -d /var/qmail/alias alias<BR>useradd -g nofiles -d /var/qmail qmaild<BR>useradd -g nofiles -d /var/qmail qmaill<BR>useradd -g nofiles -d /var/qmail qmailp<BR>groupadd qmail<BR>useradd -g qmail -d /var/qmail qmailq<BR>useradd -g qmail -d /var/qmail qmailr<BR>useradd -g qmail -d /var/qmail qmails <BR><BR># 在这里把vpopmail用户也加上<BR>groupadd -g 89 vchkpw<BR>useradd -u 89 -g vchkpw vpopmail <BR><BR>cd /home/pkg<BR>tar -xzf toaster-scripts-0.6.tar.gz<BR>cd netqmail-1.05/<BR>bunzip2 -c ../qmail-toaster-0.6-1.patch.bz2 | patch -p0<BR>cd netqmail-1.05 <BR><BR># 注:在RedHat上,需要为TLS补丁链接一个include文件:<BR>ln -s /usr/kerberos/include/com_err.h /usr/kerberos/include/krb5.h /usr/kerberos/include/profile.h /usr/include/ <BR><BR>vi qmail-smtpd.c \ 搜索函数straynewline中的451改为553 <BR><BR># 当你的服务器收到无效格式的邮件时,会发送:"I am not going to accept that message at the moment,you can try again later",对方服务器收到后,几秒钟后又会发送同样的邮件给你,造成多次的重复。 <BR># 改为553后,你的服务器将直接发送:"I am not going to accept that message,don't try sending it again.",告诉对方的服务器不要再发这封无效的信件。 <BR><BR><BR>make<BR>make setup check <BR><BR># 用你自己的主机名代替下面的mail.domain.com<BR>./config-fast mail.domain.com <BR><BR>cd /var/qmail/alias<BR>touch .qmail-postmaster .qmail-mailer-daemon .qmail-root<BR>chmod 644 /var/qmail/alias/.qmail*<BR>cd - <BR><BR>echo 1 > /var/qmail/control/mfcheck<BR>echo ./Maildir/ >/var/qmail/control/defaultdelivery <BR><BR>make cert<BR># 按提示输入公司信息 <BR><BR>make tmprsadh<BR># 注:这里可能要多等一会 <BR><BR># 用"crontab -e"在crontab里增加下面这条,每天晚上更新temp keys<BR>01 01 * * * /var/qmail/bin/update_tmprsadh > /dev/null 2>&1 <BR><BR>#为qmail服务建立监控目录和日志文件:<BR><BR>mkdir -p /var/qmail/supervise/qmail-send/log<BR>mkdir -p /var/qmail/supervise/qmail-smtpd/log<BR>mkdir -p /var/qmail/supervise/qmail-pop3d/log<BR>mkdir -p /var/qmail/supervise/qmail-pop3ds/log<BR>chmod +t /var/qmail/supervise/qmail-send<BR>chmod +t /var/qmail/supervise/qmail-smtpd<BR>chmod +t /var/qmail/supervise/qmail-pop3d/log<BR>chmod +t /var/qmail/supervise/qmail-pop3ds/log<BR>cp /home/pkg/toaster-scripts-0.6/send.run /var/qmail/supervise/qmail-send/run<BR>cp /home/pkg/toaster-scripts-0.6/send.log.run /var/qmail/supervise/qmail-send/log/run<BR>cp /home/pkg/toaster-scripts-0.6/smtpd.run /var/qmail/supervise/qmail-smtpd/run<BR>cp /home/pkg/toaster-scripts-0.6/smtpd.log.run /var/qmail/supervise/qmail-smtpd/log/run<BR>cp /home/pkg/toaster-scripts-0.6/pop3d.run /var/qmail/supervise/qmail-pop3d/run<BR>cp /home/pkg/toaster-scripts-0.6/pop3d.log.run /var/qmail/supervise/qmail-pop3d/log/run<BR>cp /home/pkg/toaster-scripts-0.6/pop3ds.run /var/qmail/supervise/qmail-pop3ds/run<BR>cp /home/pkg/toaster-scripts-0.6/pop3ds.log.run /var/qmail/supervise/qmail-pop3ds/log/run<BR>echo 20 > /var/qmail/control/concurrencyincoming<BR>chmod 644 /var/qmail/control/concurrencyincoming<BR>chmod 755 /var/qmail/supervise/qmail-send/run<BR>chmod 755 /var/qmail/supervise/qmail-send/log/run<BR>chmod 755 /var/qmail/supervise/qmail-smtpd/run<BR>chmod 755 /var/qmail/supervise/qmail-smtpd/log/run<BR>chmod 755 /var/qmail/supervise/qmail-pop3d/run<BR>chmod 755 /var/qmail/supervise/qmail-pop3d/log/run<BR>chmod 755 /var/qmail/supervise/qmail-pop3ds/run<BR>chmod 755 /var/qmail/supervise/qmail-pop3ds/log/run<BR>mkdir -p /var/log/qmail/smtpd<BR>mkdir -p /var/log/qmail/pop3d<BR>mkdir -p /var/log/qmail/pop3ds<BR>chown -R qmaill /var/log/qmail <BR><BR>#启动脚本:<BR><BR>cp /home/pkg/toaster-scripts-0.6/rc /var/qmail/<BR>cp /home/pkg/toaster-scripts-0.6/qmailctl /var/qmail/bin/<BR>chmod 755 /var/qmail/rc<BR>chmod 755 /var/qmail/bin/qmailctl <BR><BR>ln -s /var/qmail/bin/qmailctl /usr/bin<BR>ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail<BR>ln -s /var/qmail/bin/sendmail /usr/lib/sendmail <BR><BR># 用daemontools来启动qmail-send和qmail-smtpd<BR>ln -s /var/qmail/supervise/qmail-send /var/qmail/supervise/qmail-smtpd /service <BR><BR>#命令:<BR><BR># 启动,停止,重启,查看队列等<BR>qmailctl start|stop|restart|doqueue|flush|reload|stat|pause|cont|cdb|queue|help <BR><BR><BR># 检查服务<BR>netstat -an | grep 25<BR>ps -ef | grep qmail<BR>ps -efl | grep "service errors" | grep -v grep <BR><BR>日志:<BR><BR>/var/log/maillog<BR>/var/log/qmail/current<BR>/var/log/qmail/pop3d/current<BR>/var/log/qmail/pop3ds/current<BR>/var/log/qmail/smtpd/current<BR><BR>我建议重新回顾一下刚才我们所做的步骤以熟悉对qmail的安装. 下面我们将开始vpopmail的安装.<BR><BR>--------------------------------------------------------------------------------<BR><BR>vpopmail <BR><BR>vpopmail是一个以qmail为基础的虚拟域管理包<BR><BR>vpopmail的用户和组我们前边已经建立了<BR><BR>#配置:<BR><BR>mkdir -p /home/vpopmail/etc <BR><BR># 设置默认域,红色部份改成你要设置的域。<BR>echo "domain.com" > /home/vpopmail/etc/defaultdomain <BR><BR># 设置smtp规则,关闭open relays<BR>echo '127.0.0.1:allow,RELAYCLIENT=""' > /home/vpopmail/etc/tcp.smtp<BR>cd /home/vpopmail/etc ; tcprules tcp.smtp.cdb tcp.smtp.tmp < tcp.smtp <BR><BR># 设置MySQL信息,第一个vpopmail是帐号,xukixu为密码,第二个vpopmail是数据库<BR>echo "localhost|0|vpopmail|xukixu|vpopmail" > /home/vpopmail/etc/vpopmail.mysql<BR><BR>chmod 640 /home/vpopmail/etc/vpopmail.mysql <BR>chown -R vpopmail.vchkpw /home/vpopmail/etc <BR><BR># 在MySQL里添加vpopmail的帐号<BR>mysql -uroot --pxukixu<BR><BR>CREATE DATABASE vpopmail;<BR>GRANT select,insert,update,delete,create,drop ON vpopmail.*<BR>TO vpopmail@localhost IDENTIFIED BY 'xukixu';<BR>FLUSH PRIVILEGES;<BR>QUIT <BR><BR>#安装:<BR><BR>cd /home/pkg/<BR>tar zxvf vpopmail-5.4.7.tar.gz<BR>cd vpopmail-5.4.7<BR><BR># 带数据库支持<BR><BR>./configure --enable-incdir=/usr/include/mysql --enable-libdir=/usr/lib/mysql --disable-roaming-users --enable-logging=p --disable-passwd --enable-clear-passwd --disable-domain-quotas --enable-auth-module=mysql --enable-auth-logging --enable-mysql-logging --disable-valias --disable-mysql-limits<BR><BR>make<BR>make install-strip <BR><BR>#管理:<BR><BR>echo 'export PATH=$PATH:/home/vpopmail/bin' >> /etc/profile<BR>source /etc/profile <BR><BR># 添加域,红色部份前面是域名,后面是管理员(postmaster)密码<BR>vadddomain domain.com xukixu<BR><BR># 添加用户,红色部份为注解,不用输入<BR>vadduser -q 10485760S(邮箱大小) xukixu@domain.com(邮箱帐号) 1234(密码)<BR>vmoduser -c 许靖(邮箱描述) xukixu@domain.com <BR><BR># 设置邮箱容量达到90%的警告信息<BR>vi /home/vpopmail/domains/.quotawarn.msg <BR><BR>From: 邮箱管理员 <BR>Reply-To: postmaster@domain.com<BR>To: 邮箱用户<BR>Subject: 邮箱空间警告<BR>Mime-Version: 1.0<BR>Content-Type: text/html; charset=gb2312<BR>Content-Transfer-Encoding: base64 <BR><BR>您的邮箱空间已经达到90%.如果想继续使用,请删除一些信件.<BR>如果需要帮助,请联系邮箱管理员:<BR>Email : postmaster@domain.com <BR><BR># 设置邮箱已满的警告信息<BR>echo "邮件被拒绝,用户的邮箱空间已满." > /home/vpopmail/domains/.over-quota.msg <BR><BR>#启动脚本:<BR><BR>cp /home/pkg/toaster-scripts-0.6/vpopmailctl /var/qmail/bin<BR>ln -s /var/qmail/bin/vpopmailctl /usr/bin<BR>chmod 755 /var/qmail/bin/vpopmailctl <BR><BR># 用daemontools来启动qmail-pop3d和qmail-pop3ds<BR>ln -s /var/qmail/supervise/qmail-pop3d /service<BR>ln -s /var/qmail/supervise/qmail-pop3ds /service <BR><BR>#命令:<BR><BR># 启动,停止,重启,查看队列等<BR>vpopmailctl start|stop|restart|stat|pause|cont|help <BR><BR># 检查服务<BR>netstat -an | grep 110<BR>ps -ef | grep qmail<BR>ps -efl | grep "service errors" | grep -v grep <BR><BR>#补丁:<BR><BR># 带数据库支持<BR>cd /home/pkg/netqmail-1.05/netqmail-1.05<BR>patch -p0 < /home/pkg/chkuser-0.6.mysql.patch <BR><BR>#修改libmysqlclient.a存在路径<BR>vi conf-mysql<BR>/usr/lib/mysql/libmysqlclient.a<BR>make clean<BR>make<BR>qmailctl stop<BR>make setup check<BR>qmailctl start <BR><BR><BR>安装选项参考:<BR><BR>vpopmail 5.4.7<BR>Current settings<BR>---------------------------------------<BR><BR>vpopmail directory = /home/vpopmail<BR>uid = 89<BR>gid = 89<BR>roaming users = OFF --disable-roaming-users (default)<BR>password learning = OFF --disable-learn-passwords (default)<BR>md5 passwords = ON --enable-md5-passwords (default)<BR>file locking = ON --enable-file-locking (default)<BR>vdelivermail fsync = OFF --disable-file-sync (default)<BR>make seekable = ON --enable-make-seekable (default)<BR>clear passwd = ON --enable-clear-passwd (default)<BR>user dir hashing = ON --enable-users-big-dir (default)<BR>address extensions = OFF --disable-qmail-ext (default)<BR>ip alias = OFF --disable-ip-alias-domains (default)<BR>domain quotas = OFF --disable-domainquotas (default)<BR>auth module = mysql --enable-auth-module=mysql<BR>mysql replication = OFF --disable-mysql-replication (default)<BR>mysql logging = ON --enable-mysql-logging<BR>mysql limits = OFF --disable-mysql-limits (default)<BR>MySQL valias = OFF --disable-valias (default)<BR>auth inc = -I/usr/include/mysql<BR>auth lib = -L/usr/lib/mysql -lmysqlclient -lz -lm<BR>system passwords = OFF --disable-passwd (default)<BR>pop syslog = show failed attempts with clear text password<BR>--enable-logging=p<BR>auth logging = ON --enable-auth-logging (default)<BR>all domains in one SQL table = --enable-many-domains (default)<BR><BR>#POP3和SMTP测试<BR><BR>用outlook测试qmail的smtp和pop3是否正常,注意由于vpopmail支持虚拟域名,所以在outlook中设置邮件帐号时,用户名后要加上域名,如demo@demo.com。smtp是带认证的,在outlook中也要作相应设置。建议先测试正常<BR><BR><BR>后再进行下一步安装。如果qmail出现问题,可查看mysql中的vpopmail数据库,/var/log下的mysqld和maillog日志记录,这样容易很快找出问题。<BR><BR><BR>--------------------------------------------------------------------------------<BR><BR>安装并运行igenus<BR><BR>到http://www.igenus.org下载最新的安装包,我用的是igenus_2.0.2_20040901_release.tgz <BR><BR>#安装:<BR>cd /home/pkg<BR>tar zxvf igenus_2.0.2_20040901_release.tgz -C /var/www/ <BR>cd /var/www/<BR>rm -rf html/<BR>mv igenus html<BR><BR><BR><BR>#建temp文件夹 <BR><BR>cd /var/www/html/<BR>mkdir temp <BR>chmod -R 0755 temp <BR><BR>chown -R vpopmail:vchkpw temp <BR>mkdir /home/netdisk<BR><BR>chmod -R 0755 /home/netdisk <BR>chown -R vpopmail:vchkpw /home/netdisk<BR><BR>chmod -R 0755 /var/www/html/<BR>chown -R vpopmail:vchkpw /var/www/html/<BR><BR><BR>#修改httpd.conf <BR><BR>vi /etc/httpd/conf/httpd.conf<BR>Group vchkpw <BR>User vpopmail <BR>DocumentRoot "/var/www/html/"<BR><BR>AddDefaultCharset GB2312 //使默认页面为中文 <BR><BR>/etc/rc.d/init.d/httpd restart //重启apache,使修改生效 <BR><BR><BR>#修改config_inc.php文件 <BR><BR>cd /var/www/html/config <BR>vi config_inc.php <BR><BR>$CFG_BASEPATH = "/var/www/html/"; \\改成你安装的目录<BR>$CFG_MYSQL_HOST = 'localhost'; <BR>$CFG_MYSQL_USER = 'vpopmail'; \\vpopmail访问mysql的帐号<BR>$CFG_MYSQL_PASS = 'xukixu'; \\vpopmail访问mysql的密码<BR>$CFG_MYSQL_DB = 'vpopmail'; \\数据库<BR>$CFG_TEMP = $CFG_BASEPATh."temp"; \\改成你安装的目录的当前目录下<BR><BR><BR>#重新编制Mysql数据库表格 <BR><BR>#删除之前创建的域名<BR>vdeldomain domain.com<BR><BR>#编辑数据库:<BR>mysql -uroot -pxukixu<BR><BR>use vpopmail;<BR>drop table lastauth;<BR>drop table vpopmail;<BR>quit;<BR><BR>#编辑/var/www/html/docs/iGENUS.sql<BR><BR>vi /var/www/html/docs/iGENUS.sql<BR><BR># phpMyAdmin SQL Dump<BR># version 2.5.3<BR># http://www.phpmyadmin.net<BR>#<BR># Host: localhost<BR># Generation Time: Jun 04, 2004 at 11:26 AM<BR># Server version: 3.23.55<BR># PHP Version: 4.3.0<BR># <BR># Database : `vpopmail`<BR># <BR><BR># --------------------------------------------------------<BR><BR>#<BR># Table structure for table `address`<BR>#<BR><BR>use vpopmail; //加入这一行<BR>CREATE TABLE `address` (<BR>`id` int(11) unsigned NOT NULL auto_increment,<BR>`pw_id` int(5) NOT NULL default '0',<BR>`name` varchar(64) NOT NULL default '',<BR>`email` varchar(128) NOT NULL default '',<BR>UNIQUE KEY `id` (`id`),<BR>KEY `pw_id` (`pw_id`)<BR>) TYPE=MyISAM PACK_KEYS=1 ;<BR><BR># --------------------------------------------------------<BR>。。。。。。。。。<BR>。。。。。。。。。。<BR><BR><BR>CREATE TABLE `vpopmail` (<BR>`pw_id` int(5) unsigned NOT NULL auto_increment,<BR>`pw_name` varchar(32) NOT NULL default '',<BR>`pw_domain` varchar(64) NOT NULL default '',<BR>`pw_passwd` varchar(40) NOT NULL default '',<BR>`pw_uid` int(11) default NULL,<BR>`pw_gid` int(11) default NULL,<BR>`pw_gecos` varchar(48) default NULL,<BR>`pw_dir` varchar(255) default NULL,<BR>`pw_shell` varchar(20) default NULL,<BR>`pw_clear_passwd` varchar(16) default NULL, \\加入这一行 <BR>`createtime` timestamp(14) NOT NULL,<BR>PRIMARY KEY (`pw_id`),<BR>KEY `pw_name` (`pw_name`,`pw_domain`)<BR>) TYPE=MyISAM PACK_KEYS=1 ;<BR><BR>运行<BR>#mysql -uroot -pxukixu </var/www/html/docs/iGENUS.sql 导入数据表。<BR><BR><BR><BR><BR>#设置igenus 定义允许上传下载的邮件的大小<BR><BR>vi /etc/php.ini<BR>#编辑/etc/php.ini<BR><BR>max_execution_time=60<BR>memory_limit=20M<BR>post_max_size = 10M<BR>file_uploads=on<BR>upload_max_filesize=10M<BR>register_globals=On<BR>session.bug_compat_42=0<BR>session.bug_compat_warn=0<BR>sendmail_path = /var/qmail/bin/qmail-inject<BR><BR><BR>vi /etc/httpd/conf/httpd.conf<BR>#编辑/etc/http/conf/httpd.conf <BR><BR><BR>AddType application/x-httpd-php .php<BR>AddType application/x-httpd-php-source .phps<BR>DirectoryIndex index.php index.html<BR>NameVirtualHost *:80<BR><VirtualHost *:80><BR>ServerName mail.domain.net<BR>DocumentRoot /var/www/html<BR></VirtualHost><BR><BR><BR>#重启apache: <BR>#service httpd restart<BR><BR><BR>#如果需要,用vadddomain和vadduser添加新域名和新用户。<BR><BR>最后打开浏览器,输入http://domain.com/,就可以访问网站了。<BR><BR><BR>#Qmail限制附件的大小 <BR><BR>在/var/qmail/control/databytes 文件中设置附件的大小,可以实现对qmail附件大小的限制,一般安装完成后,这个文件是没有的,你可以自己创建。 <BR>smtp方式是以qmail的databytes作限制的 <BR>创建databytes并设置邮件最大为4m <BR><BR># echo 4000000 >/var/qmail/control/databyte<BR><BR><BR>#限制单域的邮箱数量 <BR><BR>vi /home/vpopmail/domains/domain.com/.qmailadmin-limits <BR><BR>maxpopaccounts 200 <BR>default_quota 52428800s <BR><BR>chmod 700 /home/vpopmail/domains/domain.com/.qmailadmin-limits <BR>chwod vpopmail:vchkpw /home/vpopmail/domains/domain.com/.qmailadmin-limits <BR><BR>这样就把邮箱总数限制在200个,每个邮箱为50M了 <BR><BR><BR><BR>#用qmail封mailfrom <BR><BR>vi/var/qmail/control/badmailfrom<BR><BR>这个控制文件实现拒收邮件功能的,每一个地址要单独一行。而且,不用重起qmail就能生效。例如:<BR><BR>peng@96633.net -----限制一个特定的用户 <BR>@sina.com -----限制整个域中的邮件 <BR><BR><BR>--------------------------------------------------------------------------------<BR><BR>安装并运行iGenus_Admin <BR>iGenus_Admin安装 <BR><BR>#下载 <BR>从www.igenus.org 下载igenus_admin的安装文件igenus_admin_0.1.tgz到/home/pkg <BR><BR>#安装 <BR>cd /home/pkg<BR>tar -xzvf igenus_admin_0.1.tgz -C /var/www/html/ <BR><BR>#设置<BR><BR>vi /var/www/html/admin/includes/config_inc.php <BR><BR><?php <BR>/*- <BR>* iGENUS webmail <BR>* <BR>* Copyright (c) 1999-2002 by iGENUS Org. <BR>* All rights reserved. <BR>* Author: Wu Qiong <wuqiong@sczg.com> <BR>* <BR>* $Id: config_inc.php,v 1.11 2004/03/23 13:59:12 wuqiong Exp $ <BR>*/ <BR><BR>if(!defined("INCLUDE_CONFIG_OK")) { <BR>define("INCLUDE_CONFIG_OK","TRUE"); <BR><BR>/* gid flags defind by vpopmail.h */ <BR><BR>// define('NO_PASSWD_CHNG',0x01); <BR>define('NO_POP', 0x02); <BR>define('NO_WEBMAIL', 0x04); <BR>// define('NO_IMAP', 0x08); <BR>// define('BOUNCE_MAIL', 0x10); <BR>// define('NO_RELAY', 0x20); <BR>// define('NO_DIALUP', 0x40); <BR>// define('V_USER0', 0x080); <BR>// define('V_USER1', 0x100); <BR>// define('V_USER2', 0x200); <BR>// define('V_USER3', 0x400); <BR>define('NO_SMTP', 0x800); <BR>// define('QA_ADMIN', 0x1000); <BR><BR>$CFG_VPOPMAIL_HOST = "localhost"; <BR>$CFG_VPOPMAIL_USER = "vpopmail"; \\改为你的帐号 <BR>$CFG_VPOPMAIL_PASS = "vpopmail"; \\改为你的密码 <BR>$CFG_VPOPMAIL_DB = "vpopmail"; <BR>$CFG_VPOPMAIL_TABLE = "vpopmail"; <BR>$CFG_ADMIN_TABLE = "admin"; <BR>$CFG_LAGESITE = true; <BR>$CFG_NUMOFPAGE = 20; <BR><BR>$CFG_MAILBOX['inbox'] = "."; <BR>$CFG_MAILBOX['outbox'] = ".Outbox"; <BR>$CFG_MAILBOX['draft'] = ".Draft"; <BR>$CFG_MAILBOX['trash'] = ".Trash"; <BR><BR>$CFG_VPOPMAIL_PATH = "/home/vpopmail"; \\改为你的vpopmail安装目录 <BR>// $CFG_VPOPMAIL_PATH = "/home2/vpopmail"; <BR><BR>$CFG_SYSADMIN_NAME = "Admin"; <BR>$CFG_SYSADMIN_PASSWD= '$1$GvmONIco$0SwBB.mEoP3KJ5Zda7ioV0'; <BR><BR>$CFG_SYSADMIN_PASSWD_FILE = $CFG_VPOPMAIL_PATH . "/etc/syspasswd.dat"; <BR>$CFG_TIMEOUT = 600; <BR><BR>$CFG_IGENUS_ADM = "iGENUS邮件系统管理"; <BR><BR>$CFG_TEMPLATE_PATH = "template/"; <BR>} <BR>?> <BR><BR>#保存退出 <BR><BR>touch /etc/syspasswd.dat<BR><BR>chown -R vpopmail.vchkpw /var/www/html <BR>chmod -R 755 /var/www/html<BR>chown root /home/vpopmail/bin/vadddomain <BR>chmod a+s /home/vpopmail/bin/vadddomain <BR>chmod 4711 /home/vpopmail/bin/vadddomain <BR>chmod 4711 /home/vpopmail/bin/vdeldomain <BR><BR>#登录设置页面 <BR>http;//domain.com/admin/sys/ <BR><BR>用户:Admin密码Admin来登录.注意A要大写..这个管理帐号密码登录后可以改的 <BR><BR>登录后,首先点"更新数据库"你就会看见你的域名啦.然后点"编辑"把"登录权限 该域管理员(Postmaster)有权登录进行用户管理"这一项打勾,确认后,就可以用 <BR><BR>http;//domain.com/admin/ <BR><BR>来登录管理了。<BR><BR>--------------------------------------------------------------------------------<BR><BR>courier-imap<BR><BR>Courier-IMAP支持IMAP/SIMAP访问<BR><BR>#安装:<BR><BR>cd /home/pkg<BR>tar -xjf courier-imap-2.2.2.20040207.tar.bz2<BR>cd courier-imap-2.2.2.20040207 <BR><BR># 作为vpopmail用户进行安装<BR>chown -R vpopmail:vchkpw ../courier-imap-2.2.2.20040207<BR>su vpopmail<BR>./configure --with-redhat<BR># 注:Redhat用户需要使用"--with-redhat"选项<BR><BR>make<BR>exit<BR>make install-strip<BR>make install-configure<BR><BR>cp courier-imap.sysvinit /etc/rc.d/init.d/courier-imap<BR>chmod 755 /etc/rc.d/init.d/courier-imap<BR>chkconfig --add courier-imap <BR><BR>#配置:<BR><BR># 修改文件/usr/lib/courier-imap/etc/authdaemonrc <BR><BR>authmodulelist="authvchkpw" <BR><BR># 修改文件/usr/lib/courier-imap/etc/imapd <BR><BR>IMAPDSTART=YES <BR><BR># 修改文件/usr/lib/courier-imap/etc/imapd-ssl <BR><BR>IMAPDSSLSTART=YES <BR><BR><BR>#启动:<BR><BR><BR>/etc/rc.d/init.d/courier-imap start <BR><BR><BR>--------------------------------------------------------------------------------<BR><BR>autorespond <BR>Autorespond是一个自动回复工具,可以很好的与qmailadmin配合使用<BR><BR>#安装:<BR><BR>cd /home/pkg<BR>tar -xvzf autorespond-2.0.5.tar.gz<BR>cd autorespond-2.0.5<BR>make<BR>make install <BR><BR><BR>--------------------------------------------------------------------------------<BR><BR>ezmlm <BR>exmlm是一个快速,强大的邮件列表程序,可以通过qmailadmin对其进行配置<BR><BR>#安装:<BR><BR>cd /home/pkg<BR>tar -xvzf ezmlm-0.53.tar.gz<BR>tar -xvzf ezmlm-idx-0.42.tar.gz<BR>cp -rf ezmlm-idx-0.42/* ezmlm-0.53/<BR>cd ezmlm-0.53<BR>patch < idx.patch<BR>chmod u+x makelang<BR><BR><BR>make<BR>make man <BR>make ch_GB #汉字GB2312支持 <BR><BR>make setup <BR><BR><BR>-------------------------------------------------------------------------------<BR><BR>qmailadmin <BR>qmailadmin除了不能添加删除虚拟域外,几乎可以完成所有的虚拟域管理 <BR><BR>#安装:<BR><BR>cd /home/pkg<BR>tar -xvzf qmailadmin-1.2.3.tar.gz<BR>cd qmailadmin-1.2.3 <BR><BR>./configure --enable-htmldir=/var/www/html --enable-cgibindir=/var/www/cgi-bin --enable-vpopuser=vpopmail --enable-autoresponder-bin=/usr/bin --disable-ezmlm-mysql --enable-maxusersperpage=20 --enable-maxaliasesperpage=20 --disable-modify-quota <BR><BR>make<BR>make install-strip<BR>cd /usr/local/share/qmailadmin/lang<BR>mv en en.bak<BR>cp zh-cn en <BR><BR>安装选项参考:<BR><BR><BR>qmailadmin 1.2.3<BR>Current settings<BR>---------------------------------------<BR>cgi-bin dir = /var/www/cgi-bin<BR>html dir = /var/www/html<BR>image dir = /var/www/html/images/qmailadmin<BR>image URL = /images/qmailadmin<BR>template dir = /usr/local/share/qmailadmin<BR>qmail dir = /var/qmail<BR>vpopmail dir = /home/vpopmail<BR>autorespond dir = /usr/bin<BR>ezmlm dir = /var/qmail/bin/ezmlm<BR>ezmlm idx = yes<BR>mysql for ezmlm = yes<BR>help = no<BR>modify quota = yes<BR>domain autofill = no<BR>modify spam check = no <BR><BR><BR>--------------------------------------------------------------------------------<BR><BR>vqadmin<BR><BR>vqadmin是一个基于web 的控制通道. 它允许系统管理员可以执行root用户才能进行的操作. <BR><BR>cd /home/pkg<BR>tar -zxf vqadmin-2.3.6.tar.gz <BR>cd vqadmin-2.3.6<BR><BR>vi db_owner.c <BR><BR>static const char *host="localhost";<BR>static const char *user="vpopmail";<BR>static const char *passwd="xukixu"; /* NULL for no password */<BR>static const char *db="vpopmail";<BR><BR>./configure <BR>make<BR>make install<BR><BR><BR>#现在我们需要将下面几行添加到httpd.conf文件中:<BR><BR>vi /etc/httpd/conf/httpd.conf<BR><BR><Directory "/var/www/cgi-bin/vqadmin"><BR>deny from all<BR>Options ExecCGI<BR>AllowOverride AuthConfig<BR>Order deny,allow<BR></Directory> <BR><BR>#保存文件并退出.<BR><BR>cd /var/www/cgi-bin/vqadmin<BR><BR>chown nobody .htaccess<BR>chmod 600 .htaccess<BR><BR># 创建一个管理帐号及密码<BR>htpasswd -bc /etc/httpd/conf/vqadmin.passwd admin(帐号) adminpass(密码)<BR>chown nobody.nobody /etc/httpd/conf/vqadmin.passwd<BR><BR>chmod 644 /etc/httpd/conf/vqadmin.passwd<BR><BR>chown -R vpopmail.vchkpw /var/www/cgi-bin<BR><BR><BR>#编辑.htaccess<BR><BR>vi .htaccess<BR><BR>AuthType Basic<BR>AuthUserFile /etc/httpd/conf/vqadmin.passwd<BR>AuthName vQadmin<BR>require valid-user<BR>satisfy any<BR><BR>service httpd restart<BR>在你的浏览器上测试一下安装结果:<BR><BR>http://www.domain.com/cgi-bin/vqadmin/vqadmin.cgi<BR><BR><BR>--------------------------------------------------------------------------------<BR><BR>SpamAssassin <BR>安装 SpamAssassin<BR>Spam是一个让人讨厌的字眼. 大部分的人都不喜欢它. 如果你想保护自己免受spam, 你就需要安装SpamAssassin.<BR><BR>安装SpamAssassin 要用到Time-HiRes、Digest-SHA1、HTML-Parser、perl-DB_File和HTML-Tagset. 如果你没有安装的话,必须首先安装它,此文件均在RHAS3安装光盘第二和第三张中。对应的软件包为:<BR><BR><BR>perl-Time-HiRes-1.38-3.i386.rpm<BR>perl-Digest-SHA1-2.01-15.1.i386.rpm<BR>perl-HTML-Parser-3.26-17.i386.rpm<BR>perl-HTML-Tagset-3.03-28.noarch.rpm<BR>perl-DB_File-1.804-88.i386.rpm<BR><BR><BR># 安装SpamAssassin<BR><BR>groupadd spamd<BR>useradd -g spamd -s /bin/false spamd<BR><BR>cd /home/pkg<BR>tar -xzvf Mail-SpamAssassin-3.0.1.tar.gz<BR>cd Mail-SpamAssassin-3.0.1<BR><BR>export LC_ALL=C<BR>perl Makefile.PL<BR>make<BR>make install<BR><BR>#我们想要SpamAssassin 随系统自动启动,安装目录中提供了一个起动脚本<BR><BR>cp spamd/redhat-rc-script.sh /etc/rc.d/init.d/spamd<BR>vi /etc/rc.d/init.d/spamd<BR><BR>SPAMDOPTIONS="-d -c -u spamd -H /home/spamd -m5"<BR><BR>#修改其中一行为上所示。<BR><BR>chmod 755 /etc/rc.d/init.d/spamd<BR>chkconfig --add spamd<BR><BR>#spamassassin的过滤模板在/etc/mail/spamassassin/local.cf,修改为:<BR><BR>vi /etc/mail/spamassassin/local.cf<BR><BR>required_hits 5.0 <BR>rewrite_subject 1 <BR>subject_tag ********SPAM******** <BR>report_safe 1 <BR>defang_mime 0 <BR>rewrite_subject 0 <BR>report_header 1 <BR>use_terse_report 1 <BR>use_bayes 1 <BR>auto_learn 1 <BR>skip_rbl_checks 1 <BR>use_razor2 0 <BR>use_dcc 0 <BR>use_pyzor 0 <BR><BR>score SUBJ_FULL_OF_8BITS 0.0 <BR>score BASE64_ENC_TEXT 0.0 <BR>score BAYES_99 0.1 <BR>score BAYES_90 0.1 <BR>score SUBJ_ILLEGAL_CHARS 0.1 <BR>score FROM_ILLEGAL_CHARS 0.5 <BR>score HEAD_ILLEGAL_CHARS 0.5 <BR>score MIME_BASE64_TEXT 0.5 <BR>ok_locales en zh <BR><BR><BR>chmod 755 /etc/rc.d/init.d/spamd<BR>chkconfig --add spamd<BR>service spamd start<BR><BR>#运行ntsysv,将spamd设定的为开机运行.<BR><BR># 进行一个spam和non-spam的测试<BR><BR>spamassassin -t < sample-spam.txt > spamtest.txt<BR>less spamtest.txt<BR>spamassassin -t < sample-nonspam.txt > nospamtest.txt<BR>less nospamtest.txt <BR>#spamtest.txt文件在主题一段中将包含"*****SPAM*****" 这一行, 而nospamtest.txt文件中则没有.<BR><BR>#建立SpamAssassin的学习系统 <BR>sa-learn --rebuild -D -p user_prefs <BR><BR>sa-learn --dump all 可以查看自学习的数据信息 <BR><BR><BR>--------------------------------------------------------------------------------<BR><BR>Clamav <BR>#添加所需的组和用户<BR><BR>groupadd clamav<BR>useradd -g clamav -s /bin/false clamav<BR><BR>#安装软件<BR><BR>cd /home/pkg <BR>tar -xzvf clamav-0.80.tar.gz<BR>cd clamav-0.80<BR>./configure<BR>make check<BR>make install<BR><BR>#测试Clamav <BR>clamscan --recursive --log=/tmp/clamscan.log ./ //扫描当前目录,测试clamscn是否运行<BR>cat /tmp/clamscan.log<BR><BR>#更改/usr/local/etc/freshclam.conf文件,去掉下面选项前面的#:<BR>vi /usr/local/etc/freshclam.conf<BR><BR>#Example \\前面加上# <BR>UpdateLogFile /var/log/freshclam.log \\去掉前面的#<BR>LogSyslog \\去掉前面的#<BR><BR>更改/usr/local/etc/clamd.conf文件,去掉下面选项前面的#: <BR>vi /usr/local/etc/clamd.conf<BR><BR>#Example \\前面加上# <BR>LogFile /var/log/clamav/clamd.log \\去掉前面的# <BR>LogFileMaxSize 2M \\去掉前面的# <BR>LogTime \\去掉前面的# <BR>PidFile /var/run/clamd.pid \\去掉前面的# <BR>DatabaseDirectory /var/lib/clamav \\去掉前面的#,并且修改路径为/usr/local/share/clamav <BR>LogSyslog \\去掉前面的#<BR>ScanMail \\去掉前面的#<BR><BR><BR>touch /var/log/freshclam.log <BR>chmod 644 /var/log/freshclam.log <BR>chown clamav:clamav /var/log/freshclam.log <BR><BR>#升级clamscan病毒库<BR>freshclam --verbose<BR><BR>#把freshclam加入crontab 定时更新病毒库,自动扫描/home目录<BR><BR>crontab -e<BR><BR>0 1 * * * freshclam --quiet -l /var/log/freshclam.log<BR>0 6 * * * /usr/local/bin/clamscan --recursive --infected --exclude /usr/local/share/clamav/viruses.db --exclude /usr/local/share/clamav/viruses.db2 --log=/var/log/clamscan.log /home<BR><BR><BR>#创建freshclam日志记录文件<BR><BR>mkdir -p /var/log/clamav<BR>touch /var/log/clamav/clamd.log<BR>chown clamav.clamav -R /var/log/clamav/<BR>chmod 644 -R /var/log/clamav/ <BR><BR>#创建clamav启动脚本<BR>vi /etc/rc.d/init.d/clamav<BR><BR>#!/bin/sh<BR>#<BR># Startup / shutdown script for Clam Antivirus<BR><BR><BR>case "$1" in<BR>start)<BR>/usr/local/sbin/clamd && echo -n 'Clamd started'<BR>/usr/local/bin/freshclam -d -c 2 -l /var/log/freshclam.log<BR>echo -n ' freshclam started'<BR>;;<BR><BR>stop)<BR>/usr/bin/killall clamd > /dev/null 2>&1 && echo -n 'Clamd stoped'<BR>/usr/bin/killall freshclam > /dev/null 2>&1 && echo -n ' freshclam Stoped'<BR>;;<BR><BR>*)<BR>echo ""<BR>echo "Usage: `basename $0` { start | stop }"<BR>echo ""<BR>exit 64<BR>;;<BR>esac<BR><BR>#使其能够执行<BR>chmod 755 /etc/rc.d/init.d/clamav<BR><BR>#随开机起动<BR>echo /etc/rc.d/init.d/clamav start >/etc/rc.d/rc.local<BR><BR><BR>--------------------------------------------------------------------------------<BR><BR>MailDrop and TNEF reader <BR>TNEF是一个从"application/ms-tnef". 类型中找出MIME附件的程序.这仅仅是微软系统中的一种附件.<BR><BR>TNEF程序允许将封装成TNEF的附件提取出来. 安装TNEF并不是必须的, 但我强烈推荐安装它!<BR><BR># 安装 maildrop<BR>cd /home/pkg<BR>tar -xjvf maildrop-1.7.0.tar.bz2<BR>cd maildrop-1.7.0<BR>./configure<BR>make<BR>make install-strip<BR>make install-man<BR><BR># 安装 the tnef<BR>cd /home/pkg<BR>tar -xzvf tnef-1.2.3.1.tar.gz<BR>cd tnef-1.2.3.1<BR>./configure<BR>make<BR>make install<BR><BR>#使用Maildrop调用SpamAssassin <BR><BR>#在/home/vpopmail/domains/localhost.com(你创建的域)/ 建立mailfilter文件 <BR>touch mailfilter <BR>chown vpopmail:vchkpw mailfilter <BR>chmod 700 mailfilter <BR><BR>vi mailfilter<BR><BR>#mailfilter内容如下: <BR><BR>VPOP="| /home/vpopmail/bin/vdelivermail '' bounce-no-mailbox" <BR>VHOME=`/home/vpopmail/bin/vuserinfo -d $EXT@$HOST` <BR><BR>if ( $SIZE < 262144 ) <BR>{ <BR>exception { <BR>xfilter "/usr/bin/spamc -f -u $EXT@$HOST" <BR>} <BR>} <BR><BR>if (/^X-Spam-Flag: YES/) <BR>{ <BR># try filtering it using user-defined rules <BR>exception { <BR>include $VHOME/Maildir/.mailfilter <BR>} <BR># then try delivering it to a Spam folder <BR>exception { <BR># to "$VPOP" <BR>to "$VHOME/Maildir/.Spam/" <BR>} <BR># ah well, I guess they'll just have to live with disappointment <BR>exception { <BR>to "$VPOP" <BR>} <BR>} <BR>else <BR>{ <BR>exception { <BR>include $VHOME/Maildir/.mailfilter <BR>} <BR>exception { <BR>to "$VPOP" <BR>} <BR>} <BR><BR>#修改.qmail-default内容如下:<BR><BR>| /usr/local/bin/maildrop ./mailfilter<BR><BR><BR>--------------------------------------------------------------------------------<BR><BR><BR>qmail-scanner&qms-analog <BR>为了能够扫描邮件服务器中进出的邮件, 我们需要安装 qmail-scanner. 如果你之前没有安装perl-suidperl,我们还需要安装它<BR><BR>cd /home/pkg<BR>rpm -Uvh perl-suidperl-5.8.0-88.3.i386.rpm<BR><BR>#解开qmail-scanner...<BR><BR>tar zxvf qmail-scanner-1.22.tgz<BR><BR>#解压qms-analog...<BR><BR>tar zxvf qms-analog-0.3.4.tar.gz<BR><BR>cd qms-analog-0.3.4<BR><BR>make all<BR><BR>#下一步,我们拷贝所需要的qms-analog文件到qmail-scanner安装目录<BR><BR>cp qmail-scanner-1.22-st-qms-20040530.patch /home/pkg/qmail-scanner-1.22/<BR><BR>cp qms-config-script /home/pkg/qmail-scanner-1.22/<BR><BR>#现在,让我们打上qms-analog补丁<BR><BR>cd /home/pkg/qmail-scanner-1.22<BR><BR>chmod 755 qms-config-script <BR><BR>patch -p1 < qmail-scanner-1.22-st-qms-20040530.patch <BR><BR>#继续安装qmail-scanner,添加所需的组和用户<BR><BR>groupadd qscand<BR>useradd -g qscand -s /bin/false qscand<BR><BR>#我们通过qms-config-script脚本来安装qmail-scanner,编辑qms-config-script<BR><BR>vi qms-config-script<BR><BR>#修改下面红色部份以达到我们的需求:<BR><BR>#!/bin/sh<BR><BR>if [ "$1" != "install" ]; then<BR>INSTALL=<BR>else<BR>INSTALL="--install"<BR>fi<BR><BR>./configure --domain domain.com \<BR>--qmail-queue-binary /var/qmail/bin/qmail-queue \<BR>--admin postmaster \<BR>--local-domains "domain1.com,domain2.com,......" \<BR>--add-dscr-hdrs yes \<BR>--dscr-hdrs-text "X-Antivirus-MYDOMAIN" \<BR>--ignore-eol-check yes \<BR>--sa-quarantine 0 \<BR>--sa-delete 0 \<BR>--sa-reject no \<BR>--sa-subject ":SPAM:" \<BR>--sa-alt yes \<BR>--sa-debug no \<BR>--notify admin \<BR>--redundant yes \<BR>--lang en_GB \<BR>--debug no \<BR>--unzip yes \<BR>--scanners clamscan,verbose_spamassassin \<BR>"$INSTALL"<BR><BR>#注意: "--admin" 和 "--domain" 参数组成了帐号"user"@"domain name". 警告消息将通过qmail-scanner 发往这个邮件帐号, 所以必须确认这是一个管理级别的帐号. 另外,所有域的警告信息都会发给这个帐号, 所以一定要小心. <BR><BR>#保存并退出。<BR><BR>#现在我们测试qmail-scanner安装<BR><BR>./qms-config-script<BR><BR>#在第一步时, 按y 允许qmail-scanner提前configure. 第二步时, 按y,建立 qmail-queue-scanner.pl 文件.<BR><BR>#测试如果没有错误 ,就可以进行下一步安装<BR><BR>./qms-config-script install <BR><BR>#看看/var/qmail/bin/qmail-scanner-queue.pl是否存在<BR><BR>chown qscand:qscand /var/qmail/bin/qmail-scanner-queue.pl<BR>chmod 4755 /var/qmail/bin/qmail-scanner-queue.pl<BR><BR>#然后用一个普通用户登陆,执行/var/qmail/bin/qmail-scanner-queue.pl -z <BR><BR>setuidgid qscand /var/qmail/bin/qmail-scanner-queue.pl -z //如果没有Can't do setuid出现,安装OK <BR>setuidgid qscand /var/qmail/bin/qmail-scanner-queue.pl -r //查看qmailscan当前包含的特征<BR>setuidgid qscand /var/qmail/bin/qmail-scanner-queue.pl -g //保存qmailscan定义特征的修改,使他生效。 <BR><BR>chown qscand:qscand /var/qmail/bin/qmail-scanner-queue.pl <BR>chmod 4755 /var/qmail/bin/qmail-scanner-queue.pl <BR><BR><BR>chown -R qscand:qscand /var/spool/qmailscan<BR><BR>vi /var/qmail/supervise/qmail-smtpd/run<BR><BR>#在你的qmail启动脚本加入红色部份<BR>#!/bin/sh<BR>QMAILDUID=`id -u vpopmail`<BR>NOFILESGID=`id -g vpopmail`<BR>PATH=$PATH:/usr/local/bin:/var/qmail/bin<BR>QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue.pl" export QMAILQUEUE<BR>MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`<BR>exec /usr/local/bin/softlimit -m 40000000 \<BR>/usr/local/bin/tcpserver -v -H -R -l 0 \<BR>-x /home/vpopmail/etc/tcp.smtp.cdb -c "$MAXSMTPD" \<BR>-u "$QMAILDUID" -g "$NOFILESGID" 0 smtp \<BR>/var/qmail/bin/qmail-smtpd \<BR>/home/vpopmail/bin/vchkpw /bin/true 2>&1<BR><BR>#后重新启动smtp服务 <BR><BR>qmailctl stop<BR>qmailctl start<BR>qmailctl stat<BR><BR>#这里有测试程序 <BR><BR>cd /home/pkg/qmail-scanner-1.22/contrib/<BR><BR>chmod 755 test_installation.sh<BR><BR>./test_installation.sh -doit<BR><BR>#这个脚本会设定的管理员邮件地址发送3个邮件,第一个邮件是一般的正常邮件,第二个邮件中会包含eicar.com测试病毒,第三个邮件同样包含eicar.com测试病毒,不过所附带的文件名不是eicar.com。 <BR>#如果qmail-scanner安装正确,管理员就应该可以收到关于后面的两个邮件的警告邮件。 <BR>#如果系统出错,可以查看/var/spool/qmailscan/qmail-queue.log日志文件。 <BR>#qmail-scanner的特征过滤在/var/spool/qmailscan/quarantine-attachments.txt<BR><BR>#主要的排错监测日志 <BR><BR>/var/spool/qmailscan/quarantine.log <BR>/var/spool/qmailscan/qmail-queue.log<BR>/var/spool/qmailscan/qms-events.log<BR>/var/log/clamav/clamd.log <BR>/var/log/maillog <BR><BR><BR>--------------------------------------------------------------------------------<BR><BR>QmailAnalog & qlogtools <BR>Qmailanalog针对qmail的日志进行一些最基本的分析,并将结果发送到你指定的位置。在我的方案中,设置qmailanalog每天晚上运行,并将结果发送给管理员。 在使用qmailanalog时,我们还将会用到qlogtools软件包。<BR><BR><BR>qlogtools提供一系列分析qmail日志的工具,这些工具将文件中诲涩难懂的日志转换成便於我们阅读和能够理解的报告。当安装完成Qmailstats和Qlogtools后,我将会创建一个脚本让它每天晚上运行,并将报告发送到管理<BR><BR><BR>员邮箱。这个脚本也可用到我们先前安装的qms-analog,qms-analog将会提供qmail-scanner运行状态报告。<BR><BR>#先安装qmailanalog<BR><BR>cd /home/pkg/<BR>tar zxvf qmailanalog-0.70.tar.gz<BR>cd qmailanalog-0.70<BR><BR>patch < /home/pkg/qmailanalog-0.70.errno.patch<BR>make && make setup check<BR><BR>#安装qlogtools<BR><BR>cd /home/pkg/<BR>tar zxvf qlogtools-3.1.tar.gz<BR>cd qlogtools-3.1<BR>patch < /home/pkg/qlogtools_errno.patch<BR><BR>make<BR><BR>./installer<BR><BR>#现在我们要创建一个脚本,并将它添加到cron,让其每天晚上运行并产生报告。<BR><BR>#下面是一个可靠的脚本,它将会收集qmailanalog输出的信息并产生报告。<BR><BR>#红色部份改成你的域名。<BR>vi /var/qmail/bin/qmailstats<BR><BR>#!/bin/sh<BR># Qmailanalog invocation script<BR>PATH=/usr/local/qmailanalog/bin:/var/qmail/bin:/bin:/usr/bin:/usr/local/bin<BR>QMAILSTATS="/tmp/q.$$"<BR>EMAILMSG="/tmp/qms.$$"<BR>umask 077<BR>cat /var/log/qmail/* /var/log/qmail/pop3d/* /var/log/qmail/pop3ds/* /var/log/qmail/smtpd/* | tai64n2tai | awk '{$1=substr($1,1,index($1,".")+6);print}' | matchup > $QMAILSTATS 5>/dev/null<BR><BR>DATE=`date +'%D'`<BR><BR>echo "To: postmaster@yourdomain.com" > $EMAILMSG<BR>echo "From: postmaster@yourdomain.com" >> $EMAILMSG<BR>echo "Subject: Nightly Qmail Stats Report for $DATE" >> $EMAILMSG<BR>echo "" >> $EMAILMSG<BR>echo "" >> $EMAILMSG<BR>echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> $EMAILMSG<BR>zoverall < $QMAILSTATS >> $EMAILMSG<BR>echo "" >> $EMAILMSG<BR>echo "" >> $EMAILMSG<BR>echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> $EMAILMSG<BR>zfailures < $QMAILSTATS >> $EMAILMSG<BR>echo "" >> $EMAILMSG<BR>echo "" >> $EMAILMSG<BR>echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> $EMAILMSG<BR>zdeferrals < $QMAILSTATS >> $EMAILMSG<BR>echo "" >> $EMAILMSG<BR>echo "" >> $EMAILMSG<BR>echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> $EMAILMSG<BR>echo "~~~~~~~~~~~~~~~~~~~~~~~~~~ L a s t 2 4 H o u r s ~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> $EMAILMSG<BR>cat /var/spool/qmailscan/qms-events.log | qms-analog 24 >> $EMAILMSG<BR>echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> $EMAILMSG<BR>echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A l l R e c o r d s ~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> $EMAILMSG<BR>cat /var/spool/qmailscan/qms-events.log | qms-analog 0 >> $EMAILMSG<BR>cat $EMAILMSG | qmail-inject<BR><BR>rm -f $QMAILSTATS<BR>rm -f $EMAILMSG<BR><BR><BR>#设置此脚本可执行<BR><BR>chmod 750 /var/qmail/bin/qmailstats<BR><BR>#现在,让我们运行脚本<BR><BR>/var/qmail/bin/qmailstats<BR><BR>#确认你的管理员邮箱,你将会收到一份非常详尽的报告。<BR><BR>#如果测试运行正常,那就加入cron让其每天早上3点运行。<BR><BR>crontab -e<BR>0 3 * * * /var/qmail/bin/qmailstats 1>/dev/null 2>/dev/null <BR><BR><BR>--------------------------------------------------------------------------------<BR><BR>isoqlog <BR>isoqlog是一个qmail日志分析工具,它是用perl写的,可以分析和统计qmail的运行日志,并生成漂亮的HTML格式的报表,如果服务器上已经安装WEB服务,管理员就可以通过浏览器来查看这些报表。相对于<BR><BR><BR>qmailanalog,isoqlog分析的项目稍微少一些。<BR><BR>isoqlog可以生成多个邮件域的报表;对于每个邮件域,isoqlog可以统计出每天、每月、每年的邮件流量以及字节数,还生成相应的统计柱状图;对于每天的报表,isoqlog可以根据邮件投递的数量以及字节数的多少来对邮<BR><BR><BR>件用户进行排列。<BR><BR>#安装isoqlog<BR><BR>cd /home/pkg<BR>tar zxvf isoqlog-2.1.1.tar.gz<BR>cd isoqlog-2.1.1<BR>./configure <BR>make<BR>make install<BR>make clean<BR><BR>cd isoqlog<BR><BR>mkdir /var/www/html/isoqlog <BR>cp -pr ./htmltemp/images ./htmltemp/library /var/www/html/isoqlog <BR><BR><BR>#配置isoqlog<BR>cd /usr/local/etc<BR>mv isoqlog.conf-dist isoqlog.conf<BR><BR>vi isoqlog.conf<BR><BR>#将下面红色部份改成你的安装目录和主机名称。<BR><BR>#isoqlog Configuration file<BR><BR>logtype = "qmail-multilog" #log type qmai-multilog, qmail-syslog, sendmail, postfix<BR>logstore = "/var/log/qmail" #<BR>domainsfile = "/usr/local/etc/isoqlog.domains" #<BR>outputdir = "/var/www/html/isoqlog" #html outpur directory<BR>htmldir = "/usr/local/share/isoqlog/htmltemp"<BR>langfile = "/usr/local/share/isoqlog/lang/english"<BR>hostname = "mail.domain.com"<BR><BR>maxsender = 100<BR>maxreceiver = 100<BR>maxtotal = 100<BR><BR>maxbyte = 100<BR><BR><BR>#保存并退出。<BR><BR>#下一步是告诉isoqlog哪些虚拟域需要产生统计报表,我希望我的mail服务器能够报告每个域的状态,所以只需要简单的创建了个链接即可:<BR><BR>ln -s /var/qmail/control/rcpthosts isoqlog.domains<BR><BR>#现在,isoqlog应该能够正常运行了,运行如下命令测试一下效果:<BR><BR>/usr/local/bin/isoqlog<BR><BR>#通过如下页面查看输出结果:<BR><BR>http://domain.com/isoqlog<BR><BR>#你可以点击各个虚拟域名称显示其报表。<BR><BR><BR>#我们希望isoqlog能够即时提供报表,将如下内容加入crontab<BR><BR>crontab -e<BR>58 * * * * /usr/local/bin/isoqlog 1>/dev/null 2>/dev/null<BR><BR>#每个小时的第58分钟运行一次<BR><BR><BR>--------------------------------------------------------------------------------<BR><BR><BR>MRTG <BR>安装 MRTG<BR>多路由器通信监视器(MRTG)是在网络链路上监控通信负载的一件工具。 MRTG 产生包含图表的HTML网页,它可以将系统中的通信情况实时的显示在页面上。 我们可以在我们的系统上使用它来监控电子邮件和spam情况。 <BR><BR># 安装 zlib (压缩的图形文件包)<BR>cd /home/pkg<BR>tar -xzf zlib-1.1.4.tar.gz<BR>mv zlib-1.1.4/ zlib<BR>cd zlib<BR>./configure<BR>make<BR>cd ..<BR><BR># 安装 libpng (PNG图片格式包)<BR>tar -xzf libpng-1.2.7.tar.gz<BR>mv libpng-1.2.7/ libpng<BR>cd libpng<BR>make -f scripts/makefile.std CC=gcc ZLIBLIB=../zlib ZLIBINC=../zlib<BR>rm *.so.* *.so<BR>cd ..<BR><BR># 安装 gd (制图软件包)<BR>tar -xzf gd-1.8.3.tar.gz<BR>mv gd-1.8.3/ gd<BR>cd gd<BR>make INCLUDEDIRS="-I. -I../zlib -I../libpng" LIBDIRS="-L../zlib -L. -L../libpng" LIBS="-lgd -lpng -lz -lm"<BR>make install<BR>cd ..<BR><BR># 编译 MRTG<BR>tar -xzf mrtg-2.10.15.tar.gz<BR>cd mrtg-2.10.15/<BR>./configure --prefix=/usr/local/mrtg-2 –-with-gd=/home/pkg/gd/ --with-z=/home/pkg/zlib/ --with-png=/home/pkg/libpng/<BR>make<BR>make install<BR>#所有MRTG需要的软件包都安装在了 /usr/local/mrtg-2 目录下. 你现在可以安全的删除上面编译的源码. 但是你最好留着,以便你编译下一个版本的MRTG时所需.<BR><BR>#通过安装inter7的qmailmrtg ,我们将在我们的系统上安装MRTG<BR><BR># 编译 qmailmrtg<BR>cd /home/pkg<BR>tar -xzf qmailmrtg7-4.0.tar.gz<BR>cd qmailmrtg7-4.0<BR>make<BR>make install<BR>mkdir /var/www/html/qmailmrtg<BR>cp qmail.mrtg.cfg index.html /var/www/html/qmailmrtg <BR>cd /var/www/html/qmailmrtg/<BR>#修改 qmail.mrtg.cfg 和 index.html文件, 将所有出现FQDN 的地方都改成你的完整域名(例如: test.com). 如果你的HTTP MRTG目录并不是默认的 (例如: 你并没有把 /var/www/html/作为你的web根目录), 则必须在/var<BR><BR><BR>/www/html/qmailmrtg/qmail.mrtg.cfg 文件中修改WorkDir变量为正确的路径. 如果你不需要记录某项服务, 你可以在所不需要记录的服务每一行的前面加一个# 来注释掉它,并删除index.html中对应的服务项目。<BR><BR>#你可以修改 pop3和smtp所在的行, 设置MaxBytes参数来重写tcpserver中-cX所在行.<BR><BR>#你还可以修改concurrency来重写concurrencyremote或concurrencylocal 的值. 如果这些文件在/var/qmail/control 目录下并不存在,则qmail默认的值为20.<BR><BR>#下面是我们的最后一步,将下面一段添加到crontab中, 以使我们能每五分钟升级一次MRTG数据. 运行如下命令:<BR><BR>crontab -e<BR>#添加下面一段 (使MRTG每五分钟运行一次) 然后退出crontab:<BR><BR>*/5 * * * * /usr/local/mrtg-2/bin/mrtg /var/www/html/qmailmrtg/qmail.mrtg.cfg 2>&1 > /dev/null<BR>#现在运行MRTG三次来安装它. 你将会收到3次警告消息. 之后,你将不会再收到警告了.<BR><BR>env LANG=C /usr/local/mrtg-2/bin/mrtg /var/www/html/qmailmrtg/qmail.mrtg.cfg<BR>#现在应该安装好了. 为了能显示些信息,我们等待15分钟的日志记录. 你可以通过下面的地址来检查图形监控情况:<BR><BR>http://your.host.name/qmailmrtg/<BR>查看它们的图形监控情况!<BR><BR><BR>--------------------------------------------------------------------------------<BR><BR>测试 <BR><BR>测试igenus <BR><BR>http://domain.com/ <BR><BR><BR>测试qmailadmin <BR><BR>http://domain.com/cgi-bin/qmailadmin<BR><BR><BR>测试vQadmin <BR><BR>http://domain.com/cgi-bin/vqadmin/vqadmin.cgi<BR><BR><BR>测试SMTP认证<BR><BR># telnet localhost 25<BR><BR>Trying 127.0.0.1...<BR><BR>Connected to mail.domain.com (127.0.0.1).<BR>Escape character is '^]'.<BR>220 mail. domain.com ESMTP<BR>EHLO hostname<BR>250-mail.domain.com<BR>250-AUTH LOGIN CRAM-MD5 PLAIN<BR>250-AUTH=LOGIN CRAM-MD5 PLAIN<BR>250-PIPELINING<BR>250 8BITMIME <BR><BR><BR>测试POP3<BR><BR># telnet localhost 110<BR>Trying 127.0.0.1...<BR>Connected to localhost.localdomain.<BR>Escape character is '^]'.<BR>+OK Hello there.<BR>user xy.wang@domain.com<BR>+OK Password required.<BR>pass [password]<BR>+OK logged in.<BR>quit<BR>+OK Bye-bye.<BR>Connection closed by foreign host.<BR><BR><BR>测试IMAP<BR># telnet localhost 143<BR>Trying 127.0.0.1...<BR>Connected to localhost.localdomain(127.0.0.1).<BR>Escape character is '^]'.<BR>* OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION STARTTLS] Courier-IMAP ready. Copyright 1998-2004 Double Precision, <BR><BR><BR>Inc. See COPYING for distribution information.<BR>a001 login user@test.com [password]<BR>a001 OK LOGIN Ok.<BR>a001 logout<BR>* BYE Courier-IMAP server shutting down<BR>a001 OK LOGOUT completed<BR>Connection closed by foreign host. <BR><BR><BR>--------------------------------------------------------------------------------<BR><BR>邮件系统维护: <BR>邮件系统相关日志 <BR><BR>/var/log/maillog<BR>/var/log/qmail/current<BR>/var/log/qmail/pop3d/current<BR>/var/log/qmail/pop3ds/current<BR>/var/log/qmail/smtpd/current<BR>/var/spool/qmailscan/qmail-queue.log<BR>/var/spool/qmailscan/qms-events.log<BR>/var/spool/qmailscan/quarantine.log<BR><BR><BR>设置Qmail用户邮箱的容量 <BR># cd /home/vpopmail/bin <BR>#./vsetuserqutoa domain.com 10500000s --domain.com这个域,都设成10m的 <BR>#./vsetuserqutoa xuki@domain.com 10500000s ---只把xuki@domain.com这个用户单独设置为10m。<BR><BR><BR>批量添加用户<BR><BR>例1:<BR><BR>新建一文件 batchadduser.sh,将以下内容拷入文件中保存 ,运行chmod u+x batchadduser.sh使其可执行。<BR><BR>#!/bin/bash <BR>#batchadduser.sh: batch add mail user. <BR>#install step. <BR>#chmod u+x batchadduser <BR>#./batchadduser.sh domain datafile <BR>if [ $# -lt 2 ] <BR>then <BR>echo "usage: $0 domain datafile" <BR>exit 1 <BR>fi <BR>domain=$1 <BR>datafile=$2 <BR>addcmd=/home/vpopmail/bin/vadduser <BR>while read username passwd <BR>do <BR>$addcmd $username@$domain $passwd <BR>done < $datafile <BR><BR>user文件内容的格式 <BR>username1 passwd <BR>username2 passwd2 <BR>............<BR><BR><BR>运行batchadduser.sh domain.com user即可批量添加用户。<BR><BR>例2:<BR><BR>我把用户名放到一个文本文件中,一个名字一行,密码和它的帐号一致,用户自己再去改密码。 <BR><BR>while read line <BR>do <BR>echo $line <BR>./vadduser $line $line <BR>done < user<BR><BR><BR>有选择地清理不需要的Mail Queue <BR><BR>1、处理队列中的邮件: <BR><BR>如想在队列中的邮件马上传递,可以 <BR># kill -HUP qmail-send <BR>要删除队列中的邮件 <BR>1) 停止QMAIL <BR>2) mv /var/qmail/queue/lock /var/qmail/;find /var/qmail/queue/ -type f -exec rm {} \; ;mv /var/qmail/lock /var/qmail/queue/<BR>3) 重启QMAIL. <BR>队列中的邮件包含在以下目录中 /var/qmail/queue/{info,mess,remote,local}/hash/#number <BR>2、在邮件队列中快速删除从一个地方发过来但又不存在的邮件 设bad.jite.com是这个域。可以键入以下命令 <BR># echo # > ~alias/.qmail-baddomain-default <BR># echo bad.jite.com:alias-baddomain>> /var/qmail/control/virtualdomains <BR># echo bad.jite.com:127.0.0.1 >> /var/qmail/control/smtproutes <BR>然后运行/var/qmail/bin/qmail-tcpok,给qmail-send 一个HUP信号 <BR>3、删除队列中的大量广告信息 <BR><BR>先停止QMAIL. <BR>1) 停止qmail, qmail-smtpd <BR>2) 在以下默认目录下 /var/qmail/queue/mess <BR>find /var/qmail/queue/mess -type f -exec grep "^Subject:dss" {} \; -print -exec rm {} \;<BR>3) 运行queue-fix清除相关文件, <BR>4) 重启qmail.<BR><BR><BR>使用sh备份qmail+mysql数据到指定的ftp地址的方法<BR>备份vpopmail的domains目录、qmail的control目录和mysql的var数据存放目录,使用crontab定时进行操作。下面是脚本文件,具体的目录视自己的系统更改: <BR>mkdir /var/qmailbakup <BR>cd /var/qmailbakup <BR>touch qmailbakup.sh <BR>chmod 755 qmailbakup .sh <BR>vi qmailbakup.sh <BR>[code:1:d480555598] <BR>#!/bin/sh <BR>DATE=`date +%Y-%m-%d-%H` <BR>cd /var/qmailbakup/ <BR>tar cvzf domains.$DATE.tar.gz /home/vpopmail/domains <BR>tar cvzf control.$DATE.tar.gz /var/qmail/control <BR>tar cvzf mysql.$DATE.tar.gz /usr/local/mysql/var <BR>ftp -n 192.168.0.21 << ! //你的ftp服务器的地址 <BR>user qmail qmailbakup //ftp用户名和密码,注意要有put权限 <BR>binary <BR>put domains.$DATE.tar.gz <BR>put control.$DATE.tar.gz <BR>put mysql.$DATE.tar.gz <BR>bye <BR>! <BR>rm -f domains.$DATE.tar.gz control.$DATE.tar.gz mysql.$DATE.tar.gz //删除本机产生的文件,如果你想在本服务器也保存一份备份,去掉该项即可。 <BR>[/code:1:d480555598] <BR>使用crontab定时执行: <BR>vi /etc/crontab <BR>00 20 * * 0-6 /var/qmailbakup/qmailbakup.sh <BR>这样每天晚上8:00执行改备份程序。 <BR><BR><BR>给新浪发信的解决办法 <BR>qmail <BR>echo "我的邮件服务器的真实域名(A记录)" > /var/qmail/control/helohost <BR><BR><BR>临时限制一个用户的pop3 <BR>vmoduser -p email_addr or domain ( for the entire domain )<BR><BR><BR>修改默认的域名 <BR>A: <BR>要更改haohao.com为默认域。 <BR>方法: <BR>更改~qmail/control/ <BR>defaultdomain <BR>me <BR>plusdomains <BR>逐一更改启动pop3和 smtp的启动脚本: <BR>修改:email.3sk.com为haohaoo.com <BR>在最上边添加:export VPOPMAIL_DOMAIN=haohaoo.com <BR><BR><BR>将一个系统的Qmail用户完整地转移到另一个系统 <BR>A: <BR>a.cdb配置的?那么请把/home/vpopmail/domains这个文件夹备份好就可以了。用户和密码文件,还有用户信件都在这个目录下。 <BR>还应该备份/var/qmail/control下的相关配置文件。 <BR><BR>b.如果是以MYSQL数据库方式来存储用户认证信息的 <BR>只需要备份 <BR>~vpopmail/domain下的所有邮件 <BR>/var/qmail/control的配置文件 <BR>MYSQL数据库目录下的vpopmail库目录。一般是/var/lib/mysql(RPM)、/usr/local/mysql/data、/usr/local/mysql/var下面。 <BR><BR><BR>把一邮件域的名字比如a.com更改为b.com,如何实现 <BR>以下几个步骤: <BR>1、cd /home/vpopmail/domains <BR>mv a.com b.com <BR>2、把vpopmail数据库的vpopmail表导出把所有a.com改为b.com,然后删除vpopmail表,再导入. <BR>3、把把vpopmail数据库的dir_control表的a.com改为b.com <BR>4、在/home/qmail/control 目录下把 virtualdomains和rcpthosts下的的a.com改为b.com. <BR>5、在/home/qmail/users目录下把assign文件的a.com改为b.com <BR>6、需要运行qmail-newu重新生成cdb。assign只是配置文件,cdb才是实际的数据文件。<BR>加快 qmail 投递邮件速度 <BR>A: /var/qmail/control下面是qmail的控制文件,这两个文件: <BR>Concurrentcylocal default: 10 最大本地同时传送数 <BR>Concurrencyremote default: 20 最大远程同时传送数 <BR>更改域的默认管理账号 <BR>A: vmoduser有个-a参数,可以赋予用户管理权限。 <BR><BR>如果想全面禁用postmaster的特殊权限话,就只能改源代码了。 <BR><BR><BR>QMAIL下的主要配置文件(/var/qmail/control目录下): <BR>文件名 默认值 使用者 用途 <BR>badmailfrom none qmail-smtpd 黑名单地址 <BR>bouncefrom MAILER-DAEMON qmail-send 退回邮件 <BR>bouncehost me qmail-send 退回邮件 <BR>concurrencylocal 10 qmail-send 本地同时投递邮件的数目 <BR>concurrencyremote 20 qmail-send 同时投递至远程主机的数目 <BR>defaultdomain me qmail-inject 默认域名 <BR>defaulthost me qmail-inject 默认主机名 <BR>databytes 0 qmail-smtpd 邮件的最大容量 (0=无限制) <BR>doublebouncehost me qmail-send <BR>doublebounceto postmaster qmail-send <BR>envnoathost me qmail-send 没有"@"的默认域名 <BR>helohost me qmail-remote 主机名 <BR>idhost me qmail-inject Message-ID的主机名 <BR>localiphost me qmail-smtpd 本地IP的替代名 <BR>locals me qmail-send 传递至本地的域名 <BR>me 系统正式域名 various <BR>morercpthosts none qmail-smtpd 第二个rcpthosts <BR>percenthack none qmail-send 使用 "%"格式的域名 <BR>plusdomain me qmail-inject <BR>qmqpservers none qmail-qmqpc QMQP服务器的IP地址 <BR>queuelifetime 604800 qmail-send 在队列中邮件保存的时间(秒) <BR>rcpthosts none qmail-smtpd 接收邮件的域名 <BR>smtpgreeting me qmail-smtpd <BR>smtproutes none qmail-remote <BR>timeoutconnect 60 qmail-remote SMTP连接超时时间 <BR>timeoutremote 1200 qmail-remote 等待远程主机的时间 <BR>timeoutsmtpd 1200 qmail-smtpd SMTP客户连接超时的时间 <BR>virtualdomains none qmail-send 虚拟域名 <BR><BR><BR>Qmail限制附件大小 <BR>我的配置经验==》Qmail限制附件大小: <BR>1.在/var/qmail/control/databytes 中设置附件大小,这个文件要手动建立,直接输入数字就行,默认单位为bytes,如10485760为10M; <BR>2.Webmail中发送附件默认只支持500K左右,如想支持5M附件,修改如下文件 <BR># vi /etc/php.ini <BR><BR>post_max_filesize=5M //320行 <BR>upload_max_filesize=5M //405行 <BR>session.bug_compat_42=0 //加入到641行 <BR>session.bug_compat_warn=0 <BR><BR># vi /etc/httpd/conf.d/php.conf <BR>LimitRequestBody 5242880 //修改14行的值为5M<BR><BR><BR>WebMail上传附件大小限制 (解决上传文件不能大于512KB的问题) <BR>更改/etc/httpd/conf.d/php.conf:<BR><BR>LimitRequestBody 524288中的524288正好跟512KB相等,将其更改为10485760,设置允许最大上传的附件为10MB。<BR><BR><BR>------------------------------------------------------------------------------<BR>无言感激<BR>http://www.xuki.org/qmail.html</DIV></DIV> <HR> <DIV class=post> <DIV class=posttop> <DIV class=username>dtltd</DIV> <DIV class=date>05-06-17, 15:23</DIV></DIV> <DIV class=posttext>Warning: SAFE MODE Restriction in effect. The script whose uid is 89 is not allowed to access /var/qmail/users/assign owned by uid 0 in /var/www/html/admin/includes/fun_inc.php on line 148<BR><BR>Warning: fopen("/var/qmail/users/assign", "r") - Resource temporarily unavailable in /var/www/html/admin/includes/fun_inc.php on line 148<BR><BR>Warning: fgets(): supplied argument is not a valid File-Handle resource in /var/www/html/admin/includes/fun_inc.php on line 149<BR><BR>Warning: fclose(): supplied argument is not a valid File-Handle resource in /var/www/html/admin/includes/fun_inc.php on line 153</DIV></DIV> <HR> <DIV id=copyright>vBulletin Version 3.0.7.23 简体中文翻译与插件制作 NewvBB.com™ 2005。</DIV></DIV><BR><BR> <P id=TBPingURL>Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=543152</P><BR></DIV></DIV></DIV>
查看全文
发表于:2008-01-28 ┆
阅读(571)
┆
评论(0)
postfix配置方案大全
<DIV> <TABLE style="BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width="96%" border=0> <TBODY> <TR> <TD width="100%" bgColor=#f3f3f3></TD> <TD width=7 height=7><IMG alt="" src="http://blog.chinaunix.net/templates/tech/images/w_right_top.gif" border=0></TD></TR> <TR> <TD align=middle bgColor=#f3f3f3 colSpan=3> <TABLE style="TABLE-LAYOUT: fixed; BORDER-COLLAPSE: collapse; WORD-WRAP: break-word" cellSpacing=0 cellPadding=0 width="100%" bgColor=#f3f3f3 border=0> <TBODY> <TR height=25> <TD align=middle width=25><IMG height=8 alt="" src="http://blog.chinaunix.net/templates/tech/images/dot.gif" width=8 border=0></TD> <TD width="90%"><A class=list1 href="http://blog.chinaunix.net/u/5948/showart_467169.html" target=_blank><FONT style="FONT-SIZE: 10pt" color=#02368d><B><U>【置顶】RHEL4上安装基于postfix的全功能邮件服务器(全部使用目前最新源码包构建) </U></B></FONT></A></TD> <TD align=middle width=25><U><IMG title=收起 onclick="ShowHideDiv('art467169',this);" alt="" src="http://blog.chinaunix.net/templates/tech/images/dot2.gif" border=0></U> </TD></TR> <TR> <TD width=25></TD> <TD colSpan=2> <DIV id=art467169 style="MARGIN: 5px; LINE-HEIGHT: 150%">本文凝聚了作者不少的安装经验,写出来供各位同仁参考指正,也为自己留一个“备份”,以便以后安装时作为参照!<BR>安装过程中借鉴了不少google出来的文章,是你们先行的足迹为作者今天的成功打下了基础,在此先行谢过!<BR>转载请注明出处:<A href="http://marion.cublog.cn/" target=_blank><FONT color=#0000ff>http://marion.cublog.cn</FONT></A><BR><BR><BR><FONT color=#0000ff size=4>所用软件包:</FONT>(本文中,以下软件包都将在/usr/local/src中存放)<BR><BR>Postfix-2.4.5<BR>Mysql-5.0.45<BR>Sasl-2.1.22<BR>DB-4.5.20<BR>O……</DIV><TEXTAREA id=text467169 style="DISPLAY: none">本文凝聚了作者不少的安装经验,写出来供各位同仁参考指正,也为自己留一个“备份”,以便以后安装时作为参照!<BR>安装过程中借鉴了不少google出来的文章,是你们先行的足迹为作者今天的成功打下了基础,在此先行谢过!<BR>转载请注明出处:<A href="http://marion.cublog.cn/" target=_blank><FONT color=#0000ff>http://marion.cublog.cn</FONT></A><BR><BR><BR><FONT color=#0000ff size=4>所用软件包:</FONT>(本文中,以下软件包都将在/usr/local/src中存放)<BR><BR>Postfix-2.4.5<BR>Mysql-5.0.45<BR>Sasl-2.1.22<BR>DB-4.5.20<BR>O……</TEXTAREA> <SCRIPT language=javascript> <!-- $("art467169").innerHTML=$("text467169").value; //--> </SCRIPT> </TD></TR> <TR height=20> <TD align=right colSpan=3><A class=list1 href="http://blog.chinaunix.net/u/5948/showart_467169.html" target=_blank><FONT style="FONT-SIZE: 10pt" color=#02368d><B><U>查看全文</U></B></FONT></A> </TD></TR> <TR height=20> <TD></TD> <TD align=right colSpan=2>发表于:2008-01-18 ┆ <A class=list1 href="http://blog.chinaunix.net/u/5948/showart_467169.html" target=_blank><U><FONT color=#800080>阅读(109)</FONT></U></A> ┆ <A class=list1 href="http://blog.chinaunix.net/u/5948/showart_467169.html" target=_blank><U><FONT color=#800080>评论(0)</FONT></U></A> </TD></TR></TBODY></TABLE></TD></TR> <TR> <TD width=7 height=7><IMG alt="" src="http://blog.chinaunix.net/templates/tech/images/w_left_buttom.gif" border=0></TD> <TD bgColor=#f3f3f3></TD> <TD width=7 height=7><IMG alt="" src="http://blog.chinaunix.net/templates/tech/images/w_right_buttom.gif" border=0></TD></TR></TBODY></TABLE><BR> <TABLE style="BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width="96%" border=0> <TBODY> <TR> <TD width=7 height=7><IMG alt="" src="http://blog.chinaunix.net/templates/tech/images/w_left_top.gif" border=0></TD> <TD width="100%" bgColor=#f3f3f3></TD> <TD width=7 height=7><IMG alt="" src="http://blog.chinaunix.net/templates/tech/images/w_right_top.gif" border=0></TD></TR> <TR> <TD align=middle bgColor=#f3f3f3 colSpan=3> <TABLE style="TABLE-LAYOUT: fixed; BORDER-COLLAPSE: collapse; WORD-WRAP: break-word" cellSpacing=0 cellPadding=0 width="100%" bgColor=#f3f3f3 border=0> <TBODY> <TR height=25> <TD align=middle width=25><IMG height=8 alt="" src="http://blog.chinaunix.net/templates/tech/images/dot.gif" width=8 border=0></TD> <TD width="90%"><A class=list1 href="http://blog.chinaunix.net/u/5948/showart_467158.html" target=_blank><FONT style="FONT-SIZE: 10pt" color=#02368d><B><U>【置顶】Postfix配置Step By Step(一)</U></B></FONT></A> </TD> <TD align=middle width=25><IMG title=收起 onclick="ShowHideDiv('art467158',this);" alt="" src="http://blog.chinaunix.net/templates/tech/images/dot2.gif" border=0> </TD></TR> <TR> <TD width=25></TD> <TD colSpan=2> <DIV id=art467158 style="MARGIN: 5px; LINE-HEIGHT: 150%"> <DIV> 很早就想试下Linux下的<A href="http://postfix.org.cn/" target=_blank><FONT color=#0000ff>Postfix</FONT></A>服务,也看了网上很多相关的教程,但是每当我看到那长长的篇幅就打退堂鼓了,但是有些东西在技术的道路上始终是要经历和面对的,这些天就一直在鼓捣着这东东,现在把自已的经历写出来,希望能对大家有点用.对于大侠来讲,这些算不了什么,但至少相对我这种还在Linux门外徊徘的人来说,它是我学习的一个历程.其中 <SPAN style="COLOR: rgb(0,0,255)" twffan="done">蓝色</SPAN>字体需用户输入,白色字体是系统显示,……</DIV></DIV><TEXTAREA id=text467158 style="DISPLAY: none"><DIV> 很早就想试下Linux下的<A href="http://postfix.org.cn/" target=_blank><FONT color=#0000ff>Postfix</FONT></A>服务,也看了网上很多相关的教程,但是每当我看到那长长的篇幅就打退堂鼓了,但是有些东西在技术的道路上始终是要经历和面对的,这些天就一直在鼓捣着这东东,现在把自已的经历写出来,希望能对大家有点用.对于大侠来讲,这些算不了什么,但至少相对我这种还在Linux门外徊徘的人来说,它是我学习的一个历程.其中 <SPAN style="COLOR: rgb(0,0,255)" twffan="done">蓝色</SPAN>字体需用户输入,白色字体是系统显示,……</TEXTAREA> <SCRIPT language=javascript> <!-- $("art467158").innerHTML=$("text467158").value; //--> </SCRIPT> </TD></TR> <TR height=20> <TD align=right colSpan=3><A class=list1 href="http://blog.chinaunix.net/u/5948/showart_467158.html" target=_blank><FONT style="FONT-SIZE: 10pt" color=#02368d><B><U>查看全文</U></B></FONT></A> </TD></TR> <TR height=20> <TD></TD> <TD align=right colSpan=2>发表于:2008-01-18 ┆ <A class=list1 href="http://blog.chinaunix.net/u/5948/showart_467158.html" target=_blank><U><FONT color=#800080>阅读(82)</FONT></U></A> ┆ <A class=list1 href="http://blog.chinaunix.net/u/5948/showart_467158.html" target=_blank><U><FONT color=#800080>评论(0)</FONT></U></A> </TD></TR></TBODY></TABLE></TD></TR> <TR> <TD width=7 height=7><IMG alt="" src="http://blog.chinaunix.net/templates/tech/images/w_left_buttom.gif" border=0></TD> <TD bgColor=#f3f3f3></TD> <TD width=7 height=7><IMG alt="" src="http://blog.chinaunix.net/templates/tech/images/w_right_buttom.gif" border=0></TD></TR></TBODY></TABLE><BR> <TABLE style="BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width="96%" border=0> <TBODY> <TR> <TD width=7 height=7><IMG alt="" src="http://blog.chinaunix.net/templates/tech/images/w_left_top.gif" border=0></TD> <TD width="100%" bgColor=#f3f3f3></TD> <TD width=7 height=7><IMG alt="" src="http://blog.chinaunix.net/templates/tech/images/w_right_top.gif" border=0></TD></TR> <TR> <TD align=middle bgColor=#f3f3f3 colSpan=3> <TABLE style="TABLE-LAYOUT: fixed; BORDER-COLLAPSE: collapse; WORD-WRAP: break-word" cellSpacing=0 cellPadding=0 width="100%" bgColor=#f3f3f3 border=0> <TBODY> <TR height=25> <TD align=middle width=25><IMG height=8 alt="" src="http://blog.chinaunix.net/templates/tech/images/dot.gif" width=8 border=0></TD> <TD width="90%"><A class=list1 href="http://blog.chinaunix.net/u/5948/showart_467188.html" target=_blank><FONT style="FONT-SIZE: 10pt" color=#02368d><B><U>Postfix 电子邮件系统精要2</U></B></FONT></A> </TD> <TD align=middle width=25><IMG title=收起 onclick="ShowHideDiv('art467188',this);" alt="" src="http://blog.chinaunix.net/templates/tech/images/dot2.gif" border=0> </TD></TR> <TR> <TD width=25></TD> <TD colSpan=2> <DIV id=art467188 style="MARGIN: 5px; LINE-HEIGHT: 150%"> <DIV>◆<STRONG>Corurier-imap安装配置</STRONG> <DIV twffan="done">Postfix只是实现邮件系统的smtp功能,pop3或imap则需要另外的软件来实现,这个软件就是courier-imap(当然也有别的软件可以选择)。</DIV> <DIV twffan="done"><STRONG>(1)安装courier-imap</STRONG></DIV> <DIV twffan="done"></DIV> <DIV twffan="done"> <TABLE class=MsoNormalTable style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BACKGROUND: rgb(243,243,243) 0% 50%; MARGIN: auto auto auto 5.4pt; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial" cellSpacing=0 cellPadding=0 border=1> <TBODY> <TR style="HEIGHT: 31.5pt"> <TD style="BORDER-RIGHT: windowtext 1pt dotted; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt dotted; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt dotted; WIDTH: 396pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt dotted; HEIGHT: 31.5pt; BACKGROUND-COLOR: transparent" vAlign=top width=528><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体" twffan="done"> <DIV class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; TEXT-ALIGN: left" align=left twffan="done"><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体" twffan="done">[root@mailserv2 ~]# <B>cd<?xml:namespace prefix = o /><o:p></o:p></B></SPAN></DIV> <DIV class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; TEXT-ALIGN: left" align=left twffan="done"><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体" twffan="done">[root@mailserv2 ~]#<B> tar jxvf courier-imap-<?xml:namespace prefix = st1 /><st1:chsdate w:st="on" isrocdate="False" islunardate="False" day="30" month="12" year="1899">4.1.3</st1:chsdate>.tar.bz2<o:p></o:p></B></SPAN></DIV> <DIV class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; TEXT-ALIGN: left" align=left twffan="done"><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体" twffan="done">[root@mailserv2 ~]# <B>cd courier-imap-<st1:chsdate w:st="on" isrocdate="False" islunardate="False" day="30" month="12" year="1899">4.1.3</st1:chsdate><o:p></o:p></B></SPAN></DIV> <DIV class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; TEXT-ALIGN: left" align=left twffan="done"><SPAN lang=EN-US twffan="done"><FONT face="Times New Roman"> [root@mailserv2courier-imap-<st1:chsdate w:st="on" isrocdate="False" islunardate="False" day="30" month="12" year="1899">4.1.3</st1:chsdate>]#<B>./configure --prefix=/usr/local/imap --with-redhat <o:p></o:p></B></FONT></SPAN></DIV> <DIV class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left" align=left twffan="done"><B><SPAN lang=EN-US twffan="done"><FONT face="Times New Roman">--disable-root-check --enable-unicode=utf-8,iso-8859-1,gb2312,gbk,gb18030<o:p></o:p></FONT></SPAN></B></DIV> <DIV class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left" align=left twffan="done"><B><FONT face="Times New Roman"><SPAN lang=EN-US twffan="done">--with-trashquota --with-dirsync </SPAN><I><SPAN lang=EN-US twffan="done">--with-mysql-libs=/usr/local/mysql/lib/mysql --with-mysql-includes=/usr/local/mysql/include/mysql/ --with-authmysql --with-authm