Postfixadmin on iredmail with mysql backend

iredmail is very useful as even though I have set up mail servers myself I tend to struggle with it and then feel it is probably less than secure / optimal.

iredmail used to come with postfixadmin as an option , then there were some instructions on adding it, but for the last couple of years the instructions no longer work fully. postfixadmin does what I need but the free iredadmin is lacking some needed (by me) features. The pro version is very expensive and has way more features than I need.

Shame there’s not a ‘semi pro’ at a better price then I might pay for it.

Currently the below works on iredmail 0.8.4

———————————————————–

Install and setup postfixadmin as detailed here  (But outdated)

Important bit – Add to database vmail.

CREATE TABLE IF NOT EXISTS log (
    TIMESTAMP DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
    username VARCHAR(255) NOT NULL DEFAULT '',
    domain VARCHAR(255) NOT NULL DEFAULT '',
    action VARCHAR(255) NOT NULL DEFAULT '',
    data VARCHAR(255) NOT NULL DEFAULT '',
    KEY TIMESTAMP (TIMESTAMP)
) ENGINE=MyISAM;
 
CREATE TABLE IF NOT EXISTS vacation (
    email VARCHAR(255) NOT NULL DEFAULT '',
    subject VARCHAR(255) NOT NULL DEFAULT '',
    body TEXT NOT NULL,
    cache TEXT NOT NULL,
    domain VARCHAR(255) NOT NULL DEFAULT '',
    created DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
    modified DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
    active TINYINT(4) NOT NULL DEFAULT '1',
    PRIMARY KEY (email),
    KEY email (email)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
 
CREATE TABLE IF NOT EXISTS vacation_notification (
    on_vacation VARCHAR(255) NOT NULL,
    notified VARCHAR(255) NOT NULL,
    notified_at TIMESTAMP NOT NULL DEFAULT now(),
    CONSTRAINT vacation_notification_pkey PRIMARY KEY(on_vacation, notified),
    FOREIGN KEY (on_vacation) REFERENCES vacation(email) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

create config.local.php in the postfixadmin root dir and put the following making sure to change the password

 
<?php
// Basic configuration.
$CONF['configured'] = true;
$CONF['postfix_admin_url'] = "/postfixadmin";
$CONF['default_language'] = "en";
$CONF['database_type'] = "mysqli";
$CONF['database_host'] = "localhost";
$CONF['database_user'] = "vmailadmin";
$CONF['database_password'] = "PASSWORD"; # <- REPLACE THIS PASSWORD.
$CONF['database_name'] = "vmail";
$CONF['smtp_server'] = "127.0.0.1";
 
$CONF['domain_path'] = "YES";
$CONF['domain_in_mailbox'] = "NO";
$CONF['quota'] = "YES";
$CONF['quota_multiplier'] = 1;
$CONF['transport'] = "YES";
$CONF['transport_options'] = array ('dovecot', 'virtual', 'local', 'relay');
$CONF['transport_default'] = "dovecot";
 
// Enable alias domain.
$CONF['alias_domain'] = 'YES';
 
// Disable features we don't have.
$CONF['backup'] = "NO";
$CONF['fetchmail'] = "NO";
$CONF['sendmail'] = "NO";
$CONF['show_footer_text'] = "NO";
$CONF['emailcheck_resolve_domain'] = "NO";
 
// Disable PostfixAdmin style vacation. We use managesieve service instead.
$CONF['vacation_control'] = "NO";
$CONF['vacation_control_admin'] = "NO";
$CONF['admin_email'] = "www@example.com";
$CONF['database_tables'] = array (
    'admin' => 'admin',
    'alias' => 'alias',
    'alias_domain' => 'alias_domain',
    'config' => 'config',
    'domain' => 'domain',
    'domain_admins' => 'domain_admins',
    'fetchmail' => 'fetchmail',
    'log' => 'log',
    'mailbox' => 'mailbox',
    'vacation' => 'vacation',
    'vacation_notification' => 'vacation_notification',
    'quota' => 'used_quota',
    'quota2' => 'mailbox',
);
 
?>

Finally postfixadmin expects the admin details to be in the vmail -> admin table but iredmail stores the details of the first admin only in the mailbox table.
You can either create a new admin in the iredadmin web app or manually create the entries in the admin table (username , password will do copied from mailbox table)

2 thoughts on “Postfixadmin on iredmail with mysql backend

  1. thanks for this! the only feature I need is to search for mailboxes in iredadmin,so $200 annual fee is a nonsence..

Leave a Reply

Your email address will not be published. Required fields are marked *

Are we human, or are we dancers ? *