GithubHelp home page GithubHelp logo

isemail's Introduction

Each language version of is_email() now has its own trunk.

Look in /svn/PHP/trunk for the PHP version, for example.

If you plan to make changes, use this command to check out the code as yourself using HTTPS:

# Project members authenticate over HTTPS to allow committing changes.
svn checkout https://isemail.googlecode.com/svn/PHP/trunk/ isemail --username your.username

When prompted, enter your generated googlecode.com password.
Use this command to anonymously check out the latest project source code:

# Non-members may check out a read-only working copy anonymously over HTTP.
svn checkout http://isemail.googlecode.com/svn/PHP/trunk/ isemail-read-only

isemail's People

isemail's Issues

Use chr() instead of Unicode inside PHP script

As little correction I would not include any Unicode characters into a PHP 
file. In my opinion a PHP file should be ASCII only, so that all kinds of 
editors can handle it. So, instead of writing the "Fake-NUL" character, I would 
instead use chr(2400).

Original issue reported on code.google.com by [email protected] on 12 Sep 2010 at 10:50

Tests.php: Show diagnosis constant names

Instead of showing only a diagnosis number we could better write the constant 
name. (e.g. With a reverse lookup array table)

Low priority of course. Maybe for version 2.5

Original issue reported on code.google.com by [email protected] on 9 Sep 2010 at 9:22

26 warnings wrong

In tests.php you see 26 undiscovered failures in "Warnings" category. These
were not visible before because a false warning was NBSP and so you could not
see that it was surrounded with STRONG html tag .

Original issue reported on code.google.com by [email protected] on 9 Sep 2010 at 9:20

(PHP) Optional: Make warning tests optional

In your PHP branch you can optionally implement following semantic from the 
Java branch:

- XSD change: warning minoccour 1 => 0 to allow fallback.
- XML testcase interpreter: If warning-tag was not found, then do not perform a 
warning-check. (Warninings from is_email() are ignored)

Original issue reported on code.google.com by [email protected] on 11 Oct 2010 at 6:14

Invalid email adress passed off as valid

What steps will reproduce the problem?
1. put $email as $email = 'abc@g'
2. check if(is_email($email))
3. invalid email id passed as valid

What is the expected output? What do you see instead?
expected echo invalid. instead echo valid


What version of the product are you using? On what operating system?
PHP 5.3.5 with Windows 7 OS

Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 16 Oct 2012 at 12:38

Attachments:

Patch for /PHP/trunk/test/tests.xml

The "obs-FWS" production reads "obs-FWS         =   1*WSP *(CRLF 1*WSP)" - so 
obsolete whitespace must begin with a whitespace character (not CRLF). Thus as 
the tests are currently written I would expect the category to be ISEMAIL_ERR.

Original issue reported on code.google.com by [email protected] on 6 Aug 2012 at 1:57

Attachments:

Adding DOCTYPE to XML

Please add
<!DOCTYPE tests>
after
<?xml ...>

This reduces warnings in Eclipse. After that, Java and PHP branch finally use 
the same file.

Original issue reported on code.google.com by [email protected] on 6 Oct 2010 at 7:47

tests_beta.xml fails in Java package

What steps will reproduce the problem?
1. grab latest test_beta.xml from source tree (r81)
2. grab latest IsEMailTest.java from source tree (r81)
3. Run against latest IsEMail.jar code (2.10 atm)

Expected output is that tests pass

Instead, I see these errors:
Mail Test #32 FAILED (Wrong validity)! '[email protected]' is 'true' 
('ISEMAIL_DOMAINNOTFOUND') instead of 'false'!
Mail Test #41 FAILED (Wrong validity)! 
'""@a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.a.b.c.d.e.f.g.h.i.j.k.l.
m.n.o.p.q.r.s.t.u.v.w.x.y.z.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.
a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.a.b.c.d.e.f.g.h.i.j.k.l.m.n.
o.p.q.r.s.t.u.v.w' is 'false' ('ISEMAIL_TOOLONG') instead of 'true'!
Mail Test #43 FAILED (Wrong validity)! '""@iana.org' is 'false' 
('ISEMAIL_UNESCAPEDDELIM') instead of 'true'!
Mail Test #60 FAILED (Wrong validity)! 
'"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghjik\l"@iana.org' 
is 'false' ('ISEMAIL_LOCALTOOLONG') instead of 'true'!
Mail Test #95 FAILED (Wrong validity)! 'test@(comment)[255.255.255.255]' is 
'false' ('ISEMAIL_DOMAINBADCHAR') instead of 'true'!
Mail Test #98 FAILED (Wrong validity)! 
'(iana)test@abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghik.abcde
fghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghik.abcdefghijklmnopqrstuv
wxyzabcdefghijklmnopqrstuvwxyzabcdefghijk.abcdefghijklmnopqrstuvwxyzabcdefghijk.
abcdefghijklmnopqrstu' is 'false' ('ISEMAIL_TOOLONG') instead of 'true'!

