To restart postfix mail server : # postfix reload
Flush the mail queue : # postfix flush
Or you can use: # postfix -f
To see mail queue : # mailq
( in send mail sendmail -bp )
# mailq | wc -l (will give the total no of mails in queue )
To remove all mail from the queue : # postsuper -d ALL
To remove all mails in the deferred queue : # postsuper -d ALL deferred
To see the mails in a tree structure : # qshape
View the mail content : # postcat -q AFD4A228 37C
Sort by from address :
# mailq | awk '/^[0-9,A-F]/ {print $7}' | sort | uniq -c | sort -n
To remove all mails sent by user@adminlogs.info from the queue :
# mailq| grep '^[A-Z0-9]'|grep user@adminlogs.info|cut -f1 -d' ' |tr -d \*|postsuper -d -
Good article.Keep it up.
ReplyDelete