📄 基于linux和postfix的邮件系统的web mail安装手册 linuxsir_org.htm
字号:
<DIV class=codeblock><CODE>[root@mail build] chkconfig httpd
on<BR>[root@mail build] chkconfig mysqld on<BR>[root@mail build] service
httpd start<BR>[root@mail build] service mysqld start<BR>[root@mail build]
service courier-authlib start<BR>[root@mail build] service courier-imap
start<BR>[root@mail build] postfix start</CODE></DIV>
<P></P>
<P>通过后台加入域名和用户名(本文档中的域名为: test.com 、 用户名: test@test.com )</P>
<P>
<DIV class=codeblock><CODE>[root@mail build] perl -MMIME::Base64 -e 'print
encode_base64("test\@test.com");'<BR>dGVzdEB0ZXN0LmNvbQ==<BR>[root@mail
build] perl -MMIME::Base64 -e 'print
encode_base64("000000");'<BR>MDAwMDAw<BR>[root@mail build] telnet
localhost 25<BR>Trying 127.0.0.1...<BR>Connected to localhost.localdomain
(127.0.0.1).<BR>Escape character is '^]'.<BR>220 mail.test.com ESMTP
Postfix<BR>ehlo mail<BR>250-mail.test.com<BR>250-PIPELINING<BR>250-SIZE
10240000<BR>250-VRFY<BR>250-ETRN<BR>250-AUTH PLAIN LOGIN<BR>250-AUTH=PLAIN
LOGIN<BR>250 8BITMIME<BR>auth login<BR>334
VXNlcm5hbWU6<BR>dGVzdEB0ZXN0LmNvbQ== //用户名(test@test.com)<BR>334
UGFzc3dvcmQ6<BR>MDAwMDAw // 密码(000000)<BR>235 Authentication successful
//表示成功验证通过</CODE></DIV>
<P></P>
<P><FONT id=19 size=4><B><BR>19、安装Clamav<BR></B></FONT></P>
<P>
<DIV class=codeblock><CODE>[root@mail build] rpm --import
http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt<BR>[root@mail build]
rpm --import RPM-GPG-KEY.dag.txt<BR>[root@mail build] rpm -q gpg-pubkey
--qf "%{summary} -> %{version}-%{release}\n"<BR>gpg(CentOS-4 key )
-> 443e1821-421f218f<BR>gpg(Dag Wieers (Dag Apt Repository v1.0) )
-> 6b8d79e6-3f49313d</CODE></DIV>
<P></P>
<P>
<DIV class=codeblock><CODE>[root@mail build] vi
/etc/yum.repos.d/dag.repo</CODE></DIV>
<P></P>
<P>
<DIV class=codeblock><CODE>[dag]<BR>name=Dag RPM Repository for Red Hat
Enterprise
Linux<BR>baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag<BR>gpgcheck=1<BR>enabled=1</CODE></DIV>
<P></P>
<P>
<DIV class=codeblock><CODE>[root@mail build] yum update<BR>[root@mail
build] yum install clamav</CODE></DIV>
<P></P>
<P><FONT id=20 size=4><B><BR>20、升级病毒库<BR></B></FONT></P>
<P>
<DIV class=codeblock><CODE>[root@mail build] /usr/bin/freshclam<BR>ClamAV
update process started at Thu Mar 9 17:23:21 2006<BR>main.cvd is up to
date (version: 36, sigs: 44686, f-level: 7, builder: tkojm)<BR>daily.cvd
is up to date (version: 1319, sigs: 1376, f-level: 7, builder:
ccordes)</CODE></DIV>
<P></P>
<P><FONT id=21 size=4><B><BR>21、安装Spamassassin<BR></B></FONT></P>
<P>
<DIV class=codeblock><CODE>[root@mail build] yum install
spamassassin<BR>[root@mail build] service spamassassin start</CODE></DIV>
<P></P>
<P><FONT id=22 size=4><B><BR>22、安装MailScanner<BR></B></FONT></P>
<P>
<DIV class=codeblock><CODE>[root@mail build] tar –zxf
../src/MailScanner-4.51.5-1.rpm.tar.gz<BR>[root@mail build]
MailScanner-4.51.5-1/install.sh</CODE></DIV>
<P></P>
<P><FONT id=23 size=4><B><BR>23、设置MailScanner<BR></B></FONT></P>
<P>
<DIV class=codeblock><CODE>[root@mail build] chkconfig sendmail
off<BR>[root@mail build] chkconfig --level 2345 MailScanner
on<BR>[root@mail build] vi /etc/MailScanner/MailScanner.conf</CODE></DIV>
<P></P>
<P>
<DIV class=codeblock><CODE>%org-name% = toping.net<BR>%org-long-name% =
wooxian<BR>%web-site% = www.toping.net<BR>%report-dir% =
/etc/MailScanner/reports/cn<BR>Run As User = postfix<BR>Run As Group =
postfix<BR>Incoming Queue Dir = /var/spool/postfix/hold<BR>Outgoing Queue
Dir = /var/spool/postfix/incoming<BR>MTA = postfix<BR>Virus Scanners =
clamav<BR>Always Include SpamAssassin Report = yes<BR>Use SpamAssassin =
yes<BR>Required SpamAssassin Score = 6<BR>SpamAssassin User State Dir =
/var/spool/MailScanner/spamassassin<BR>SpamAssassin Install Prefix =
/usr/bin<BR>SpamAssassin Local Rules Dir = /etc/MailScanner</CODE></DIV>
<P></P>
<P>
<DIV class=codeblock><CODE>[root@mail build] yum install
unrar<BR>[root@mail build] unrar x ../src/cn.rar<BR>[root@mail build] mv
cn /etc/MailScanner/reports/<BR>[root@mail build] mv
/etc/postfix/header_check /etc/postfix/header_check.bak<BR>[root@mail
build] vi /etc/postfix/header_check</CODE></DIV>
<P></P>
<P>
<DIV class=codeblock><CODE>/^Received:/ HOLD</CODE></DIV>
<P></P>
<P>
<DIV class=codeblock><CODE>[root@mail build] chown –R postfix:postfix
/var/spool/MailScanner/*<BR>[root@mail build] postfix stop<BR>[root@mail
build] service MailScanner start</CODE></DIV>
<P></P>
<P><FONT id=24 size=4><B><BR>24、测试病毒邮件<BR></B></FONT></P>
<P>
<DIV class=codeblock><CODE>[root@mail build] telnet localhost 25<BR>Trying
127.0.0.1...<BR>Connected to localhost.localdomain (127.0.0.1).<BR>Escape
character is '^]'.<BR>220 mail.test.com ESMTP Postfix<BR>ehlo
mail<BR>250-mail.test.com<BR>250-PIPELINING<BR>250-SIZE
10240000<BR>250-VRFY<BR>250-ETRN<BR>250-AUTH PLAIN LOGIN<BR>250-AUTH=PLAIN
LOGIN<BR>250 8BITMIME<BR>auth login<BR>334
VXNlcm5hbWU6<BR>dGVzdEB0ZXN0LmNvbQ== //用户名(test@test.com)<BR>334
UGFzc3dvcmQ6<BR>MDAwMDAw // 密码(000000)<BR>235 Authentication successful
//表示成功验证通过<BR>MAIL FROM:<BR>250 Ok<BR>RCPT TO:<BR>250 Ok<BR>DATA<BR>354
End data with .<BR>Subject:Virus
test<BR>X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*<BR>.<BR>250
Ok: queued as F0C221CC20 //出现F0C221CC20这行表示mailscanner运行成功了<BR>quit<BR>221
Bye<BR>Connection closed by foreign host.</CODE></DIV>
<P></P>
<P>收到邮件后会在主题会变成:{Virus?} Virus test</P>
<P>邮件内容会是以下内容:<BR>警告: 此邮件有一个或多个附加档案被移除<BR>警告: 附加档案名称: (详细讯息).<BR>警告:
请参考此信件附加档案 "toping.net-Attachment-Warning.txt" 取得更详细的资料</P>
<P>此讯息由 MailScanner
电子邮件防护系统发出<BR>-----------------------------------------<BR>原有邮件附加档案为
"详细讯息" 被列入拒绝处理的名单.<BR>且被替换为此讯息.</P>
<P>若您仍希望收到*被感染的*附加档案,,请联络系统管理者.包含以下内容:</P>
<P>Thu Mar 9 15:57:25 2006 病毒侦测报告:<BR>ClamAV: msg-3682-1.txt contains
Eicar-Test-Signature</P>
<P>求助问题: 检查 the toping.net () MailScanner 机器的
/var/spool/MailScanner/quarantine/20060309 (编号
639F13F97B.BBC3F).<BR>--<BR>系统管理者</P>
<P>以上内容出现表示mailscanner的病毒过滤生效。并成功运行!!</P>
<P>到此一台具有反垃圾和反病毒的邮件服务器建成了,希望我的文档对邮件服务器爱好者能有所帮助~!
如果文档中有任何问题可以发邮件给我指出来我会马上改正。谢谢大家!祝大家好运!!scyz at toping.net</P>
<P><FONT id=25 size=4><B><BR>25、关于本文;<BR></B></FONT></P>
<P>祝兄弟们好运。本人水平有限。如果发现文章中有什么错误和不当的地方请发邮件:scyz@toping.net。我会在第一时间给予答复。</P>
<P><FONT id=26 size=4><B><BR>26、更新日志;<BR></B></FONT></P>
<P>新增使用mailscanner来对进出邮件进行监管。new<BR>修正上一个版本的一些理解性和文件性错误。<BR>主要“加强”了病毒过滤和垃圾邮件过滤,更加节约系统资源,使系统配置更简单化。<BR>垃圾邮件过滤基本上达到了95%的成功率<BR>本文首次使用MailScanner+Clamav配合对邮件病毒进行过滤。<BR>经过严格病毒邮件测试成功率达到了100%。<BR>翻译了病毒邮件提示为中文提示,让系统更加的人性化。</P>
<P><FONT id=27 size=4><B><BR>27、参考文档;<BR></B></FONT></P>
<P><FONT id=28 size=4><B><BR>28、相关文档;<BR></B></FONT></P>
<P><A
href="http://www.linuxsir.org/main/?q=node/203"><B>《基于FreeBSD和Postfix的邮件系统与邮件列表的web
mail安装4.51》</B></A></P>
<P><BR></P></DIV>
<DIV class=links>By scyzxp at 2006/04/24 - 01:36 | <A
href="http://www.linuxsir.org/main/?q=taxonomy/term/1">Linux</A> | <A
href="http://www.linuxsir.org/main/?q=taxonomy/term/29">Mail服务器</A> | <A
title=共享你有关本文的思想和意见。
href="http://www.linuxsir.org/main/?q=comment/reply/195#comment">参与评论</A>
| 4275 阅读</DIV></DIV><A id=comment></A>
<FORM action=?q=comment method=post>
<DIV><INPUT type=hidden value=195 name=edit[nid]> <A id=comment-592></A>
<DIV class=comment>
<H3 class=title><A class=active
href="http://www.linuxsir.org/main/?q=node/195#comment-592">下载链接失效,求所需文件.</A></H3>
<DIV class=content>
<P>下载地址: http://www.toping.net/soft/src.tar.gz 无效链接</P></DIV>
<DIV class=links>By kesin at 周三, 2006/07/26 - 09:12 | <A
href="http://www.linuxsir.org/main/?q=comment/reply/195/592">回复</A></DIV></DIV><A
id=comment-405></A>
<DIV class=comment>
<H3 class=title><A class=active
href="http://www.linuxsir.org/main/?q=node/195#comment-405">谢谢,辛苦了~</A></H3>
<DIV class=content>
<P>详尽无比,面向所有读,老少通吃。。。</P>
<P>兄弟辛苦了~</P>
<P>这是LinuxSir.Org 文档管理系统开放以来第一篇MailServer的文档,也是目前我看到的有关Mail文档中最详实的一篇。</P>
<P>我做了一下排版,方便大家阅读。。。。</P>
<P>北南 呈上</P></DIV>
<DIV class=links>By 北南南北 at 周二, 2006/04/25 - 20:10 | <A
href="http://www.linuxsir.org/main/?q=comment/reply/195/405">回复</A></DIV></DIV>
<DIV style="MARGIN-LEFT: 25px"><A id=comment-429></A>
<DIV class=comment>
<H3 class=title><A class=active
href="http://www.linuxsir.org/main/?q=node/195#comment-429">谢谢老大。以后我会用更好的文档来回报社区</A></H3>
<DIV class=content>
<P>谢谢老大。以后我会用更好的文档来回报社区</P></DIV>
<DIV class=links>By Anonymous (没有被验证) at 周六, 2006/05/06 - 03:35 | <A
href="http://www.linuxsir.org/main/?q=comment/reply/195/429">回复</A></DIV></DIV></DIV>
<DIV style="MARGIN-LEFT: 50px"><A id=comment-518></A>
<DIV class=comment>
<H3 class=title><A class=active
href="http://www.linuxsir.org/main/?q=node/195#comment-518">阅读困难...错别字太多了....</A></H3>
<DIV class=content>
<P>阅读困难...错别字太多了....</P></DIV>
<DIV class=links>By Anonymous (没有被验证) at 周一, 2006/06/26 - 21:57 | <A
href="http://www.linuxsir.org/main/?q=comment/reply/195/518">回复</A></DIV></DIV></DIV></DIV></FORM><!-- end content -->
<DIV id=footer>
<CENTER><A href="http://www.linuxsir.org/"><IMG
src="基于Linux和Postfix的邮件系统的web mail安装手册 LinuxSir_Org.files/logo.jpg"></A>
<BR><A href="http://www.miibeian.gov.cn/"><FONT color=blue
size=3><B>闽ICP备06025536号</B></FONT></A><BR>
<SCRIPT language=JavaScript
src="基于Linux和Postfix的邮件系统的web mail安装手册 LinuxSir_Org.files/cyberpolice.htm"></SCRIPT>
<BR><A href="http://www.linuxsir.org/main/?q=node/78"><FONT color=blue
size=3><B>© 2002-2006 LinuxSir.Org</B></FONT></A><BR></CENTER></DIV></TD>
<TD id=sidebar-right>
<DIV class="block block-block" id=block-block-2>
<H2 class=title>基础知识</H2>
<DIV class=content>
<UL>
<LI><A href="http://www.linuxsir.org/main/?q=taxonomy/term/23">安装配置</A>
<LI><A
href="http://www.linuxsir.org/main/?q=taxonomy/term/1/25/">基础入门</A>
<LI><A href="http://www.linuxsir.org/main/?q=taxonomy/term/22/">硬件解决</A>
<LI><A href="http://www.linuxsir.org/main/?q=taxonomy/term/21">软件管理</A>
<LI><A
href="http://www.linuxsir.org/main/?q=taxonomy/term/35/48/">重要资源</A>
</LI></UL></DIV></DIV>
<DIV class="block block-block" id=block-block-4>
<H2 class=title>软件应用</H2>
<DIV class=content>
<UL>
<LI><A href="http://www.linuxsir.org/main/?q=taxonomy/term/30">网络工具</A>
<LI><A href="http://www.linuxsir.org/main/?q=taxonomy/term/32">图形图像</A>
<LI><A href="http://www.linuxsir.org/main/?q=taxonomy/term/31">音乐视频</A>
<LI><A href="http://www.linuxsir.org/main/?q=taxonomy/term/49">字体中文</A>
<LI><A href="http://www.linuxsir.org/main/?q=taxonomy/term/33">软件其它</A>
</LI></UL></DIV></DIV>
<DIV class="block block-block" id=block-block-5>
<H2 class=title>网络服务器</H2>
<DIV class=content>
<UL>
<LI><A href="http://www.linuxsir.org/main/?q=taxonomy/term/27">文件服务器<A>
<LI><A
href="http://www.linuxsir.org/main/?q=taxonomy/term/28">Web服务器</A>
<LI><A href="http://www.linuxsir.org/main/?q=taxonomy/term/29">邮件服务器</A>
<LI><A href="http://www.linuxsir.org/main/?q=taxonomy/term/37">数据库应用</A>
<LI><A href="http://www.linuxsir.org/main/?q=taxonomy/term/50">服务器其它</A>
</LI></UL></DIV></DIV>
<DIV class="block block-comment" id=block-comment-0>
<H2 class=title>最新评论</H2>
<DIV class=content>
<DIV class=item-list>
<UL>
<LI><A
href="http://www.linuxsir.org/main/?q=node/140#comment-630">http://www.linuxsir.org/main/?q=node/140#comment-630</A><BR>1
hour 25 min 前
<LI><A
href="http://www.linuxsir.org/main/?q=node/10#comment-628">压缩:</A><BR>1
day 5 hours 前
<LI><A
href="http://www.linuxsir.org/main/?q=node/178#comment-627">不行</A><BR>1
day 9 hours 前
<LI><A
href="http://www.linuxsir.org/main/?q=node/158#comment-626"></A><BR>2
days 1 hour 前
<LI><A
href="http://www.linuxsir.org/main/?q=node/42#comment-625">太感谢了</A><BR>2
days 5 hours 前
<LI><A
href="http://www.linuxsir.org/main/?q=node/222#comment-624">错了</A><BR>2
days 19 hours 前
<LI><A
href="http://www.linuxsir.org/main/?q=node/222#comment-623">q</A><BR>2
days 20 hours 前
<LI><A
href="http://www.linuxsir.org/main/?q=node/222#comment-622">有些道理</A><BR>2
days 20 hours 前
<LI><A
href="http://www.linuxsir.org/main/?q=node/219#comment-621">"内置的摄像头也能用这个吗?"</A><BR>3
days 9 hours 前
<LI><A
href="http://www.linuxsir.org/main/?q=node/80#comment-620">终于知道了...</A><BR>3
days 18 hours
前</LI></UL></DIV></DIV></DIV></TD></TR></TBODY></TABLE></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -