The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,859 other subscribers

Viewing email in Linux using postfix’s mailq and postcat | Jeff Geerling

Posted by jpluimers on 2023/09/22

Since mail mostly “works” I use these below commands only very little and tend to forget them.

Luckily they were documented at [Wayback/Archive] Viewing email in Linux using postfix’s mailq and postcat | Jeff Geerling

Here are the most common commands I use when either developing or troubleshooting email in production:
  • mailq – print a list of all queued mail
  • postcat -vq [message-id] – print a particular message, by ID (you can see the ID along in mailq‘s output)
  • postqueue -f – process the queued mail immediately
  • postsuper -d ALL – delete ALL queued mail (use with caution—but handy if you have a mail send going awry!)

Via [Wayback/Archive] postfix process queue – Google Search two interesting answers (thanks [Wayback/A] Nicolas for asking):

Remember there are multiple queues as per:

  • [Wayback/Archive] Postfix Mail Queue Management
    All mails which postfix handles will stay in the server in one of these queues until the message leaves from the server.
    1. maildrop
    2. hold
    3. incoming
    4. active
    5. deferred
    6. Corrupt
  • [Wayback/Archive] Postfix Bottleneck Analysis
    $ qshape -s hold | head
                             T  5 10 20 40 80 160 320 640 1280 1280+
                     TOTAL 486  0  0  1  0  0   2   4  20   40   419
                 yahoo.com  14  0  0  1  0  0   0   0   1    0    12
      extremepricecuts.net  13  0  0  0  0  0   0   0   2    0    11
            ms35.hinet.net  12  0  0  0  0  0   0   0   0    1    11
          winnersdaily.net  12  0  0  0  0  0   0   0   2    0    10
               hotmail.com  11  0  0  0  0  0   0   0   0    1    10
               worldnet.fr   6  0  0  0  0  0   0   0   0    0     6
            ms41.hinet.net   6  0  0  0  0  0   0   0   0    0     6
                    osn.de   5  0  0  0  0  0   1   0   0    0     4
    
    • The “T” column shows the total (in this case sender) count for each domain. The columns with numbers above them, show counts for messages aged fewer than that many minutes, but not younger than the age limit for the previous column. The row labeled “TOTAL” shows the total count for all domains.
    • In this example, there are 14 messages allegedly from yahoo.com, 1 between 10 and 20 minutes old, 1 between 320 and 640 minutes old and 12 older than 1280 minutes (1440 minutes in a day).

My related blog posts:

–jeroen

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.