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






-- 
-------- Warning! ------------
100'000 pelos de escoba fueron
introducidos satisfactoriamente
en su puerto USB.






-- 
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/20130125030837.GB18865@utopian

Reply via email to