1

Topic: Script Getmail, Get Plain Password Stored

==== Required information ====
- iRedMail version: 0.8.7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySql
- Linux/BSD distribution name and version: Ubuntu 14.04.1 LTS
- Related log if you're reporting an issue:
====

Hi EveryOne, Mr Zhang

I've make PHP Script to get Username And Password from Mailbox, because I want to run A getmail.

Here My PHP Script

<i>

mysql_connect("$hostname","$usermysql","$passmysql")or die ("Error Conect Database");
mysql_select_db("$dbmysql") or die ("Error DB");

$result = mysql_query("SELECT username,password from mailbox");

while ($row=mysql_fetch_array($result))
        {
                $USERNAME = $row["username"];
                $PASSWORD = $row["password"];

        $data = file_get_contents("getmailrc");
        $data = str_replace("{USERNAME}", "$USERNAME", $data);
        $data = str_replace("{PASSWORD}", "$PASSWORD", $data);

        file_put_contents("$USERNAME", $data);
        }


</i>

I get output getmail Script like this

<i>

[retriever]
type = SimplePOP3SSLRetriever
server = svr1.batutua.co.id
username = myusername@mydomain.co.id
password = $1$J9Tg6pxY$sb7hBQvRcm/BDM6HIaf9/.
[destination]
type = MDA_external
path = /usr/lib/dovecot/deliver
arguments = ("-e", "-f", "%(sender)", "-d", "myusername@mydomain.co.id")
user = vmail
group = vmail


</i>

I got the problem, because password is on MD5 Hash, how can I get password on Plain Text. I've to use it to Retrieve getmail from primary mail server

Thx

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Script Getmail, Get Plain Password Stored

Passwords are stored in MD5/SSHA hash, you cannot get plain password in SQL/LDAP except you store them in plain.

A possible solution is: get the password while user login to webmail.

3

Re: Script Getmail, Get Plain Password Stored

thx Mr Zhang, I just modify to store them in Plain text