2009年6月17日 星期三

[FreeBSD] 讓 Mail Server 支援 POP3 / POP3s / IMAP / IMAPs 功能 - 安裝 dovecot

測試環境:



  • FreeBSD 7 -  FreeBSD 7.0-RELEASE-p12


步驟:



  1. 編譯與安裝

    • # cd /usr/ports/mail/dovecot ; make install clean ; // 預設就很 ok 了



  2. 建立 SSL 相關資料

    • # openssl req -new -x509 -nodes -out /tmp/public.pem -keyout /tmp/private.pem -days 3650

      • Country Name (2 letter code) [AU]:TW
        State or Province Name (full name) [Some-State]:Taiwan
        Locality Name (eg, city) []:ChiaYi County
        Organization Name (eg, company) [Internet Widgits Pty Ltd]:CYY
        Organizational Unit Name (eg, section) []:CYY
        Common Name (eg, YOUR name) []:
        Email Address []:admin@localhost



    • # cd /etc/ssl/ ; mkdir certs private ; chmod 700 certs private

    • # cp /tmp/public.pem /etc/ssl/certs/dovecot.pem ; cp /tmp/private.pem /etc/ssl/private/dovecot.pem

    • # rm -rf /tmp/public.pem /tmp/private.pem



  3. 啟動

    • # vim /etc/rc.conf

      • dovecot_enable="YES"



    • # /usr/local/etc/rc.d/dovecot start




如此一來,即可使用,可使用以下方式測試



  • POP3

    • # telnet localhost 110



  • POP3s

    • # telnet localhost 995



  • IMAP

    • # telnet localhost 143



  • IMAPs

    • # telnet localhost 993




指令



  • POP3

    • USER id

    • PASS password

    • QUIT



  • IMAP

    • - login id password

    • - logout




沒有留言:

張貼留言