Top / Linux / Dovecot

DOVECOT

Project URL
http://www.dovecot.org/

Current Version

StatusVersionRelease Date
Stable2.1.12Nov 29 2012
Old Stable2.0.21June 12 2012
Debian Package1.2.15-7-
Debian Package(unstable)2.1.7-6-

Dovecot + postfix + sieve

Debian の Dovecot パッケージは、dovecot-common と dovecot-imapd dovecot-pop3dからなります。

いままで、fetchmail で他のサーバより取得したファイルを、imapにて提供するようにしてsquirrelmailを組み合わせてWebmailとしてきましたが、AJAXを用いたRoundcube が使いやすそうなの移行作業を行ってきました。roundcubeは、発展初期なソフトウェアなのでまだ機能が十分ではありません。機能拡充は、プラグイン方式なのですが、ビルトインでの振り分けプログラムがまだありません。振り分け機能は、MUAとして必須なので サーバー側振り分けプログラムであるSieveを用いることにしました。

Sieveは,単独でもパッケージ化されていますが,dovecot の場合、パッケージに含まれています。sieveサーバ(managesieve)および sieveによる振り分けサービスをローカル配送に追加する形で行うようになっています。

いつも使ってきたMTAがpostfixなので今回はpostfixにて設定。

Debian Package 1.2.15-4 のsieveが動かない。

dovecotはいままで使ってきたので、sieveの設定だけすれば使えると考えましたが、以下のように出て どうもうまく行きません。

dlopen(/usr/lib/dovecot/lda/lib90_sieve_plugin.so) failed:
/usr/lib/dovecot/lda/lib90_sieve_plugin.so: undefined symbol:
duplicate_check
Couldn't load required plugins

調べてみると sieveプラグインを使う用になっていないようです。cmusieveあたりに宣言がなっているのではないかと思ったりしますが、くわしくはまだ調べていません。

dovecot 2 をビルドして突っ込んでみた。

とりあえず 最新なのは 2.0.11なので、探してみましたが debパッケージがありません。とりあえず checkinstall でやってみようと思いましたがこれもうまくいきません。なので ./configure make install してしまいましたら、うまく動くようになりました。(^^;

やったのは

  1. dovecot-2.0.11 を cofigure make make install *1
  2. dovecot-2.0-pigeonhole-0.2.2 を cofigure make make install
  3. dovecot の設定*2
    1. /etc/ に dovecot の設定がないので /usr/share/doc/dovecot/example-configをコピーして名前を変えました。
    2. /etc/dovecot/dovecot.conf の以下を設定
      # Protocols we want to be serving.
      protocols = imap pop3 lmtp sieve
      
      # A comma separated list of IPs or hosts where to listen in for connections.
      # "*" listens in all IPv4 interfaces, "::" listens in all IPv6 interfaces.
      # If you want to specify non-default ports or anything more complex,
      # edit conf.d/master.conf.
      listen = *, ::
      
      # Base directory where to store runtime data.
      base_dir = /var/run/dovecot/
    3. /etc/dovecot/conf.d/10-mail.conf
      #mail_location =
      mail_location = maildir:~/Maildir
    4. /etc/dovecot/conf.d/15-lda.conf
      protocol lda {
        # Space separated list of plugins to load (default is global mail_plugins).
        mail_plugins = $mail_plugins sieve
      }
    5. /etc/dovecot/conf.d/15-lmtp.conf
      protocol lmtp {
         # Space separated list of plugins to load (default is global mail_plugins).
         mail_plugins = $mail_plugins sieve
      }
    6. あと スタートアップスクリプトを作って /etc/init.d/ に入れて update-rc.d にて登録。
    7. sieveを動かすには、ローカル配送時にdovecotに渡してやらないとだめなので /etc/postfix/main.cf に以下を追加。
      mailbox_command = /usr/libexec/dovecot/deliver -a "$RECIPIENT"

これで roundcube で振り分けが動くようになりました。manageseive plugin と合わせて設定も簡単です。

時間を見つけて2.0の野良パッケージつくろうっと。
と思っていたら sid と testing(wheezy)は 1:2.0.12-1 と 2.0になっていたので 入れ替え(2011-05-17 (火) 17:11:48 Merlin)

Dovecot2 導入

Debian Package

dovecot-antispam*3Dovecot plugins for training spam filters
dovecot-commonsecure mail server that supports mbox, maildir, dbox and mdbox mailboxes
dovecot-dbgdebug symbols for Dovecot
dovecot-devheader files for the dovecot mail server
dovecot-gssapiGSSAPI authentication support for Dovecot
dovecot-imapdsecure IMAP server that supports mbox, maildir, dbox and mdbox mailboxes
dovecot-ldapLDAP support for Dovecot
dovecot-lmtpdsecure LMTP server for Dovecot
dovecot-managesievedsecure ManageSieve? server for Dovecot
dovecot-mysqlMySQL support for Dovecot
dovecot-pgsqlPostgreSQL support for Dovecot
dovecot-pop3dsecure POP3 server that supports mbox, maildir, dbox and mdbox mailboxes
dovecot-sievesieve filters support for Dovecot
dovecot-sqliteSQLite support for Dovecot
mysqmail-dovecot-loggerreal-time logging system in MySQL - Dovecot traffic-logger
  1. aptitude install dovecot-common dovecot-imapd dovecot-lmtpd dovecot-pop3d dovecot-sieve dovecot-managesieved
  2. dovecot の設定
    1. cp /etc/dovecot/dovecot.conf.ucf-dist /etc/dovecot/dovecot.conf
    2. /etc/dovecot/dovecot.conf の以下を設定
      # A comma separated list of IPs or hosts where to listen in for connections.
      # "*" listens in all IPv4 interfaces, "::" listens in all IPv6 interfaces.
      # If you want to specify non-default ports or anything more complex,
      # edit conf.d/master.conf.
      listen = *, ::
      
      # Base directory where to store runtime data.
      base_dir = /var/run/dovecot/
    3. /etc/dovecot/conf.d/10-mail.conf
      #mail_location =
      mail_location = maildir:~/Maildir
    4. /etc/dovecot/conf.d/15-lda.conf
      protocol lda {
        # Space separated list of plugins to load (default is global mail_plugins).
        mail_plugins = $mail_plugins sieve
      }
    5. /etc/dovecot/conf.d/15-lmtp.conf
      protocol lmtp {
         # Space separated list of plugins to load (default is global mail_plugins).
         mail_plugins = $mail_plugins sieve
      }
    6. /usr/share/dovecot/protocols.d に以下の内容を持つファイルの作成 
      dovecot-sieve.protocols
      protocols = $protocols sieve
    7. sieveを動かすには、ローカル配送時にdovecotに渡してやらないとだめなので /etc/postfix/main.cf に以下を追加。
      mailbox_command = /usr/libexec/dovecot/deliver -a "$RECIPIENT"

dovecot-2.1 以降でエラーが出て動かなくなる。

Error: user *****: Initialization failed: namespace configuration error: inbox=yes namespace missing

なるエラーが出ていたら、/etc/dovecot/conf.d/10-mail.confのバージョンが合ってないので10-mail.conf.ucf-dist を元に再設定すること。


*1 ディレクトリは、--prefix=/usr --sysconfdir=/etc --localstatedir=/var
*2 ファイアーウォール内なので無茶手抜き設定です
*3 次はこれあたりを試したい

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2013-01-07 (月) 10:49:56 (3915d)