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

1、Courier-imap的安装

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

TRASHQUOTA
AUTH_MYSQL

shell

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

2、Authlib的配置

编辑/authdaemonrc文件:

shell

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

内容如下:

authmodulelist="authmysql"
authmodulelistorig="authmysql"
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/authmysqlrc

内容如下:

MYSQL_SERVER            localhost
MYSQL_USERNAME          extmail
MYSQL_PASSWORD          extmail
MYSQL_SOCKET            /tmp/mysql.sock
MYSQL_PORT              3306
MYSQL_OPT               0
MYSQL_DATABASE          extmail
MYSQL_USER_TABLE        mailbox
MYSQL_CRYPT_PWFIELD     password
MYSQL_UID_FIELD         uidnumber
MYSQL_GID_FIELD         gidnumber
MYSQL_LOGIN_FIELD       username
MYSQL_HOME_FIELD        homedir
MYSQL_NAME_FIELD        name
MYSQL_MAILDIR_FIELD     maildir
MYSQL_QUOTA_FIELD       quota
MYSQL_SELECT_CLAUSE     SELECT username,password,"",uidnumber,gidnumber,\
                        CONCAT('/home/domains/',homedir),               \
                        CONCAT('/home/domains/',maildir),               \
                        quota,                                          \
                        name                                            \
                        FROM mailbox                                    \
                        WHERE username = '$(local_part)@$(domain)'

3、配置开机自起

配置自动启动: 编辑/etc/rc.conf文件:

shell

# vi /etc/rc.conf

添加如下行:

courier_authdaemond_enable="YES"
courier_imap_pop3d_enable="YES"
courier_imap_imapd_enable="YES"

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

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

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
 
五、配置courier-pop3_imap.txt · 最后更改: 2012/11/01 22:31 由 shaobo
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki