Upgrading to dovecot 1.2: hello Sieve!
Par jd le jeudi, juillet 9 2009, 16:43 - Naquadah Network - Lien permanent
Last year, I told you I wanted to use Sieve to filter my mail. I did not switch, because of the lacking implementation of some Sieve features inside Dovecot, my preferred IMAP server.
After that disapointement, I kept my 8 years old mail setup, being fetchmail running on my workstation and throwing the mails in procmail, then using mutt locally to read the maildirs. But that's over.
As I told you yesterday, I got a laptop to replace my workstation. It was not possible to continue using such a mail setup, since my laptop can be offline, and so would be my mails.
So I decided to upgrade Dovecot to 1.2. I used the dovecot-1.2-work Subversion branch of our lovely Debian maintainers, and built a Debian package for Lenny. The upgrade from 1.1 was almost painless, since the configuration file did not change heavily.
Then I started to write my little Sieve script. Sieve is a very nice language. Almost user friendly. So in 20 lines I rewrote all my procmail stuff, matching things like List-Id with regex to put the mails automagically in the right folder. I reconfigured mutt to use IMAP, and it works fine. I even reimported my old Maildir via IMAP using mutt too.
I am now a happy IMAP user.
For people wondering why I wanted to switch away from procmail to Sieve: the reason is that Sieve script can be uploaded remotely via managesieve. This means you do not need FTP/SSH/whatever access to put your script. You can, for example, use connect-sieve or the Sieve plugin for Thunderbird/Icedove.
Commentaires
And don't forget
aptitude show avelsieve
which is a pretty good plugin for SquirrelMail to do the exact same thing.
Good thing the patches were updated when you pulled your snapshot from our svn tree then! It'll be uploaded to sid shortly (and backports), once I notate the differences from upgrading from 1.0 (lenny's version) in the README.Debian.
jhr: I had also been using avelsieve with sqmail and had previously looked at roundcube but found it lacking. I recently relooked at an updated version and found it much better, so much so that I have removed my sqmail instance and switched - the SVN trunk has a managesieve plugin in it that works fairly well.
Additionally, would you be willing to share your sieve rules, either in their entirety or snippets to illustrate the variable usage?
From my PoV, Sieve is cool, but has the drawback to be server-side only.
I like decentralization, so I opt for imapfilter which should please you, since its config file is a lua one
Here's a piece of it:
require [ "regex", "variables", "fileinto" ];
if header :contains "X-Spam-Flag" "YES"
{
fileinto "spam";
}
elsif header :regex "List-Id" "<debian-([^\.]+)\.lists\.debian\.org>"
{
fileinto "lists.debian.${1}";
}
elsif header :regex "List-Id" "<([^\.]+).lists.alioth.debian.org>"
{
fileinto "lists.debian.${1}";
}
elsif header :regex "List-Id" "<([^\.]+).lists.freedesktop.org>"
{
fileinto "lists.freedesktop.${1}";
}
elsif header :regex "List-Id" "<([^\.]+)"
{
fileinto "lists.${1}";
}
ook: problem is that when you just have a Web browser and a webmail, and can't run imapfilter, your mail is not filtered...
Everyone has a friend with an hosted server, and a crontab is just effective
I did not know Sieve, but I think it is a thing I missed for many years.
I you use your laptop offline and still want to be able to read your email, you can have a look at OfflineIMAP: an software that synchronizes an IMAP hierarchy with a Maildir one.