Mailboxes Auto Login for ispconfog administrators

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

  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 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 below lines to /var/www/ispconfig/mail/webmailer.php after line 59 and right after
           $webmail_url = str_replace('[SERVERNAME]', $serverData['server_name'], $webmail_url);
    lines to add:
    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. 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: Nov 15, 2019
    ahrasis, recin and Jesse Norell like this.
  2. recin

    recin Member

    Thanks. It works like a charm.
    Only 2 notes:
    • You dont need -R when doing chown to a file
    • When adding lines to ispconfig webmailer.php file, note you can't do it in the end of the file, they should be before the exit in the last line
  3. recin

    recin Member

    After step one, you could try if it works accessing webmail with any mail created followed by :admin and the plain master password
  4. adammazin

    adammazin New Member

    thank you for replying and helpful comments, you are right , i did edit the post
  5. adammazin

    adammazin New Member

    ya it work, test it by yourself
  6. recin

    recin Member

    I wanted to mean you could add this info in the original post, just to be sure that the postfix password is OK before start playing with ispconfig files.

    On the other hand, how could we keep this changes after ispconfig upgrades?
  7. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Use Internet Search Engines with
    Code: ispconfig conf-custom
    adammazin likes this.

Share This Page