Christian Heidingsfelder
2013-01-18
Hi all and thanks for reading in advance ,,,
weird scenario.
If i do a show tables on my Postfix db i get the following:
mysql> SHOW TABLES from postfix;
+---------------+
| Tables_in_postfix |
+---------------+
| admin |
| alias |
| awl |
| bayes_expire |
| bayes_global_vars |
| bayes_seen |
| bayes_token |
| bayes_vars |
| config |
| domain |
| domain_admins |
| dspam_preferences |
| dspam_signature_data |
| dspam_stats |
| dspam_token_data |
| fetchmail |
| log |
| mailbox |
| vacation |
| vacation_notification |
+---------------+
20 rows in set (0.00 sec)
If i do a table status i get the following :
mysql> SHOW TABLE STATUS from postfix;
+---------------+-----+------+--------+----+-----------+---------+------------+---------+-------+-----------+--------------+--------------+--------------+-----------+-------+-------------------------+-----------------------+
| Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time | Update_time | Check_time | Collation | Checksum | Create_options | Comment |
+---------------+-----+------+--------+----+-----------+---------+------------+---------+-------+-----------+--------------+--------------+--------------+-----------+-------+-------------------------+-----------------------+
| admin | MyISAM | 10 | Dynamic | 7 | 73 | 516 | 281474976710655 | 5120 | 0 | NULL | 2008-11-01 17:02:41 | 2013-01-18 15:46:07 | 2013-01-18 15:46:07 | utf8_general_ci | NULL | | Postfix Admin - Virtual Admins |
| alias | MyISAM | 10 | Dynamic | 348 | 90 | 31336 | 281474976710655 | 17408 | 0 | NULL | 2008-11-01 17:02:41 | 2013-01-18 15:46:07 | 2013-01-18 15:46:07 | utf8_general_ci | NULL | | Postfix Admin - Virtual Aliases |
| awl | MyISAM | 10 | Dynamic | 0 | 0 | 0 | 281474976710655 | 1024 | 0 | NULL | 2008-05-29 14:33:40 | 2013-01-18 15:46:07 | 2013-01-18 15:46:07 | utf8_general_ci | NULL | | |
| bayes_expire | MyISAM | 10 | Fixed | 0 | 0 | 0 | 2533274790395903 | 1024 | 0 | NULL | 2008-05-29 14:33:40 | 2013-01-18 15:46:07 | 2013-01-18 15:46:07 | utf8_general_ci | NULL | | |
| bayes_global_vars | MyISAM | 10 | Dynamic | 1 | 20 | 20 | 281474976710655 | 2048 | 0 | NULL | 2008-05-29 14:33:40 | 2013-01-18 15:46:07 | 2013-01-18 15:46:07 | utf8_general_ci | NULL | | |
| bayes_seen | MyISAM | 10 | Dynamic | 0 | 0 | 0 | 281474976710655 | 1024 | 0 | NULL | 2008-05-29 14:33:40 | 2013-01-18 15:46:07 | 2013-01-18 15:46:07 | utf8_general_ci | NULL | | |
| bayes_token | MyISAM | 10 | Fixed | 0 | 0 | 0 | 9007199254740991 | 1024 | 0 | NULL | 2008-05-29 14:33:40 | 2013-01-18 15:46:07 | 2013-01-18 15:46:07 | utf8_general_ci | NULL | | |
| bayes_vars | MyISAM | 10 | Dynamic | 0 | 0 | 0 | 281474976710655 | 1024 | 0 | 1 | 2008-05-29 14:33:40 | 2013-01-18 15:46:07 | 2013-01-18 15:46:07 | utf8_general_ci | NULL | | |
| config | MyISAM | 10 | Dynamic | 1 | 20 | 20 | 281474976710655 | 3072 | 0 | 2 | 2008-11-01 17:02:41 | 2013-01-18 15:46:07 | 2013-01-18 15:46:07 | utf8_general_ci | NULL | | PostfixAdmin settings |
| domain | MyISAM | 10 | Dynamic | 58 | 60 | 3484 | 281474976710655 | 5120 | 0 | NULL | 2008-11-01 17:02:41 | 2013-01-18 15:46:07 | 2013-01-18 15:46:07 | utf8_general_ci | NULL | | Postfix Admin - Virtual Domains |
| domain_admins | MyISAM | 10 | Dynamic | 8 | 45 | 360 | 281474976710655 | 5120 | 0 | NULL | 2008-05-29 13:16:37 | 2013-01-18 15:46:07 | 2013-01-18 15:46:07 | utf8_general_ci | NULL | | Postfix Admin - Domain Admins |
| dspam_preferences | MyISAM | 10 | Dynamic | 0 | 0 | 0 | 281474976710655 | 1024 | 0 | NULL | 2008-05-29 15:05:24 | 2013-01-18 15:46:07 | 2013-01-18 15:46:07 | utf8_general_ci | NULL | | |
| dspam_signature_data | MyISAM | 10 | Dynamic | 0 | 0 | 0 | 1099511627775 | 1024 | 0 | NULL | 2008-05-29 15:05:24 | 2013-01-18 15:46:07 | 2013-01-18 15:46:07 | utf8_general_ci | NULL | max_rows=2500000 avg_row_length=8096 | |
| dspam_stats | MyISAM | 10 | Fixed | 1 | 35 | 35 | 9851624184872959 | 2048 | 0 | NULL | 2008-05-29 15:05:24 | 2013-01-18 15:46:07 | 2013-01-18 15:46:07 | utf8_general_ci | NULL | | |
| dspam_token_data | MyISAM | 10 | Fixed | 0 | 0 | 0 | 6192449487634431 | 1024 | 0 | NULL | 2008-05-29 15:05:24 | 2013-01-18 15:46:07 | 2013-01-18 15:46:07 | utf8_general_ci | NULL | pack_keys=1 | |
| fetchmail | MyISAM | 10 | Dynamic | 1 | 92 | 92 | 281474976710655 | 2048 | 0 | 2 | 2008-11-01 17:02:41 | 2013-01-18 15:46:07 | 2013-01-18 15:46:07 | utf8_general_ci | NULL | | |
| log | MyISAM | 10 | Dynamic | 676 | 110 | 74840 | 281474976710655 | 12288 | 0 | NULL | 2008-05-29 13:16:37 | 2013-01-18 15:46:07 | 2013-01-18 15:46:07 | utf8_general_ci | NULL | | Postfix Admin - Log |
| mailbox | MyISAM | 10 | Dynamic | 82 | 123 | 10164 | 281474976710655 | 5120 | 0 | NULL | 2008-11-01 17:02:41 | 2013-01-18 15:46:07 | 2013-01-18 15:46:07 | utf8_general_ci | NULL | | Postfix Admin - Virtual Mailboxes |
+---------------+-----+------+--------+----+-----------+---------+------------+---------+-------+-----------+--------------+--------------+--------------+-----------+-------+-------------------------+-----------------------+
18 rows in set (0.00 sec)
The Postfix admin gives me an error .. if i delete a domain in example.
phpmyadmin shows (20) as the number of tables in db postfix , but it shows only 18
if i try to create table vacation in postfix, it says .. error table exists….
Well .. i am confused .. :-)
Someone an idea
Regards Chris
Christian Boltz
2013-01-18
What's the result of
check table vacation;
check table vacation_notification;
I'd guess those tables are somehow broken. You might need to drop and re-create them.
Christian Heidingsfelder
2013-01-18
mysql> check table vacation;
+------------+-----+-------+---------------------------+
| Table | Op | Msg_type | Msg_text |
+------------+-----+-------+---------------------------+
| postfix.vacation | check | Error | Table 'postfix.vacation' doesn't exist |
| postfix.vacation | check | error | Corrupt |
+------------+-----+-------+---------------------------+
2 rows in set (0.00 sec)
mysql> check table vacation_notification;
+---------------------+-----+-------+-----------------------------------+
| Table | Op | Msg_type | Msg_text |
+---------------------+-----+-------+-----------------------------------+
| postfix.vacation_notification | check | Error | Table 'postfix.vacation_notification' doesn't exist |
| postfix.vacation_notification | check | error | Corrupt |
+---------------------+-----+-------+-----------------------------------+
2 rows in set (0.00 sec)
Christian Boltz
2013-01-18
Try
repair table vacation;
repair table vacation_notification;
If this doesn't fix it (check with check table again), drop those tables and re-create them.
If even dropping the table doesn't work, you might have to do it on the filesystem level. In this case, show the output of "ls -l /var/lib/mysql/postfix/vacation*". (Basically you have to stop MySQL and then delete those files. If unsure, ask before deleting anything.)
Assuming you are using PostfixAdmin 2.3.6, use this to re-create the tables:
CREATE TABLE `vacation` ( `email` varchar(255) NOT NULL, `subject` varchar(255) CHARACTER SET utf8 NOT NULL, `body` text CHARACTER SET utf8 NOT NULL, `cache` text NOT NULL, `domain` varchar(255) NOT NULL, `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `active` tinyint(1) NOT NULL DEFAULT '1', PRIMARY KEY (`email`), KEY `email` (`email`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Postfix Admin - Virtual Vacation' CREATE TABLE `vacation_notification` ( `on_vacation` varchar(255) CHARACTER SET latin1 NOT NULL, `notified` varchar(255) CHARACTER SET latin1 COLLATE latin1_german1_ci NOT NULL, `notified_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`on_vacation`,`notified`), CONSTRAINT `vacation_notification_pkey` FOREIGN KEY (`on_vacation`) REFERENCES `vacation` (`email`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Postfix Admin - Virtual Vacation Notifications'
Note: You (obviously) will loose all vacation settings by doing this. Restore them from your backup (sqldump) or re-add them manually in PostfixAdmin.
Christian Heidingsfelder
2013-01-18
mysql> repair table vacation;
+------------+-----+-------+---------------------------+
| Table | Op | Msg_type | Msg_text |
+------------+-----+-------+---------------------------+
| postfix.vacation | repair | Error | Table 'postfix.vacation' doesn't exist |
| postfix.vacation | repair | error | Corrupt |
+------------+-----+-------+---------------------------+
2 rows in set (0.00 sec)
mysql> check table vacation;
+------------+-----+-------+---------------------------+
| Table | Op | Msg_type | Msg_text |
+------------+-----+-------+---------------------------+
| postfix.vacation | check | Error | Table 'postfix.vacation' doesn't exist |
| postfix.vacation | check | error | Corrupt |
+------------+-----+-------+---------------------------+
2 rows in set (0.00 sec)
So no change at all .
I Use
Postfix Admin 2.2.1.1
Christian Boltz
2013-01-18
This means you should delete the broken tables and re-create them.
To delete the tables, use
drop table vacation;
drop table vacation_notification;
Then re-create both tables - IIRC 2.2.2.1 comes with a *.sql file - search for "create table vacation" in it. You'll also have to restore the vacation settings of your users.
BTW: 2.2.2.1 is very old. I highly recommend to upgrade to 2.3.6 - but please fix the database issues first.