Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: pop filtering

From: jeff::rebol::net at: 14-Feb-2001 14:21

Howdy, Tom:
> hey guys, > > I'd like to filter my mail, according to address, as it comes > off of the server. Jeff posted this script some time ago, but > it's for use with something like sendmail or exim, and I've > never been able to get it working. How easy would it be to > convert this thing to pop?
How about: #!/usr/local/bin/rebol -q REBOL [Title: "POP FROM FILTER"] me: "account" pass: ask/hide "Password? " server: "pop.server.dom" pop: open rejoin [pop:// me ":" pass "@" server] forall pop [ message: import-email mesg: first pop prin [index? pop message/from tab message/subject "->"] foreach [item file][ [rebol-list--rebol--com] %rebol-box [docbook--lists--oasis-open--org] %doc-box ][ if find item message/to [ write/append probe file mesg break ] ] ] close pop It will print out the from and subject of the message, and the file it ends up sticking it in. I did not test the above, but it looks correct to me. :) -jeff