We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
Sieve support enabled!
Sieve support enabled!
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.
Re: Sieve support enabled!
This is excellent and I followed this guide to successfully implement sieve support. However..
I noticed some errors in the logs like this;
dovecot_lmtp defer (-46): LMTP error after end of data
And I also noticed that there may be an issue with localdomain emails not getting through (try sending from one domain to another on the same box, and reply + reply) - the 2nd reply back doesn't make it home. Could be just me, but would be good for others to try this out as my mail config is pretty much on par with stock standard vestacp.
Regards Steven
I noticed some errors in the logs like this;
dovecot_lmtp defer (-46): LMTP error after end of data
And I also noticed that there may be an issue with localdomain emails not getting through (try sending from one domain to another on the same box, and reply + reply) - the 2nd reply back doesn't make it home. Could be just me, but would be good for others to try this out as my mail config is pretty much on par with stock standard vestacp.
Regards Steven
Re: Sieve support enabled!
Glad this was helpful!
Hmm - I'm not seeing this in either my /var/log/mail.log or /var/log/exim4 - where did you see it? Is it actually causing any problems?Steven wrote:dovecot_lmtp defer (-46): LMTP error after end of data
You may be having the same issue I did, whereby exim4 requires auth to relay mail between local domains. See viewtopic.php?f=12&t=6183 - does that apply?Steven wrote:And I also noticed that there may be an issue with localdomain emails not getting through (try sending from one domain to another on the same box, and reply + reply) - the 2nd reply back doesn't make it home.
Re: Sieve support enabled!
This was excellent work. If I may make one suggestion, you can make this work for more than just the admin user by changing the settings in 90-sieve.conf to this:
That way it picks the home directory of the user running the dovecot process, which is the unix user that owns the domain authenticated on.
Code: Select all
sieve = ~/sieve/%d/%n/dovecot.sieve
sieve_dir = ~/sieve/%d/%n/scripts
Re: Sieve support enabled!
Works perfectly on debian 9!
I followed the tip of @mxroute, but all worked ok on the main example!
Thanks!
I followed the tip of @mxroute, but all worked ok on the main example!
Thanks!