-<html> <head> </head> <body> <pre>
+<html> <body> <pre>
POSTSUPER(1) POSTSUPER(1)
<b>NAME</b>
postsuper - Postfix superintendent
<b>SYNOPSIS</b>
- <b>postsuper</b> [<b>-psv</b>] [<b>-c</b> <i>config_dir</i>] [<b>-d</b> <i>queue_id</i>] [<b>-h</b>
- <i>queue_id</i>] [<b>-H</b> <i>queue_id</i>] [<b>-r</b> <i>queue_id</i>] [<i>directory</i> <i>...</i>]
+ <b>postsuper</b> [<b>-psv</b>] [<b>-c</b> <i>config</i><b>_</b><i>dir</i>] [<b>-d</b> <i>queue</i><b>_</b><i>id</i>] [<b>-h</b>
+ <i>queue</i><b>_</b><i>id</i>] [<b>-H</b> <i>queue</i><b>_</b><i>id</i>] [<b>-r</b> <i>queue</i><b>_</b><i>id</i>] [<i>directory ...</i>]
<b>DESCRIPTION</b>
The <b>postsuper</b> command does maintenance jobs on the Postfix
Options:
- <b>-c</b> <i>config_dir</i>
+ <b>-c</b> <i>config</i><b>_</b><i>dir</i>
The <b>main.cf</b> configuration file is in the named
directory instead of the default configuration
directory. See also the MAIL_CONFIG environment
setting below.
- <b>-d</b> <i>queue_id</i>
+ <b>-d</b> <i>queue</i><b>_</b><i>id</i>
Delete one message with the named queue ID from the
named mail queue(s) (default: <b>hold</b>, <b>incoming</b>,
- <b>active</b> and <b>deferred</b>). If a <i>queue_id</i> of <b>-</b> is speci-
+ <b>active</b> and <b>deferred</b>). If a <i>queue</i><b>_</b><i>id</i> of <b>-</b> is speci-
fied, the program reads queue IDs from standard
input. For example, to delete all mail from or to
<b>user@example.com</b>:
/ user@example\.com$/ { print $1 } \
' | tr -d '*!' | postsuper -d -
- Specify <b>-d</b> <b>ALL</b> to remove all messages; for example,
- specify <b>-d</b> <b>ALL</b> <b>deferred</b> to delete mail in the
+ Specify <b>-d ALL</b> to remove all messages; for example,
+ specify <b>-d ALL deferred</b> to delete mail in the
<b>deferred</b> queue. As a safety measure, the word <b>ALL</b>
must be specified in upper case.
- <b>Postfix</b> <b>queue</b> <b>IDs</b> <b>are</b> <b>reused.</b> <b>There</b> <b>is</b> <b>a</b> <b>very</b>
- <b>small</b> <b>possibility</b> <b>that</b> <b>postsuper</b> <b>deletes</b> <b>the</b> <b>wrong</b>
- <b>message</b> <b>file</b> <b>when</b> <b>it</b> <b>is</b> <b>executed</b> <b>while</b> <b>the</b> <b>Postfix</b>
- <b>mail</b> <b>system</b> <b>is</b> <b>running.</b>
+ <b>Postfix queue IDs are reused. There is a very</b>
+ <b>small possibility that postsuper deletes the wrong</b>
+ <b>message file when it is executed while the Postfix</b>
+ <b>mail system is running.</b>
The scenario is as follows:
of the old message that it should have
deleted.
- <b>-h</b> <i>queue_id</i>
+ <b>-h</b> <i>queue</i><b>_</b><i>id</i>
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: <b>incoming</b>,
<b>active</b> and <b>deferred</b>) to the <b>hold</b> queue. If a
- <i>queue_id</i> of <b>-</b> is specified, the program reads queue
+ <i>queue</i><b>_</b><i>id</i> of <b>-</b> is specified, the program reads queue
IDs from standard input.
- Specify <b>-h</b> <b>ALL</b> to hold all messages; for example,
- specify <b>-h</b> <b>ALL</b> <b>deferred</b> to hold mail in the
+ Specify <b>-h ALL</b> to hold all messages; for example,
+ specify <b>-h ALL deferred</b> to hold mail in the
<b>deferred</b> queue. As a safety measure, the word <b>ALL</b>
must be specified in upper case.
- Note: mail that is put "on hold" will not expire
+ Note: while mail is "on hold" it will not expire
when its time in the queue exceeds the <b>maxi-</b>
- <b>mal</b><i>_</i><b>queue</b><i>_</i><b>lifetime</b> setting.
+ <b>mal_queue_lifetime</b> setting. It becomes subject to
+ expiration after it is released from "hold".
- <b>-H</b> <i>queue_id</i>
+ <b>-H</b> <i>queue</i><b>_</b><i>id</i>
Release mail that was put "on hold". Move one mes-
- sage with the named queue ID from the named mail
+ sage with the named queue ID from the named mail
queue(s) (default: <b>hold</b>) to the <b>deferred</b> queue. If
- a <i>queue_id</i> of <b>-</b> is specified, the program reads
+ a <i>queue</i><b>_</b><i>id</i> of <b>-</b> is specified, the program reads
queue IDs from standard input.
- Specify <b>-H</b> <b>ALL</b> to release all mail that is "on
- hold". As a safety measure, the word <b>ALL</b> must be
+ Specify <b>-H ALL</b> to release all mail that is "on
+ hold". As a safety measure, the word <b>ALL</b> must be
specified in upper case.
- <b>-p</b> Purge old temporary files that are left over after
+ <b>-p</b> Purge old temporary files that are left over after
system or software crashes.
- <b>-r</b> <i>queue_id</i>
- Requeue the message with the named queue ID from
- the named mail queue(s) (default: <b>hold</b>, <b>incoming</b>,
- <b>active</b> and <b>deferred</b>). To requeue multiple mes-
- sages, specify multiple <b>-r</b> command-line options.
- Alternatively, if a <i>queue_id</i> of <b>-</b> is specified, the
+ <b>-r</b> <i>queue</i><b>_</b><i>id</i>
+ Requeue the message with the named queue ID from
+ the named mail queue(s) (default: <b>hold</b>, <b>incoming</b>,
+ <b>active</b> and <b>deferred</b>). To requeue multiple mes-
+ sages, specify multiple <b>-r</b> command-line options.
+ Alternatively, if a <i>queue</i><b>_</b><i>id</i> of <b>-</b> is specified, the
program reads queue IDs from standard input.
- Specify <b>-r</b> <b>ALL</b> to requeue all messages. As a safety
- measure, the word <b>ALL</b> must be specified in upper
+ Specify <b>-r ALL</b> to requeue all messages. As a safety
+ measure, the word <b>ALL</b> must be specified in upper
case.
- A requeued message is moved to the <b>maildrop</b> queue,
- from where it is copied by the pickup daemon to a
- new file whose name is guaranteed to match the new
+ A requeued message is moved to the <b>maildrop</b> queue,
+ from where it is copied by the pickup daemon to a
+ new file whose name is guaranteed to match the new
queue file inode number. The new queue file is sub-
- jected again to mail address rewriting and substi-
+ jected again to mail address rewriting and substi-
tution. This is useful when rewriting rules or vir-
tual mappings have changed.
- Postfix queue IDs are reused. There is a very
+ Postfix queue IDs are reused. There is a very
small possibility that <b>postsuper</b> requeues the wrong
- message file when it is executed while the Postfix
+ message file when it is executed while the Postfix
mail system is running, but no harm should be done.
<b>-s</b> Structure check and structure repair. It is highly
- recommended to perform this operation once before
+ recommended to perform this operation once before
Postfix startup.
- <b>o</b> Rename files whose name does not match the
+ <b>o</b> Rename files whose name does not match the
message file inode number. This operation is
- necessary after restoring a mail queue from
+ necessary after restoring a mail queue from
a different machine, or from backup media.
<b>o</b> Move queue files that are in the wrong place
in the file system hierarchy and remove sub-
directories that are no longer needed. File
- position rearrangements are necessary after
- a change in the <b>hash</b><i>_</i><b>queue</b><i>_</i><b>names</b> and/or
- <b>hash</b><i>_</i><b>queue</b><i>_</i><b>depth</b> configuration parameters.
+ position rearrangements are necessary after
+ a change in the <b>hash_queue_names</b> and/or
+ <b>hash_queue_depth</b> configuration parameters.
<b>-v</b> Enable verbose logging for debugging purposes. Mul-
- tiple <b>-v</b> options make the software increasingly
+ tiple <b>-v</b> options make the software increasingly
verbose.
<b>DIAGNOSTICS</b>
- Problems are reported to the standard error stream and to
+ Problems are reported to the standard error stream and to
<b>syslogd</b>.
- <b>postsuper</b> reports the number of messages deleted with <b>-d</b>,
+ <b>postsuper</b> reports the number of messages deleted with <b>-d</b>,
the number of messages requeued with <b>-r</b>, and the number of
- messages whose queue file name was fixed with <b>-s</b>. The
+ messages whose queue file name was fixed with <b>-s</b>. The
report is written to the standard error stream and to <b>sys-</b>
<b>logd</b>.
Directory with the <b>main.cf</b> file.
<b>BUGS</b>
- Mail that is not sanitized by Postfix (i.e. mail in the
+ Mail that is not sanitized by Postfix (i.e. mail in the
<b>maildrop</b> queue) cannot be placed "on hold".
-<b>CONFIGURATION</b> <b>PARAMETERS</b>
- See the Postfix <b>main.cf</b> file for syntax details and for
+<b>CONFIGURATION PARAMETERS</b>
+ See the Postfix <b>main.cf</b> file for syntax details and for
default values.
- <b>hash</b><i>_</i><b>queue</b><i>_</i><b>depth</b>
+ <b>hash_queue_depth</b>
Number of subdirectory levels for hashed queues.
- <b>hash</b><i>_</i><b>queue</b><i>_</i><b>names</b>
- The names of queues that are organized into multi-
+ <b>hash_queue_names</b>
+ The names of queues that are organized into multi-
ple levels of subdirectories.
- <b>queue</b><i>_</i><b>directory</b>
- Top-level directory of the Postfix queue. This is
+ <b>queue_directory</b>
+ Top-level directory of the Postfix queue. This is
also the root directory of Postfix daemons that run
chrooted.
-<b>SEE</b> <b>ALSO</b>
+<b>SEE ALSO</b>
<a href="sendmail.1.html">sendmail(1)</a> sendmail-compatible user interface
<a href="postqueue.1.html">postqueue(1)</a> unprivileged queue operations
<b>LICENSE</b>
- The Secure Mailer license must be distributed with this
+ The Secure Mailer license must be distributed with this
software.
<b>AUTHOR(S)</b>
#include <msg.h>
#include <mymalloc.h>
#include <htable.h>
-#include <binhash.h>
#include <stringops.h>
#include <events.h>
* State.
*/
static HTABLE *anvil_remote_map; /* indexed by service+ remote client */
-static BINHASH *anvil_local_map; /* indexed by local client handle */
/*
* Absent a real-time query interface, these are logged at process exit time
ANVIL_REMOTE_FREE(anvil_remote);
if (msg_verbose)
- msg_info("%s: anvil_remote_map used=%d",
- myname, anvil_remote_map->used);
+ msg_info("%s: anvil_remote_map used=%d",
+ myname, anvil_remote_map->used);
}
/* anvil_remote_lookup - dump address status */
* Record this connection under the local client information, so that we
* can clean up all its connection state when the local client goes away.
*/
- if ((anvil_local =
- (ANVIL_LOCAL *) binhash_find(anvil_local_map,
- (char *) &client_stream,
- sizeof(client_stream))) == 0) {
+ if ((anvil_local = (ANVIL_LOCAL *) vstream_context(client_stream)) == 0) {
anvil_local = (ANVIL_LOCAL *) mymalloc(sizeof(*anvil_local));
ANVIL_LOCAL_INIT(anvil_local);
- binhash_enter(anvil_local_map, (char *) &client_stream,
- sizeof(client_stream), (char *) anvil_local);
+ vstream_control(client_stream,
+ VSTREAM_CTL_CONTEXT, (void *) anvil_local,
+ VSTREAM_CTL_END);
}
ANVIL_LOCAL_ADD_ONE(anvil_local, anvil_remote);
if (msg_verbose)
/*
* Update the local client information.
*/
- if ((anvil_local =
- (ANVIL_LOCAL *) binhash_find(anvil_local_map,
- (char *) &client_stream,
- sizeof(client_stream))) != 0)
+ if ((anvil_local = (ANVIL_LOCAL *) vstream_context(client_stream)) != 0)
ANVIL_LOCAL_DROP_ONE(anvil_local, anvil_remote);
if (msg_verbose)
msg_info("%s: anvil_local 0x%lx",
* that we still have for this local client. Do not destroy remote client
* status information before it expires.
*/
- if ((anvil_local =
- (ANVIL_LOCAL *) binhash_find(anvil_local_map,
- (char *) &client_stream,
- sizeof(client_stream))) != 0) {
+ if ((anvil_local = (ANVIL_LOCAL *) vstream_context(client_stream)) != 0) {
if (msg_verbose)
msg_info("%s: anvil_local 0x%lx",
myname, (unsigned long) anvil_local);
ANVIL_LOCAL_DROP_ALL(client_stream, anvil_local);
- binhash_delete(anvil_local_map,
- (char *) &client_stream,
- sizeof(client_stream), myfree);
+ myfree((char *) anvil_local);
} else if (msg_verbose)
msg_info("client socket not found for fd=%d",
vstream_fileno(client_stream));
-
- if (msg_verbose)
- msg_info("%s: anvil_local_map used=%d",
- myname, anvil_local_map->used);
}
/* anvil_service - perform service for client */
* connection-management stuff is handled by the common code in
* multi_server.c.
*/
+ if (msg_verbose)
+ msg_info("--- start request ---");
if (attr_scan_plain(client_stream,
ATTR_FLAG_MISSING | ATTR_FLAG_STRICT,
ATTR_TYPE_STR, ANVIL_ATTR_REQ, request,
/* Note: invokes anvil_service_done() */
multi_server_disconnect(client_stream);
}
+ if (msg_verbose)
+ msg_info("--- end request ---");
vstring_free(ident);
vstring_free(request);
}
* Initial client state tables.
*/
anvil_remote_map = htable_create(1000);
- anvil_local_map = binhash_create(100);
/*
* Do not limit the number of client requests.