Results 1 to 6 of 6

Thread: change email password via script

  1. #1
    Member
    Join Date
    Jan 2004
    Posts
    755

    Default change email password via script

    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. #2
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,496

    Default

    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
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  3. #3
    Member
    Join Date
    Jan 2004
    Posts
    755

    Default

    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. #4
    Member
    Join Date
    Jan 2004
    Posts
    755

    Default

    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. #5
    Member
    Join Date
    May 2003
    Location
    Boston, MA USA
    Posts
    34

    Default

    Quote Originally Posted by chirpy
    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
    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. #6
    Member
    Join Date
    May 2003
    Location
    Boston, MA USA
    Posts
    34

    Default

    Nevermind :-)

Similar Threads

  1. Password Change Script
    By bryzo in forum E-mail Discussions
    Replies: 4
    Last Post: 10-06-2008, 01:43 PM
  2. Remote password change script problem... need help!
    By sllik in forum cPanel & WHM Discussions
    Replies: 4
    Last Post: 10-03-2005, 09:54 PM
  3. [Exim] Change pop Password Script
    By NetPires in forum cPanel & WHM Discussions
    Replies: 3
    Last Post: 08-01-2005, 03:41 AM
  4. change the E-Mail Account Password with a php/cgi script?
    By lukelukeluke in forum cPanel & WHM Discussions
    Replies: 1
    Last Post: 06-27-2005, 02:51 AM
  5. script to change password
    By mikerobinson in forum cPanel & WHM Discussions
    Replies: 0
    Last Post: 08-03-2004, 10:03 PM