1

Topic: Missing tables

==== Required information ====
- iRedMail version (check /etc/iredmail-release):  Iredadmin v0.4.2 (MySQL)
- Linux/BSD distribution name and version: centos 7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): mysql
- Web server (Apache or Nginx): apache 2.4.6
- Manage mail accounts with iRedAdmin-Pro? no
- Related log if you're reporting an issue:
====

When I click on Iredadmin - > Admins I get this error
Error: (1054, "Unknown column 'name' in 'field list'")

----

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

2

Re: Missing tables

Could you please show me output of below SQL commands?

sql> USE vmail;
sql> DESC admin;
sql> DESC mailbox;

3

Re: Missing tables

MariaDB [vmail]> DESC admin;
+------------+--------------+------+-----+---------------------+-------+
| Field      | Type         | Null | Key | Default             | Extra |
+------------+--------------+------+-----+---------------------+-------+
| username   | varchar(255) | NO   |     | NULL                |       |
| password   | varchar(255) | NO   |     | NULL                |       |
| superadmin | tinyint(1)   | NO   |     | 0                   |       |
| created    | datetime     | NO   |     | 0000-00-00 00:00:00 |       |
| modified   | datetime     | NO   |     | 0000-00-00 00:00:00 |       |
| active     | tinyint(1)   | NO   |     | 1                   |       |
+------------+--------------+------+-----+---------------------+-------+


MariaDB [vmail]>  DESC mailbox;
+--------------------------+-----------------+------+-----+---------------------+-------+
| Field                    | Type            | Null | Key | Default             | Extra |
+--------------------------+-----------------+------+-----+---------------------+-------+
| username                 | varchar(255)    | NO   | PRI | NULL                |       |
| password                 | varchar(255)    | NO   |     | NULL                |       |
| name                     | varchar(255)    | NO   |     | NULL                |       |
| language                 | varchar(5)      | NO   |     |                     |       |
| storagebasedirectory     | varchar(255)    | NO   |     | /var/vmail          |       |
| storagenode              | varchar(255)    | NO   |     | vmail1              |       |
| maildir                  | varchar(255)    | NO   |     | NULL                |       |
| quota                    | bigint(20)      | NO   |     | 0                   |       |
| domain                   | varchar(255)    | NO   | MUL | NULL                |       |
| transport                | varchar(255)    | NO   |     |                     |       |
| department               | varchar(255)    | NO   | MUL |                     |       |
| rank                     | varchar(255)    | NO   |     | normal              |       |
| employeeid               | varchar(255)    | YES  | MUL |                     |       |
| isadmin                  | tinyint(1)      | NO   | MUL | 0                   |       |
| isglobaladmin            | tinyint(1)      | NO   | MUL | 0                   |       |
| enablesmtp               | tinyint(1)      | NO   | MUL | 1                   |       |
| enablesmtpsecured        | tinyint(1)      | NO   | MUL | 1                   |       |
| enablepop3               | tinyint(1)      | NO   | MUL | 1                   |       |
| enablepop3secured        | tinyint(1)      | NO   | MUL | 1                   |       |
| enableimap               | tinyint(1)      | NO   | MUL | 1                   |       |
| enableimapsecured        | tinyint(1)      | NO   | MUL | 1                   |       |
| enabledeliver            | tinyint(1)      | NO   | MUL | 1                   |       |
| enablelda                | tinyint(1)      | NO   | MUL | 1                   |       |
| enablemanagesieve        | tinyint(1)      | NO   | MUL | 1                   |       |
| enablemanagesievesecured | tinyint(1)      | NO   | MUL | 1                   |       |
| enablesieve              | tinyint(1)      | NO   | MUL | 1                   |       |
| enablesievesecured       | tinyint(1)      | NO   | MUL | 1                   |       |
| enableinternal           | tinyint(1)      | NO   | MUL | 1                   |       |
| enabledoveadm            | tinyint(1)      | NO   | MUL | 1                   |       |
| enablelib-storage        | tinyint(1)      | NO   | MUL | 1                   |       |
| enableindexer-worker     | tinyint(1)      | NO   | MUL | 1                   |       |
| enablelmtp               | tinyint(1)      | NO   | MUL | 1                   |       |
| enabledsync              | tinyint(1)      | NO   | MUL | 1                   |       |
| allow_nets               | text            | YES  |     | NULL                |       |
| lastlogindate            | datetime        | NO   |     | 0000-00-00 00:00:00 |       |
| lastloginipv4            | int(4) unsigned | NO   |     | 0                   |       |
| lastloginprotocol        | char(255)       | NO   |     |                     |       |
| disclaimer               | text            | YES  |     | NULL                |       |
| allowedsenders           | text            | YES  |     | NULL                |       |
| rejectedsenders          | text            | YES  |     | NULL                |       |
| allowedrecipients        | text            | YES  |     | NULL                |       |
| rejectedrecipients       | text            | YES  |     | NULL                |       |
| settings                 | text            | YES  |     | NULL                |       |
| passwordlastchange       | datetime        | NO   | MUL | 0000-00-00 00:00:00 |       |
| created                  | datetime        | NO   |     | 0000-00-00 00:00:00 |       |
| modified                 | datetime        | NO   |     | 0000-00-00 00:00:00 |       |
| expired                  | datetime        | NO   | MUL | 9999-12-31 00:00:00 |       |
| active                   | tinyint(1)      | NO   | MUL | 1                   |       |
| local_part               | varchar(255)    | NO   |     | NULL                |       |
+--------------------------+-----------------+------+-----+---------------------

4

Re: Missing tables

This is default SQL structure for `vmail.admin` table, i wonder why yours is different.

CREATE TABLE IF NOT EXISTS admin (                                              
    username VARCHAR(255) NOT NULL DEFAULT '',                                  
    password VARCHAR(255) NOT NULL DEFAULT '',                                  
    name VARCHAR(255) NOT NULL DEFAULT '',                                      
    language VARCHAR(5) NOT NULL DEFAULT '',                                    
    passwordlastchange DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',         
    -- Store per-admin settings. Used in iRedAdmin-Pro.                         
    settings TEXT,                                                              
    created DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',                    
    modified DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',                   
    expired DATETIME NOT NULL DEFAULT '9999-12-31 00:00:00',                    
    active TINYINT(1) NOT NULL DEFAULT 1,                                       
    PRIMARY KEY (username),                                                     
    INDEX (passwordlastchange),                                                 
    INDEX (expired),                                                            
    INDEX (active)                                                              
) ENGINE=MyISAM;

5

Re: Missing tables

Don't know I mess something obvious. Can I repair this table?
If I delete it, admin account will be gone.

6

Re: Missing tables

You can create this table with above structure, then insert sql record to create new admin account.

7

Re: Missing tables

It works now, thank you!