.TH SMTPCTL 8 "$Mdocdate: July 8 2014 $" "" .SH NAME .ad l \fB\%smtpctl\fP \- control the Simple Mail Transfer Protocol daemon .SH SYNOPSIS .ad l .br \fB\%smtpctl\fP \fIcommand\fP [\fIargument\fP ...] .SH DESCRIPTION .ad l The \fB\%smtpctl\fP program controls \fBsmtpd\fP(8). Commands may be abbreviated to the minimum unambiguous prefix; for example, \fBsh\fP s for \fBshow\fP stats. .PP The following commands are available: .RS 5 .TP \fBdiscover\fP \fIenvelope-id\fP | message-id Schedule a single envelope, or all envelopes with the same message ID that were manually moved to the queue. .TP \fBencrypt\fP [\fIstring\fP] Encrypt the password \fIstring\fP to a representation suitable for user credentials and print it to the standard output. If \fIstring\fP is not provided, cleartext passwords are read from standard input. .PP It is advised to avoid providing the password as a parameter as it will be visible from \fBtop\fP(1) and \fBps\fP(1) output. .TP \fBlog\fP brief Disable verbose debug logging. .TP \fBlog\fP verbose Enable verbose debug logging. .TP \fBmonitor\fP Display updates of some \fBsmtpd\fP(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 .RS 5 .IP \(bu Current number of active SMTP clients (absolute value). .IP \(bu New SMTP clients. .IP \(bu Disconnected clients. .IP \(bu Current number of envelopes in the queue (absolute value). .IP \(bu Newly enqueued envelopes. .IP \(bu Dequeued envelopes. .IP \(bu Successful deliveries. .IP \(bu Temporary failures. .IP \(bu Permanent failures. .IP \(bu Message loops. .IP \(bu Expired envelopes. .IP \(bu Envelopes removed by the administrator. .IP \(bu Generated bounces. .RE .TP \fBpause\fP envelope \fIenvelope-id\fP | message-id Temporarily suspend scheduling for the envelope with the given ID, or all envelopes with the given message ID. .TP \fBpause\fP mda Temporarily stop deliveries to local users. .TP \fBpause\fP mta Temporarily stop relaying and deliveries to remote users. .TP \fBpause\fP smtp Temporarily stop accepting incoming sessions. .TP \fBprofile\fP \fIsubsystem\fP Enables real-time profiling of \fIsubsystem\fP. Supported subsystems are: .PP .RS 5 .IP \(bu queue, to profile cost of queue IO .IP \(bu imsg, to profile cost of event handlers .RE .TP \fBremove\fP \fIenvelope-id\fP | message-id Remove a single envelope, or all envelopes with the same message ID. .TP \fBresume\fP envelope \fIenvelope-id\fP | message-id Resume scheduling for the envelope with the given ID, or all envelopes with the given message ID. .TP \fBresume\fP mda Resume deliveries to local users. .TP \fBresume\fP mta Resume relaying and deliveries to remote users. .TP \fBresume\fP route \fIroute-id\fP Resume routing on disabled route \fIroute-id\fP. .TP \fBresume\fP smtp Resume accepting incoming sessions. .TP \fBschedule\fP all Mark all envelopes as ready for immediate delivery. .TP \fBschedule\fP \fIenvelope-id\fP | message-id Mark a single envelope, or all envelopes with the same message ID, as ready for immediate delivery. .TP \fBshow\fP envelope \fIenvelope-id\fP Display envelope content for the given ID. .TP \fBshow\fP hosts Display the list of known remote MX hosts. For each of them, it shows the IP address, the canonical hostname, a reference count, the number of active connections to this host, and the elapsed time since the last connection. .TP \fBshow\fP hoststats Display status of last delivery for domains that have been active in the last 4 hours. It consists of the following fields, separated by a "|": .PP .RS 5 .IP \(bu Domain. .IP \(bu Ux timestamp of last delivery. .IP \(bu Status of last delivery. .RE .TP \fBshow\fP message \fIenvelope-id\fP Display message content for the given ID. .TP \fBshow\fP 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 .RS 5 .IP \(bu Envelope ID. .IP \(bu Address family of the client which enqueued the mail. .IP \(bu Type of delivery: one of "mta", "mda" or "bounce". .IP \(bu Various flags on the envelope. .IP \(bu Sender address (return path). .IP \(bu The original recipient address. .IP \(bu The destination address. .IP \(bu Time of creation. .IP \(bu Time of expiration. .IP \(bu Time of last delivery or relaying attempt. .IP \(bu Number of delivery or relaying attempts. .IP \(bu Current runstate: either "pending" or "inflight" if \fBsmtpd\fP(8) is running, or "offline" otherwise. .IP \(bu Delay in seconds before the next attempt if pending, or time ellapsed if currently running. This field is blank if \fBsmtpd\fP(8) is not running. .IP \(bu Error string for the last failed delivery or relay attempt. .RE .TP \fBshow\fP relays Display the list of currently active relays and associated connectors. For each relay, it shows a number of counters and information on its internal state on a single line. Then comes the list of connectors (source addresses to connect from for this relay). .TP \fBshow\fP routes Display status of routes currently known by \fBsmtpd\fP(8). Each line consists of a route number, a source address, a destination address, a set of flags, the number of connections on this route, the current penalty level which determines the amount of time the route is disabled if an error occurs, and the delay before it gets reactivated. The following flags are defined: .PP .RS 5 .TP D The route is currently disabled. .TP N The route is new. No SMTP session has been established yet. .TP Q The route as a timeout registered to lower its penalty level and possibly reactivate or discard it. .RE .TP \fBshow\fP stats Displays runtime statistics concerning \fBsmtpd\fP(8). .TP \fBshow\fP status Shows if MTA, MDA and SMTP systems are currently running or paused. .TP \fBstop\fP Stop the server. .TP \fBtrace\fP \fIsubsystem\fP Enables real-time tracing of \fIsubsystem\fP. Supported subsystems are: .PP .RS 5 .IP \(bu imsg .IP \(bu io .IP \(bu smtp (incoming sessions) .IP \(bu filters .IP \(bu transfer (outgoing sessions) .IP \(bu bounce .IP \(bu scheduler .IP \(bu expand (aliases/virtual/forward expansion) .IP \(bu lookup (user/credentials lookups) .IP \(bu stat .IP \(bu rules (matched by incoming sessions) .IP \(bu mproc .IP \(bu all .RE .TP \fBuncorrupt\fP \fImessage-id\fP Move all envelopes with the given message ID from corrupt bucket back to queue. .TP \fBunprofile\fP \fIsubsystem\fP Disables real-time profiling of \fIsubsystem\fP. .TP \fBuntrace\fP \fIsubsystem\fP Disables real-time tracing of \fIsubsystem\fP. .TP \fBupdate\fP table \fIname\fP For table backends that provide caching, causes \fBsmtpd\fP(8) to update the cache. .RE .PP When \fB\%smtpd\fP receives a message, it generates a \fImessage-id\fP for the message, and one \fIenvelope-id\fP per recipient. The \fImessage-id\fP is a 32-bit random identifier that is guaranteed to be unique on the host system. The \fIenvelope-id\fP is a 64-bit unique identifier that encodes the \fImessage-id\fP in the 32 upper bits and a random envelope identifier in the 32 lower bits. .PP A command which specifies a \fImessage-id\fP applies to all recipients of a message; a command which specifies an \fIenvelope-id\fP applies to a specific recipient of a message. .SH FILES .ad l .RS 5 .TP /var/run/smtpd.sock Ux -domain socket used for communication with \fBsmtpd\fP(8). .RE .SH SEE ALSO .ad l \fBsmtpd\fP(8) .SH HISTORY .ad l The \fB\%smtpctl\fP program first appeared in OpenBSD 4.6.