After we finished install ISPConfig3, and configure all email forward and do redirect script in sieve. Unfortunately many duplicate messages happen!
So we try to google to find the way we can solve this issue!
-- We need develop package , dovecot-dev and dovecot-managesieved
# aptitude install dovecot-dev dovecot-managesieved
-- Unfortunately without pigeonhole we can not implement pigeonhole extension.
# wget http://pigeonhole.dovecot.org/releases/2.1/dovecot-2.1-pigeonhole-0.3.6.tar.gz
# tar xzvf dovecot-2.1-pigeonhole-0.3.6.tar.gz
# cd dovecot-2.1-pigeonhole-0.3.6
dovecot-2.1-pigeonhole-0.3.6# ./configure --with-dovecot=/usr/lib/dovecot
dovecot-2.1-pigeonhole-0.3.6# make
dovecot-2.1-pigeonhole-0.3.6# make install
# cd ..
-- Download and install duplicate extension
# wget http://hg.rename-it.nl/pigeonhole-0.3-sieve-duplicate/archive/tip.tar.gz# tar xzvf tip.tar.gz# cd pigeonhole-0-3-sieve-duplicate-6319bd61b834/pigeonhole-0-3-sieve-duplicate-6319bd61b834# ./autogen.shpigeonhole-0-3-sieve-duplicate-6319bd61b834# ./configure --with-dovecot=/usr/lib/dovecot --with-pigeonhole=/usr/include/dovecot/sievepigeonhole-0-3-sieve-duplicate-6319bd61b834# makepigeonhole-0-3-sieve-duplicate-6319bd61b834# make install
-- When finished install duplication we need to link seive to /usr/local/lib/dovecot/sieve
/usr/lib/dovecot/modules# ln -s /usr/local/lib/dovecot/sieve sieve
-- Then need to do sieve_before script to serve all custom_mailfilter for every user.
# cd /home/vmailhome/vmail# mkdir sievehome/vmail/sieve# vi duplicate-discard.sieve
--- edit file duplicate-discard.sieve like this
require "vnd.dovecot.duplicate";
if duplicate {
discard;
stop;
}
-- compile sieve script
home/vmail/sieve# sievec duplicate-discard.sieve
-- edit dovecot configuration file in plugin directive
# vi /etc/dovecot/dovecot.conf
.. edit plugin like this
plugin { quota = dict:user::file:/home/vmail/%d/%n/.quotausage sieve=/home/vmail/%d/%n/.sieve sieve_plugins = sieve_duplicate sieve_extensions = +vnd.dovecot.duplicate sieve_duplicate_period = 10m sieve_before = /home/vmail/sieve/duplicate-discard.sieve}
-- Restart dovecot
# /etc/init.d/dovecot restart
reference