man smail (Administration système) - mail delivery system

NAME

smail, sendmail, mailq, runq, rmail, rsmtp, smtpd, newaliases - mail delivery system

SYNOPSIS

smail [ flags ] address... sendmail [ flags ] address...

/usr/sbin/smail [ flags ] address ...

mailq [ -sE -v[N] ] [ msg-id ... ]

runq [ msg-id ... ]

rmail address ...

rsmtp

smtpd

in.smtpd

newaliases

DESCRIPTION

Smail is a program used for receiving and delivering mail. Its job is to take mail from sources on the local or on remote hosts and deliver to the appropriate destinations. This may be either on remote hosts or on the local machine. It is not intended to be a user interface for reading and submitting mail. See mailx(1) on System V, Mail(1) on BSD systems, or mail(1) on other systems for information on user interfaces.

Smail is invoked under a wide variety of names, which serve to isolate some of its major uses: receiving local mail, receiving remote mail, attempting delivery of un-delivered mail and displaying information about un-delivered mail.

OPTIONS

All of these commands accept the same set of flags, differing mainly in their default mode of operation. Two exceptions are the rmail and rsmtp commands which support only a subset of the possible flags. These two commands are intended to be used from remote hosts through remote execution over UUCP (see uux(1)) and are thus limited in how much they can do.

The flags which are recognised by smail are:

