On Fri, Jan 25, 2013 at 04:08:37AM CET, Lázaro <netad...@lex-sa.cu> said:
> Thread name: "Re: Client "daemon" for sorting e-mail via IMAP" 
> Mail number: 8 
> Date: Wed, Jan 23, 2013 
> In reply to: Robert Brockway 
> >
> > On Tue, 22 Jan 2013, Erwan David wrote:
> > 
> > >I personnaly use imapfilter for such tasks. But it requires some lua
> > >scripting, as it is rather a lua library for accessing and searching imap
> > >accounts than a program.
> > 
> > I've been using imapfilter for about a year after 15+ years of using
> > fetchmail/procmail to deliver & sort mail.  Before that my mail was always
> > delivered locally on a Unix box and I didn't have enough of it to warrant
> > filtering :)
> > 
> > Imapfilter is itself great but LUA is quite different to other programming
> > languages I've used in the past.  I've done a bit of work in LUA but have
> > ended up with a (perhaps hacky) solution of having a shell script construct
> > my .imapfilter/config.
> > 
> > I considered 'fetchmail -m procmail' as a solution but didn't select it at
> > the time.  I think I'm going to take another look at it though, now that
> > I've had more of a chance to play with the alternatives.
> > 
> > Cheers,
> > 
> > Rob
> 
> 
> aptitude search sieve|grep mailutils
> 
> lazaro@utopian:~$ cat script.sc
> 
> require ["fileinto", "redirect" , "reject"];
> 
> # remove from the dir, mail more than 3M
> # without download it
> if size :over 3000K {discard; stop;}
> 
> # if the From: contain 'Fulano' put it in "fulanito" named dir
> if header :contains ["From"] "Fulano" { fileinto "fulanito"; stop; }
> 
> # if the mail is for me put in /var/mail/lazaro
> if header :contains ["To","Cc"] "netadmin" {fileinto "/var/mail/lazaro"; 
> stop; }
> 
> # two times if, more than on line
> if attachment :contains ".zip" {
> if size :over 10000K { discard; stop; } 
> } 
> 
> # if the subjest is "something" send it to somebody
> if header :contains ["Subject"]  "something" { 
> redirect "someb...@somedomain.cu"
> stop 
> }
> 
> # EOF
> 
> lazaro@utopian:~$ sieve -f imap://user:pass@localhost/ script.sc

Humm interesting. I use sieve at delivery time (through the dovecot
plugin). But I do not think sieve allows to test on mail age (time
since reception), which is my main test in , since I use it for
archiving.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20130128065543.ge11...@rail.eu.org

Reply via email to