Howdy, Tom:

       Say you run a REBOL script from a .forward: 

       | /path/to/filter.r

       then executable script filter.r might look like this:

#!/path/to/rebol -qws
REBOL [
    Title: "Mail filter"
]

stdin: copy system/ports/input
message: import-email stdin

foreach [item file][
    "REBOL"  %rebol-box
    "Debian" %deb-box
    "me"     %me-box
][
    if find item message/content [
        write/append file stdin
        exit
    ]
]
write/append %default-box stdin

quit

{

    Of course you can filter on message/subject,
    message/to, message/from, etc...


    The principle is the same using pop, but you use a pop
    port to retrieve the mail and you need to export messages
    you take from pop back to mailbox format (easy).

    -jeff


> howdy guys,
> 
> I have  this crazy idea that I  can use REBOL  to filter my
> mail to different files as I receive it.  Ok, starting with
> this:
> 
> match: ["REBOL"
>          "Debian"
>      "me"
> ]
> 
> I'm gonna wing it, here:
> 
> no I'm not, either.  can someone give me a hint?
> 
> thanks, -tom

}

Reply via email to