Possibly fixed by a new backport of the php release to java.

Original issue reported on code.google.com by [email protected] on 3 Jun 2011 at 1:17

The mystery of A-records

"us.ibm.com" still throws warnings in testcases, since its A-record is 
determinated different on each system.

(I do not want that we change the testcase to another domain, since this 
"special" domain might show some bugs in our Java/PHP branches.)

I still have no results in finding a reason.

Here is my current test:
- Dominic Sayer's server (PHP version?): No A-Record
- Dominic Sayer's localhost (PHP version?): No A-Record (i assume)
- My localhost (Windows XP Home; XAMPP; Apache/2.2.14 (Win32) DAV/2 
mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 
mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1) -- A record found!!!
- My server viathinksoft.de (Apache/2.2.9 (Debian) DAV/2 SVN/1.5.1 
PHP/5.2.6-1+lenny8 with Suhosin-Patch mod_ssl/2.2.9 OpenSSL/0.9.8g 
mod_perl/2.0.4 Perl/v5.10.0) -- A record found!!!
- My localhost (JAVA): No A-record
- My university computer (JAVA): No A-record

Sounds like a big problem for servers that behave like "us.ibm.com" (I don't 
think that this DNS-behavior is worldwide unique!). If the enduser wants to 
check such a email-adress, the result of your email-tester is not clearly 
defined. Some systems say "OK", some say "Warning". Very weird.

Additional question: Do we need A-record test? Is an email with just MX also 
probably valid?

Original issue reported on code.google.com by [email protected] on 4 Oct 2010 at 7:15

Test dns-check and non-dns-check data separately

Some tests change validity depending on whether DNS checking is enabled. As 
such, those tests should be in separate XML files and checkXML() be altered to 
not force DNS checking.

When I turned dns checking off, these tests failed:

(tests.xml)
Mail Test #8, 9, 18, 20, 96, 99, 100, 209, 214, 277, 279 and 280.

Original issue reported on code.google.com by [email protected] on 2 Jun 2011 at 11:58

IPV6BADCHAR: Split up?

After explode() we are checking each single "group" against the pattern 
[0-9A-Fa-f]{0,4}. If it does not match, we are sending IPV6BADCHAR.

This diagnosis could be confusing if we check

:ffdee:

Here we do NOT have bad characters inside, instead we have just a too long 
"group". Maybe we should define and alternative error-code for it.

(PS: Why did you match with preg_grep() and not with preg_match() as my initial 
version draft was?)

Original issue reported on code.google.com by [email protected] on 1 Oct 2010 at 1:45

Folding White Space before and after the @ sign

What steps will reproduce the problem?
1) foo @email.com
2) foo@ email.com

What is the expected output? What do you see instead?
Invalid email address.

What version of the product are you using? On what operating system?
csharp @version 2010-10-18. Java-Translation of isemail.php:r68.

Please provide any additional information below.
1) Inside the if statement "if (!working_element.Equals(new_element))" on line 
253 should return false but it doesn't.
2) Inside the if statement "if (!element.Equals(new_element))" on line 678 
should return false but it doesn't.

Original issue reported on code.google.com by [email protected] on 31 May 2011 at 10:56

Invalid domain (with ampersand) validates OK, not even warning data in ResultInfo in C#

What steps will reproduce the problem?
1. C# use IsEmailValid("AndB@thisisA&B.com") (method from IsMail.cs)
2.
3.

What is the expected output? What do you see instead?
Expect  false (or if you want to erroneously go for true then at least 
information about faulty character - ampersand in the ResultInfo) 

What version of the product are you using? On what operating system?
C# dated April 24, 2011 on Windows 7 using VS2012 to compile the code

Please provide any additional information below.

On the website I see more useful information thatn with teh C# code
Try the url:
http://isemail.info/AndB%40thisisA%26B.com



Original issue reported on code.google.com by [email protected] on 28 Jan 2015 at 11:53

Java: Unicode hostnames causes crash

com.dominicsayers.isemail.dns.DNSLookupException: 
javax.naming.InvalidNameException: Label has two-byte char: مثال; remaining 
name 'مثال.إختبار'
    at com.dominicsayers.isemail.dns.DNSLookup.doLookup(DNSLookup.java:70)
    at com.dominicsayers.isemail.dns.DNSLookup.hasRecords(DNSLookup.java:29)
    at com.dominicsayers.isemail.IsEMail.is_email_verbose(IsEMail.java:709)
    at com.dominicsayers.isemail.IsEMailTest.checkXML(IsEMailTest.java:96)
    at com.dominicsayers.isemail.IsEMailTest.performXMLTests(IsEMailTest.java:132)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
    at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: javax.naming.InvalidNameException: Label has two-byte char: 
