2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Emacs 附属の sieve.el で Dovecot 附属の managesieve サーバに接続する

Last updated at Posted at 2016-09-09

IMAP サーバ側でメールを振り分ける場合、managesieve サーバに接続して、メールを振り分ける規則を記述した Sieve スクリプトをアップロードする必要があります。

以下は、私が使っている Sieve スクリプトの一部抜粋です。

require ["fileinto"];
# X-Spam-Flag: YES があるメールは迷惑メールボックスに振り分け
if header :is "X-Spam-Flag" "YES"
{
    fileinto "Junk";
    stop;
}
# root/postmaster 宛のメールは管理者用メールボックスに振り分け
if anyof (address :localpart :is "to" "root",
          address :localpart :is "to" "postmaster")
{
    fileinto "Administrator";
    stop;
}
# 別メールアドレス(携帯電話)に転送
if true
{
    redirect "foo@example.net";
}
# 全てのメールを受信箱に格納
keep;

その上で、Emacs 上で managesieve サーバに接続するには M-x sieve-manage RET としてやればよいのですが、Dovecot 附属の managesieve サーバに接続する場合、認証に失敗して以下のエラーメッセージが出ることがあります。

Server aborted SASL authentication: Received empty AUTHENTICATE client response line.

これは、http://borg4.vdomains.jp/~goro/diary/2012/1765 で解説されている問題と、まったく同じ問題だと思われますので、DIGEST-MD5 を無効化してやれば良いようです。つまり、以下のように使いたい認証方式だけを選んで、~/.emacs に書いておけば良いわけです。

(setq sieve-manage-authenticators '(cram-md5 plain login))
2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?