Per filtrare le mail su di un server IMAP, esiste un piccolo programma semplice da configurare:

imapfilter

francesco@ubuntu:~$ ll
total 104
drwxr-xr-x 13 francesco francesco  4096 mars   2 00:09 ./
drwxr-xr-x  3 root      root       4096 déc.  15 12:24 ../
-rw-------  1 francesco francesco 14354 mars   3 11:25 .bash_history
-rw-r--r--  1 francesco francesco   220 déc.  15 12:24 .bash_logout
-rw-r--r--  1 francesco francesco  3486 déc.  15 12:24 .bashrc
drwx------  2 francesco francesco  4096 déc.  15 12:25 .cache/
drwx------  3 francesco francesco  4096 déc.  15 12:37 .config/
drwxrwxr-x  3 francesco francesco  4096 févr. 28 00:15 .getmail/
drwx------  2 francesco francesco  4096 févr. 27 22:30 .gnupg/
drwx------  2 francesco francesco  4096 mars   2 21:06 .imapfilter/
drwx------ 23 francesco francesco  4096 mars   2 12:51 Mail/
drwxrwxr-x  3 francesco francesco  4096 mars   2 00:07 .mutt/
-rw-------  1 francesco francesco   997 févr. 24 17:06 .mutt_certificates
drwx------  5 francesco francesco  4096 févr. 25 14:55 .offlineimap/
-rwx------  1 francesco francesco   683 févr. 23 16:37 .offlineimaprc*
-rwx------  1 francesco francesco   688 févr. 23 16:09 .offrc*
-rw-r--r--  1 francesco francesco   675 déc.  15 12:24 .profile
-rw-rw-r--  1 francesco francesco    66 janv. 23 00:13 .selected_editor
drwx------  2 francesco francesco  4096 janv. 18 20:37 .ssh/
drwxr-xr-x  2 francesco francesco  4096 févr. 25 14:56 .vim/
-rw-------  1 root      root       6114 mars   2 00:09 .viminfo
drwx------  2 francesco francesco  4096 janv. 27 00:07 .w3m/

All'interno della directory, troviamo il file di configurazione e i logs di debug:

francesco@ubuntu:~/.imapfilter$ ll
total 52
drwx------  2 francesco francesco 4096 mars   3 11:31 ./
drwxr-xr-x 13 francesco francesco 4096 mars   2 00:09 ../
-rw-------  1 francesco francesco 1566 mars   1 19:23 certificates
-rwx------  1 francesco francesco 2202 mars   2 21:06 config.lua*
-rw-------  1 francesco francesco 1682 mars   1 19:26 debug.5bPfwi
-rw-------  1 francesco francesco 1682 mars   1 19:33 debug.7VtlNA
-rw-------  1 francesco francesco 1768 mars   1 19:43 debug.82HG1L
-rw-------  1 francesco francesco 1789 mars   1 19:39 debug.9YhvpW
-rw-------  1 francesco francesco 1761 mars   1 19:38 debug.cCvGhI
-rw-------  1 francesco francesco    0 mars   1 19:15 debug.kBer8N
-rw-------  1 francesco francesco 5393 mars   1 23:34 debug.lDYA9T
-rw-------  1 francesco francesco 1682 mars   1 19:23 debug.mYYcuA
-rw-------  1 francesco francesco 1682 mars   1 19:37 debug.UQsQZu
-rw-------  1 francesco francesco    0 mars   1 19:37 debug.xGlHD2

E questo è il contenuto del file di config:

francesco@ubuntu:~/.imapfilter$ cat config.lua 
---------------
-- Options --
---------------

options.timeout = 120
options.subscribe = true


account1 = IMAP {
    server = 'mail.unixmail.fr',
    username = '******@unixmail.fr',
    password = '******',
    ssl = 'ssl3',
}

msgs = account1.INBOX:contain_from('AIB-CUR@LIST.CINECA.IT') +
       account1.INBOX:contain_to('AIB-CUR@LIST.CINECA.IT')
