{
    "mode": "man",
    "parameter": "postsuper",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/postsuper/1/json",
    "generated": "2026-05-30T05:10:00Z",
    "synopsis": "postsuper [-psSv]\n[-c configdir] [-d queueid]\n[-e queueid] [-f queueid]\n[-h queueid] [-H queueid]\n[-r queueid] [directory ...]",
    "sections": {
        "NAME": {
            "content": "postsuper - Postfix superintendent\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "postsuper [-psSv]\n[-c configdir] [-d queueid]\n[-e queueid] [-f queueid]\n[-h queueid] [-H queueid]\n[-r queueid] [directory ...]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The  postsuper(1)  command  does maintenance jobs on the Postfix queue. Use of the command is\nrestricted to the superuser.  See the postqueue(1) command for unprivileged queue  operations\nsuch as listing or flushing the mail queue.\n\nBy  default,  postsuper(1)  performs the operations requested with the -s and -p command-line\noptions on all Postfix queue directories - this includes the incoming, active, deferred,  and\nhold  directories  with message files and the bounce, defer, trace and flush directories with\nlog files.\n\nOptions:\n",
            "subsections": [
                {
                    "name": "-c",
                    "content": "The main.cf configuration file is in the named directory instead of the  default  con‐\nfiguration directory. See also the MAILCONFIG environment setting below.\n",
                    "flag": "-c"
                },
                {
                    "name": "-d",
                    "content": "Delete  one  message  with  the  named queue ID from the named mail queue(s) (default:\nhold, incoming, active and deferred).\n\nTo delete multiple files, specify the -d option multiple times, or specify a  queueid\nof  -  to read queue IDs from standard input. For example, to delete all mail with ex‐\nactly one recipient user@example.com:\n\npostqueue -j | jq '\n# See JSON OBJECT FORMAT section in the postqueue(1) manpage\nselect(.recipients[0].address == \"user@example.com\")\n| select(.recipients[1].address == null)\n| .queueid\n' | postsuper -d -\n\nOr the historical form:\n\nmailq | tail -n +2 | grep -v '^ *(' | awk  'BEGIN { RS = \"\" }\n# $7=sender, $8=recipient1, $9=recipient2\n{ if ($8 == \"user@example.com\" && $9 == \"\")\nprint $1 }\n' | tr -d '*!' | postsuper -d -\n\nSpecify \"-d ALL\" to remove all messages; for example, specify  \"-d  ALL  deferred\"  to\ndelete  all  mail  in  the  deferred queue.  As a safety measure, the word ALL must be\nspecified in upper case.\n\nWarning: Postfix queue IDs are reused (always with Postfix <= 2.8; and with Postfix >=\n2.9  when enablelongqueueids=no).  There is a very small possibility that postsuper\ndeletes the wrong message file when it is executed while the Postfix  mail  system  is\ndelivering mail.\n\nThe scenario is as follows:\n\n1)     The  Postfix  queue  manager  deletes the message that postsuper(1) is asked to\ndelete, because Postfix is finished with the message (it is delivered, or it is\nreturned to the sender).\n\n2)     New mail arrives, and the new message is given the same queue ID as the message\nthat postsuper(1) is supposed to delete.  The probability for reusing a deleted\nqueue  ID  is about 1 in 215 (the number of different microsecond values that\nthe system clock can distinguish within a second).\n\n3)     postsuper(1) deletes the new message, instead of the old message that it should\nhave deleted.\n",
                    "flag": "-d"
                },
                {
                    "name": "-e",
                    "content": "",
                    "flag": "-e"
                },
                {
                    "name": "-f",
                    "content": "Request  forced  expiration  for one message with the named queue ID in the named mail\nqueue(s) (default: hold, incoming, active and deferred).\n\n•      The message will be returned to the sender when the queue manager  attempts  to\ndeliver that message (note that Postfix will never deliver messages in the hold\nqueue).\n\n•      The -e and -f options both request forced expiration. The difference is that -f\nwill also release a message if it is in the hold queue. With -e, such a message\nwould not be returned to the sender until it is released with -f or -H.\n\n•      When a deferred message is force-expired, the return  message  will  state  the\nreason  for  the  delay.  Otherwise, the reason will be \"message is administra‐\ntively expired\".\n\nTo expire multiple files, specify the -e or -f option multiple  times,  or  specify  a\nqueueid  of  -  to read queue IDs from standard input (see the -d option above for an\nexample, but be sure to replace -d in the example).\n\nSpecify \"-e ALL\" or \"-f ALL\" to expire all messages; for example, specify \"-e ALL  de‐‐\nferred\"  to  expire all mail in the deferred queue.  As a safety measure, the word ALL\nmust be specified in upper case.\n\nThese features are available in Postfix 3.5 and later.\n",
                    "flag": "-f"
                },
                {
                    "name": "-h",
                    "content": "Put mail \"on hold\" so that no attempt is made to deliver it.  Move  one  message  with\nthe  named  queue  ID  from the named mail queue(s) (default: incoming, active and de‐‐\nferred) to the hold queue.\n\nTo hold multiple files, specify the -h option multiple times, or specify a queueid of\n- to read queue IDs from standard input.\n\nSpecify  \"-h ALL\" to hold all messages; for example, specify \"-h ALL deferred\" to hold\nall mail in the deferred queue.  As a safety measure, the word ALL must  be  specified\nin upper case.\n\nNote:  while  mail  is \"on hold\" it will not expire when its time in the queue exceeds\nthe maximalqueuelifetime or bouncequeuelifetime setting. It becomes subject to ex‐\npiration after it is released from \"hold\".\n\nThis feature is available in Postfix 2.0 and later.\n",
                    "flag": "-h"
                },
                {
                    "name": "-H",
                    "content": "Release  mail  that  was put \"on hold\".  Move one message with the named queue ID from\nthe named mail queue(s) (default: hold) to the deferred queue.\n\nTo release multiple files, specify the -H option multiple times, or specify a queueid\nof - to read queue IDs from standard input.\n\nNote:  specify  \"postsuper -r\" to release mail that was kept on hold for a significant\nfraction of $maximalqueuelifetime or $bouncequeuelifetime, or longer.\n\nSpecify \"-H ALL\" to release all mail that is \"on hold\".  As a safety measure, the word\nALL must be specified in upper case.\n\nThis feature is available in Postfix 2.0 and later.\n",
                    "flag": "-H"
                },
                {
                    "name": "-p",
                    "content": "-p, -s, and -S operations are done before other operations.\n",
                    "flag": "-p"
                },
                {
                    "name": "-r",
                    "content": "Requeue the message with the named queue ID from the  named  mail  queue(s)  (default:\nhold, incoming, active and deferred).\n\nTo requeue multiple files, specify the -r option multiple times, or specify a queueid\nof - to read queue IDs from standard input.\n\nSpecify \"-r ALL\" to requeue all messages. As a safety measure, the word  ALL  must  be\nspecified in upper case.\n\nA  requeued  message  is  moved  to the maildrop queue, from where it is copied by the\npickup(8) and cleanup(8) daemons to a new queue file. In many  respects  its  handling\ndiffers from that of a new local submission.\n\n•      The  message  is  not  subjected to the smtpdmilters or nonsmtpdmilters set‐\ntings.  When mail has passed through an external  content  filter,  this  would\nproduce incorrect results with Milter applications that depend on original SMTP\nconnection state information.\n\n•      The message is subjected again to  mail  address  rewriting  and  substitution.\nThis is useful when rewriting rules or virtual mappings have changed.\n\nThe address rewriting context (local or remote) is the same as when the message\nwas received.\n\n•      The message is subjected to the same contentfilter settings (if any)  as  used\nfor  new  local  mail submissions.  This is useful when contentfilter settings\nhave changed.\n\nWarning: Postfix queue IDs are reused (always with Postfix <= 2.8; and with Postfix >=\n2.9  when  enablelongqueueids=no).   There is a very small possibility that postsu‐‐\nper(1) requeues the wrong message file when it is executed while the Postfix mail sys‐\ntem is running, but no harm should be done.\n\nThis feature is available in Postfix 1.1 and later.\n",
                    "flag": "-r"
                },
                {
                    "name": "-s",
                    "content": "startup.  The -p, -s, and -S operations are done before other operations.\n\n•      Rename files whose name does not match the message file inode number. This  op‐\neration  is  necessary after restoring a mail queue from a different machine or\nfrom backup, when queue files were created with Postfix <=  2.8  or  with  \"en‐\nablelongqueueids = no\".\n\n•      Move  queue  files that are in the wrong place in the file system hierarchy and\nremove subdirectories that are no longer needed.  File position  rearrangements\nare  necessary  after  a change in the hashqueuenames and/or hashqueuedepth\nconfiguration parameters.\n\n•      Rename queue files created with \"enablelongqueueids = yes\" to  short  names,\nfor migration to Postfix <= 2.8.  The procedure is as follows:\n\n# postfix stop\n# postconf enablelongqueueids=no\n# postsuper\n\nRun postsuper(1) repeatedly until it stops reporting file name changes.\n",
                    "flag": "-s"
                },
                {
                    "name": "-S -s",
                    "content": "file inode number. This option exists for testing  purposes,  and  is  available  with\nPostfix  2.9  and  later.   The -p, -s, and -S operations are done before other opera‐\ntions.\n",
                    "flag": "-s"
                },
                {
                    "name": "-v -v",
                    "content": "increasingly verbose.\n",
                    "flag": "-v"
                }
            ]
        },
        "DIAGNOSTICS": {
            "content": "Problems are reported to the standard error stream and to syslogd(8) or postlogd(8).\n\npostsuper(1)  reports  the number of messages deleted with -d, the number of messages expired\nwith -e, the number of messages expired or released with -f, the number of messages  held  or\nreleased  with  -h or -H, the number of messages requeued with -r, and the number of messages\nwhose queue file name was fixed with -s. The report is written to the standard  error  stream\nand to syslogd(8) or postlogd(8).\n",
            "subsections": []
        },
        "ENVIRONMENT": {
            "content": "MAILCONFIG\nDirectory with the main.cf file.\n",
            "subsections": []
        },
        "BUGS": {
            "content": "Mail  that is not sanitized by Postfix (i.e. mail in the maildrop queue) cannot be placed \"on\nhold\".\n",
            "subsections": []
        },
        "CONFIGURATION PARAMETERS": {
            "content": "The following main.cf parameters are especially relevant to this  program.   The  text  below\nprovides only a parameter summary. See postconf(5) for more details including examples.\n\nconfigdirectory (see 'postconf -d' output)\nThe default location of the Postfix main.cf and master.cf configuration files.\n\nhashqueuedepth (1)\nThe   number   of   subdirectory   levels   for  queue  directories  listed  with  the\nhashqueuenames parameter.\n\nhashqueuenames (deferred, defer)\nThe names of queue directories that are split across multiple subdirectory levels.\n\nimportenvironment (see 'postconf -d' output)\nThe list of environment parameters that a privileged Postfix process will import  from\na non-Postfix parent process, or name=value environment overrides.\n\nqueuedirectory (see 'postconf -d' output)\nThe location of the Postfix top-level queue directory.\n\nsyslogfacility (mail)\nThe syslog facility of Postfix logging.\n\nsyslogname (see 'postconf -d' output)\nA  prefix  that is prepended to the process name in syslog records, so that, for exam‐\nple, \"smtpd\" becomes \"prefix/smtpd\".\n\nAvailable in Postfix version 2.9 and later:\n\nenablelongqueueids (no)\nEnable long, non-repeating, queue IDs (queue file names).\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "sendmail(1), Sendmail-compatible user interface\npostqueue(1), unprivileged queue operations\npostlogd(8), Postfix logging\nsyslogd(8), system logging\n",
            "subsections": []
        },
        "LICENSE": {
            "content": "The Secure Mailer license must be distributed with this software.\n\nAUTHOR(S)\nWietse Venema\nIBM T.J. Watson Research\nP.O. Box 704\nYorktown Heights, NY 10598, USA\n\nWietse Venema\nGoogle, Inc.\n111 8th Avenue\nNew York, NY 10011, USA\n\n\n\nPOSTSUPER(1)",
            "subsections": []
        }
    },
    "summary": "postsuper - Postfix superintendent",
    "flags": [
        {
            "flag": "-c",
            "long": null,
            "arg": null,
            "description": "The main.cf configuration file is in the named directory instead of the default con‐ figuration directory. See also the MAILCONFIG environment setting below."
        },
        {
            "flag": "-d",
            "long": null,
            "arg": null,
            "description": "Delete one message with the named queue ID from the named mail queue(s) (default: hold, incoming, active and deferred). To delete multiple files, specify the -d option multiple times, or specify a queueid of - to read queue IDs from standard input. For example, to delete all mail with ex‐ actly one recipient user@example.com: postqueue -j | jq ' # See JSON OBJECT FORMAT section in the postqueue(1) manpage select(.recipients[0].address == \"user@example.com\") | select(.recipients[1].address == null) | .queueid ' | postsuper -d - Or the historical form: mailq | tail -n +2 | grep -v '^ *(' | awk 'BEGIN { RS = \"\" } # $7=sender, $8=recipient1, $9=recipient2 { if ($8 == \"user@example.com\" && $9 == \"\") print $1 } ' | tr -d '*!' | postsuper -d - Specify \"-d ALL\" to remove all messages; for example, specify \"-d ALL deferred\" to delete all mail in the deferred queue. As a safety measure, the word ALL must be specified in upper case. Warning: Postfix queue IDs are reused (always with Postfix <= 2.8; and with Postfix >= 2.9 when enablelongqueueids=no). There is a very small possibility that postsuper deletes the wrong message file when it is executed while the Postfix mail system is delivering mail. The scenario is as follows: 1) The Postfix queue manager deletes the message that postsuper(1) is asked to delete, because Postfix is finished with the message (it is delivered, or it is returned to the sender). 2) New mail arrives, and the new message is given the same queue ID as the message that postsuper(1) is supposed to delete. The probability for reusing a deleted queue ID is about 1 in 215 (the number of different microsecond values that the system clock can distinguish within a second). 3) postsuper(1) deletes the new message, instead of the old message that it should have deleted."
        },
        {
            "flag": "-e",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-f",
            "long": null,
            "arg": null,
            "description": "Request forced expiration for one message with the named queue ID in the named mail queue(s) (default: hold, incoming, active and deferred). • The message will be returned to the sender when the queue manager attempts to deliver that message (note that Postfix will never deliver messages in the hold queue). • The -e and -f options both request forced expiration. The difference is that -f will also release a message if it is in the hold queue. With -e, such a message would not be returned to the sender until it is released with -f or -H. • When a deferred message is force-expired, the return message will state the reason for the delay. Otherwise, the reason will be \"message is administra‐ tively expired\". To expire multiple files, specify the -e or -f option multiple times, or specify a queueid of - to read queue IDs from standard input (see the -d option above for an example, but be sure to replace -d in the example). Specify \"-e ALL\" or \"-f ALL\" to expire all messages; for example, specify \"-e ALL de‐‐ ferred\" to expire all mail in the deferred queue. As a safety measure, the word ALL must be specified in upper case. These features are available in Postfix 3.5 and later."
        },
        {
            "flag": "-h",
            "long": null,
            "arg": null,
            "description": "Put mail \"on hold\" so that no attempt is made to deliver it. Move one message with the named queue ID from the named mail queue(s) (default: incoming, active and de‐‐ ferred) to the hold queue. To hold multiple files, specify the -h option multiple times, or specify a queueid of - to read queue IDs from standard input. Specify \"-h ALL\" to hold all messages; for example, specify \"-h ALL deferred\" to hold all mail in the deferred queue. As a safety measure, the word ALL must be specified in upper case. Note: while mail is \"on hold\" it will not expire when its time in the queue exceeds the maximalqueuelifetime or bouncequeuelifetime setting. It becomes subject to ex‐ piration after it is released from \"hold\". This feature is available in Postfix 2.0 and later."
        },
        {
            "flag": "-H",
            "long": null,
            "arg": null,
            "description": "Release mail that was put \"on hold\". Move one message with the named queue ID from the named mail queue(s) (default: hold) to the deferred queue. To release multiple files, specify the -H option multiple times, or specify a queueid of - to read queue IDs from standard input. Note: specify \"postsuper -r\" to release mail that was kept on hold for a significant fraction of $maximalqueuelifetime or $bouncequeuelifetime, or longer. Specify \"-H ALL\" to release all mail that is \"on hold\". As a safety measure, the word ALL must be specified in upper case. This feature is available in Postfix 2.0 and later."
        },
        {
            "flag": "-p",
            "long": null,
            "arg": null,
            "description": "-p, -s, and -S operations are done before other operations."
        },
        {
            "flag": "-r",
            "long": null,
            "arg": null,
            "description": "Requeue the message with the named queue ID from the named mail queue(s) (default: hold, incoming, active and deferred). To requeue multiple files, specify the -r option multiple times, or specify a queueid of - to read queue IDs from standard input. Specify \"-r ALL\" to requeue all messages. As a safety measure, the word ALL must be specified in upper case. A requeued message is moved to the maildrop queue, from where it is copied by the pickup(8) and cleanup(8) daemons to a new queue file. In many respects its handling differs from that of a new local submission. • The message is not subjected to the smtpdmilters or nonsmtpdmilters set‐ tings. When mail has passed through an external content filter, this would produce incorrect results with Milter applications that depend on original SMTP connection state information. • The message is subjected again to mail address rewriting and substitution. This is useful when rewriting rules or virtual mappings have changed. The address rewriting context (local or remote) is the same as when the message was received. • The message is subjected to the same contentfilter settings (if any) as used for new local mail submissions. This is useful when contentfilter settings have changed. Warning: Postfix queue IDs are reused (always with Postfix <= 2.8; and with Postfix >= 2.9 when enablelongqueueids=no). There is a very small possibility that postsu‐‐ per(1) requeues the wrong message file when it is executed while the Postfix mail sys‐ tem is running, but no harm should be done. This feature is available in Postfix 1.1 and later."
        },
        {
            "flag": "-s",
            "long": null,
            "arg": null,
            "description": "startup. The -p, -s, and -S operations are done before other operations. • Rename files whose name does not match the message file inode number. This op‐ eration is necessary after restoring a mail queue from a different machine or from backup, when queue files were created with Postfix <= 2.8 or with \"en‐ ablelongqueueids = no\". • Move queue files that are in the wrong place in the file system hierarchy and remove subdirectories that are no longer needed. File position rearrangements are necessary after a change in the hashqueuenames and/or hashqueuedepth configuration parameters. • Rename queue files created with \"enablelongqueueids = yes\" to short names, for migration to Postfix <= 2.8. The procedure is as follows: # postfix stop # postconf enablelongqueueids=no # postsuper Run postsuper(1) repeatedly until it stops reporting file name changes."
        },
        {
            "flag": "-s",
            "long": null,
            "arg": null,
            "description": "file inode number. This option exists for testing purposes, and is available with Postfix 2.9 and later. The -p, -s, and -S operations are done before other opera‐ tions."
        },
        {
            "flag": "-v",
            "long": null,
            "arg": null,
            "description": "increasingly verbose."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "sendmail",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/sendmail/1/json"
        },
        {
            "name": "postqueue",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/postqueue/1/json"
        },
        {
            "name": "postlogd",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/postlogd/8/json"
        },
        {
            "name": "syslogd",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/syslogd/8/json"
        }
    ]
}