Board index » cppbuilder » Email Scanner

Email Scanner


2003-09-11 05:47:14 AM
cppbuilder65
Does anyone know of program that will scan a text document and extract all
valid email addresses from the text document. The text document would have
garbage in it and occasionaly would have a XXXX@XXXXX.COM . I
could probably write something in a few hours but am feeling extremly lazy
today :)
Thanks
 
 

Re:Email Scanner

Quote
What do you need it for?
A friend and I have been making a game called Kingdoms of War you can check
it out at www.AbandonedCastle.com if you are interested. At any rate
we have a mailing list that we send out to everyone when a "new age" starts
(The game starts over about every 3 months). I get a lot of returned emails
for email accounts that don't exist or the email account is full, etc.
I have written a program that loops through my emails in outlook and am able
to get the body of the message that an email server sent me. below is an
example
****************************************
Hi. This is the qmail-send program at greenback.hotkey.net.au.
I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.
< XXXX@XXXXX.COM >:
Sorry, no mailbox here by that name. (#5.1.1)
****************************************
The problem is that different email servers use different formats just
looking through the messages I have seen at least 15 different formats from
different email servers...thus I need a function or a program that can
extract all valid emails from a text document :) Did you really want that
long of story?
Quote
Is it for "Junk Mail"? (Maybe you adjust your
settings if your name is not "Junk Mail")
I use the name Junk Mail and junk email address in all news forums because
this is one place where spammers can get your email. I try to avoid having
tons of spam so I have a junk mail address that does nothing but delete the
messages from the email server.
 

Re:Email Scanner

Hi!
Junk Mail schrieb:
Quote
A friend and I have been making a game called Kingdoms of War you can check
it out at www.AbandonedCastle.com if you are interested.
Looks very good! How long did it take you?
Quote
****************************************
Hi. This is the qmail-send program at greenback.hotkey.net.au.
I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.

< XXXX@XXXXX.COM >:
Sorry, no mailbox here by that name. (#5.1.1)
****************************************
Use boost::spirit:
void found_address(char const *begin, char const *end)
{
string sAddress(begin,end);
//...
}
rule<>rEmail = +(alnum_p | '.')>>'@'>>+alnum_p>>+('.'>>
+alnum_p);
rule<>rFullText = *( *(anychar_p-rEmail)>>!rEmail[&found_address] );
parse(text.begin(), rFullText);
//or:
parse(text.begin(), text.end(), rFullText);
(untested, maybe you need to add some parenthese)
Quote
I use the name Junk Mail and junk email address in all news forums because
this is one place where spammers can get your email. I try to avoid having
tons of spam so I have a junk mail address that does nothing but delete the
messages from the email server.
Many people have their correct(!) name combined with an "incorrect"
email address (incorrect, because they use "SPAMBLOCKER" or "REMOVETHIS"
or something). But if you want/need to you can still email them.
Frank
 

{smallsort}

Re:Email Scanner

"Frank Birbacher" < XXXX@XXXXX.COM >wrote in message
Quote
Hi!

Junk Mail schrieb:
>A friend and I have been making a game called Kingdoms of War you can
check
>it out at www.AbandonedCastle.com if you are interested.

Looks very good! How long did it take you?
Been working on it for at least 3 years maybe a little longer...my how time
flies. When I was in school I worked on it with my friend in my spare time
about 20 hours per week. I'm done with school now...well not really...I
have all my classes done but have been putting off my research paper for the
last 9 months :) Been working on the game too much to find time or the
desire to do it. Most of the game is actually written in java. My choice
would have been c++ builder but my friend had other intentions :) The
server is written entirely in c++ Builder though. Biggest issue with
getting the client and server to communicate was that java uses a different
encoding for there ints than c++ does. I forget which one but it uses
either big indian or little indian and we had to convert those to pass ints
back and forth. Now I'm just rambling :)
What is boost::spirit ? Also some of your code uses <>which isn't valid
c++ syntax. Is boost::spirit some type of preparser or something?
Quote
Use boost::spirit:

void found_address(char const *begin, char const *end)
{
string sAddress(begin,end);
//...
}

rule<>rEmail = +(alnum_p | '.')>>'@'>>+alnum_p>>+('.'>>
+alnum_p);
rule<>rFullText = *( *(anychar_p-rEmail)>>!rEmail[&found_address] );

parse(text.begin(), rFullText);
//or:
parse(text.begin(), text.end(), rFullText);

(untested, maybe you need to add some parenthese)