Jump to content

How big should E-mail be?


doubledee

Recommended Posts

Take a look here: http://en.wikipedia.org/wiki/Email_address#Valid_email_addresses

 

Most people won't have an email address above 60-80 chars, but they are still valid well over that longer than that.

 

The link you posted says...

Syntax

 

The format of email addresses is local-part@domain where the local-part may be up to 64 characters long and the domain name may have a maximum of 253 characters - but the maximum 256 characters length of a forward or reverse path restricts the entire email address to be no more than 254 characters.[1] - formally defined in RFC 5322 (sections 3.2.3 and 3.4.1) and by RFC 5321.

 

 

Debbie

 

 

Link to comment
Share on other sites

Like I said, you will almost never see someone with an email 255 characters long. That's just absurd.

 

Most people have short, easy to remember emails...so around 60-80 characters and you should be fine. If you ever get a complaint you can always increase it.

 

Then 60 it is.

 

Thanks,

 

 

Debbie

 

Link to comment
Share on other sites

And.... ?

 

And so apparently Pikachu2000 guess wasn't right...

 

 

Debbie

 

 

Guess? It wasn't a guess. I actually did some research on this some time ago and read the related RFCs that that define the format of an email address. If I missed a limiting factor in the calculation, then so be it. In the end, the number I provided was larger than the maximum characters in an email address. Setting a field's max size to that value would have no real, negative effect. Sure, a malicious user could enter an invalid email address longer than the actual limit, but so what? They could just as easily enter any invalid or otherwise non-existent address. Setting the field smaller, as you've done, does introduce the possibility of truncating an actual email address, thereby corrupting the data and rendering it useless.

Link to comment
Share on other sites

And.... ?

 

And so apparently Pikachu2000 guess wasn't right...

 

 

Debbie

 

 

Guess? It wasn't a guess. I actually did some research on this some time ago and read the related RFCs that that define the format of an email address. If I missed a limiting factor in the calculation, then so be it. In the end, the number I provided was larger than the maximum characters in an email address. Setting a field's max size to that value would have no real, negative effect. Sure, a malicious user could enter an invalid email address longer than the actual limit, but so what? They could just as easily enter any invalid or otherwise non-existent address. Setting the field smaller, as you've done, does introduce the possibility of truncating an actual email address, thereby corrupting the data and rendering it useless.

 

Why are you and Thorpe going at me tonight?!  :shrug:

 

I never judged either of your responses.  I just commented on what each of you said.  Geesh!

 

Yes, I could truncate someone's e-mail, and maybe 70 or 80 characters would be better.  But anything over 80 and I say, "Who cares?!"  (I am of the mindset that you don't support difficult users...)  ;)

 

 

Debbie

 

Link to comment
Share on other sites

All I did was respond to your implication that the number I provided was purely arbitrary, and supply some additional, related facts.

 

That's for you and Thorpe to duke out.

 

I never questioned your ability, and was just saying that Thorpe's max and yours and what I found online varied.

 

 

Debbie

 

Link to comment
Share on other sites

In the end, the number I provided was larger than the maximum characters in an email address. Setting a field's max size to that value would have no real, negative effect.

 

Except varchar can only go to 255 and not 322. ;P

 

 

 

I don't recall mentioning using a varchar field type. And even so, the limit is 65,534 bytes in MySQL >= 5.0.3.

Link to comment
Share on other sites

In the end, the number I provided was larger than the maximum characters in an email address. Setting a field's max size to that value would have no real, negative effect.

 

Except varchar can only go to 255 and not 322. ;P

 

Actually, after MySQL 5.0.3 a VARCHAR could go from 0-65,535  (Or at least that is what I found online?!)

 

(I wonder when you would want to go to TEXT() versus a large VARCHAR??  From what I have read, VARCHAR() blows TEXT() out of the water when it comes to query speeds...)

 

And if I was going to store messages (e.g. Success/Failure message), I wonder which would make more sense?

 

 

Debbie

 

 

Link to comment
Share on other sites

And even so, the limit is 65,534 bytes in MySQL >= 5.0.3.

 

Actually, after MySQL 5.0.3 a VARCHAR could go from 0-65,535

 

Huh. So it is. Interesting.

 

 

(I wonder when you would want to go to TEXT() versus a large VARCHAR??  From what I have read, VARCHAR() blows TEXT() out of the water when it comes to query speeds...)

 

VARCHAR stores data in the row, whereas TEXT/BLOB is just a reference to another location where the data is stored. Therefore, TEXT/BLOB only contributes a very small amount to the row size. VARCHAR has a maximum size of the row size - so it's only 0-65,353 if it's the only column in the row.

 

The speed of VARCHAR vs TEXT/BLOB is highly situational. If you have a small amount of data (such as an email address) then VARCHAR should be faster. If you have a blog article, obviously TEXT is a better option.

 

And if I was going to store messages (e.g. Success/Failure message), I wonder which would make more sense?

 

Like I said, if you are putting that huge chunk in there I would go with a TEXT. But, I still think this is a bad approach.

Link to comment
Share on other sites

Why are you and Thorpe going at me tonight?!  :shrug:

 

I never judged either of your responses.  I just commented on what each of you said.  Geesh!

You said he was wrong.  You don't think "I guess he was wrong" is being judgmental?

 

As a personal policy I've been ignoring your little tantrums on here, but this is just ridiculous.  You told an expert he was wrong when he was absolutely correct.  If you're so smart, why are you asking us?

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.