The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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:
    38
    Likes Received:
    0
    Trophy Points:
    6
    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?
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,471
    Likes Received:
    199
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
  3. kamm

    kamm Active Member

    Joined:
    Jan 17, 2004
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    6
    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?
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,471
    Likes Received:
    199
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    I'm not aware of any restrictions on the username part of the email account.
     
  5. kamm

    kamm Active Member

    Joined:
    Jan 17, 2004
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    6
    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.
     
  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