Search code examples
phpimapchange-password

IMAP: Change email password through php


How can I change password of the mail account using php. I am using IMAP functions.

IMAP doc : http://php.net/manual/en/book.imap.php

Note: There is no acess to cpanel API


Solution

  • If you don't have access to the cPanel API, then you're even less likely to have root access to the various files that would be needed to make the changes.

    Changing passwords is not a feature of IMAP, POP or SMTP - it's a server configuration issue, so you need to manipulate the server configuration. Several hosts provide APIs (such as cPanel / Hostgator) but you've ruled that out, so he only other option would be "exec", and I wouldn't touch that with a bargepole for cPanel, Plesk or simlar as you'd also need ot manuliplate the databases that store the configs. Ouch, if if you had root access.

    Edit: A bit more reasearch and I have found this: http://trac.roundcube.net/browser/github/plugins/password/password.php that supports several back ends. However the cPanel option uses the cPanel API; so still no luck!