今天早上在郵件服務器上添加新用戶時顯示配額已滿添加用戶失敗等信息;趕快登錄服務器進行排查啊,首先簡單介紹一下咱們的環境Centos 6.4+Apache+postfix+mysql(其實我也不太清楚,由於不是我來搭建的。嘿嘿)如下爲一個菜鳥排查錯誤思路過程:mysql
突破口一、使用df -h 查看磁盤空間是否正常web
[root@mail ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/sda3 30G 6.4G 22G 23% / tmpfs 947M 0 947M 0% /dev/shm /dev/sda1 194M 20M 165M 11% /boot
經過查看結果顯示磁盤空間還有不少。sql
突破口二、而後查看服務器日誌:數據庫
[root@mail ~]#tail /var/log/messages Mar 7 09:25:58 localhost postfix/smtpd[11886]: auxpropfunc error no mechanism available Mar 7 09:27:46 localhost postfix/smtpd[13245]: auxpropfunc error invalid parameter supplied Mar 7 09:27:46 localhost postfix/smtpd[13245]: sql_select option missing Mar 7 09:27:46 localhost postfix/smtpd[13245]: auxpropfunc error no mechanism available Mar 7 09:31:40 localhost postfix/smtpd[16724]: auxpropfunc error invalid parameter supplied Mar 7 09:31:40 localhost postfix/smtpd[16724]: sql_select option missing Mar 7 09:31:40 localhost postfix/smtpd[16724]: auxpropfunc error no mechanism available Mar 7 09:35:03 localhost postfix/smtpd[19464]: auxpropfunc error invalid parameter supplied Mar 7 09:35:03 localhost postfix/smtpd[19464]: sql_select option missing Mar 7 09:35:03 localhost postfix/smtpd[19464]: auxpropfunc error no mechanism available
經過日誌查看顯示:沒有關於配額已滿的錯誤。
apache
突破口三、查看並編輯更改配置文件vim
[root@mail ~]# vim /etc/postfix/main.cf mime_header_checks= regexp:/etc/postfix/mime_header_checks mailbox_size_limit = 512000000 #郵件大小權限 message_size_limit = 20480000 #信息大小權限 ###筆者假想多是這裏的配額有點小,就將這裏的默認大小更改爲了### [root@mail ~]# vim /etc/pos##tfix/main.cf mime_header_checks= regexp:/etc/postfix/mime_header_checks mailbox_size_limit = 1024000000 message_size_limit = 40960000
重啓服務
bash
[root@mail small.com]# /etc/init.d/courier-authlib restart #認證模塊的加載 Stopping Courier authentication services: authdaemond Starting Courier authentication services: authdaemond [root@mail small.com]# /etc/init.d/courier-imap restart pop三、imap #服務模塊的重啓 Stopping Courier-IMAP server: imap imap-ssl pop3 pop3-ssl Starting Courier-IMAP server: imap imap-ssl pop3 pop3-ssl [root@mail small.com]# /etc/init.d/saslauthd restart #saslauthd認證模塊的從新加載 Stopping saslauthd: [ OK ] Starting saslauthd: [ OK ] [root@mail small.com]# /etc/init.d/httpd restart #apache服務器重啓,頁面的從新加載 Stopping httpd: [ OK ] Starting httpd: [ OK ] [root@mail small.com]# /etc/init.d/postfix restart 郵件服務器的重啓 Shutting down postfix: [ OK ] Starting postfix: [ OK ] [root@mail small.com]# vim /etc/postfix/main.cf [root@mail small.com]# /etc/init.d/postfix restart Shutting down postfix: [ OK ] Starting postfix: [ OK ]
重啓登錄頁面添加用戶發現仍是沒法添加,仍是一樣的錯誤,從而說明不是此權限限制的問題。仔細想了一下多是數據庫的問題
服務器
突破口四、進入數據庫查看數據庫的參數設定dom
[root@mail small.com]# mysql -p123456 mysql> show databases; #查看全部表 +--------------------+ | Database | +--------------------+ | information_schema | | extmail | | mysql | | test | +--------------------+ 4 rows in set (0.13 sec) mysql> use extmail #指定郵件數據表 Database changed mysql> show tables; #查看全部表 +-------------------+ | Tables_in_extmail | +-------------------+ | alias | | domain | | domain_manager | | mailbox | | manager | +-------------------+ 5 rows in set (0.01 sec) mysql> desc domain; +----------------------+--------------+------+-----+---------------------+-------+ | Field | Type | Null | Key | Default | Extra | +----------------------+--------------+------+-----+---------------------+-------+ | domain | varchar(255) | NO | PRI | | | | description | varchar(255) | NO | | | | | hashdirpath | varchar(255) | NO | | | | | maxalias | int(10) | NO | | 0 | | | maxusers | int(10) | NO | | 0 | | | maxquota | varchar(16) | NO | | 0 | | | maxnetdiskquota | varchar(16) | NO | | 0 | | | transport | varchar(255) | YES | | NULL | | | can_signup | tinyint(1) | NO | | 0 | | | default_quota | varchar(255) | YES | | NULL | | | default_netdiskquota | varchar(255) | YES | | NULL | | | default_expire | varchar(12) | YES | | NULL | | | disablesmtpd | smallint(1) | YES | | NULL | | | disablesmtp | smallint(1) | YES | | NULL | | | disablewebmail | smallint(1) | YES | | NULL | | | disablenetdisk | smallint(1) | YES | | NULL | | | disableimap | smallint(1) | YES | | NULL | | | disablepop3 | smallint(1) | YES | | NULL | | | createdate | datetime | NO | | 0000-00-00 00:00:00 | | | expiredate | date | NO | | 0000-00-00 | | | active | tinyint(1) | NO | | 1 | | +----------------------+--------------+------+-----+---------------------+-------+ 21 rows in set (0.01 sec) mysql> select * from domain\G; *************************** 1. row *************************** domain: email.org description: virtualDomain for extmail.org hashdirpath: A0/B0 maxalias: 50 maxusers: 50 maxquota: 1073741824 maxnetdiskquota: 1073741824 transport: NULL can_signup: 1 default_quota: 5242880 default_netdiskquota: 5242880 default_expire: 1y disablesmtpd: 0 disablesmtp: 0 disablewebmail: 0 disablenetdisk: 0 disableimap: 1 disablepop3: 0 createdate: 2007-02-14 15:10:04 expiredate: 2010-11-08 active: 0 *************************** 2. row *************************** domain: luck.com description: luck.com hashdirpath: maxalias: 100 maxusers: 200 maxquota: 15728640000S maxnetdiskquota: 524288000S transport: can_signup: 0 default_quota: 5242880S default_netdiskquota: 5242880S default_expire: 1y disablesmtpd: 0 disablesmtp: 0 disablewebmail: 0 disablenetdisk: 0 disableimap: 1 disablepop3: 0 createdate: 2013-08-22 21:14:17 expiredate: 0000-00-00 active: 0 *************************** 3. row *************************** domain: small.com description: small.com hashdirpath: maxalias: 100 maxusers: 200 maxquota: 15728640000S #最大配額 maxnetdiskquota: 5242880000S transport: can_signup: 0 default_quota: 104857600S default_netdiskquota: 5242880S default_expire: 10y disablesmtpd: 0 disablesmtp: 0 disablewebmail: 0 disablenetdisk: 0 disableimap: 0 disablepop3: 0 createdate: 2013-08-23 00:59:55 expiredate: 0000-00-00 active: 1 3 rows in set (0.00 sec) [root@mail small.com]# mysqldump -xR -p123456. extmail > /tmp/extmail_20140328.sql #備份數據庫 [root@mail small.com]# ls /tmp/extmail_20140328.sql #查看備份狀態 /tmp/extmail_20140328.sql [root@mail small.com]# mysql -p123456 #登錄mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 823051 Server version: 5.1.69-log Source distribution Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> use extmail Database changed mysql> update domain set maxquota='31457280000S'; #更改參數使其配額更大 Query OK, 3 rows affected (0.00 sec) Rows matched: 3 Changed: 3 Warnings: 0 mysql> quit #退出服務器
登錄頁面添加用戶,添加成功,郵件服務器添加用戶的錯誤修復完成。
ide