account1.INBOX:move_messages(account1['AIB-CUR'], msgs)

msgs = account1.INBOX:contain_to('debian-changes@lists.debian.org')
account1.INBOX:move_messages(account1['debian-changes'], msgs)

msgs = account1.INBOX:contain_to('debian-security-announce@lists.debian.org') +
       account1.INBOX:contain_to('debian-security@lists.debian.org') +
       account1.INBOX:contain_cc('debian-security@lists.debian.org')
account1.INBOX:move_messages(account1['debian-security'], msgs)

msgs = account1.INBOX:contain_to('debian-user@lists.debian.org') +
       account1.INBOX:contain_cc('debian-user@lists.debian.org')
account1.INBOX:move_messages(account1['debian-user'], msgs)

msgs = account1.INBOX:contain_to('debian-user-french@lists.debian.org') +
       account1.INBOX:contain_cc('debian-user-french@lists.debian.org')
account1.INBOX:move_messages(account1['debian-french'], msgs)

msgs = account1.INBOX:contain_to('debian-italian@lists.debian.org') +
       account1.INBOX:contain_cc('debian-italian@lists.debian.org')
account1.INBOX:move_messages(account1['debian-italian'], msgs)

msgs = account1.INBOX:contain_to('debian-l10n-italian@lists.debian.org') +
       account1.INBOX:contain_cc('debian-l10n-italian@lists.debian.org')
account1.INBOX:move_messages(account1['debian-l10n-it'], msgs)

msgs = account1.INBOX:contain_to('debian-user-portuguese@lists.debian.org') +
       account1.INBOX:contain_cc('debian-user-portuguese@lists.debian.org')
account1.INBOX:move_messages(account1['debian-portuguese'], msgs)

msgs = account1.INBOX:contain_to('debian-user-spanish@lists.debian.org') +
       account1.INBOX:contain_cc('debian-user-spanish@lists.debian.org')
account1.INBOX:move_messages(account1['debian-spanish'], msgs)

msgs = account1.INBOX:contain_to('freebsd-questions@freebsd.org') +
       account1.INBOX:contain_cc('freebsd-questions@freebsd.org') +
       account1.INBOX:contain_to('questions@freebsd.org') +
       account1.INBOX:contain_cc('questions@freebsd.org')
account1.INBOX:move_messages(account1['FreeBSD-questions'], msgs)

msgs = account1.INBOX:contain_to('freebsd-security@freebsd.org') +
       account1.INBOX:contain_cc('freebsd-security@freebsd.org') +
       account1.INBOX:contain_to('security-advisories@freebsd.org')
account1.INBOX:move_messages(account1['FreeBSD-security'], msgs)

msgs = account1.INBOX:contain_to('freebsd-stable@freebsd.org') +
       account1.INBOX:contain_cc('freebsd-stable@freebsd.org')
account1.INBOX:move_messages(account1['FreeBSD-stable'], msgs)

msgs = account1.INBOX:contain_from('tinderbox@freebsd.org')
account1.INBOX:move_messages(account1['FreeBSD-tinderbox'], msgs)

msgs = account1.INBOX:contain_to('koha@lists.katipo.co.nz') +
       account1.INBOX:contain_cc('koha@lists.katipo.co.nz')
account1.INBOX:move_messages(account1['koha'], msgs)

msgs = account1.INBOX:contain_to('mutt-users@mutt.org') +
       account1.INBOX:contain_cc('mutt-users@mutt.org')
account1.INBOX:move_messages(account1['mutt'], msgs)

msgs = account1.INBOX:contain_to('misc@openbsd.org') +
       account1.INBOX:contain_cc('misc@openbsd.org')
account1.INBOX:move_messages(account1['OpenBSD'], msgs)

msgs = account1.INBOX:contain_from('webmaster@cyberciti.biz')
account1.INBOX:move_messages(account1['nixcraft'], msgs)