Sudo mailq
The mailq
command!
mailq
is a command-line utility that displays the mail queue, which is a list of emails that are waiting to be delivered to their final destinations. The queue is managed by the Mail Transfer Agent (MTA), such as Postfix or Sendmail.
When you run sudo mailq
, you'll see a list of emails that are currently in the queue, along with some information about each message, such as:
- The sender's email address
- The recipient's email address
- The message ID
- The size of the message
- The status of the message (e.g., "deferred", "pending", "delivered")
Here's an example output:
-Queue ID- --Size-- ---Rcpt--- Status
123456 1024 [email protected] deferred
789012 512 [email protected] pending
345678 2048 [email protected] delivered
In this example, there are three messages in the queue:
- Message 123456 is deferred, meaning it couldn't be delivered to the recipient's email address.
- Message 789012 is pending, meaning it's waiting to be delivered.
- Message 345678 has already been delivered.
You can use various options with mailq
to filter the output or take action on specific messages. For example:
-v
or--verbose
to show more detailed information about each message.-q
or--queue
to show only the messages in the queue, without any additional information.-d
or--delete
to delete a specific message from the queue.-r
or--requeue
to requeue a specific message.
Keep in mind that the mailq
command is usually used by system administrators to manage the mail queue and troubleshoot email delivery issues. If you're not familiar with the command or its output, it's best to consult the documentation for your MTA or seek assistance from a system administrator.