News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

SMF doesn't recognize new TLD email accounts!!!

Started by elTopo, September 14, 2014, 08:49:39 AM

Previous topic - Next topic

elTopo

I just realized, SMF won't accept new TLD emails in profiles!!!!  :o

emails like info@mysite.international or info@mysite.support etc.!!!

and I just installed SMF in such a new TLD domain and I was planning to procced with a second installation in yet another such domain, soon...

I need admins and mods to use our domain email accounts...

My jaw has dropped.. Up to now I was happy with everything about SMF and now, this!

Is there something I can do?

When I enter the email in my profile, I get a "You have not entered a valid email address." when, ofcourse, the email address is 100% valid. Can I edit some php file and get the validy check out of the way?

thnx

elTopo

update: I edited directly the db on the server and thus got the right emails in the profiles. I've checked, and I do receive emails.

But you should really look into this, dear SMF staff. New TLDs have been around for months. It's a handicap for the software not to recognize them.

:)

Arantor

When that part of SMF was written *years* ago, the longest TLD was 6 letters, with absolutely no sign of new TLDs (remember: SMF 2.0 went stable 3 years ago and most of the innards were done years ago). I'd forgotten they had introduced stupidly-long TLDs lately.

It's a not-so-complicated fix in several places, though. I will try to nudge the team to include this in a future 2.0 patch and definitely in 2.1.

Sources/Post.php
Code (find) Select
elseif (preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,6})$~', $_REQUEST['email']) == 0)

Code (replace) Select
elseif (preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,16})$~', $_REQUEST['email']) == 0)

Code (find) Select
if (!allowedTo('moderate_forum') && preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,6})$~', $_POST['email']) == 0)

Code (replace) Select
if (!allowedTo('moderate_forum') && preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,16})$~', $_POST['email']) == 0)

Sources/Profile-Modify.php
Code (find) Select
if ($row['mask'] == 'email' && (preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,6})$~', $value) === 0 || strlen($value) > 255))

Code (replace) Select
if ($row['mask'] == 'email' && (preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,16})$~', $value) === 0 || strlen($value) > 255))

Code (find) Select
if (preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,6})$~', $email) == 0)

Code (replace) Select
if (preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,16})$~', $email) == 0)

Sources/Register.php
Code (find) Select
if ($row['mask'] == 'email' && (preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,6})$~', $value) === 0 || strlen($value) > 255))

Code (replace) Select
if ($row['mask'] == 'email' && (preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,16})$~', $value) === 0 || strlen($value) > 255))

Code (find) Select
if (preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,6})$~', $_POST['new_email']) == 0)

Code (replace) Select
if (preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,16})$~', $_POST['new_email']) == 0)

Sources/SendTopic.php
Code (find) Select
if (preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,6})$~', $_POST['y_email']) == 0)

Code (replace) Select
if (preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,16})$~', $_POST['y_email']) == 0)

Code (find) Select
if (preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,6})$~', $_POST['r_email']) == 0)

Code (replace) Select
if (preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,16})$~', $_POST['r_email']) == 0)

Code (find) Select
if (preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,6})$~', $_POST['y_email']) == 0)

Code (replace) Select
if (preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,16})$~', $_POST['y_email']) == 0)

Code (find) Select
elseif (preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,6})$~', $_POST['email']) == 0)

Code (replace) Select
elseif (preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,16})$~', $_POST['email']) == 0)

Sources/Subs-Members.php
Code (find) Select
if (empty($regOptions['email']) || preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,6})$~', $regOptions['email']) === 0 || strlen($regOptions['email']) > 255)

Code (replace) Select
if (empty($regOptions['email']) || preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,16})$~', $regOptions['email']) === 0 || strlen($regOptions['email']) > 255)


I believe that should be all of them.

EDIT: Tracked for 2.1 (with notes about 2.0) as https://github.com/SimpleMachines/SMF2.1/issues/2321

Burke ♞ Knight

Arantor, would you be okay with me making this a mod, for those that would rather not do all those edits themselves?

As you know me, you know I link back to the post and add credit in the mod. :)

Arantor

No, I wouldn't, for the same reason I didn't. I want this to be fixed in a mainstream release.


elTopo

thanks for the quick reaction, Arantor. I'll make all edits directly in the database and wait for the next update.

One more thing: I realize now, it won't accept non-enlgish domains, either (like info@ελτόπο.gr)

Non-english domains have been around for years! why keeping them out?

Arantor

The fact it's not possible on the vast majority of SMF installations is of no concern, of course.

The majority of SMF installations do not use UTF-8 which is a fundamental requirement for the domains you talk about. For many years, most servers simply did not offer the functionality required as a standard thing to support full UTF-8, so SMF never bothered with the massive amount of extra code to support the domains properly.

Oh, and if you make 'all edits directly in the database' you have completely done it wrong since none of those edits were in the database.

Kindred

I think he meant that he would continue to manually update the user's email address in the database until this fix gets rolled into a release.


Thing is - it would probably be rolled into 2.0.10, if an when that gets done -- since we are in the middle of 2.0.9 and we're not adding something like this into the middle of a release cycle (sure route to disaster) -- I have no guarantee when it would be done.

(but yes, this should most certainly be added as a 2.1 issue.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor

QuoteI think he meant that he would continue to manually update the user's email address in the database until this fix gets rolled into a release.

Or once he's done the patch, it'll just be accepted anyway to allow longer TLDs...

elTopo

Quote from: Arantor on September 14, 2014, 09:43:53 AMOh, and if you make 'all edits directly in the database' you have completely done it wrong since none of those edits were in the database.

I meant, I edited the right email directly in the database (in the members' table)..

As for the non-english domains, i don't suppose it's such a big deal to have smf accept non-english domains for members' emails. For example, it does link correctly to non-enlgish domains in posts. But that's up to you, ppl.

( btw.. non-english domains are not that uncommon in many countries... )

Arantor

Quotei don't suppose it's such a big deal to have smf accept non-english domains for members' emails

What would I know about the subject? I mean, I'm only a former member of the development team and have been known to do some extremely complex things with Unicode as well as understanding what's involved in a Unicode->Punycode translation (which is what's needed here). I wouldn't know anything at all about how this is *actually impossible* out of the box on a standard 2.0 configuration since it doesn't use Unicode out of the box at all in 2.0, only does for 2.1 on a new install.

No, I'm sure it really is as simple as you say and no big deal.

Chalky

I might be wrong A, but when elTopo said "i don't suppose it's such a big deal to have smf accept non-english domains for members' emails" I understood it to mean that the problem is probably non-critical and a low priority for resolution. I don't think he was making any assertions about the complexity of the task  :)

Arantor

That's not how I read it. He seems very sure that it's a simple task to change to actually make SMF accept such things.

Chalky

Ambiguous English idioms again  :P. Guess we'll have to wait and see.

Arantor

I still have trouble with English and I've only been speaking it for nearly 31 years ;D

elTopo

Not sure why, but I keep sensing an attitude. :( Not sure whether I do anything wrong.

Dear Arantor, I never meant to question your guru status and I do apologize if I somehow gave that impression.

You won't hear of me again in this thread..

:-X

Arantor

I'm sorry, I just react *very* badly to people who have the attitude that things should be done because they think they should be done, even when there are very sound reasons why they *can't* be done, beyond 'it's complicated'.

Yes, it should be done. It won't happen before SMF 3.0 precisely because it *can't* be done in the current SMF architecture and no amount of 'but it should be done' can fix that.

Advertisement: