.\" $OpenBSD: smtpctl.8,v 1.40 2013/02/14 13:21:16 gilles Exp $ .\" .\" Copyright (c) 2006 Pierre-Yves Ritschard .\" Copyright (c) 2012 Gilles Chehade .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: February 14 2013 $ .Dt SMTPCTL 8 .Os .Sh NAME .Nm smtpctl .Nd control the Simple Mail Transfer Protocol daemon .Sh SYNOPSIS .Nm .Ar command .Op Ar argument ... .Sh DESCRIPTION The .Nm program controls .Xr smtpd 8 . Commands may be abbreviated to the minimum unambiguous prefix; for example, .Cm sh s for .Cm show stats . .Pp The following commands are available: .Bl -tag -width Ds .It Cm log brief Disable verbose debug logging. .It Cm log verbose Enable verbose debug logging. .It Cm monitor Display updates of some .Xr smtpd 8 internal counters in one second intervals. Each line reports the increment of all counters since the last update, except for some counters which are always absolute values. The first line reports the current value of each counter. The fields are: .Pp .Bl -bullet -compact .It Current number of active SMTP clients (absolute value). .It New SMTP clients. .It Disconnected clients. .It Current number of envelopes in the queue (absolute value). .It Newly enqueued envelopes. .It Dequeued envelopes. .It Successful deliveries. .It Temporary failures. .It Permanent failures. .It Message loops. .It Expired envelopes. .It Envelopes removed by the administrator. .It Generated bounces. .El .It Cm pause mda Temporarily stop deliveries to local users. .It Cm pause mta Temporarily stop relaying and deliveries to remote users. .It Cm pause smtp Temporarily stop accepting incoming sessions. .It Cm profile Ar subsystem Enables real-time profiling of .Ar subsystem . Supported subsystems are: .Pp .Bl -bullet -compact .It queue, to profile cost of queue IO .It imsg, to profile cost of event handlers .El .It Cm remove Ar envelope-id | message-id Remove a single envelope, or all envelopes with the same message ID. .It Cm resume mda Resume deliveries to local users. .It Cm resume mta Resume relaying and deliveries to remote users. .It Cm resume smtp Resume accepting incoming sessions. .It Cm schedule all Mark all envelopes as ready for immediate delivery. .It Cm schedule Ar envelope-id | message-id Mark a single envelope, or all envelopes with the same message ID, as ready for immediate delivery. .It Cm show envelope Ar envelope-id Display envelope content for the given ID. .It Cm show message Ar envelope-id Display message content for the given ID. .It Cm show queue Display information concerning envelopes that are currently in the queue. Each line of output describes a single envelope. It consists of the following fields, separated by a "|": .Pp .Bl -bullet -compact .It Envelope ID. .It Address family of the client which enqueued the mail. .It Type of delivery: one of "mta", "mda" or "bounce". .It Various flags on the envelope. .It Sender address (return path). .It The original recipient address. .It The destination address. .It Time of creation. .It Time of expiration. .It Time of last delivery or relaying attempt. .It Number of delivery or relaying attempts. .It Current runstate: either "pending" or "inflight" if .Xr smtpd 8 is running, or "offline" otherwise. .It Delay in seconds before the next attempt if pending, or time ellapsed if currently running. This field is blank if .Xr smtpd 8 is not running. .It Error string for the last failed delivery or relay attempt. .El .It Cm show stats Displays runtime statistics concerning .Xr smtpd 8 . .It Cm stop Stop the server. .It Cm trace Ar subsystem Enables real-time tracing of .Ar subsystem . Supported subsystems are: .Pp .Bl -bullet -compact .It imsg .It io .It smtp (incoming sessions) .It filter .It transfer (outgoing sessions) .It bounce .It scheduler .It expand (aliases/virtual/forward expansion) .It lookup (user/credentials lookups) .It stat .It rules (matched by incoming sessions) .It imsg-size .It all .El .It Cm unprofile Ar subsystem Disables real-time profiling of .Ar subsystem . .It Cm untrace Ar subsystem Disables real-time tracing of .Ar subsystem . .It Cm update table Ar name For table backends that provide caching, causes .Xr smtpd 8 to update the cache. .El .Pp When .Nm smtpd receives a message, it generates a .Ar message-id for the message, and one .Ar envelope-id per recipient. The .Ar message-id is a 32-bit random identifier that is guaranteed to be unique on the host system. The .Ar envelope-id is a 64-bit unique identifier that encodes the .Ar message-id in the 32 upper bits and a random envelope identifier in the 32 lower bits. .Pp A command which specifies a .Ar message-id applies to all recipients of a message; a command which specifies an .Ar envelope-id applies to a specific recipient of a message. .Sh FILES .Bl -tag -width "/var/run/smtpd.sockXX" -compact .It /var/run/smtpd.sock .Ux Ns -domain socket used for communication with .Xr smtpd 8 . .El .Sh SEE ALSO .Xr smtpd 8 .Sh HISTORY The .Nm program first appeared in .Ox 4.6 .