[精华] 【原创】postfix(ldap)邮件系统

 

http://www.chinaunix.net 作者:anstan  发表于:2007-05-25 11:47:27
发表评论】【查看原文】【Mail服务器讨论区】【关闭

RHAS4+postfix+cyrus-sasl+ldap+courier-imap+courier-maildrop+jamm+squirrelmail


转载请注明出处
2005年7月24日完成

1.openldap

2.cyrus-sasl

3.postfix

4.courier-authlib

5.courier-imap

6.courier-maildrop

7.管理工具 

8.测试 

9.webmail 


实现功能:smtp认证、pop3和imap、虚拟域和虚拟用户、web管理用户(phpldapadmin+jamm)、webmail(squirrelmail)、邮箱quota

创建vmail用户和组 
# groupadd vmail -g 5000 
# useradd vmail -u 5000 -g 5000 -s/sbin/nologin -d/dev/null 
# mkdir /var/mailbox 
# chown vmail:vmail /var/mailbox
# chmod -R ug+rwx,o-rwx /var/mailbox

1.安装openldap 2.2.26
# wget ftp://ftp.openldap.org/pub/OpenLDAP/openldap-stable/openldap-stable-20050429.tgz
# tar zxvf openldap-stable-20050429.tgz
# cd openldap-2.2.26
# ./configure --prefix=/usr/local/openldap --enable-ldbm=yes --enable-bdb=no --enable-ipv6=no
# make depend 
# make 
# make test 
# make install

# wget http://jaist.dl.sourceforge.net/sourceforge/jamm/jamm-0.9.7-rc1.tar.gz
# tar zxvf jamm-0.9.7-rc1.tar.gz
# cp jamm-0.9.7-rc1/src/schema/jamm.schema /usr/local/openldap/etc/openldap/schema/

先获得rootpw的加密密码,注意每次都不一样。你也可以用明文的
# /usr/local/openldap/sbin/slappasswd
New password: 12345 
Re-enter new password: 12345 
{SSHA}eBmoJWzMhMGgC48iqHHQyX4Q4CGhzZxO

# vi /usr/local/openldap/etc/openldap/slapd.conf
include         /usr/local/openldap/etc/openldap/schema/core.schema
include         /usr/local/openldap/etc/openldap/schema/cosine.schema
include         /usr/local/openldap/etc/openldap/schema/nis.schema
include         /usr/local/openldap/etc/openldap/schema/jamm.schema

allow bind_v2

pidfile /usr/local/openldap/var/run/slapd.pid
argsfile /usr/local/openldap/var/run/slapd.args

database ldbm
directory /usr/local/openldap/var/openldap-data
suffix "dc=test,dc=com"

rootdn "cn=Manager,dc=test,dc=com"
rootpw {SSHA}eBmoJWzMhMGgC48iqHHQyX4Q4CGhzZxO
#rootpw 12345 

index objectClass pres,eq
index mail,cn eq,sub

access to dn.regex=".*,jvd=([^,]+),o=hosting,dc=test,dc=com"
      attr=userPassword
    by self write
    by group/jammPostmaster/roleOccupant.expand="cn=postmaster,jvd=$1,o=hosting,dc=test,dc=com" write
    by anonymous auth
    by * none

access to dn.regex=".*jvd=([^,]+),o=hosting,dc=test,dc=com"
    by self write
    by group/jammPostmaster/roleOccupant.expand="cn=postmaster,jvd=$1,o=hosting,dc=test,dc=com" write
    by * read

access to *
    by * read

启动ldap
# /usr/local/openldap/libexec/slapd -d 256
出现slapd starting说明启动成功了,建议调试的时候以这种方式启动dlap

# vi /usr/local/openldap/etc/openldap/base.ldif
dn: dc=test, dc=com
objectClass: top
objectClass: domain
domainComponent: test

dn: cn=Manager, dc=test, dc=com
objectClass: top
objectClass: organizationalRole
cn: Manager

