Sieve support enabled!
Posted: Fri Oct 31, 2014 3:30 pm
I found a couple of queries here about sieve, but none answered. After playing around (quite) a bit with it, I think I have it resolved. This is in Ubuntu 14.04 so things may be slightly different on other OS. I'm showing just the lines that need changing in the configs.
Step 1 - install packages
I was missing the last one, which had me scratching my head for a bit.
Step 2 - initial dovecot settings
Most of the default configs (extra confs are added when installing packages) will be correct, just a couple to change:
Step 3 - sieve scripts directory
By default, dovecot stores scripts in the user's home directory. But this doesn't work on Vesta because we are using virtual mail users; one CP user account (ie system user) holds all the mail accounts for their domains. We need a different setup; change your paths as required, but I put them in my admin user home directory:
Permissions are important! Then, we configure dovecot to save all scripts in here, in domain/user structure:
Step 4 - exim
As others have discovered, this doesn't work yet, because dovecot doesn't know when mail is delivered, and therefore to sieve it. We change exim to deliver mail to dovecot.
Step 5 - restart
That should do it. You should then be able to use the sieve plugin in RC - or I've installed Horde, which also has a sieve plugin. Both seem to work as expected.
I'm no expert so feel free to take issue with any of the above! I'm particularly unsure about the exim4 config setup - is it save to change exim4.conf.template? Or does it get rebuilt with some changes of Vesta?
If anything changes I'll try to change the top post here so it serves as a guide.
Step 1 - install packages
Code: Select all
apt-get install dovecot-sieve dovecot-manageseived dovecot-lmtpd
Step 2 - initial dovecot settings
Most of the default configs (extra confs are added when installing packages) will be correct, just a couple to change:
Code: Select all
/etc/dovecot/dovecot.conf
#protocols = imap pop3
protocols = imap pop3 lmtp sieve
Code: Select all
/etc/dovecot/conf.d/20-lmtp.conf
#mail_plugins = $mail_plugins
mail_plugins = sieve
By default, dovecot stores scripts in the user's home directory. But this doesn't work on Vesta because we are using virtual mail users; one CP user account (ie system user) holds all the mail accounts for their domains. We need a different setup; change your paths as required, but I put them in my admin user home directory:
Code: Select all
mkdir /home/admin/sieve
chown admin:mail /home/admin/sieve
chmod 770 /home/admin/sieve
Code: Select all
/etc/dovecot/conf.d/90-sieve.conf
#sieve = ~/.dovecot.sieve
sieve = /home/admin/sieve/%d/%n/dovecot.sieve
#sieve_dir = ~/sieve
sieve_dir = /home/admin/sieve/%d/%n/scripts
As others have discovered, this doesn't work yet, because dovecot doesn't know when mail is delivered, and therefore to sieve it. We change exim to deliver mail to dovecot.
Code: Select all
/etc/exim4/exim4.conf.template
look for 'ROUTERS CONFIGURATION section', then 'localuser:'
#transport = local_delivery
transport = dovecot_lmtp
Code: Select all
/etc/exim4/exim4.conf.template
look for 'TRANSPORTS CONFIGURATION section', then add a new transport
dovecot_lmtp:
driver = lmtp
socket = /var/run/dovecot/lmtp
#maximum number of deliveries per batch, default 1
batch_max = 200
Code: Select all
service dovecot restart
service exim4 restart
I'm no expert so feel free to take issue with any of the above! I'm particularly unsure about the exim4 config setup - is it save to change exim4.conf.template? Or does it get rebuilt with some changes of Vesta?
If anything changes I'll try to change the top post here so it serves as a guide.