apps:imapfilter
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
Previous revision | |||
— | apps:imapfilter [2016-02-16 14:32] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Imapfilter ====== | ||
+ | One of the greatest benefits of IMAP is the fact that all mails, folders etc. are residing on the server. So it doesn' | ||
+ | |||
+ | As soon as your mail setup and volume grows you might want to use filters for e.g. sorting your mail into different folders. And here it becomes obvious what the problem might be: you define Message Filters in [[Thunderbird]] and those work really fine. But on the other systems you must either also define the same rules or keep on sorting manually. The more systems you use the less doable this becomes. But it can already be a big hassle when only using two systems. | ||
+ | |||
+ | If you don't have access to a mailserver using [[http:// | ||
+ | |||
+ | The real deal however would be to use Sieve. imapfilter sorts mail after it has arrived in your inbox, Sieve will directly deliver the mail into the correct folder (mailbox). | ||
+ | |||
+ | ===== The configuration file ===== | ||
+ | Understanding and writing the configuration file is actually most work. It is quite easy to understand though, check my example below and '' | ||
+ | |||
+ | More complex setups are easily possible, this is about sorting mails into folders only. Of course you must fill in your account settings accordingly! | ||
+ | |||
+ | <file lua imapfilter_config.lua> | ||
+ | --------------------- | ||
+ | -- General Options -- | ||
+ | --------------------- | ||
+ | |||
+ | -- Otherwise the timeout is infinite | ||
+ | options.timeout = 120 | ||
+ | |||
+ | -- Newly created mailboxes are automatically subscribed | ||
+ | options.subscribe = true | ||
+ | |||
+ | |||
+ | ---------------------- | ||
+ | -- Account Settings -- | ||
+ | ---------------------- | ||
+ | |||
+ | myaccount = IMAP { | ||
+ | server = ' | ||
+ | username = ' | ||
+ | password = ' | ||
+ | ssl = ' | ||
+ | } | ||
+ | |||
+ | |||
+ | ----------- | ||
+ | -- Rules -- | ||
+ | ----------- | ||
+ | |||
+ | function SortMail() | ||
+ | |||
+ | -- Forum | ||
+ | -- Move messages from " | ||
+ | -- folder " | ||
+ | messages = myaccount.INBOX: | ||
+ | myaccount.INBOX: | ||
+ | |||
+ | -- Mailings | ||
+ | -- Move messages that contain " | ||
+ | -- " | ||
+ | -- " | ||
+ | messages = myaccount.INBOX: | ||
+ | myaccount.INBOX: | ||
+ | myaccount.INBOX: | ||
+ | |||
+ | -- Administration | ||
+ | -- Move messages that contain " | ||
+ | -- sender to the maildir subfolder " | ||
+ | -- " | ||
+ | messages = myaccount.INBOX: | ||
+ | myaccount.INBOX: | ||
+ | myaccount.INBOX: | ||
+ | |||
+ | end | ||
+ | |||
+ | -- Daemonize imapfilter and run the rules in function " | ||
+ | -- 60 seconds. | ||
+ | become_daemon(60, | ||
+ | </ | ||
+ | |||
+ | ===== Cron ===== | ||
+ | It is nice that imapfilter will run daemonized, but if the host reboots imapfilter won't start automatically. | ||
+ | So just put this into your crontab, it will check every minute if imapfilter is running and start it if necessary. | ||
+ | |||
+ | <code bash> | ||
+ | * * * * * [ `pidof imapfilter` ] || imapfilter | ||
+ | </ |
apps/imapfilter.txt · Last modified: 2016-02-16 14:32 by 127.0.0.1