database schema lengths
I was taking a quick look at the clapf database schema and noticed that many of the fields were set to varchar(128). Won't this cause emails, senders, rcpt, domains, and hostnames to be truncated?
The RFC for the max length of an email is 254 chars: http://stackoverflow.com/questions/386294/what-is-the-maximum-length-of-a-valid-email-address
The RFC for the max length of a hostname is 253 chars http://en.wikipedia.org/wiki/Hostname
Probably a good idea to set to varchar(255) for those fields to match the RFC maximum length.
Comments (3)
-
reporter -
repo owner - changed status to wontfix
You are right, an email address can be longer than 128 chars, however in practice I haven't seen such a long address, so chances are that 128 will be enough.
Anyway feel free to extend it if required.
-
reporter Does clapf support ipv6? Just wondering as the minefield IP field is limited to 15 chars ..
- Log in to comment
It looks like MySQL does use more space when using varchar(255). (VARCHAR fields are converted to CHAR to gain the advantage of working with fixed-width rows. So the strings in memory become padded out to the maximum length of your declared VARCHAR column.)
Maybe not a good idea to change then: http://stackoverflow.com/questions/262238/are-there-disadvantages-to-using-a-generic-varchar255-for-all-text-based-field