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!

change email password via script

Discussion in 'E-mail Discussion' started by Lyttek, Feb 17, 2006.

  1. Lyttek

    Lyttek Well-Known Member

    Joined:
    Jan 2, 2004
    Messages:
    770
    Likes Received:
    3
    Trophy Points:
    168
    Greetings!

    Is it possible to change the password (or delete the password) of an email account via script? I'd like to setup a script that I can run (when needed) that will disable email access to a list of accounts.

    Basically, when a client terminates employees, I need to shut off access and would rather script it than do it by hand.
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,460
    Likes Received:
    22
    Trophy Points:
    463
    Location:
    Go on, have a guess
    I don't believe that there's a script to do that. However, it should just be a simply matter of generating your own MD5 password in /home/account/etc/domain.com/shadow or comment out the mailbox name in /home/account/etc/domain.com/passwd
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Lyttek

    Lyttek Well-Known Member

    Joined:
    Jan 2, 2004
    Messages:
    770
    Likes Received:
    3
    Trophy Points:
    168
    Well, that might explain why I can't find it ;)

    Actually, commenting out the account might be easier anyway... If I were to remove the line for that account altogether, what would happen? If I went to change the password, would it choke, or simply create the password?
     
  4. Lyttek

    Lyttek Well-Known Member

    Joined:
    Jan 2, 2004
    Messages:
    770
    Likes Received:
    3
    Trophy Points:
    168
    Went ahead and tried it.

    If you comment out or remove the appropriate line in the 'shadow' file (as opposed to the passwd file), you can't login to email. You can then change the password via cpanel and all will be well.
     
  5. ElrondBCN

    ElrondBCN Active Member

    Joined:
    May 19, 2003
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    156
    Location:
    Boston, MA USA
    Would you happen to know where the cpanel account passwords are kept? I'd like to be able to change those via a script as well.
     
  6. ElrondBCN

    ElrondBCN Active Member

    Joined:
    May 19, 2003
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    156
    Location:
    Boston, MA USA
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