مثال; remaining name 'مثال.إختبار'
    at com.sun.jndi.dns.DnsName.verifyLabel(Unknown Source)
    at com.sun.jndi.dns.DnsName.add(Unknown Source)
    at com.sun.jndi.dns.DnsName.parse(Unknown Source)
    at com.sun.jndi.dns.DnsName.<init>(Unknown Source)
    at com.sun.jndi.dns.DnsContext.fullyQualify(Unknown Source)
    at com.sun.jndi.dns.DnsContext.c_getAttributes(Unknown Source)
    at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_getAttributes(Unknown Source)
    at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.getAttributes(Unknown Source)
    at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.getAttributes(Unknown Source)
    at javax.naming.directory.InitialDirContext.getAttributes(Unknown Source)
    at com.dominicsayers.isemail.dns.DNSLookup.doLookup(DNSLookup.java:61)
    ... 28 more


Original issue reported on code.google.com by [email protected] on 11 Oct 2010 at 12:26

Clean mailing list stored in mysql database

Dominic, I recently posted this question on your website & I thought it would 
be more helpful to everyone if I posted actual code here.

This isn't a problem, but more of a way that I am trying to implement this code 
to rid (clean) our email lists that we have stored in various mysql databases.

What steps will reproduce the problem?

I am attempting to use the following code.

<?php 
include('../blahblahblah/customers.php'); 
require_once('../is_email/is_email.php');

$conn = mysql_connect($dbhost, $dbuser, $dbpass, $dbname);
if (mysql_error()) {
printf("Connect failed: %s\n",mysql_error());
exit ();
}
mysql_select_db($dbname);
if (mysql_error()) {
printf("Connect to database failed: %s\n",mysql_error());
exit ();
}

/* If connection to database, run sql statement. */
if ($conn)
{   
$query = sprintf("SELECT id,valid,email FROM prospects WHERE yahoo='N'");

// Perform Query
$result = mysql_query($query);

// Check result
// This shows the actual query sent to MySQL, and the error. Useful for 
debugging.
if (!$result) {
    $message  = 'Invalid query: ' . mysql_error() . "\n";
    $message .= 'Whole query: ' . $query;
    die($message);
}

// Use result
// Attempting to print $result won't allow access to information in the resource
// One of the mysql result functions must be used
// See also mysql_result(), mysql_fetch_array(), mysql_fetch_row(), etc.
while ($row = mysql_fetch_array($result, MYSQL_BOTH)) { 
 //printf ("ID: %s  Email: %s", $row[0], $row["email"]);
 $email= $row["email"];
 $valid= $row["valid"];
 $record_id = $row["id"];

 if (is_email($email)) echo "$email is a valid email address";

}

// Free the resources associated with the result set

mysql_free_result($result);
mysql_close($conn);
}
?>

What is the expected output? What do you see instead?

I expected to see valid email's to show up as valid and invalid emails not show 
up at all.

What version of the product are you using? On what operating system?
Version 2.10 - centos-5-x86_64 Php 5.16 Mysql 5.077 




Original issue reported on code.google.com by [email protected] on 19 Oct 2010 at 2:58

Feature: Add TLD check

Additionally, a official static TLD list of IANA can be checked. (Java + PHP 
solution)

It is questionable, if this additional check should be enabled by an parameter 
or not. I think it would be better if the TLD-check should not be deactivated.

