Thứ Năm, 3 tháng 12, 2015

Queue Postfix in zimbra

1.      Postfix, Amavis, ClamAV spool directory paths and Names
zimbra@mta2 ~]$ ls /opt/zimbra/data/
altermime  amavisd  cbpolicyd  clamav  dspam  postfix  sasl2  tmp

ls /opt/zimbra/data/postfix/spool/
active  bounce  corrupt  defer  deferred  flush  hold  incoming  maildrop  pid  private  public  saved  trace

2.      Stop and Starting Postfix and mta
Postfix stop
Postfix start

Để stop và start dịch vụ Postfix, amavis và clamav .
Từ quyền zimbra
Zmmtactl stop
Zmmtactl start

3.      To see the Postfix Queues
Từ quyền root gõ:
[root@mta2 ~]# /opt/zimbra/libexec/zmqstat
hold=28
corrupt=0
deferred=0
active=0
incoming=0
               [root@mta2 ~]#

Từ quyền zimbra
zimbra@mta2 ~]$ /opt/zimbra/postfix/sbin/postqueue -p
-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
B4F581016AD!   21611 Tue Dec  8 16:21:27  hungnp13@viettelpost.com.vn
                                         hungnp13@viettelpost.com.vn
CD3141014B1!   12178 Tue Dec  8 16:21:03  hungnp13@viettelpost.com.vn
                                         hungnp13@viettelpost.com.vn
368D1101684!   13895 Tue Dec  8 16:21:24  hungnp13@viettelpost.com.vn
                                         hungnp13@viettelpost.com.vn

Từ quyền zimbra
[zimbra@mta2 ~]$ mailq | more
-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
B4F581016AD!   21611 Tue Dec  8 16:21:27  hungnp13@viettelpost.com.vn
                                         hungnp13@viettelpost.com.vn
CD3141014B1!   12178 Tue Dec  8 16:21:03  hungnp13@viettelpost.com.vn
                                         hungnp13@viettelpost.com.vn

368D1101684!   13895 Tue Dec  8 16:21:24  hungnp13@viettelpost.com.vn
                                         hungnp13@viettelpost.com.vn
784EC10165E!   21529 Tue Dec  8 16:21:17  hungnp13@viettelpost.com.vn
                                         hungnp13@viettelpost.com.vn

4.      Qshape – Print Postfix queue domain and ade distribution
Từ quyền zimbra gõ:
[zimbra@mta2 ~]$ qshape
                                         T  5 10 20 40 80 160 320 640 1280 1280+
                                  TOTAL  0  0  0  0  0  0   0   0   0    0     0
[zimbra@mta2 ~]$ qshape active
                                         T  5 10 20 40 80 160 320 640 1280 1280+
                                  TOTAL  0  0  0  0  0  0   0   0   0    0     0
[zimbra@mta2 ~]$ qshape incomming
Can't stat incomming: No such file or directory
 at /opt/zimbra/postfix/sbin/qshape.pl line 375
                                         T  5 10 20 40 80 160 320 640 1280 1280+
                                  TOTAL  0  0  0  0  0  0   0   0   0    0     0
[zimbra@mta2 ~]$ qshape deferred
                                         T  5 10 20 40 80 160 320 640 1280 1280+
                                  TOTAL  0  0  0  0  0  0   0   0   0    0     0
[zimbra@mta2 ~]$ qshape held
Can't stat held: No such file or directory
 at /opt/zimbra/postfix/sbin/qshape.pl line 375
                                         T  5 10 20 40 80 160 320 640 1280 1280+
                                  TOTAL  0  0  0  0  0  0   0   0   0    0     0
[zimbra@mta2 ~]$ qshape -s hold | head
                                         T  5 10 20 40 80 160 320 640 1280 1280+
                                  TOTAL 28  0  0  0  0 28   0   0   0    0     0
                     viettelpost.com.vn 28  0  0  0  0 28   0   0   0    0     0
[zimbra@mta2 ~]$

5.      To view a message in the queue
Để xem tin nhắn sử dụng postcat :
/opt/zimbra/postfix/sbin/postcat -q EC753D0D00

Hoặc cùng với nhiều thông tin sử dụng tùy chọn qv
/opt/zimbra/postfix/sbin/postcat -qv EC753D0D00

6.      To flush Postfix queue
/opt/zimbra/postfix/sbin/postqueue -f

7.      To requeue message in Postfix
/opt/zimbra/postfix/sbin/postsuper -r ALL

8.      To put message on hold
Nếu kí tự “*” là kí tự tiếp theo của queue ID, EC753D0D00*, nó có nghĩa là user này nằm trong mail active
Nếu kí tự “!” là kí tự tiếp theo của queue ID, EC753D0D00!, nó có nghĩa là đã put đến hold.
Để put một message đến hold,
/opt/zimbra/postfix/sbin/postsuper -h EC753D0D00

Để put trên hold message từ một tài khoản user@domain
/opt/zimbra/postfix/sbin/postqueue -p | awk ‘BEGIN { RS = “” } { if ($7 == “user@domain.com” ) print $1 }’ | tr -d ‘!*’ | postsuper -h
Để put tất cả tin nhắn đến hold
/opt/zimbra/postfix/sbin/postsuper -h ALL
postsuper: Placed on hold: 6 messages

9.      To delete message from queue


10.  To delete single message from queues
/opt/zimbra/postfix/sbin/postsuper -d [MSGID From postqueue -p]

11.  To delete ALL message from queues
/opt/zimbra/postfix/sbin/postsuper -d ALL

     Có một cách khác là:
     
mailq | awk '{print $1}' | postsuper -d -

12.  To delete ALL from the feferred queue
/opt/zimbra/postfix/sbin/postsuper -d ALL deferred

13.  To delete All message From the Hold queue
/opt/zimbra/postfix/sbin/postsuper -d ALL hold

14.  To delete many message from queues
/opt/zimbra/postfix/sbin/postsuper -d - < filename-with-queue-ids.txt

Tập tin như sau:
3E1C6CAFFFE
6B862CC9D76
0BC38CC1BC9
90628CC6F3C
E26B9CC3C62
92A35CC943D
A84BDBCE15D
EA57CB1DF04
0F102CC74CB
386E8CC4DFF
92606CC0BDA
0799FC8149A
024CFCBD0DE
2D30FC47DA0
31D85CC6308
B8B3FC3DEBC
AA4C7C913D0
280F5CC8C6C
9F341CC8A26
93CD1B3B0EC
433D0BF3716
A1435CB4C38
2DB04CC911D
56A29CC8819
11881C8268C
5C050A79851
C6739CC4BA5
11D3FCC7D09
8CBC0B20E0A

15.  Delete from queue by Email address
Bằng CLI (Command Lind Interface)



Không có nhận xét nào:

Đăng nhận xét