Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Email address / addpop / What is a valid username?

Discussion in 'cPanel Developers' started by kamm, Feb 27, 2013.

  1. kamm

    kamm Active Member

    Joined:
    Jan 17, 2004
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    156
    Location:
    Spain
    cPanel Access Level:
    Root Administrator
    When using addpop what constitutes a valid username (username@example.com)

    Minimum, maximum characters?
    Characters allowed?

    Is this documented anywhere?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,443
    Likes Received:
    416
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. kamm

    kamm Active Member

    Joined:
    Jan 17, 2004
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    156
    Location:
    Spain
    cPanel Access Level:
    Root Administrator
    Thanks, but that doesn't have the information I'm seeking.

    I'm trying to find out what cpanel considers a valid username for an email address.

    Minimum, maximum characters?
    Characters allowed?
    and something I just remembered...
    Reserved words?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,443
    Likes Received:
    416
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    I'm not aware of any restrictions on the username part of the email account.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. kamm

    kamm Active Member

    Joined:
    Jan 17, 2004
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    156
    Location:
    Spain
    cPanel Access Level:
    Root Administrator
    OK - thanks.

    I think I'll just limit it to this:
    Code:
    /^[a-zA-Z0-9\.]+$/
    ...should be good enough for most purposes and no doubt addpop will fail if it's not.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. Snorx

    Snorx Registered

    Joined:
    Sep 18, 2013
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Actually, I found out that the following expression specifically gives the needed validation:

    Code:
    /^(?!.*(\.)\1)[a-zA-Z0-9_\-]+([a-zA-Z0-9_\.\-]+[a-zA-Z0-9_\-])?$/
    Regards,
    Georgi
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice