Sealyu

          --- 博客已遷移至: http://www.sealyu.com/blog

            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
            618 隨筆 :: 87 文章 :: 225 評論 :: 0 Trackbacks
          本來是打算用cyrus 做pop3服務器的,但是因為跟openwebmail不兼容,就選用了dovecot,性能應該比cyrus 好。

          一、編譯安裝
          # tar xzvf dovecot-1.0.2.tar.gz
          # cd dovecot-1.0.2
          # ./configure
          # make
          # make install

          二、找出sendmail郵箱的位置
          # echo "Hello me" | mail -s "Dovecot test" $USER
          一般的rh系統都在 /var/mail 目錄下


          三、配置dovecot
          # mv /usr/local/etc/dovecot-example.conf /usr/local/etc/dovecot.conf
          每個配置的選項conf文件里已經有很詳細的注釋了,這里貼出我的dovecot.conf:
          protocols = imap pop3
          disable_plaintext_auth = no
          ssl_disable = yes
          ser=<%u> method=%m rip=%r lip=%l %c
          #login_log_format = %$: %s

          mail_location = mbox:~/mail:INBOX=/var/mail/%u

          dotlock_use_excl = yes
          maildir_copy_with_hardlinks = yes

          protocol pop3 {
          pop3_uidl_format = %v.%u
          }


          protocol lda {
          postmaster_address = postmaster@example.com
          }

          auth_verbose = yes

          auth default {
          mechanisms = plain
          passdb shadow {
          }
          userdb passwd {
          }
          user = root
          }

          四、啟動dovecot
          編輯啟動腳本 /etc/init.d/dovecot,適應于所有的操作系統
          #! /bin/sh

          DAEMON=/usr/local/sbin/dovecot

          test -x $DAEMON || exit 0
          set -e

          base_dir=`$DAEMON -a|grep '^base_dir: '|sed 's/^base_dir: //'`
          pidfile=$base_dir/master.pid

          if test -f $pidfile; then
          running=yes
          else
          running=no
          fi

          case "$1" in
          start)
          echo -n "Starting Dovecot"
          $DAEMON
          echo "."
          ;;
          stop)
          if test $running = yes; then
          echo "Stopping Dovecot"
          kill `cat $pidfile`
          echo "."
          else
          echo "Dovecot is already stopped."
          fi
          ;;
          reload)
          if test $running = yes; then
          echo -n "Reloading Dovecot configuration"
          kill -HUP `cat $base_dir/master.pid`
          echo "."
          else
          echo "Dovecot isn't running."
          fi
          ;;
          restart|force-reload)
          echo -n "Restarting Dovecot"
          if test $running = yes; then
          kill `cat $base_dir/master.pid`
          sleep 1
          fi
          $DAEMON
          echo "."
          ;;
          *)
          echo "Usage: /etc/init.d/dovecot {start|stop|reload|restart|force-reload}" >&2
          exit 1
          ;;
          esac

          exit 0

          # /etc/init.d/dovecot start 啟動dovecot
          # kill `cat /usr/local/var/run/dovecot/master.pid` 關閉dovecot

          參考資料:
          http://wiki.dovecot.org/FrontPage?action=show&redirect=%E9%A6%96%E9%A1%B5
          posted on 2008-07-31 21:16 seal 閱讀(543) 評論(0)  編輯  收藏 所屬分類: Linux
          主站蜘蛛池模板: 七台河市| 古丈县| 瑞昌市| 肃南| 金门县| 陆川县| 麻城市| 明水县| 潼关县| 牡丹江市| 盘锦市| 沙洋县| 沐川县| 永寿县| 周至县| 琼海市| 星座| 尼木县| 呈贡县| 自贡市| 林州市| 都昌县| 博乐市| 剑川县| 龙江县| 马关县| 石狮市| 琼中| 若尔盖县| 全南县| 富川| 从化市| 江华| 射阳县| 武宣县| 和政县| 康保县| 芜湖县| 高邮市| 临沭县| 左贡县|