dn: o=hosting, dc=test, dc=com
objectClass: top
objectClass: organization
o: hosting

# /usr/local/openldap/bin/ldapadd -x -D "cn=Manager,dc=test,dc=com" -W -f /usr/local/openldap/etc/openldap/base.ldif
Enter LDAP Password:12345
adding new entry "dc=test, dc=com"
adding new entry "cn=Manager, dc=test, dc=com"
adding new entry "o=hosting, dc=test, dc=com"

2.安装cyrus-sasl 2.1.21
as4默认已经安装了,给它改个文件名吧,如果把rpm包删除之后配置跟我的肯定不一样
# mv /usr/lib/sasl /usr/lib/sasl.OFF
# mv /usr/lib/sasl2 /usr/lib/sasl2.OFF

编译安装cyrus-sasl2.1.21
# wget ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-2.1.21.tar.gz
# tar zxvf cyrus-sasl-2.1.21.tar.gz
# cd cyrus-sasl-2.1.21

密码验证方式为saslauthd编译方法 
# ./configure --disable-anon -enable-plain --enable-login --enable-ldapdb --with-ldap=/usr/local/openldap --with-saslauthd=/var/run/saslauthd --sysconfdir=/etc
密码验证方式为authdaemond的编译方法
# ./configure --disable-anon -enable-plain --enable-login --enable-ldapdb --with-ldap=/usr/local/openldap --with-authdaemond=/usr/local/var/spool/authdaemon/socket

# make
# make install

为了让postfix能找到sasl,请运行如下命令:
# echo "/usr/local/lib" >;>; /etc/ld.so.conf
# ldconfig

# ln -s /usr/local/lib/sasl2 /usr/lib/sasl2

密码验证方式为saslauthd的配置方法
# vi /usr/local/lib/sasl2/smtpd.conf
pwcheck_method: saslauthd
mech_list: login plain

# vi /etc/saslauthd.conf
ldap_servers: ldap://127.0.0.1
ldap_search_base: o=hosting,dc=test,dc=com
ldap_filter: (&(objectClass=JammMailAccount)(mail=%u@%r)(accountActive=TRUE)(delete=FALSE))

# vi /etc/sysconfig/saslauthd 
MECH=ldap

密码验证方式为auxprop的配置方法(计划中)

密码验证方式为authdaemond的配置方法
# vi /usr/local/lib/sasl2/smtpd.conf 
pwcheck_method:authdaemond
log_level:3
mech_list:PLAIN LOGIN
authdaemond_path: /usr/local/var/spool/authdaemon/socket

3.安装postfix 2.2.4
如果你的系统上原来有sendmail,先将其停止并将其文件改名:
# /etc/init.d/sendmail stop
# chkconfig --level 0123456 sendmail off
# mv /usr/bin/newaliases /usr/bin/newaliases.orig
# mv /usr/bin/mailq /usr/bin/mailq.orig
# mv /usr/sbin/sendmail /usr/sbin/sendmail.orig

开始安装
# groupadd -g 12345 postfix
# useradd -u 12345 -g 12345 -c postfix -d/dev/null -s/sbin/nologin postfix
# groupadd -g 54321 postdrop
# wget ftp://postfix.cn99.com/postfix/official/postfix-2.2.4.tar.gz
# tar -zxvf postfix-2.2.4.tar.gz
# cd postfix-2.2.4
# echo /usr/local/openldap/lib >;>; /etc/ld.so.conf 
# ldconfig 
# make -f Makefile.init makefiles \
'CCARGS=-DHAS_LDAP -I/usr/local/openldap/include -DUSE_SASL_AUTH -I/usr/local/include/sasl' \
'AUXLIBS=-L/usr/local/openldap/lib -lldap -llber -L/usr/local/lib -lsasl2' 
# make install 

