• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

mailq Command Examples in Linux

by admin

The mailq command lists any outgoing email messages awaiting delivery:

# mailq
Queue ID- --Size-- ----Arrival Time--  -Sender/Recipient--
46AAB43972*    333 Tue Jan 10 21:17:14 smith@example.com
                                       jones@elsewhere.org

Sent mail messages are also recorded in a log file, /var/log/mail.log.

mailq Command Examples

1. To see the mails in queue:

# mailq 

2. To show the mail submission queue specified:

# mailq -Ac 

3. To show the “lost” items in the mail queue instead of the normal queue items:

# mailq -qL 

4. To show the quarantined items in the mail queue instead of the normal queue items:

# mailq -qQ 

5. To Limit processed jobs to those containing substr as a substring:

# mailq -q[!]I substr 

6. To Limit processed jobs to quarantined jobs containing substr as a substring:

# mailq -q[!]Q substr 

7. To Limit processed jobs to those containing substr as a substring of one of the recipients:

# mailq -q[!]R substr 

8. To limit processed jobs to those containing substr as a substring:

# mailq -q[!]S substr 

9. To Print verbose information:

# mailq -v 

Note

Sendmail is an intelligent mail agent, and it tries to deliver mail even when failures occur. For example, if a user attempts to send an email to user@hostname.com, and the mail server for hostname.com is turned off, sendmail will be unable to make a connection to TCP port 25 on the mail server for hostname.com and consequently won’t be able to deliver the mail. Instead of giving up, sendmail will place the email in a queue and attempt redelivery. The default action of sendmail is to attempt redelivery of queued mail every 4 hours for 5 days before giving up and sending a “Delivery Failure” notification to the original sender. Queued mail is stored in the directory /var/spool/mqueue and is managed by the program mailq.

Filed Under: Linux

Some more articles you might also be interested in …

  1. cpufreq-info: command not found
  2. pidof: command not found
  3. ascii Command Examples in Linux
  4. nmon: command not found
  5. kwrite: command not found
  6. How to Disable IPv6 on Ubuntu 18.04 Bionic Beaver Linux
  7. mkfs.ext4 Command Examples in Linux
  8. battop Command Examples in Linux
  9. minicom: command not found
  10. gcov Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • qm Command Examples in Linux
  • qm wait Command Examples in Linux
  • qm start Command Examples in Linux
  • qm snapshot Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright