title: Email Validation RFC 2821 using Java
body: <p>I am working on email Validation using java having RFC 2821 in mind.
  I have used following code to validate all my email address:</p>
  
  <pre><code>InternetAddress emailAddr = new InternetAddress(email);
  emailAddr.validate();
  </code></pre>
  
  <p>Java api says its RFC-822 compliant. Is there a much difference between RFC 2821 and 822?</p>
  
  <p>Also the above api is failing to validate email in below cases:</p>
  
  <ol>
  <li><code>var@yahoo</code> - validation returns true, but it is invalid email</li>
  <li><code>var(comment)@yahoo.com</code> - validation returns false, but it is valid email</li>
  </ol>
  
  <p>Can you tell me any work around for this to get it done.</p>