引用:
1. 使用自已獨立的資料庫。
2. 提供容量限制 (quotas) 的功能來替代系統中原有的 filesystem quotas。
3. filesystem quotas 它不會提醒你容量是否快要滿了,當容量滿時,filesystem quotas 就立即停止接收新的 mail。
4. Cyrus-IMAP 提供的 "soft-quotas" 功能,它會偵察使用了多少空間以及數量,當接近容量限制 (quota) 時,它會親切的提醒你,要你做好準備。一旦 quota 界滿時,它會再次的向 user 發出警告,期間如有 mail 傳入,
它會退回 (bounced back) 該 mail,並且解釋說該使用者信箱已滿。這樣貼切的功能,讓遺失 mail 的機率降為更低。
[1.] apt-get install cyrus-imapd
wget ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-imapd-2.2.12.tar.gz
tar zxvf cyrus-imapd-2.2.12.tar.gz
cd cyrus-imapd-2.2.12
./configure –with-auth=unix
useradd -g mail cyrus
passwd cyrus
secret
make depend
make all CFLAGS=-0
make install
[Q.] [root@ssorc cyrus-imapd-2.2.12]# make all CFLAGS=-0
### Making all in /root/cyrus-imapd-2.2.12/man
make[1]: Entering directory `/root/cyrus-imapd-2.2.12/man'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/cyrus-imapd-2.2.12/man'
### Making all in /root/cyrus-imapd-2.2.12/lib
make[1]: Entering directory `/root/cyrus-imapd-2.2.12/lib'
gcc -c -I.. -DHAVE_CONFIG_H -0
libconfig.c
gcc: unrecognized option '-0'
In file included from libconfig.h:47,
from libconfig.c:57:
imapopts.h:181: error: array type has incomplete element type
make[1]: *** [libconfig.o] Error 1
make[1]: Leaving directory `/root/cyrus-imapd-2.2.12/lib'
make: *** [all] Error 1
[A.] ??
[2.] vi /etc/cyrus.conf
SERVICES {
# add or remove based on preferences
imap cmd="imapd" listen="imap" prefork=5
# imaps cmd="imapd -s" listen="imaps" prefork=1
pop3 cmd="pop3d" listen="pop3" prefork=3
# pop3s cmd="pop3d -s" listen="pop3s" prefork=1
# sieve cmd="timsieved" listen="sieve" prefork=0
[Q.] [root@dev2 root]# telnet localhost 110
Trying 127.0.0.1…
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
+OK dev2.sy.com Cyrus POP3 v2.2.3-Red Hat 2.2.3-11 server ready <[email protected]>
user root
+OK Name is a valid mailbox
pass
-ERR Missing argument
pass 123456
-ERR [AUTH] Invalid login
[A.] start the saslauthd
[Q.] [root@dev2 root]# telnet localhost 110
Trying 127.0.0.1…
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
+OK dev2.sy.com Cyrus POP3 v2.2.3-Red Hat 2.2.3-11 server ready <[email protected]>
user root
+OK Name is a valid mailbox
123456
-ERR Unrecognized command
pass 123456
-ERR [SYS/PERM] Unable to locate maildrop
[A.] 方式一,修改 /etc/imapd.conf; 增加下列兩行
autocreatequota: -1
createonpost: yes # 讓信箱自動建立
方式二,因為Cyrus-IMAPd uses it's own Maildir format and not mboxes,所以要用cyrus-imapd製作mailbox的程式
執行
cyradm localhost –user cyrus
或者 cyradm –auth login localhost –user cyrus
(–user 後面接管理員帳號 (在 imapd.conf 裡設置的 admins: cyrus))
localhost> cm user.test # 建立mailbox
localhost> lm # list mailbox
localhost> setacl user.test cyrus all
localhost> listacl user.test
[Q.] 測試 Cyrus-IMAP 的認證是否有正常運作
imtest -m login -a test localhost # test為使用者名稱
S: * OK dev2.sy.com Cyrus IMAP4 v2.2.3-Red Hat 2.2.3-11 server ready
C: C01 CAPABILITY
S: * CAPABILITY IMAP4 IMAP4rev1 ACL QUOTA LITERAL+ MAILBOX-REFERRALS NAMESPACE UIDPLUS ID NO_ATOMIC_RENAME UNSELECT CHILDREN
MULTIAPPEND BINARY SORT THREAD=ORDEREDSUBJECT THREAD=REFERENCES ANNOTATEMORE IDLE STARTTLS LISTEXT LIST-SUBSCRIBED X-NETSCA
PE
S: C01 OK Completed
Please enter your password:
C: L01 LOGIN test {6}
S: + go ahead
C: <omitted>
S: L01 NO Login failed: authentication failure
Authentication failed. generic failure
Security strength factor: 0
[A.] vi /etc/postfix/master.cf
修改deliver正確路徑
old-cyrus unix – n n – – pipe
flags=R user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -m ${extension} ${user}
#flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
# Cyrus 2.1.5 (Amos Gouaux)
cyrus unix – n n – – pipe
user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -r ${sender} -m ${extension} ${user}
#user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
imtest -m login -a cross localhost
S: * OK dev2.sy.com Cyrus IMAP4 v2.2.3-Red Hat 2.2.3-11 server ready
C: C01 CAPABILITY
S: * CAPABILITY IMAP4 IMAP4rev1 ACL QUOTA LITERAL+ MAILBOX-REFERRALS NAMESPACE UIDPLUS ID NO_ATOMIC_RENAME UNSELECT CHILDREN MULTIAPPEND BINARY SORT THREAD=ORDEREDSUBJECT THREAD=REFERENCES ANNOTATEMORE IDLE STARTTLS LISTEXT LIST-SUBSCRIBED X-NETSCAPE
S: C01 OK Completed
Please enter your password:
C: L01 LOGIN cross {6}
S: + go ahead
C: <omitted>
S: L01 OK User logged in
Authenticated.
Security strength factor: 0
. logout
[Q.] cyradm localhost –user cyrus –auth login
IMAP Password:
Login failed: authentication failure at /usr/lib/perl5/Cyrus/IMAP/Admin.pm line 119
cyradm: cannot authenticate to server with login as cyrus
[A.] Quote: http://www.chinaunix.net/jh/14/84003.html
其實cyrus 用戶密碼存放于兩個地方 一個是sasldb2 里面 就是用saslpasswd 命令加進去的那個
POP / IMAP 收寄信
vi /etc/postfix/main.cf
mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp
# home_mailbox = Maildir/
# mail_spool_directory = /var/spool/imap/
# 經過測式,第二第二個似乎不用設定
ref: http://www.delouw.ch/linux/Postfix-Cyrus-Web-cyradm-HOWTO/html/index.html
安裝 web-cyradm
wget http://www.web-cyradm.org//web-cyradm-0.5.4-1.tar.gz
tar zxvf web-cyradm-0.5.4-1.tar.gz
mv web-cyradm-0.5.4-1 /var/www/html/
touch /var/log/web-cyradm.log
chown nobody /var/log/web-cyradm.log
cd /var/www/html/web-cyradm/config
cp conf.php.dist conf.php
vi conf.php
未完…
留言