# vi /etc/postfix/main.cf
#=====================BASE========================= 
myhostname = www.test.com 
mydomain = test.com 
myorigin = $mydomain 
mydestination = $myhostname localhost localhost.$mydomain 
mynetworks = 127.0.0.0/8 
inet_interfaces = all 

virtual_mailbox_base = /var/mailbox 
virtual_minimum_uid = 5000 
virtual_uid_maps = static:5000 
virtual_gid_maps = static:5000 

#virtual_transport = virtual
virtual_transport = maildrop
maildrop_destination_recipient_limit = 1

virtual_mailbox_domains = ldap:domains
virtual_maps = ldap:aliases, ldap:accountsmap
virtual_mailbox_maps = ldap:accounts 

domains_server_host = localhost 
domains_search_base = o=hosting,dc=test,dc=com 
domains_query_filter = (&(objectClass=JammVirtualDomain)(jvd=%s)(accountActive=TRUE)(delete=FALSE)) 
domains_result_attribute = jvd 
domains_bind = no 
domains_scope = one

aliases_server_host = localhost 
aliases_search_base = o=hosting,dc=test,dc=com 
aliases_query_filter = (&(objectClass=JammMailAlias)(mail=%s)(accountActive=TRUE)) 
aliases_result_attribute = maildrop 
aliases_bind = no

accounts_server_host = localhost 
accounts_search_base = o=hosting,dc=test,dc=com 
accounts_query_filter = (&(objectClass=JammMailAccount)(mail=%s)(accountActive=TRUE)(delete=FALSE)) 
accounts_result_attribute = mailbox 
accounts_bind = no 

accountsmap_server_host = localhost 
accountsmap_search_base = o=hosting,dc=test,dc=com 
accountsmap_query_filter = (&(objectClass=JammMailAccount)(mail=%s)(accountActive=TRUE)(delete=FALSE)) 
accountsmap_result_attribute = mail 
accountsmap_cache = yes 
accountsmap_bind = no 

#============== ldap Quota ============ 
message_size_limit = 14336000
virtual_mailbox_limit_size = 20971520
virtual_mailbox_limit_override=yes 
virtual_maildir_extended = yes 
virtual_create_maildirsize = yes 

virtual_mailbox_limit_maps = ldap:quota
quota_server_host = localhost 
quota_search_base = o=hosting,dc=example,dc=com 
quota_query_filter = (&(&(objectClass=JammMailAccount)(mail=%s))(accountActive=TRUE)(delete=FALSE)) 
quota_result_attribute = quota 
quota_cache = no 
quota_bind = no 

#====================SASL======================== 
broken_sasl_auth_clients = yes
#In order to allow mail relaying by authenticated clients
smtpd_recipient_restrictions =
  permit_mynetworks,
  permit_sasl_authenticated,
  reject_invalid_hostname,
  reject_non_fqdn_hostname,
  reject_unknown_sender_domain,
  reject_non_fqdn_sender,
  reject_non_fqdn_recipient,
  reject_unknown_recipient_domain,
  reject_unauth_pipelining,
  reject_unauth_destination,
  permit
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_security_options = noanonymous
smtpd_sasl_application_name = smtpd
smtpd_banner=$myhostname ESMTP "Version not Available"

启动postfix
# postfix start 

4.安装Courier-authlib 0.56
新版本的imap不再包含authentication library,必须先安装 Courier authentication library 
# wget http://www.courier-mta.org/beta/courier-authlib/courier-authlib-0.56.20050709.tar.bz2
# tar jxvf courier-authlib-0.56.20050709.tar.bz2
# cd courier-authlib-0.56.20050709
# ./configure \
--with-redhat \
--with-authldap=yes \
--with-mailuser=vmail --with-mailgroup=vmail
# make
# make install
# make install-configure

# vi /usr/local/etc/authlib/authdaemonrc
authmodulelist="authldap"
authmodulelistorig="authldap"

# vi /usr/local/etc/authlib/authldaprc
LDAP_SERVER    localhost 
LDAP_PORT 389 
LDAP_PROTOCOL_VERSION 3 
LDAP_BASEDN dc=test,dc=com 
LDAP_AUTHBIND 1 
LDAP_MAIL mail 
LDAP_FILTER (objectClass=JammMailAccount)(accountActive=TRUE)(delete=FALSE) 
LDAP_GLOB_UID vmail 
LDAP_GLOB_GID vmail 
LDAP_HOMEDIR homeDirectory 
LDAP_MAILDIR mailbox 
LDAP_DEFAULTDELIVERY defaultDelivery 
LDAP_MAILDIRQUOTA quota 
LDAP_FULLNAME cn
LDAP_CRYPTPW userPassword
#LDAP_CLEARPW clearPassword 
LDAP_DEREF never 
LDAP_TLS 0

注意:确认在这个文件中不能用空格键(包括行尾),只能用tab键

设置自启动
# cp courier-authlib.sysvinit /etc/rc.d/init.d/courier-authlib
# chmod 755 /etc/rc.d/init.d/courier-authlib
# chkconfig --level 0123456 courier-authlib on

手动启动服务:
# authdaemond start

测试courier-authlib
检查进程: 
# pstree |grep authdaemond 
|-authdaemond.mys---5*[authdaemond.mys]

5.安装Courier-imap 4.0.3
# wget http://www.courier-mta.org/beta/imap/courier-imap-4.0.3.20050702.tar.bz2
# tar jxvf courier-imap-4.0.3.20050702.tar.bz2
# cd courier-imap-4.0.3.20050702
# ./configure \
--prefix=/usr/local/imap \
--with-redhat \
--disable-root-check \
--enable-unicode=utf-8,iso-8859-1,gb2312,gbk,gb18030 \
--with-trashquota \
--with-dirsync
# make
# make install-strip (先install-strip,如果失败,再make install)
# make install-configure

# vi /usr/local/imap/etc/pop3d
将POP3DSTART=NO改为POP3DSTART=YES

# vi /usr/local/imap/etc/imapd
将IMAPDSTART=NO改为IMAPDSTART=YES

让imap自启动:
# cp courier-imap.sysvinit /etc/rc.d/init.d/courier-imap
# chmod 755 /etc/rc.d/init.d/courier-imap
# chkconfig --level 0123456 courier-imap on
手动启动服务:
# /usr/local/imap/libexec/pop3d.rc start
# /usr/local/imap/libexec/imapd.rc start

测试courier-imap
检查进程:
# pstree |grep courier 
|-2*[courierlogger]
|-2*[couriertcpd]

检查端口,应该有如下端口打开:
# netstat -an |grep LISTEN
tcp  0  0 0.0.0.0:110  0.0.0.0:*  LISTEN
tcp  0  0 0.0.0.0:143  0.0.0.0:*  LISTEN

6.安装Courier-maildrop 1.8.1
# wget http://ufpr.dl.sourceforge.net/sourceforge/courier/maildrop-1.8.1.tar.bz2
# tar jxvf maildrop-1.8.1.tar.bz2
# cd maildrop-1.8.1
# ./configure \
--prefix=/usr/local/maildrop \
--enable-sendmail=/usr/sbin/sendmail \
--enable-trusted-users='root vmail' \
--enable-syslog=1 \
--enable-maildirquota \
--enable-maildrop-uid=5000 \
--enable-maildrop-gid=5000 \
--with-trashquota \
--with-dirsync
# make
# make install
# cp /usr/local/maildrop/bin/maildrop /usr/bin
# chmod a+rx /usr/bin/maildrop

运行maildrop -v应该有如下提示信息: 
maildrop 1.8.0 Copyright 1998-2004 Double Precision, Inc.
GDBM extensions enabled.
Courier Authentication Library extension enabled.
Maildir quota extension enabled.
This program is distributed under the terms of the GNU General Public
License. See COPYING for additional information.

新建/etc/maildroprc文件
# vi /etc/maildroprc
logfile "/var/mailbox/maildrop.log" 
to "$HOME/$DEFAULT"

# chmod a+r /etc/maildroprc

配置Postfix
# vi /etc/postfix/main.cf
virtual_transport = maildrop 
maildrop_destination_recipient_limit = 1 

# vi /etc/postfix/master.cf
maildrop unix - n n - - pipe 
flags=DRhu user=vmail:vmail argv=/usr/local/maildrop/bin/maildrop -w 90 -d ${recipient}

7.管理工具

安装apache 2.0.54 
# wget http://apache.freelamp.com/httpd/httpd-2.0.54.tar.bz2 
# tar jxvf httpd-2.0.54.tar.bz2 
# cd httpd-2.0.54 
# ./configure --prefix=/usr/local/apache 
# make 
# make install 

设置自启动 
# cp support/apachectl /etc/init.d/httpd 

修改/etc/init.d/httpd 
# vi /etc/init.d/httpd (前面部分修改成这样) 
#!/bin/sh 

# Startup script for the Apache Web Server 
# chkconfig: - 85 15 
# description: Apache is a World Wide Web server. It is used to serve \ 
# HTML files and CGI. 
# processname: httpd 
# pidfile: /usr/local/apache/log/httpd.pid 
# config: /usr/local/apache/conf/httpd.conf 

# chkconfig --add httpd 
# chmod 755 /etc/init.d/httpd 
# chkconfig httpd on

# vi /usr/local/apache/conf/httpd.conf
DocumentRoot "/var/www" 
<Directory "/var/www">; 
Options Indexes FollowSymLinks 
AllowOverride None 
Order allow,deny
Allow from all 
</Directory>;
User vmail
Group vmail

创建web根目录
# mkdir /var/www 

启动服务
# /usr/local/apache/bin/apachectl start 
或 
# service httpd start

安装jamm

安装jdk
从sun网站下载(下载页面)j2sdk-1_4_2_08-linux-i586.bin,下载前要注册
# chmod 755 j2sdk-1_4_2_08-linux-i586.bin
# ./j2sdk-1_4_2_08-linux-i586.bin
# mv j2sdk1.4.2_08 /usr/local
# ln -s /usr/local/j2sdk1.4.2_08 /usr/local/j2sdk

安装resin
# wget http://www.caucho.com/download/resin-3.0.14.tar.gz
# tar zxvf resin-3.0.14.tar.gz
# mv resin-3.0.14 /usr/local/j2sdk

设置JDK变量环境
# vi /etc/profile 
JAVA_HOME=/usr/local/j2sdk
PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
CLASSPATH=.:$JAVA_HOME/lib
export PATH JAVA_HOME CLASSPATH

# source /etc/profile

启动resin
# /usr/local/j2sdk/resin-3.0.14/bin/httpd.sh start

现在就能够从http://192.168.1.100:8080上能看到resin的页面,这也就表示单独的resin运行成功了。然后,为了整合resin和apache,我们需要重新编译一下,以生成mod_caucho给apache调用
# cd /usr/local/j2sdk/resin-3.0.14/
# ./configure --with-apache=/usr/local/apache
# make 
# make install

安装配置jamm
# mkdir /var/www/jamm
# wget http://peterhost.dl.sourceforge.net/sourceforge/jamm/jamm-0.9.6-bin.tar.gz
# tar zxvf jamm-0.9.6-bin.tar.gz
# mkdir /var/www/jamm 
# cp jamm-0.9.6/jamm-0.9.6.war /var/www/jamm/
# cd /var/www/jamm
# jar -xf jamm-0.9.6.war
# cd WEB-INF/
# cp jamm.properties.dist jamm.properties
# vi jamm.properties
jamm.ldap.search_base = o=hosting,dc=test,dc=com
jamm.ldap.root_dn = cn=Manager,dc=test,dc=com

