Author Topic: Postfix Mail Server commands  (Read 29950 times)

0 Members and 1 Guest are viewing this topic.

Postfix Mail Server commands
« on: March 27, 2014, 10:12:09 PM »
Some useful postfix commands
postqueue -p = mailq    //postqueue -p is the same as mailq

service postfix reload    //reload config
service postfix restart   //restart postfix server

postconf  mail_version      //View the postfix version
postconf -d     //Show default postfix values
postconf -n     //Show non default postfix values

mailq     //list mail queue and MAIL_ID's, list mail queue
postqueue -p //list mail queue and MAIL_ID's, list mail queue
postfix  flush   // flush mail queue
postqueue -f    //process the queue now
postcat -q MAIL_ID     //read email from mail queue

postsuper -d MAIL_ID       //To remove MAIL_ID mail from the queue
postsuper -d ALL       //To remove all mail from the queue
postsuper -d ALL deferred        //To remove all mails in the deferred queue

postqueue -p | awk '/^[0-9,A-F]/ {print $7}' | sort | uniq -c | sort -n           //sort and count emails by "from address"

postqueue -p | grep '^[A-Z0-9]'|grep|cut -f1 -d' ' |tr -d \*|postsuper -d -          //removing all emails sent by:

postqueue -p | awk '/^[0-9,A-F].* / {print $1}' | cut -d '!' -f 1 | postsuper -d -      //remove all email sent from

To delete all messages from the queue by a certain user:
for i in `postqueue -p | grep | awk '{print $1}' | grep -v host | grep -v \*`; do postsuper -d $i; done

postqueue -p | grep '^[A-Z0-9]'|grep|cut -f1 -d' ' |tr -d \*|postsuper -d -      //remove all email sent by domain

postqueue -p | tail -n 1   //Mail queue stats short
postqueue -p | grep -c "^[A-Z0-9]"    //number of emails in Mail queue

tail -f /var/log/maillog    //watch logs live
« Last Edit: February 26, 2015, 04:51:41 PM by Administrator »
AntiDDoS Protection (web + mail)

Join our Development Team and get paid !

Services Monitoring & RBL Monitoring

Do you need Fast and FREE Support included for your CWP linux server?
Installation Instructions
Get Fast Support Here

Re: Postfix Mail Server commands
« Reply #1 on: April 13, 2019, 06:33:45 AM »
Where I can see the list email just to sent. I find in my WHM but I can not see. Help meee