-bc
Display the file COPYING, distributed with the source, which details your rights and restrictions for distributing this software.
-bd
Listen for connection requests on a socket bound in the internet domain. When a connection occurs, conduct an SMTP (Simple Mail Transfer Protocol) conversation with the peer process. Listening will only occur if BSD style internet networking functionality is available.
-bm
Deliver mail to the recipient addresses. This is the default mode of operation if invoked as sendmail, smail, rmail or send-mail.
-bp
List information about the messages currently in smail's input or frozen (error) message spool directories. This is the default mode of operation if invoked as mailq. If one or more message-IDs are given on the command-line then only information about the specified message(s) will be displayed, otherwise the entire queue is shown.
Normally the input queue is examined in detail and the frozen (error) queue is summarized. With -E the opposite is true.
With the -v or -d flag, a per-message transaction log is displayed for each message which shows what has transactions have completed or failed for the message so far.
-bi
Initialise the aliases file, or a YP aliases file. This is the default option when invoked as newaliases.
If an aliases file was not specified with -oA, then the system default aliases file is rebuilt by calling the mkaliases program (see mkaliases(8) for more information).
If an aliases file is specified with -oA, then this name is passed to the mkaliases program
The mkaliases program is executed from the directory indicated by the smail_util_dir attribute (by default /usr/lib/smail).
-bP
Take the addresses given on the command line as config file item names (see smailconf(5) for more information) and write the values for each item on the standard output. Also will write out reconstructions of all the configuration files - see below. References to item names, such as hostnames or uucp_name which may be computed at run time, will yield the values that smail would compute normally. For example, on my workstation, the command:
smail -bP hostnames max_message_size
produces the output:
futatsu.uts.amdahl.com:futatsu.amdahl.com
102400
With the -v or -d flag the configuration item names are displayed as well and the value is given in a format suitable for including in a configuration file. So for example the command:
smail -v -bP max_message_size
produces the output:
max_message_size=102400
In addition to other configuration file items, the name primary_name will output the primary (or canonical) name for the local host which will be used by smail, and config_file will output the name of the primary configuration file.
If the name begins with a `$' then the internal variable and/or meta expansion is performed and the result is displayed (with the name if -v or -d is given, as with configuration items). Remember to quote or escape the `$' character from the shell. Note this value is shown without quoting or escaping of special characters.
Configuration items which are permitted to contain variable and/or meta expansions can be often be fully expanded to reveal their run-time values by using the ${eval: meta expansion modifier. See smail(5) for more information. For example these two commands:
smail -bP '${smtp_hello_reject_hostnames}'
smail -bP '${eval:smtp_hello_reject_hostnames}'
might produce the following output on a machine called ``proven'' in the domain ``example.com'', and with ``mail.example.net'' also handled locally:
localhost\.;I must be talking to myself!
:.*\.localdomain;There's no such domain 'localdomain'!
:${rxquote:hostname}:${rxquote:more_hostnames}

localhost\.;I must be talking to myself!
:.*\.localdomain;There's no such domain 'localdomain'!
:proven\.example\.com:mail\.example.com
Also, the name help will produce a verbose listing of all variables associated with their type, one variable per line, and the name all will produce a verbose listing of all variables along with their values. It is equivalent to smail -v -bP followed by a list of the names of all configuration variables.
Additionally a reconstructed version of the config files needed to build the current configuration can be dumped out. In all cases this is done with uppercase keywords, and the following keywords are recognised:
CONFIG
The config file (this is actually the same as specifying all).
DIRECTORS
The directors file currently in operation.
ROUTERS
The routers file currently in operation.
TRANSPORTS
The transports file currently in operation. This will contain both default and explicitly defined transports, however where 2 transports have been defined with the same name, only the most recently defined one is dumped (the older ones cause a comment to be added to the output). This is to prevent problems if the reconstructed transport files are used as a configuration file.
QUALIFY
The qualify file currently in operation.
RETRY
The retry file currently in operation.
ALL
All of the configuration files detailed above.
NOTE: The method used to reconstruct the config files is to walk through the tables of configuration options. As smail has developed some options have changed name, with both the old and the new names being supported. This means that when the config file is dumped, the same config item may be dumped under only the new name. Also any overlapping flag values may cause problems, in that all variables affecting that flag will be dumped, and combined their effect may not be what you expect.
-bR
Enter the hostile mail domain of giant mail messages, and RFC standard scrolls. Attempt to make it down to protocol level 26 and back.
-bS
Read SMTP commands on standard input, but do not produce SMTP replies on standard output. All failures are reported by return mail, rather than through reply codes. This is suitable for setting up a batched form of SMTP between machines over a remote execution service like UUCP. This is the default mode of operation if invoked as rsmtp.
-bs
Read SMTP commands on standard input and produce SMTP replies on standard output. The currently implemented SMTP commands are HELO, MAIL FROM, RCPT TO, DATA, RSET, NOOP, VRFY, EXPN and QUIT. This is the default mode of operation if invoked as smtpd or in.smtpd. For compatibility with some implementations of inetd(8N), if smtpd is started with no standard output, standard input will be dup(2)'d to standard output.
-bt
Enter address test mode. Read addresses on standard input and produce the parse results and host routing/resolving information on standard output. This is primarily useful for debugging smail or debugging new smail routers.
-bv
Verify a list of addresses by producing the list of addresses produced by aliasing and forwarding expansions and by host routing or resolving. Addresses which cannot be resolved are also displayed, along with the reasons why.
-C filename
-oC filename
Sets the pathname of the primary config file to use in reading global attribute values. If specified, then smail sets the effective UID and GID back to the real UID and GID, to avoid problems when installations allow smail to be set UID to the superuser. If the filename is - then no primary config file is read. This should only be used for debugging purposes.
-d[number]
-v[number]
turn on debugging. If a number is given, set the debugging level to that value, otherwise the debugging level is set to 1. No white space is allowed before the optional number. There is no difference between use of -d and -v.
-D file
Redirect debugging output to the indicated file. Normally, debugging output will disable background delivery because programs should not continue to write to standard error after the mail process exits. However, if a debug output file is specified, then background delivery can occur.
-E
When used with mailq or -bp will show entries from the frozen (error) message queue instead of the main input message.
Note -E only works when printing the queues. Frozen messages cannot be processed directly by smail. See unfreezemail(8) to learn how to reprocess frozen messages after the error that caused them to be frozen has been cleared.
-em or -oem
Mail errors back to the sender (default).
-ee or -oee
These forms refer to a BERKENET error processing style which is not supported. If used, errors will be mailed back to the sender.
-ep or -oep
Write errors to the standard error output.
-eq or -oeq
Do not send notification of errors to the sender. This only works for mail delivered locally. Errors encountered on remote hosts mail still result in returned mail. Supply a Precedence: junk header field to set this behaviour on local and remote hosts.
-ew or -oew
Write errors to the sender's terminal using the write(1) command, if he is logged in. Otherwise, mail errors back to the sender. (This is currently not supported and is treated in the same manner as -oem)
-F fullname
Explicitly set the full name of the sender for incoming mail, used only if the operation mode is reception of a single mail message on standard input.
-f sender
-r sender Explicitly set the sender address for incoming mail, used only if the operation mode is reception of a single mail message on standard input.
-h number
Sets the hopcount for a single message. If this is not specified, the hop count is computed from the number of Received: fields in the message header. The hopcount is used for a primitive form of infinite loop detection: a sufficiently large hop count will cause mail to be rejected.
-I or -oI
Use the hidden dot algorithm in reading the message. Lines with one or more dots at the beginning have the leading dot removed, while a line containing only a single dot ends the input message. This is always set for messages received using SMTP.
-i or -oi
Do not allow a single `.' to end an incoming message. Otherwise, a dot on a line by itself will end a message. This is the default if smail is invoked as rmail.
-m or -om
Allow retention of the sender as a recipient for alias and mailing list expansions that include the sender. If this is not set, the sender will not receive a copy of the message only as a result of being in an alias or mailing list.
-N
Disable delivery of this message. All other processing is performed, and transports are expected to go through most of the steps involved in delivery. This is useful for debugging smail when you do not actually wish to have messages delivered.
-n
Do not perform alias processing. This only prevents expansion of entries in alias files. Mailing list files and forward files may still be expanded.
-odb
Deliver mail in background, if mail delivery is to be performed. Background delivery is not currently supported in the SMTP modes; foreground delivery is used instead.
-odf
Deliver mail in foreground, if mail delivery is to be performed.
-oA filename
Sets the pathname of the aliases file. This overrides the default name of the aliases file, and is used with the -bi option (or when called as newaliases) to invoke mkaliases with a specific filename as its only argument.
-oD filename
Sets the pathname of the director file. This overrides the default name of the director file as well as any name set in a config file. If specified, then smail sets the effective UID and GID back to the real UID and GID, to avoid problems when installations allow smail to be set UID to the superuser. If the filename is - then no director file is read. This should only be used for debugging purposes.
-oE filename
Sets the pathname of the delivery retry control file. This overrides the default name of the retry file as well as any name set in a config file. If specified, then smail sets the effective UID and GID back to the real UID and GID, to avoid problems when installations allows smail to be set UID to the superuser (the normal case). If the filename is - then no retry file is read. This should only be used for debugging purposes.
-oG grade_range
Sets the range of grades of messages processed by a queue run. This overrides the default value of runq_grades compiled into the smail binary, as well as any name set in a config file. This may be used to allow queue processing to only process specific grades of mail, so that (for example) mailing list mail can be deferred during peak periods until a time when the system load will be much lighter. Typically the config file version of the runq_grades value would be used most of the time, with the occasional off-peak invocation of runq from cron with the -oG option set to process low priority mail. The parameter is a grade range string as used for the delivery_grades and runq_grades configuration variables.
-oL directory name
Sets the pathname of the smail library directory. This overrides the default value of smail_lib_dir compiled into the smail binary, as well as any name set in a config file. This string may be used to locate configuration files, such as the director, router and transport files, alias and path files, and mailing list directories.
-oQ filename
Sets the pathname of the hostname qualification file. This overrides the default name of the qualify file as well as any name set in a config file. If specified, then smail sets the effective UID and GID back to the real UID and GID, to avoid problems when installations allows smail to be set uid to the superuser (the normal case). If the filename is - then no qualify file is read. This should only be used for debugging purposes.
-oR filename
Sets the pathname of the router file. This overrides the default name of the router file as well as any name set in a config file. If specified, then smail sets the effective UID and GID back to the real UID and GID, to avoid problems when installations allows smail to be set UID to the superuser (the normal case). If the filename is - then no router file is read. This should only be used for debugging purposes.
-oT filename
Sets the pathname of the transport file. This overrides the default name of the transport file as well as any name set in a config file. If specified, then smail sets the effective UID and GID back to the real UID and GID, to avoid problems when installations allow smail to be set UID to the superuser. If the filename is - then no transport file is read. This should only be used for debugging purposes.
-Q or -odq
Spool incoming messages but do not actually perform delivery until a later queue. This mode of operation is somewhat more efficient in terms of CPU usage, though it does slow down the flow of mail.
-q[interval]
Cause smail to process its input spool directory. If an interval is given, smail will repeatedly check its input spool directory, sleeping for the given interval between checks. The interval is in seconds, though it can be defined as a sequence of numbers with suffixes of `s' for seconds, `m' for minutes, `h' for hours, `d' for days, `w' for weeks and `y' for years. For example, -q2h30m specifies an interval of two hours and 30 minutes. This flag is useful in conjunction with the -bd mode of operation and will cause the daemon process to wake up on these intervals and perform queue processing. Performing a single queue run is the default mode of operation if smail is invoked as runq. Any parameters are used to match message-IDs in the queue, and those messages are processed. If a message-ID is given, but the message is not in the queue (due to a mistake or the message having been already delivered), then the parameter is silently ignored.
-s
When used with mailq or -bp will show only the summary tally of messages in the mail queues.
-t
Extract addresses from the To:, Cc: and Bcc: fields of the message header. This is useful for user agents that do not wish to compute the recipient addresses themselves. In this mode, any addresses given on the command line are addresses that explicitly will NOT receive mail, even as a result of aliasing or forwarding expansions. This option is ignored unless smail is in the mode set by the -bm flag (which is the default mode).
-V or -bV
Print the smail version on the standard output.
-oU
Report memory usage when smail exits.
-oX mail-service
Set the TCP/IP service name or port number to be used for listening for SMTP requests. This can used in conjunction with the -bd mode to define alternate debugging versions of the smail SMTP listening daemon, which may be useful in testing a new installation.
-oMs sender_host
Specify the name of the system that sent the mail message. This value can be included in expansion strings through the variable $sender_host.
-oMa sender_host_address
Specify the address of the system that sent the mail message. This value can be included in expansion strings through the variable $sender_host_address.
-oMr sender_proto
Specify the protocol that was used by the sending host to deliver the mail message. This value can be included in expansion strings through the variable $sender_proto.
-oMt ident_sender
Specify the user that initiated the message transfer on the previous host to get to this host. This value is set by the SMTP receiver when a message is received from a host supporting the RFC 1413 ``ident'' protocol. This value can be included in expansion strings through the variable $ident_sender.
-oMu ident_method
Specify the method used to determine ident_sender (above). A mail receiver that has a transmitting user identity associated with it could call smail with these flags to have that information included in the message data. This value can be included in expansion strings through the variable $ident_method.
--
Stop processing command options and use the rest of the arguments as addresses.

NORMAL USAGE

Under normal usage, one smail daemon exists which receives requests from remote hosts and processes the input spool directory at intervals. Such a daemon can be started from /etc/rc with a command such as

smail -bd -q1h
which will cause queue runs at one hour intervals.

New mail can be submitted from user agents by calling smail directly and passing a message on standard input. Mailers such as BSD Mail(1) and some AT&T UNIX System V mailx(1) programs submit mail by invoking smail with a command such as

smail -em -i recipient-address ...
Because smail also works correctly if invoked as sendmail it is common to install smail as /usr/lib/sendmail so that existing binaries on BSD systems, or other systems that current run sendmail, do not need to be modified to run smail instead.

Some user agents, such as GNU Emacs may wish to have smail decipher the recipient list from the header. These programs may invoke smail with a command such as

smail -em -t -i

To receive mail over UUCP, smail can be invoked directly from uuxqt as /bin/rmail. Alternately, /bin/rmail can be another program that invokes smail directly as

smail -em -i -fsender-address recipient address ...
It is common for the System V based /bin/rmail program to perform delivery by itself, resulting in mail bypassing smail altogether. Such systems should replace /bin/rmail with a copy of smail or modify /bin/rmail so that it executes a copy of smail with the arguments as given above.
NOTE:
In the future, a separate program may be distributed with smail to serve the function of rmail at a lower cost. This program will only write the input spool file, while allowing a smail daemon to process messages at a later time. This will save the cost of a complete exec(2) of smail for each incoming message.

An alternative method of receiving mail over UUCP is through the rsmtp command, which receives batched SMTP requests. This can be used between two sites running smail to gain many of the benefits of the SMTP protocol, such as the ability to use recipient addresses which uux cannot correctly pass to a remote rmail program. For example, addresses containing quotes or spaces cannot be expected to pass correctly over an uux/rmail link. However a uux/rsmtp link can handle such cases.

SENDMAIL COMPATIBILITY

Smail was designed to be as close of a plug-in replacement for the BSD sendmail program as possible. External programs can call smail in very much the same manner that they previously called sendmail and expect similar results. However, smail is completely different internally and has entirely different configuration files. As a result, the -o option to smail only sets a few configuration parameters which were felt to be commonly used by other programs. Also, for convenience, some new (upper case only) parameters are defined only in smail. Attempts to set other options using this flag are ignored. See the OPTIONS section for the complete list of supported -o options.

Because smail can be called in a manner very similar to sendmail it is common to install smail as /usr/lib/sendmail so that no other program need be modified to use the new mailer. Thus, once properly configured, smail can be installed into a current sendmail-based environment, including an environment without access to source, with minimal effort.

Note that smail does much more verification of SMTP commands and parameters and as such programs which formerly used the -bs option should be changed to invoke smail (as sendmail) with the -bS option which will avoid such checks.

SMAIL UNDER SYSTEM V

The easiest way to install smail on a System V host is to install it as /bin/rmail. An alternative is cause mailx(1) to call /usr/lib/sendmail by changing the mailx(1) configuration file /usr/lib/mailx/mailx.rc to include a line such as: sendmail=/usr/lib/sendmail

System V's mail(1) command attempts to perform delivery by itself. Use of mail(1) to send mail should thus be discouraged unless mail(1) is modified to call smail to perform delivery.

FILES

For many sites, the compiled in configuration of smail is sufficient and thus no configuration files are needed. The following files and directories are from the default smail configuration and most can be changed in the run-time configuration:

/etc/smail/config
Optional general smail configuration. This file can override compiled-in configuration.
/etc/smail/qualify
Optional hostname qualification configuration file.
/etc/smail/directors
Optional configuration for smail directors, i.e., configured methods for resolving local addresses. This file replaces the compiled-in director configuration.
/etc/smail/routers
Optional configuration for smail routers, i.e., configured methods for resolving or routing to remote hosts. This file replaces the compiled-in router configuration.
/etc/smail/transports
Optional configuration for smail transports; i.e., configured methods of mail delivery. This file replaces the compiled-in transport configuration.
/etc/smail/retry
Optional delivery retry configuration file; i.e., minimum time between retries, and maximum time to retry before giving up.

The following files are commonly used to locally redirect mail and to give paths to remote sites.

/etc/aliases
A file of aliases for local addresses.
A file of paths to remote hosts.
/etc/smail/lists
A directory of mailing list files.
/var/mail
The directory for user mailbox files.
~/.forward
Lists of forwarding addresses for local users.

The smail mailer typically uses the following directories for working storage, and to hold incoming mail messages.

/var/mail
The top of the spool directory hierarchy.
/var/mail/input
Smail's spool directory for incoming messages.
/var/mail/error
A directory for messages which failed for some reason that the site administrator should investigate.
/var/mail/msglog
A directory of transaction logs for individual messages.
/var/mail/lock
A directory used in smail input spool files.
/var/mail/smail.pid
The process-ID of the master daemon is stored here.

The following files log the activity of the smail mailer. The system administrator should check and truncate these files from time.

/var/log/smail/logfile
A log of smail transactions.
/var/log/smail/paniclog
A log of configuration or system errors encountered by smail.

DIAGNOSTICS

Exits with 0 if no errors, non-0 otherwise. See /usr/include/sysexits.h or src/exitcodes.h in the smail source for the list of possible exit codes.

If the -bd option was used, then bind() failed: Address already in use implies that another process is already listening on the SMTP socket.

SEE ALSO

binmail(1), mailx(1) under System V, Mail(1) under BSD, smail(5), smailconf(5), smaildrct(5), smailmeth(5), smailqual(5), smailrtrs(5), smailrtry(5), smailtrns(5), mailaddr(7), bouncemail(8), checkerr(8), mkaliases(8), pathmerge(8), savelog(8), smailbug(8), unfreezemail(8), pathto(1), Smail Administration and Installation Guide, Smail Design Document, DARPA Internet Requests for Comments, RFC821, RFC822 and RFC976.

BUGS

Many mail bugs are not smail bugs. Smail can't help it if remote sites trash your mail messages.

If you find any bugs, please use the smailbug utility to send a complete description of the problem, along with any fixes or work-arounds you recommend, to the smail maintainers.

If you need help configuring your installation, or are experiencing problems that you cannot clearly define as bugs, please see the README file in the source distribution for the addresses of the smail mailing lists where there are lots of helpful people lurking.

Setting the input spool directory processing interval to a period of more than 2147483647 seconds is silly and will result in an incorrectly calculated processing interval.

Route-addrs on protocol level 1 are too strong.

COPYRIGHT

Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll

Copyright (C) 1992 Ronald S. Karr

See a file COPYING, distributed with the source code, or type smail -bc, to view distribution rights and restrictions associated with this software.

CETTE PAGE DOCUMENTE AUSSI :