# vi /usr/local/j2sdk/resin-3.0.14/conf/resin.conf
把 
<web-app id='/' document-directory="webapps/ROOT"/>; 
改成
<web-app id='' document-directory="."/>; 
并在这行后加一行
<web-app id='/jamm' document-directory="/var/www/jamm"/>; 

重新启动apache和resin
# /usr/local/j2sdk/resin-3.0.14/bin/httpd.sh restart
# service httpd restart

安装php 5.0.4 
# wget http://cn.php.net/get/php-5.0.4.tar.bz2/from/this/mirror
# tar jxvf php-5.0.4.tar.bz2
# cd php-5.0.4
# ./configure \
--prefix=/usr/local/php \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-ldap=/usr/local/openldap \
--disable-ipv6
# make 
# make install 
# cp php.ini-dist /usr/local/php/lib/php.ini 

# vi /usr/local/php/lib/php.ini 
找到
;default_charset = "iso-8859-1" 
在这行下面加一行 
default_charset = "gbk" 

# vi /usr/local/apache/conf/httpd.conf 
加两行
AddType application/x-httpd-php .php 
AddType application/x-httpd-php-source .phps 
找到下面一行在后面加上index.php,这表示网站的默认页也能够为index.php,把index.jsp也加上去吧
DirectoryIndex index.html index.html.var index.php 

安装phpldapadmin 0.9.6c
本来jamm已经非常好了,可是不能修改quota和homedirectory,可能是我不知道再哪里改吧,只好又装了个phpldapadmin
# wget http://jaist.dl.sourceforge.net/sourceforge/phpldapadmin/phpldapadmin-0.9.6c.tar.gz
# tar zxvf phpldapadmin-0.9.6c.tar.gz -C /var/www
# mv /var/www/phpldapadmin-0.9.6c /var/www/phpldapadmin
# cd /var/www/phpldapadmin 
# cp config.php.example config.php
# vi /var/www/phpldapadmin/config.php
$blowfish_secret = 'any'
$servers[$i]['name'] = 'LDAP Server';
$servers[$i]['host'] = 'localhost';
$servers[$i]['base'] = 'dc=test,dc=com';
$servers[$i]['auth_type'] = 'cookie';
$language = 'zh-tw';

重启apache
# service httpd restart 

现在可以添加用户了
登陆jamm
http://192.168.1.100/jamm/index.jsp
用户名:root
密码:12345

在jamm中建一域:test.com,并在该域下建一用户:test,密码:12345。然后到phpldapadmin中把该用户的homeDirectory改成/var/mailbox,并新增此用户一属性quota,将其值设为100000000S(就是100M)

创建该用户maildir
新建/usr/sbin/maildirmake.sh文件
# vi /usr/sbin/maildirmake.sh 
#!/bin/bash
set -e
if [ ! -d /var/mailbox/$1 ]
then
mkdir /var/mailbox/$1
fi 
chown -R vmail:vmail /var/mailbox/$1
cd "/var/mailbox/$1"
/usr/local/imap/bin/maildirmake $2
chown -R vmail:postfix /var/mailbox/$1/$2
chmod -R g=s /var/mailbox/$1/$2

# chmod 755 /usr/sbin/maildirmake.sh

# maildirmake.sh test.com test 

8.测试

发现邮件系统在安装过程中会碰到各式各样的问题,于是把测试部分单独列出来,请注意看日志目录下的maillog和message。

测试smtp
启动saslauthd
# chkconfig saslauthd on
# service saslauthd start 

如果你的密码验证方式为authdaemond,就不用启动saslauthd了,但是要
#chmod +x /usr/local/var/spool/authdaemon

# perl -MMIME::Base64 -e 'print encode_base64("test\@test.com");'
dGVzdEB0ZXN0LmNvbQ==
# perl -MMIME::Base64 -e 'print encode_base64("12345");'
MTIzNDU=

# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 www.test.com ESMTP "Version not Available"
ehlo www.test.com
250-www.test.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250 8BITMIME
auth login
334 VXNlcm5hbWU6
dGVzdEB0ZXN0LmNvbQ==
334 UGFzc3dvcmQ6
MTIzNDU=
235 Authentication successful

测试POP3和IMAP
# telnet localhost 110
+OK Hello there 
user [email protected] 
+OK Password required. 
pass 12345 
+OK Logged in. 
QUIT
+OK bye-bye

测试maildrop
# maildrop -V 9 -d [email protected]
maildrop: authlib: groupid=1001
maildrop: authlib: userid=1001
maildrop: authlib: [email protected], home=/var/mailbox/, mail=test.com/test/
maildrop: Changing to /var/mailbox/

ctrl+c退出

9.安装squirrelmail 1.4.5
下载squirrelmail及中文包
# wget http://heanet.dl.sourceforge.net/sourceforge/squirrelmail/squirrelmail-1.4.5.tar.bz2
# wget http://heanet.dl.sourceforge.net/sourceforge/squirrelmail/zh_CN-1.4.5-20050713.tar.bz2
把squirreelmail解压到/var/www目录下。
# tar jxvf squirrelmail-1.4.5.tar.bz2 -C /var/www
# mv /var/www/squirrelmail-1.4.5 /var/www/squirrelmail
解压中文包
# tar jxvf zh_CN-1.4.5-20050713.tar.bz2 -C /var/www/squirrelmail/

在配置squirrelmail之前先下载插件:
Quota Usage Version 1.3
# wget http://www.squirrelmail.org/countdl.php?fileurl=http%3A%2F%2Fwww.squirrelmail.org%2Fplugins%2Fquota_usage-1.3-1.2.7.tar.gz

Compatibility 2.0.1
# wget http://www.squirrelmail.org/countdl.php?fileurl=http%3A%2F%2Fwww.squirrelmail.org%2Fplugins%2Fcompatibility-2.0.1.tar.gz

Change LDAP Password 1.8 
# wget http://www.squirrelmail.org/countdl.php?fileurl=http%3A%2F%2Fwww.squirrelmail.org%2Fplugins%2Fchange_ldappass-1.8.tar.gz 

把插件解压到squirrelmail的plugin目录下
# tar zxvf quota_usage-1.3-1.2.7.tar.gz -C /var/www/squirrelmail/plugins/
# tar zxvf compatibility-2.0.1.tar.gz -C /var/www/squirrelmail/plugins/
# tar zxvf change_ldappass-1.8.tar.gz -C /var/www/squirrelmail/plugins/

配置Quota Usage
# cd /var/www/squirrelmail/plugins/quota_usage
# cp config.php.sample config.php

配置Change LDAP Password
# cd /var/www/squirrelmail/plugins/change_ldappass
# cp config.php.sample config.php
# vi /var/www/squirrelmail/plugins/change_ldappass/config.php
$ldap_server = "localhost"; 
$ldap_password_field = "userpassword"; 
$ldap_user_field = "mail"; 
$ldap_base_dn = "dc=test,dc=com"; 


配置squirrelmail
# cd /var/www/squirrelmail
# ./configure
进入10. Languages
把1. Default Language : 的en_US改成zh_CN。
进入8. Plugins,添加这三个插件

打开浏览器输入http://192.168.1.100/squirrelmail/,用[email protected]登陆,成功!

结束,还有防病毒和防垃圾部分请参考我的另一篇文章(点这里),终于告一段落了,休息几天先。

主要参考文章
http://jamm.sourceforge.net/howto/single-html/mailserver.html
http://wanderingbarque.com/howtos/mailserver/mailserver.html
http://www.freebsdchina.org/forum/topic_21506.html
https://bugzilla.andrew.cmu.edu/cgi-bin/cvsweb.cgi/src/sasl/saslauthd/LDAP_SASLAUTHD?rev=1.11&content-type=text/x-cvsweb-markup

你可能感兴趣的:([精华] 【原创】postfix(ldap)邮件系统)