archive:imapfilter
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
archive:imapfilter [2024-04-12 12:58] – removed - external edit (Unknown date) 127.0.0.1 | archive:imapfilter [2024-04-12 12:58] (current) – ↷ Links adapted because of a move operation jens | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | <WRAP round alert> | ||
+ | The content of this page is no longer maintained and could be outdated soon or already is. The reasons could be various, like this information became obsolete or there is by now a better way to handle the information on this page. This page will be retained here for archiving reasons. | ||
+ | </ | ||
+ | ====== 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 [[apps: | ||
+ | |||
+ | 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 | ||
+ | </ |