Extracting Info from Emails
[1/10] from: michael:mccannworld at: 15-Jun-2005 1:30
Hello Everyone,
I am new to Rebol and would like to extact certain bits of information from
consistently formatted emails as they arrive in my Outlook inbox. Is this
possible, and how might I go about doing this?
Thanks very much,
Michael McCann
-- Binary/unsupported file stripped by Ecartis --
-- Type: application/ms-tnef
-- File: winmail.dat
[2/10] from: SunandaDH::aol::com at: 15-Jun-2005 4:46
Michael:
> Is this possible, and how might I go about doing this?
Welcome to REBOlist!
It's built in, almost.
Use the 'import-email to turn an email into a REBOL object.
Sunanda.
[3/10] from: hallvard::ystad::oops-as::no at: 15-Jun-2005 11:12
Dixit [SunandaDH--aol--com] (Wed, 15 Jun 2005 04:46:02 EDT):
>Michael:
>>> Is this possible, and how might I go about doing this?
>It's built in, almost.
>Use the 'import-email to turn an email into a REBOL
>object.
It's built-in and more than so, almost. When importing an
email containing fewer headers than defined in the
protocol, those empty headers are added with a 'none
value. And then there is the X-REBOL: header, which is
also added..... :)
HY
[4/10] from: lookoutzero:gm:ail at: 15-Jun-2005 5:54
I think ideally Rebol would be used to access the email while it is still on
the pop server. I don't think Rebol knows how to read an Outlook PST file
store. You could export the emails as csv and then parse the emails. There
are some useful scripts here:
http://www.codeconscious.com/rebol/library-cat.html
But I resort to Unicon or Perl for the use of regular expressions at this
point, as I'm a Rebol newby and find parsing in Rebol beyond my skills at
this point.
On 6/15/05, Michael C. McCann <[michael--mccannworld--com]> wrote:
> Hello Everyone,
> I am new to Rebol and would like to extact certain bits of information
<<quoted lines omitted: 9>>
> To unsubscribe from the list, just send an email to
> lists at rebol.com <http://rebol.com> with unsubscribe as the subject.
--
Michael Appelmans
[mla--itinko--com]
www.itinko.com <http://www.itinko.com>
[5/10] from: gchiu:compkarori at: 15-Jun-2005 22:38
Michael C. McCann wrote.. apparently on 15-Jun-2005/1:30:15-7:00
>Hello Everyone,
>
>I am new to Rebol and would like to extact certain bits of information from
>consistently formatted emails as they arrive in my Outlook inbox. Is this
>possible, and how might I go about doing this?
>
Maybe you can create a custom action ( VB macro ) to be used in an email rule to export
the email as they come in as a text file, and then run Rebol scripts on the exported
email?
Alternatively, use a rule to forward them to another pop mail box that you have, and
let Rebol pick them from there.
--
Graham Chiu
http://www.compkarori.com/cerebrus
http://www.compkarori.com/rebolml
[6/10] from: premshree:pillai:gm:ail at: 15-Jun-2005 16:16
On 6/15/05, Graham Chiu <[gchiu--compkarori--co--nz]> wrote:
> Alternatively, use a rule to forward them to another pop mail box that you have, and
let Rebol pick them from there.
If you have a dedicated pop mail box for this purpose alone, this'd be
great. You could run a REBOL script as a daemon that keeps polling
your mailbox.
Also, prolly of some help: http://www.livejournal.com/users/premshree/34430..html
--
Premshree Pillai
http://www.livejournal.com/users/premshree/
[7/10] from: pwawood:mango:my at: 15-Jun-2005 22:35
Michael
Welcome to the Rebolist. It's definitely possible and for me extracting data
is one of Rebol's many strengths. As Sunanda said Rebol makes it very easy
to get at the standard email info eg sender, subject.
If the information you want to extract within the body of the text, Rebol
also makes it easy. Perhaps you could provide an example of the information
you're trying to extract.
In my experience it is usually easier to process your emails directly from
the server rather than once you've downloaded them to Outlook. This is
because of the way Outlook stores email.
Regards
Peter
[8/10] from: hallvard:ystad:oops-as:no at: 15-Jun-2005 18:16
Hi again
I suddenly realized that noone has given an example.
Here's one (Warning! This is long!). I copied it from the
rebol console, so that's where the extra "{" on each line
is from. Here goes (it's your original email):
>> probe a: import-email {Received: by 10.38.24.21 with SMTP id 21mr1926733rnx;
{ Wed, 15 Jun 2005 01:30:48 -0700 (PDT)
{ Received: with ECARTIS (v1.0.0; list rebol); Wed, 15
Jun 2005 04:30:30 -0400 (EDT)
{ From: "Michael C. McCann" <[removed--mccannworld--com]>
{ To: <[removed--rebol--com]>
{ Subject: [REBOL] Extracting Info from Emails
{ Date: Wed, 15 Jun 2005 01:30:15 -0700
{ MIME-Version: 1.0
{ Content-type: text/plain
{ Sender: [removed--rebol--com]
{ Errors-To: [removed--rebol--com]
{ Precedence: bulk
{ Reply-To: [removed--rebol--com]
{ X-list: rebol
{
{ Hello Everyone,
{
{ I am new to Rebol and would like to extact certain
bits of information from
{ consistently formatted emails as they arrive in my
Outlook inbox. Is this
{ possible, and how might I go about doing this?
{
{ Thanks very much,
{ Michael McCann
{
{ }
make object! [
To: [[removed--rebol--com]]
CC: none
BCC: none
From: [[removed--mccannworld--com]]
Reply-To: [[removed--rebol--com]]
Date: 15-Jun-2005/1:30:15-7:00
Subject: "[REBOL] Extracting Info from Emails"
Return-Path: none
Organization: none
Message-Id: none
Comment: none
X-REBOL: "Core 2.5.6.3.1 http://WWW.REBOL.COM"
MIME-Version: "1.0"
Content-Type: "text/plain"
Content: {Hello Everyone,
I am new to Rebol and would like to extact certain bits
of information from
consistently formatted emails as they arrive in my Outlook
inbox. Is this
possible, and how might I go about doing this?
Thanks very much,
Michael McCann
}
Received: {with ECARTIS (v1.0.0; list rebol); Wed, 15
Jun 2005 04:30:30 -0400 (EDT)}
Sender: "[removed--rebol--com]"
Errors-To: "[removed--rebol--com]"
Precedence: "bulk"
X-list: "rebol"
]
>>
You now can access any field in the email like this:
>> a/Date
== 15-Jun-2005/1:30:15-7:00
>> a/X-list
== "rebol"
etc.
HY
Dixit "Michael C. McCann" <[michael--mccannworld--com]> (Wed,
15 Jun 2005 01:30:15 -0700):
[9/10] from: michael::mccannworld::com at: 15-Jun-2005 9:46
Thanks, all, for the help & suggestions. I will try
them and let you know how it goes.
Michael
[10/10] from: carlos::lorenz::gmail::com at: 15-Jun-2005 14:14
Hi all
In my experience it is usually easier to process your emails directly from
> the server rather than once you've downloaded them to Outlook. This is
> because of the way Outlook stores email.
I have just finished a CGI script that performs a filter action at server
before the download of messages to email client and I may say REBOL makes
these tasks easy to accomplish
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted