<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Java Email Address class</title>
	<atom:link href="http://leshazlewood.com/2006/11/06/emailaddress-java-class/feed/" rel="self" type="application/rss+xml" />
	<link>http://leshazlewood.com/2006/11/06/emailaddress-java-class/</link>
	<description>Where Les is More</description>
	<lastBuildDate>Wed, 14 Dec 2011 19:45:05 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: admin</title>
		<link>http://leshazlewood.com/2006/11/06/emailaddress-java-class/comment-page-1/#comment-892</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Fri, 04 Feb 2011 01:03:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.leshazlewood.com/?p=23#comment-892</guid>
		<description>Hi everyone,

I created this project to make this an Open Source effort, so everyone can participate, contribute patches, and make this even better:

http://code.google.com/p/emailaddress/

Please contribute!

Best,

Les</description>
		<content:encoded><![CDATA[<p>Hi everyone,</p>
<p>I created this project to make this an Open Source effort, so everyone can participate, contribute patches, and make this even better:</p>
<p><a href="http://code.google.com/p/emailaddress/" rel="nofollow">http://code.google.com/p/emailaddress/</a></p>
<p>Please contribute!</p>
<p>Best,</p>
<p>Les</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Casey</title>
		<link>http://leshazlewood.com/2006/11/06/emailaddress-java-class/comment-page-1/#comment-264</link>
		<dc:creator>Casey</dc:creator>
		<pubDate>Fri, 26 Mar 2010 05:05:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.leshazlewood.com/?p=23#comment-264</guid>
		<description>Hi again -

for those having issues with speed and recursion, or needing the ability to extract parts of address or headers, i rewrote a lot of the code to help with that:

http://boxbe.com/freebox.html

We have used it for several years to relatively-efficiently parse/process several billion in-the-wild addresses. There _are_ still a few lingering hangups on highly unusual addresses (i.e. spam garbage) that bring down a server from time to time (working on that, don&#039;t hold your breath), but it&#039;s otherwise pretty solid. It&#039;s about 3-4 times slower than the (much, much simpler) JavaMail parser.

I agree with Les that an open-source project is in order (don&#039;t have the time to set it up now, sorry). I was given wise-sounding advice that use of a lexer is in order for serious efficiency (perhaps JFlex? JavaCC?), since no solution based on regex is ever going to be fast and accurate both, given the formidable (some say &quot;insanely unparsable&quot;) flexibility of 2822.

Hope that helps.</description>
		<content:encoded><![CDATA[<p>Hi again -</p>
<p>for those having issues with speed and recursion, or needing the ability to extract parts of address or headers, i rewrote a lot of the code to help with that:</p>
<p><a href="http://boxbe.com/freebox.html" rel="nofollow">http://boxbe.com/freebox.html</a></p>
<p>We have used it for several years to relatively-efficiently parse/process several billion in-the-wild addresses. There _are_ still a few lingering hangups on highly unusual addresses (i.e. spam garbage) that bring down a server from time to time (working on that, don&#8217;t hold your breath), but it&#8217;s otherwise pretty solid. It&#8217;s about 3-4 times slower than the (much, much simpler) JavaMail parser.</p>
<p>I agree with Les that an open-source project is in order (don&#8217;t have the time to set it up now, sorry). I was given wise-sounding advice that use of a lexer is in order for serious efficiency (perhaps JFlex? JavaCC?), since no solution based on regex is ever going to be fast and accurate both, given the formidable (some say &#8220;insanely unparsable&#8221;) flexibility of 2822.</p>
<p>Hope that helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Les</title>
		<link>http://leshazlewood.com/2006/11/06/emailaddress-java-class/comment-page-1/#comment-263</link>
		<dc:creator>Les</dc:creator>
		<pubDate>Fri, 26 Feb 2010 15:49:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.leshazlewood.com/?p=23#comment-263</guid>
		<description>@Oliver

That may be the case due to the Java regex parser implementation.

I think it&#039;s about time to create an open source project for this and focus on speed.  We&#039;ll probably need to turn it in to a combo of scanning + regex, but the community can definitely benefit from this.

Regards,

Les</description>
		<content:encoded><![CDATA[<p>@Oliver</p>
<p>That may be the case due to the Java regex parser implementation.</p>
<p>I think it&#8217;s about time to create an open source project for this and focus on speed.  We&#8217;ll probably need to turn it in to a combo of scanning + regex, but the community can definitely benefit from this.</p>
<p>Regards,</p>
<p>Les</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oliver</title>
		<link>http://leshazlewood.com/2006/11/06/emailaddress-java-class/comment-page-1/#comment-262</link>
		<dc:creator>Oliver</dc:creator>
		<pubDate>Fri, 26 Feb 2010 13:03:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.leshazlewood.com/?p=23#comment-262</guid>
		<description>Unfortunately the running time for long email addresses prohibits the use of your surely great code in most projects...</description>
		<content:encoded><![CDATA[<p>Unfortunately the running time for long email addresses prohibits the use of your surely great code in most projects&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: johnstok</title>
		<link>http://leshazlewood.com/2006/11/06/emailaddress-java-class/comment-page-1/#comment-261</link>
		<dc:creator>johnstok</dc:creator>
		<pubDate>Thu, 25 Feb 2010 16:18:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.leshazlewood.com/?p=23#comment-261</guid>
		<description>Les,

Calling isValidText() for the following email address seems to cause an infinite loop:

ea8322fd-eac3-4f24-a0f1-bd05e10fda53@abc.def

Otherwise very useful :-)</description>
		<content:encoded><![CDATA[<p>Les,</p>
<p>Calling isValidText() for the following email address seems to cause an infinite loop:</p>
<p><a href="mailto:ea8322fd-eac3-4f24-a0f1-bd05e10fda53@abc.def">ea8322fd-eac3-4f24-a0f1-bd05e10fda53@abc.def</a></p>
<p>Otherwise very useful <img src='http://leshazlewood.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Beppe Sabatini</title>
		<link>http://leshazlewood.com/2006/11/06/emailaddress-java-class/comment-page-1/#comment-260</link>
		<dc:creator>Beppe Sabatini</dc:creator>
		<pubDate>Sun, 21 Feb 2010 01:31:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.leshazlewood.com/?p=23#comment-260</guid>
		<description>Many thanks! Here&#039;s a paragraph I added to my copy:
&lt;code&gt;
	// Legal top-level domains:
	// http://data.iana.org/TLD/tlds-alpha-by-domain.txt

	private Set&lt;String&gt; TLDs;

	public EmailValidator() {
		this.TLDs = new HashSet&lt;String&gt;();

		try {
			InputStream tldIs = Resources.getResourceAsStream(&quot;properties/tlds-alpha-by-domain.txt&quot;);
			DataInputStream tldDis = new DataInputStream(tldIs);
			BufferedReader tldBr = new BufferedReader(new InputStreamReader(tldDis));
			String strLine;
			// Read file line by line
			while ((strLine = tldBr.readLine()) != null) {
				if(StringUtils.isBlank(strLine)){
					continue;
				}
				if(&quot;#&quot;.equals(strLine.substring(0,1))){
					continue;
				}
				TLDs.add(strLine);
			}
			// Close the input stream
			tldDis.close();
		} catch (Exception e) {// Catch exception if any
			System.err.println(&quot;Error: &quot; + e.getMessage());
		}
	}

	public boolean isValidTopLevelDomain(String email){
		if(StringUtils.isBlank(email)){
			return(false);
		}
		String[] domains = email.split(&quot;\\.&quot;);
		if(domains.length &lt; 2){
			return(false);
		}
		String topLevelDomain = domains[domains.length - 1].toUpperCase();
		if(TLDs.contains(topLevelDomain)){
			return(true);
		}
		return(false);
	}

&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Many thanks! Here&#8217;s a paragraph I added to my copy:<br />
<code><br />
	// Legal top-level domains:<br />
	// <a href="http://data.iana.org/TLD/tlds-alpha-by-domain.txt" rel="nofollow">http://data.iana.org/TLD/tlds-alpha-by-domain.txt</a></p>
<p>	private Set<string> TLDs;</p>
<p>	public EmailValidator() {<br />
		this.TLDs = new HashSet</string><string>();</p>
<p>		try {<br />
			InputStream tldIs = Resources.getResourceAsStream("properties/tlds-alpha-by-domain.txt");<br />
			DataInputStream tldDis = new DataInputStream(tldIs);<br />
			BufferedReader tldBr = new BufferedReader(new InputStreamReader(tldDis));<br />
			String strLine;<br />
			// Read file line by line<br />
			while ((strLine = tldBr.readLine()) != null) {<br />
				if(StringUtils.isBlank(strLine)){<br />
					continue;<br />
				}<br />
				if("#".equals(strLine.substring(0,1))){<br />
					continue;<br />
				}<br />
				TLDs.add(strLine);<br />
			}<br />
			// Close the input stream<br />
			tldDis.close();<br />
		} catch (Exception e) {// Catch exception if any<br />
			System.err.println("Error: " + e.getMessage());<br />
		}<br />
	}</p>
<p>	public boolean isValidTopLevelDomain(String email){<br />
		if(StringUtils.isBlank(email)){<br />
			return(false);<br />
		}<br />
		String[] domains = email.split("\\.");<br />
		if(domains.length < 2){<br />
			return(false);<br />
		}<br />
		String topLevelDomain = domains[domains.length - 1].toUpperCase();<br />
		if(TLDs.contains(topLevelDomain)){<br />
			return(true);<br />
		}<br />
		return(false);<br />
	}</p>
<p></code></string></code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: amine</title>
		<link>http://leshazlewood.com/2006/11/06/emailaddress-java-class/comment-page-1/#comment-259</link>
		<dc:creator>amine</dc:creator>
		<pubDate>Thu, 12 Nov 2009 22:16:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.leshazlewood.com/?p=23#comment-259</guid>
		<description>salut t l mond</description>
		<content:encoded><![CDATA[<p>salut t l mond</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael</title>
		<link>http://leshazlewood.com/2006/11/06/emailaddress-java-class/comment-page-1/#comment-258</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Tue, 10 Nov 2009 10:15:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.leshazlewood.com/?p=23#comment-258</guid>
		<description>OK, as I suspected the characters I wanted to appear in my previous post didn&#039;t appear! What I meant to say was that all occurences of &gt;</description>
		<content:encoded><![CDATA[<p>OK, as I suspected the characters I wanted to appear in my previous post didn&#8217;t appear! What I meant to say was that all occurences of &gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael</title>
		<link>http://leshazlewood.com/2006/11/06/emailaddress-java-class/comment-page-1/#comment-257</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Tue, 10 Nov 2009 10:12:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.leshazlewood.com/?p=23#comment-257</guid>
		<description>@Hugh #89438 (and Les):

I had the same problem as you did copying the code from the web page, it&#039;s all run together into a single line with no line breaks! The way I got around this was to view the source of the page (Ctrl-U in Firefox) and copy the code from the source window, which preserved the line breaks correctly. However, it was then necessary to replace all occurrences of &gt; &lt; and &amp; with &gt;</description>
		<content:encoded><![CDATA[<p>@Hugh #89438 (and Les):</p>
<p>I had the same problem as you did copying the code from the web page, it&#8217;s all run together into a single line with no line breaks! The way I got around this was to view the source of the page (Ctrl-U in Firefox) and copy the code from the source window, which preserved the line breaks correctly. However, it was then necessary to replace all occurrences of &gt; &lt; and &amp; with &gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ken T</title>
		<link>http://leshazlewood.com/2006/11/06/emailaddress-java-class/comment-page-1/#comment-256</link>
		<dc:creator>Ken T</dc:creator>
		<pubDate>Sun, 04 Oct 2009 06:15:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.leshazlewood.com/?p=23#comment-256</guid>
		<description>The class is great.  I used a previous version some time ago.  Thanks for the work!

This comment isn&#039;t really about the code though.  You can delete the comment if you want.  I just thought I should tell you that whoever is delivering your ads is really picking awful ads to put on your site..

Find anyone&#039;s email
The JCrew home page.

If you are using ad revenue to pay for hosting, you might want to find a way to convince the supplier to pick more pertinent ads.

Good luck.  BTW, I did my part.  :-)</description>
		<content:encoded><![CDATA[<p>The class is great.  I used a previous version some time ago.  Thanks for the work!</p>
<p>This comment isn&#8217;t really about the code though.  You can delete the comment if you want.  I just thought I should tell you that whoever is delivering your ads is really picking awful ads to put on your site..</p>
<p>Find anyone&#8217;s email<br />
The JCrew home page.</p>
<p>If you are using ad revenue to pay for hosting, you might want to find a way to convince the supplier to pick more pertinent ads.</p>
<p>Good luck.  BTW, I did my part.  <img src='http://leshazlewood.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

