Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Replies

Avatar

Avatar
Validate 10
Level 5
DarrenBiz
Level 5

Likes

67 likes

Total Posts

205 posts

Correct Reply

37 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Validate 10
Level 5
DarrenBiz
Level 5

Likes

67 likes

Total Posts

205 posts

Correct Reply

37 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 1
View profile
DarrenBiz
Level 5

08-05-2019

So another piece to this puzzle (provided by Support) is the option value for the valid characters in an email address XtkEmail_Characters. I tested this value and this Option value is definitely being used by the mystery validation function to check for valid characters in the email before the write happens.

email_chars.png

What they couldn't confirm was how this was applied to the email address (local-part or domain or both). Nor could they confirm what other checks were being performed before the recipient Write was attempted.

Avatar

Avatar
Validate 10
Level 5
DarrenBiz
Level 5

Likes

67 likes

Total Posts

205 posts

Correct Reply

37 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Validate 10
Level 5
DarrenBiz
Level 5

Likes

67 likes

Total Posts

205 posts

Correct Reply

37 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 1
View profile
DarrenBiz
Level 5

13-06-2019

OK - I finally have an answer on how ACC determines a valid email. It took way more effort than I expected but we got an answer:

So I am assuming that the first part of this response is the dataPolicy check and the second is a regex against the XtkEmail_Characters option. e.g. something like this

loadLibrary("xtk:shared/nl.js");

loadLibrary("xtk:shared/dataPolicy.js");

var email = "blah232456@gmail.com";

/**

*

* Function to determine if an email is valid for the Adobe Campaign

* database checks. This process checks using the default email dataPolicy

* and the option value XtkEmail_Characters.

*

* @param email {string} email address to test

* @return true(valid) | false(invalid)

*

**/ 

function isValidAdobeEmail( email ) { 

var patt = "[^@" + getOption('XtkEmail_Characters').replace(/[.*+?\-^${}()|[\]\\]/g, '\\\$&') + "]";

//logInfo("EmailFunctions.js::isValidAdobeEmail() - Escaped XtkEmail_Characters: " + patt);

var regex = new RegExp(patt, "g"); 

var testFlag = !regex.test(email); 

//logInfo("Result of XtkEmail_Characters test: " + ((testFlag)?"valid":"invalid"));

var dataPolicyResult = !NL.isEmpty(NL.DataPolicy.filter("email", email)); 

//logInfo("Result of dataPolicy email test: " + ((!NL.isEmpty(dataPolicyResult))?"valid":"invalid"));

return testFlag && dataPolicyResult; 

}

//Test the email

if( isValidAdobeEmail(email) ) {

  //email address is valid

} else {

  //email is invalid

}

Edit: minimised the code

Avatar

Avatar
Contributor
MVP
wodnicki
MVP

Likes

938 likes

Total Posts

1,061 posts

Correct Reply

495 solutions
Top badges earned
Contributor
Shape 1
Give Back 100
Give Back 50
Give Back 25
View profile

Avatar
Contributor
MVP
wodnicki
MVP

Likes

938 likes

Total Posts

1,061 posts

Correct Reply

495 solutions
Top badges earned
Contributor
Shape 1
Give Back 100
Give Back 50
Give Back 25
View profile
wodnicki
MVP

14-06-2019

Hi,

No there is no regex here. The code is matching characters after splitting the string into @ and .

Pseudocode in js would be:

str.split(/[@.]/).filter(function(_){

    return _.match(/^[XtkEmail_Characters as a character class]+$/);

}).length >= 3

Thanks,

-Jon