Install libpostfix-parse-mailq-perl by entering the following commands in the terminal:
sudo apt update sudo apt install libpostfix-parse-mailq-perl
module to parse the postfix mail queue
Postfix::Parse::Mailq is a Perl module that reads the output of Postfix's mailq command and returns the contents of the queue as an arrayref. Each record is then reported as a hashref.