Note: For maintenance there should be a function which is called by developers 
which checks if the official TLD list ( 
http://data.iana.org/TLD/tlds-alpha-by-domain.txt ) is equal to our static 
list. So, we can immediately change our source code when we notice that IANA 
has assigned a new TLD. (Maybe also on-demand-refreshing of the internal TLD 
table...?)

Original issue reported on code.google.com by [email protected] on 14 Jun 2010 at 9:41

Out of Range Exception thrown in C# validate function when entire sub domain section is in parens

What steps will reproduce the problem?
1. Run UI tester.
2. Paste in "bob@example.(foo).com"
3. System.ArgumentOutOfRangeException was unhandled is thrown at line 736 
because elementLength is zero.

What is the expected output? What do you see instead?
No exepction thrown and email flagged as invalid.

What version of the product are you using? On what operating system?
Most recent C# code.

Please provide any additional information below.

At line 732 I've added an if statement to handle the zero length string:
  if (elementLength == 0) return false;


Original issue reported on code.google.com by [email protected] on 1 Feb 2012 at 9:25

New SVN structure

I would have the big wish that the SVN folder structure changes.

Currently, python and java are branches. (which is literally surely correct) 
But these are no branches in the SVN terminology. They cannot be merged and 
have a complete different semantics.

Also, most users will not receive the Java sources, since they only checkout 
the trunk.

Please change the folder structure to

php/trunk/...
php/branches/...
php/tags/...
java/trunk/...
java/branches/...
java/tags/...

Since python is not yet developed, you can leave pyron/trunk/ etc empty.

I want to publish my finished Java sourcecode soon!

Original issue reported on code.google.com by [email protected] on 6 Oct 2010 at 8:22

Comments around address literal

Beta test set #90

Michael Rushton & Cal Henderson assert that comments are allowed around an 
address literal. is_email() currently says this is invalid.

Original issue reported on code.google.com by [email protected] on 13 Oct 2010 at 1:06

Small corrections in is_email_statustext.php

Small corrections in is_email_statustext.php

(1) At part  ISEMAIL_STATUSTEXT_SMTPCODE.

You write in comment for switch "default:"

"191 and others"

This comment is not correct. Actually, it also matches to 190 AND to the case 
"ISEMAIL_ERROR" (128)

(2) You should consider having another SMTP-code flag which outputs only 
integers of the SMTP code without text (I already did that in Java branch).

(3) You should consider putting the SMTP-text-codes into String-constants, 
since they repeat over and over. I have solved this in Java with:

public static final String SMTP_553_510 = "553 5.1.0 Other address status";
public static final String SMTP_553_511 = "553 5.1.1 Bad destination mailbox 
address";
public static final String SMTP_553_512 = "553 5.1.2 Bad destination system 
address";
public static final String SMTP_553_513 = "553 5.1.3 Bad destination mailbox 
address syntax";
public static final String SMTP_250 = "250 2.1.5 ok";

Original issue reported on code.google.com by [email protected] on 10 Oct 2010 at 4:46

Empty quoted strings

An empty quoted string is valid according to the RFCs. is_email() currently 
marks it invalid.

Original issue reported on code.google.com by [email protected] on 13 Oct 2010 at 1:01

AAAA records?

Do we need AAAA IPv6 record check if MX was not found? Or does the RFC say only 
that A-record must be available if MX fails?

Original issue reported on code.google.com by [email protected] on 8 Oct 2010 at 4:55

Value throws an exception when running IsEMail.is_email_verbose(email, true)

The problem is that the jndi.properties that coldfusion uses on startup 
includes the following:

java.naming.provider.url=localhost:2932



and that value throws an exception when running IsEMail.is_email_verbose(email, 
true)

javax.naming.ConfigurationException: localhost:2932 is not a valid DNS 
pseudo-URL

I tried changing it to various but anything else causes the coldfusion server 
to fail to start.



However in my code, if I set the: 
sys.setProperty("java.naming.provider.url","dns::2932") via sys = 
createObject(“java”,”java.lang.System”), the call to IsEMail works.  I 
don’t know what effect changing the naming provider in the coldfusion env 
scope will have on the system so I am not comfortable with it.



So, looking at your code carefully I can across the dnsLookup.java and through 
other research via 
http://download.oracle.com/javase/1,5.0/docs/guide/jndi/jndi-dns.html

I see you can set the env.put(Context.PROVIDER_URL, dnsserver); which could be 
used in the doLookup function.



So is it possible to have an new function in the dnsLookup class that sets a 
custom dns server ( ie: dns::2932 which works for me ) that the doLookup 
function can utilize?



Does that make any sense lol…I am trying to explain it the best I can.



So, short story is that it would be nice to pass a custom PROVIDER_URL when we 
init() isEmail.



Thanks for your time!



John Skrotzki

Original issue reported on code.google.com by [email protected] on 7 Jun 2011 at 7:51

Test suite version number is wrong

What steps will reproduce the problem?
1. Look at tests.xml
2. Version comment refers to 2.5
3. version attribute in <tests> element is 2.4


Original issue reported on code.google.com by [email protected] on 4 Oct 2010 at 4:53

TLD "invalid" + domainname check + IDNs?

I remember reading in some RFC document, that the TLD "invalid" is a reserved 
TLD for purpose marking invalid hosts.

The email address "test@invalid" shows only a warning instead of a failure. I 
think, it should be a failure since the main subject of your libary is to 
accomplish with RFC rules.

Original issue reported on code.google.com by [email protected] on 11 Oct 2010 at 12:05

IPV6TOOMANYGROUPS etc. not tested

For warnings/errors like IPV6TOOMANYGROUPS we currently have no testcases. This 
should be done to check if the new IPv6 semantics really work correctly (and 
sending correct diagnosis results).

Original issue reported on code.google.com by [email protected] on 1 Oct 2010 at 1:46

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.