Courier-IMAP是一个提供POP3、IMAP服务的程序,能够很方便的配置使其支持加密协议POP3s、IMAPs。并良好的支持Maildir。

1、Courier-imap的安装

安装时选择(如果你使用MySQL认证,则选择AUTH_MYSQL):

TRASHQUOTA
AUTH_LDAP

shell

# cd /usr/ports/mail/courier-imap/ && make install clean

2、Authlib的配置

编辑/authdaemonrc文件:

shell

# vi /usr/local/etc/authlib/authdaemonrc

内容如下:

authmodulelist="authldap"
authmodulelistorig="authldap"
daemons=5
authdaemonvar=/var/run/authdaemond
subsystem=mail
DEBUG_LOGIN=0
DEFAULTOPTIONS="wbnodsn=1"
LOGGEROPTS=""

增加/var/run/authdaemond的执行权限

shell

# chmod +x /var/run/authdaemond

编辑authldaprc文件:

shell

# vi /usr/local/etc/authlib/authldaprc

内容如下:

LDAP_URI                ldap://ldap.extmail.org
LDAP_PROTOCOL_VERSION   3
LDAP_BASEDN             o=extmailAccount,dc=extmail.org    
LDAP_BINDDN             cn=Manager,dc=extmail.org
LDAP_BINDPW             secret
LDAP_TIMEOUT            5
LDAP_MAIL               mail
LDAP_FILTER             (active=1)
LDAP_GLOB_UID           vmail
LDAP_GLOB_GID           vmail
LDAP_HOMEDIR            homeDirectory
LDAP_MAILROOT           /home/domains
LDAP_MAILDIRQUOTA       mailQuota
LDAP_CRYPTPW            userPassword
LDAP_DEREF              never
LDAP_TLS                0

3、配置支持POP3s

shell

# cp /usr/local/etc/courier-imap/pop3d.cnf.dist /usr/local/etc/courier-imap/pop3d.cnf

编辑pop3d.cnf文件:

shell

# vi /usr/local/etc/courier-imap/pop3d.cnf

内容如下:

RANDFILE = /usr/local/share/courier-imap/pop3d.rand

[ req ]
default_bits = 1024
encrypt_key = yes
distinguished_name = req_dn
x509_extensions = cert_type
prompt = no
default_md = sha1

[ req_dn ]
C=CN
ST=SH
L=Shang Hai
O=Extmail
OU=Extmail
CN=Extmail.org
emailAddress=liushaobo@extmail.org


[ cert_type ]
nsCertType = server

执行如下命令产生供POP3s使用的证书

shell

# /usr/local/sbin/mkpop3dcert

4、配置支持IMAPS

拷贝份配置文件:

shell

# cp /usr/local/etc/courier-imap/imapd.cnf.dist /usr/local/etc/courier-imap/imapd.cnf

编辑imapd.cnf文件:

shell

# vi /usr/local/etc/courier-imap/imapd.cnf

内容如下:

RANDFILE = /usr/local/share/courier-imap/imapd.rand

[ req ]
default_bits = 1024
encrypt_key = yes
distinguished_name = req_dn
x509_extensions = cert_type
prompt = no
default_md = sha1
[ req_dn ]
C=CN
ST=SH
L=Shang Hai
O=Extmail
OU=Extmail
CN=Extmail.org
emailAddress=liushaobo@extmail.org


[ cert_type ]
nsCertType = server

执行如下命令产生供IMAP使用的证书:

shell

# /usr/local/sbin/mkimapdcert

5、配置自动启动:

编辑/etc/rc.conf文件:

shell

# vi /etc/rc.conf

添加如下行:

courier_authdaemond_enable="YES"
courier_imap_pop3d_enable="YES"
courier_imap_imapd_enable="YES"
courier_imap_pop3d_ssl_enable="YES"
courier_imap_imapd_ssl_enable="YES"

这5行的作用分别是在开机时:启动authdaemond,启动pop3d,启动imapd,启动pop3d-ssl,启动imapd-ssl。

也可以使用命令行来控制这些进程的启动或者停止:

shell

/usr/local/etc/rc.d/courier-authdaemond start/stop
/usr/local/etc/rc.d/courier-imap-pop3d start/stop
/usr/local/etc/rc.d/courier-imap-imapd start/stop
/usr/local/etc/rc.d/courier-imap-pop3d-ssl start/stop
/usr/local/etc/rc.d/courier-imap-imapd-ssl start/stop
 
伍、配置courier-pop3_imap.txt · 最后更改: 2012/11/01 22:59 由 shaobo
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki