mailq Command in Linux with Examples Last Updated : 22 Oct, 2024 Comments Improve Suggest changes Like Article Like Report mailq i.e. "mail-queue", this command in Linux prints the mail queue i.e. the list of messages that are there in the mail queue. You should have a mail-server setup on your Linux machine, to use this command, there are ways i.e MTA's(Mail Transfer agent) you can use like sendmail which uses the service smtp. The output of mailq command is similar to the sendmail -bp command that also prints the mail queue. Syntaxmailq [options]The most commonly used options include -v for verbose mode, which provides more detailed information such as message priority.Practical Examples of the mailq CommandExample 1: maliq without any optionSimply prints the messages in the mail queue.$ mailqOutput Mail Queue (1 request)---QID---- --Size-- -----Q-Time----- ------Sender/Recipient-----SS04506 5 Tue Nov 12 09:01 root (User unknown)Example 2: Prints along with priority specifiedSimply prints the messages in the mail queue.$ mailq -vOutput Mail Queue (1 request)---QID---- --Size-- -Priority- -----Q-Time----- ------Sender/Recipient-----SS04506 5 2005 Tue Nov 12 09:01 root (User unknown)Here,QID: Specific ID allotted to message.Size: Number of bytes contained in body of message.Q-Time Time at which message entered the queue.Real-World Applications of mailq Managing High Email Traffic: mailq helps administrators monitor email queues, ensuring efficient processing during high-volume campaigns.Troubleshooting Failed Emails: It identifies failed messages due to issues like incorrect addresses or full mailboxes, enabling quick fixes.Prioritizing Critical Emails: mailq allows adjusting the flow of high-priority messages, such as transactional emails or alerts.Tracking Delivery Delays: mailq provides insights into delayed emails, helping with diagnostics and load balancing.ConclusionThe mailq command is an essential tool for managing email queues in Linux-based systems. It allows system administrators to view the status of emails waiting in the queue, troubleshoot delivery issues, and optimize the flow of outgoing messages. In environments with high email traffic, mailq plays a critical role in maintaining the efficiency and reliability of mail servers. Comment More infoAdvertise with us gupta_shashank Follow Improve Article Tags : Linux-Unix Write From Home linux-command Similar Reads last command in Linux with Examples The 'last' command in Linux is a powerful utility used to display a list of all users who have logged in and out since the creation of the '/var/log/wtmp' file. It provides a chronological view of user sessions, allowing administrators to monitor user activity, troubleshoot issues, and manage system 5 min read less command in Linux with Examples The 'less' command in Linux is an indispensable utility for browsing the contents of text files interactively. Unlike traditional text editors, 'less' allows you to view text files page by page without loading the entire file into memory. This approach not only speeds up the file loading process, es 5 min read let command in Linux with Examples The `let` command in Linux is a powerful tool used for evaluating arithmetic expressions on shell variables. It supports various operators and functionalities to perform calculations and manipulate values. Syntax of `let` command in Linux The basic syntax of the `let` is as follows. let [expression] 3 min read ln command in Linux with Examples The 'ln' command in Linux is a powerful utility that allows you to create links between files. These links can either be hard links or soft (symbolic) links. If you're unfamiliar with these concepts, check out our detailed guide on Hard and Soft Links in Linux to understand their differences, use ca 3 min read locate command in Linux with Examples locate command in Linux is used to find the files by name. There are two most widely used file-searching utilities accessible to users called to find and locate. The locate utility works better and faster than the find command counterpart because instead of searching the file system when a file sear 6 min read look command in Linux with Examples The look command in Linux is used to display lines that begin with a specified string. It is especially useful for searching through large files or lists, as it helps you locate entries efficiently. By default, the look command performs case-insensitive matches and searches for exact prefixes. The l 3 min read How to List All Block Devices in Linux | lsblk Command Understanding the storage devices connected to your Linux system is crucial for efficient system management. The 'lsblk' command, short for "list block devices," is a powerful tool that provides detailed information about block devices such as hard drives, solid-state drives, and other storage-relat 6 min read lshw command in Linux with Examples The 'lshw' (List Hardware) command in Linux/Unix is a powerful tool for extracting detailed information about the system's hardware configuration. This tool retrieves data from files in the '/proc' directory and is capable of reporting on a wide array of components, including memory configuration, C 3 min read lsmod command in Linux with Examples lsmod command is used to display the status of modules in the Linux kernel. It results in a list of loaded modules. lsmod is a trivial program which nicely formats the contents of the /proc/modules, showing what kernel modules are currently loaded. Syntax: lsmod Example: Run lsmod at the command lin 1 min read How to List Open Files in Linux | lsof Command In the world of Linux, understanding and managing open files is crucial for system administrators and users alike. The Linux operating system provides a powerful utility called lsof (List Open Files) that allows users to gain insights into the files currently open on their system. In this article, w 7 min read Like