🖥️mailq

➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the mailq command with important options and switches using examples.

▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁

#                ███╗   ███╗ █████╗ ██╗██╗      ██████╗ 
#                ████╗ ████║██╔══██╗██║██║     ██╔═══██╗
#                ██╔████╔██║███████║██║██║     ██║   ██║
#                ██║╚██╔╝██║██╔══██║██║██║     ██║▄▄ ██║
#                ██║ ╚═╝ ██║██║  ██║██║███████╗╚██████╔╝
#                ╚═╝     ╚═╝╚═╝  ╚═╝╚═╝╚══════╝ ╚══▀▀═╝ 
                                                       
                

#==============================#
# CMD MAILQ
#==============================##==============================#
lq -AC
# -Ac -Am These options are used by Sendmail for selecting configuration files and are ignored by Exim.#

mailq -Lq
#  -L <tag>  This option is equivalent to setting syslog_processname in the config file and setting log_file_path to syslog.  The  -q option starts one queue runner process. This scans the queue of waiting messages, and runs a delivery process for each one in turn.

mailq | awk '/^[0-9A-F]/{print $1}' | tr -d \* | xargs -n 1 postcat -q > mailq-20160801.txt
# Save your whole postfix queue to a file.'

mailq |grep " Jan 20 " |awk {'print $1'} |xargs -n 1 postsuper -d
# Delete messages from Jan 20th in the postfix queue.

mailq | grep " Dec 16 " | awk {'print $1'} | xargs -n 1 postsuper -d 
# Delete messages from Dec 16th in the postfix queue.

mailq | awk '/^[0-9A-F]+ .+ Dec 11 /{print $1}' | xargs -n 1 postsuper -d 
# Delete messages from Dec 11th in the postfix queue.

#==============================##==============================#
# CMD MAILQ
#==============================##==============================#
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

  █║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌

              ██╗ ██╗ ██████╗  ██████╗ ██╗  ██╗███████╗██████╗
             ████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
             ╚██╔═██╔╝██║  ██║██║   ██║ ╚███╔╝ █████╗  ██║  ██║
             ████████╗██║  ██║██║   ██║ ██╔██╗ ██╔══╝  ██║  ██║
             ╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
              ╚═╝ ╚═╝ ╚═════╝  ╚═════╝ ╚═╝  ╚═╝╚══════╝╚═════╝

               █║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌

░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░