ISPmail Admin

Documentation

Installation

  1. Requirements
    • Webserver: Any will do as long as PHP is supported. It must not even be on the same server as the mailserver database as long as it can access it.
    • PHP: 7.2 or newer (the mysqli extension is built in). I recommend the latest.
      Required extensions: BCMath extension
    • MariaDb: 5.1 or newer - or Mysql 5.6 or newer.
    • Write access to the database: The ISPmail guide rightfully limited the database user mailuser to readonly. ISPmail Admin naturally needs write access to the mailserver database.
    • Javascript and cookies:: The browser you intend to use ISPmail Admin with needs Javascript and cookies enabled.
  2. Prepare database user
    The ISPmail guide rightfully limited the database user mailuser to readonly. ISPmail Admin naturally needs write access to the mailserver database. So there are two possibilites: Grant write access to the mailuser (not recommended) or create a new user (e.g. mailadmin) with read/write access.
    • Method 1, recommended: Create user mailadmin with read/write access:
      Run the following SQL–commands on the database server:
      GRANT SELECT, UPDATE, INSERT, DELETE on `mailserver`.* TO 'mailadmin'@'127.0.0.1' IDENTIFIED BY 'password';
      FLUSH PRIVILEGES;
      SHOW GRANTS FOR 'mailadmin'@'127.0.0.1';
      The last should show that it has worked and is in effect.
    • Method 2: Grant write access to the mailuser:
      Run the following SQL–commands on the database server:
      GRANT SELECT, UPDATE, INSERT, DELETE on `mailserver`.* TO 'mailuser'@'127.0.0.1';
      FLUSH PRIVILEGES;
      SHOW GRANTS FOR 'mailadmin'@'127.0.0.1';
      The last should show that it has worked and is in effect.
  3. Download ISPmail Admin
  4. Extract the archive into an appropriate directory
  5. Modify cfg/config.inc.php:
    /**
    ** DATABASE ACCESS
    **/
    define('IMA_CFG_DB_HOST',     '127.0.0.1');
    define('IMA_CFG_DB_PORT',     '3306');
    /// optional, can be faster
    // define('IMA_CFG_DB_SOCKET',   '/path/to/database.socket');
    define('IMA_CFG_DB_USER',     'db_user');
    define('IMA_CFG_DB_PASSWORD', 'db_pass');
    define('IMA_CFG_DB_DATABASE', 'mailserver');
    
    /**
    ** ACCESS CONTROL
    ** uncomment the type you want to use.
    **/
    // define('IMA_CFG_LOGIN', IMA_LOGINTYPE_ACCOUNT);  
    // define('IMA_CFG_LOGIN', IMA_LOGINTYPE_ADM);  
    // define('IMA_CFG_LOGIN', IMA_LOGINTYPE_ADMAUTO);  
    
    /// Define the administrator's name and password.
    define('IMA_CFG_ADM_USER',  'admin_user');     // admin username
    define('IMA_CFG_ADM_PASS',  'admin_Pass');     // admin password
    
    /**
    ** PASSWORD HASHES
    ** Enable only *one* of the following
    **/
    define('IMA_CFG_USE_BCRYPT_HASHES', true);
    // define('IMA_CFG_USE_SHA256_HASHES', true);
    // define('IMA_CFG_USE_MD5_HASHES', true);
    
    /**
    ** QUOTAS
    **/
    /// true or false
    define('IMA_CFG_USE_QUOTAS', true);
    /// in bytes. 0 is unlimited, 1GB = 2^30 Bytes = 1073741824
    define('IMA_CFG_DEFAULT_QUOTA', 0);
    /// convenience for input field
    define('IMA_CFG_QUOTA_STEP', 1073741824);
    
    /**
    ** Enable Blacklist
    **/
    //define('IMA_SUPPORT_BLACKLIST', true);
    /**
    ** GUI
    ** Spread long lists on multiple pages.
    ** Set number of maximum entries per page.
    ** Changes take effect after login/logout.
    ** If not defined, defaults to 65535.
    **/
    // define('IMA_LIST_MAX_ENTRIES', 200);
    
    • Set the database access information (IMA_CFG_DB_ ...)
    • Set the ISPmail Admin access (login) type by uncommenting (remove the leading "//") the line with the method you want to use:
      • "define('IMA_CFG_LOGIN', IMA_LOGINTYPE_ACCOUNT)":
        Only one user will administrate ISPmail Admin but all users with an email–account may login (using their password) and manage aliases for their accounts.
      • "define('IMA_CFG_LOGIN', IMA_LOGINTYPE_ADM)":
        Only one user will use ISPmail Admin and that is the administrator.
      • "define('IMA_CFG_LOGIN', IMA_LOGINTYPE_ADMAUTO)":
        Same as above, but when you've protected ISPmail Admin behind a .htaccess username and password, another login is not really needed.
    • Set the ISPmail Admin administrative user and his password (IMA_CFG_ADM_ ...). Use a strong password, yes? Please?
  6. Add the database table for blacklist (if you enabled IMA_SUPPORT_BLACKLIST)
  7. CREATE TABLE `blacklist_email` (
      `id` bigint(20) UNSIGNED NOT NULL,
      `address` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
      `reason` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_nopad_ci;
    --
    -- Indexes for table `blacklist_email`
    --
    ALTER TABLE `blacklist_email`
      ADD PRIMARY KEY (`id`),
      ADD UNIQUE KEY `address` (`address`) USING BTREE;
    --
    -- AUTO_INCREMENT for table `blacklist_email`
    --
    ALTER TABLE `blacklist_email`
      MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;
    COMMIT;
    
  8. Open index.php in your browser