Mailboxes Auto Login for ispconfog administrators

Discussion in 'Tips/Tricks/Mods' started by adammazin, Oct 4, 2019.


You found this instruction and feature

  1. good

    0 vote(s)
  2. not useful

    0 vote(s)
  3. sucks

    0 vote(s)
  1. adammazin

    adammazin New Member

    Hello guys,
    finally i got it work, I'm not programmer so i hope programmers help make it easier for others. i did it because my clients was nagging since i moved them from Cpanel to awesome Ispconfig to give them ability for auto login to other mailboxes without remembering or resetting mailbox passwords. so steps like below:
    Step One: create dovecot master password following these instructions:
    changes will be done here /etc/dovecot/dovecot.conf
    like below:
    auth_master_user_separator = :
    passdb {
    args = /etc/dovecot/dovecot-master-users
    you can use another separators as you like " _ , - , +" just don't use "*"
    and you have to create this file /etc/dovecot/dovecot-master-users and but master password inside like below
    to create master password like above use this CLI command
    doveadm pw -s SSHA512
    keep in mind this text {SSHA512} is important read instruction.
    don't forget to restart dovecot
    service dovecot restart
    keep this password save or simply don't keep it on your PC use it and forget it, if anyone got them you and your clients will be hacked :D
    before i forget change file permission
    chown -R root:dovecot /etc/dovecot/dovecot-master-users
    chmod 644 /etc/dovecot/dovecot-master-users
    Step Two: you have to play with ispconfig files :rolleyes: so go and add these lines to /var/www/ispconfig/mail/webmailer.php
    include "/var/www/ispconfig/mail/RoundcubeLogin.class.php";
    $dbemail = $app->db->queryOneRecord("SELECT email FROM mail_user WHERE mailuser_id = ?", $emailId);
    $rcl = new RoundcubeLogin("/roundcube/", $debug);
    try {
            $rcl->login($dbemail['email'].":admin", "Your PLAIN Password");
    catch (RoundcubeLoginException $ex) {
     echo "ERROR: Technical problem, ".$ex->getMessage();}
    and replace "Your PLAIN Password" on above code with your plain master password you created earlier, remember plain not encrypted. above line will be added after line 59 right after
           $webmail_url = str_replace('[SERVERNAME]', $serverData['server_name'], $webmail_url);
    and you have to comment out this line
    //      header('Location:' . $webmail_url);
    then go and create this file /var/www/ispconfig/mail/RoundcubeLogin.class.php on same directory like you see, fill it with code from this file or or just download file and upload it to above directory.
    ***All thanks after Brilliant Ispconfig Team to this guy Philipp C. Heckel and his script find it here:
    after creating it don't forget to change file permission:
    chown -R ispconfig:ispconfig /var/www/ispconfig/mail/RoundcubeLogin.class.php

    Now go and test your new feature ;)
    Last edited: Oct 5, 2019
    Jesse Norell likes this.

Share This Page