架构基于FreeBSD和Postfix的IGENUS Webmail邮件系统[1]

[入库:2005年9月21日] [更新:2007年3月24日]

本文简介:


架构基于FreeBSD和Postfix的IGENUS  Webmail邮件系统
FreeBSD+Postfix+cyrus-sasl+Courier-imap+igenus+Clamav+amavisd-new
杨廷勇
Copyright & 2004、2005
本文介绍使用FreeBSD+Postfix+cyrus-sasl+Courier-imap+igenus+Clamav+amavisd-new来架构一个具有多域名,有webmai防病毒和垃圾邮件并有web管理界面的邮件系统。
Jacky, $Revision: 1.01 bate $Date: 2005-4-6 
系统主要采用MySQL做为认证数据库。
本文在FreeBSD4.10和5.3上安装测试通过,登录认证放弃采用PAM方式。看了很多资料,但大多都是使用PAM,不明白cyrus-sasl2-saslauthd可以与MySQL、PgSQL进行认证了,为什么还在用第三方软件PAM来实现认证呢?
您在以本文作为根据配置电脑的时候,若出现任何故障,后果自负,与本人无关。
________________________________________
Table of Contents 
Chapter 1. 系统安装
1.1 安装MySQL
1.2 安装Apache
1.3 安装PHP
1.4 安装openssl
1.5 安装phpMyAdmin
1.6 通过phpMyadmin设置数据库
1.7 安装cyrus-sasl2-saslauthd
1.8 安装 postfix 和 cyrus-sasl
1.9 安装expect
1.10 安装Courier-imap
Chapter 2. 配置邮件服务器
2.1 配置rc.conf
2.2 配置cyrus-sasl2-saslauthd
2.3 配置postfix 和 cyrus-sasl
2.4 配置Courier-imap
Chapter 3. 安装postfix管理工具
3.1安装本人开发的postfix管理工具
3.2 用户登录测试
Chapter 4. 防病毒与防垃圾邮件
4.1 安装Clamav
4.2 安装amavisd-new
4.3 安装配置Spamassassin
Chapter 5. 安装webmail
Chapter 6. 查看系统状态
________________________________________
Chapter 1. 系统安装
安装之前:因用户数据都保存在/var目录下,因此安装FreeBSD时/var的空间应尽量大。FreeBSD的版本为5.3,按最小化安装,软件包只安装cvsup,安装结束后用cvsup更新ports树。在文档中假设服务器的ip地址为192.168.0.2,域名为toping.net,主机名为mail.toping.net。
________________________________________
1.1 安装MySQL
mail# cd /usr/ports/databases/mysql323-server
mail# make install clean

编辑/etc/rc.conf,加入
mysql_enable="YES"

________________________________________
1.2 安装Apache
mail# cd /usr/ports/www/apache2
mail# make install clean
      
编辑/etc/rc.conf,加入
Apache2_enable="YES"
      
________________________________________
1.3 安装PHP
mail# cd /usr/ports/www/mod_php4

mail# make install clean
      
安装需要的PHP扩展模块
mail# cd /usr/ports/lang/php4-extensions
mail# make install clean

注:gettext需选中
最后在编辑/usr/local/etc/apache2/httpd.conf中加入:
#php_mod4
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
________________________________________
1.4 安装openssl
mail# cd /usr/ports/security/openssl

mail# make install clean
      
________________________________________
1.5 安装phpMyAdmin
mail# cd /usr/ports/databases/phpmyadmin
mail# make install clean(在这里建议可以选择所有的选项)

安装装后默认的安装目录为:/usr/local/www下面你要做的就是移到/usr/local/www/data目录下面
mail# mv /usr/local/www/phpMyAdmin /usr/local/www/data/
修改/usr/local/www/phpMyAdmin/config.inc.php
$cfg['PmaAbsoluteUri'] = 'http://192.168.0.2/phpMyAdmin/';
$cfg['Servers'][$i]['auth_type']     = 'http';    // Authentication method (config, http or cookie based)?
指定phpmyadmin的认证方式为http方式。
在浏览器输入http://192.168. 0.2/phpMyAdmin/,首次进行登入的用户名为root密码为空,登入后可以修改你的密码。 

________________________________________
1.6 通过phpMyadmin设置数据库
建立两个数据库用户
#======================postfix==================================

INSERT INTO user (host,user,password) VALUES('localhost','postfix','');
update user set password=password('admin123') where User='postfix';
FLUSH PRIVILEGES;
GRANT ALL ON mail.* TO postfix@localhost IDENTIFIED BY "admin123";
#======================courier==================================
INSERT INTO user (host,user,password) VALUES ('localhost','courier','');
update user set password=password('admin123') where User='courier';
FLUSH PRIVILEGES;
GRANT select,insert,update on mail.* TO courier;

建立数据库
#=======================MAIL.SQL=================================

CREATE TABLE domaininfo (
  domain_id int(5) NOT NULL auto_increment,
  domain varchar(25) NOT NULL default '',
  alias varchar(30) default NULL,
  passwd varchar(35) NOT NULL default '',

本文关键:架构基于FreeBSD和Postfix的IGENUS Webmail邮件系统
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top