一个很好用的自定义规则,给邮件分类的dovecot插件managesieve

1,安装,进入/usr/ports/mail/dovecot-pigeonhole安装,或用pkg install dovecot-pigeonhole来安装.

2,Roundcube设置

1)加载插件,编辑~/roundcubemail/config/config.inc.php:

$config['plugins'] = array(..., 'managesieve', ...,);

2)插件设置,编辑~/roundcubemail/plugins/managesieve/config.inc.php:

$config['managesieve_port'] = 4190;

$config['managesieve_host'] = '127.0.0.1';

3,设置dovecot

1)安装/usr/ports/mail/dovecot-pigeonhole

2)安装devocot时记得把mysql支持选上

3)编辑/usr/local/etc/dovecot/dovecot.conf,添加lmtp,sieve:

protocols = imap sieve lmtp
...
!include conf.d/*.conf

4)编辑/usr/local/etc/dovecot/conf.d/20-lmtp.conf,加载sieve

protocol lmtp {
  # Space separated list of plugins to load (default is global mail_plugins).
  mail_plugins = $mail_plugins sieve
}

5)编辑/usr/local/etc/dovecot/conf.d/90-sieve.conf,没有就创建一个(我就没有)

plugin {
  sieve_dir = ~/mail/%d/%n #其实就是服务器的邮件目录,根据自己的情况改
  sieve = ~/mail/%d/%n/managesieve.sieve #sieve规则,位置在邮件用户目录下,根据自己的情况改
  mail_home = ~/mail/%d/%n #根据自己情况写
}

如果一切顺利应该能编写过滤规则了,出错了多看log…

Related content