Content-type: text/html Man page of sendmail

sendmail

Section: Maintenance Commands (8)
Index Return to Main Contents
 

NAME

sendmail, newaliases, mailq, smtpd - Sends mail over the Internet  

SYNOPSIS

/usr/sbin/sendmail [-flags] [address ...]

/usr/sbin/newaliases

/usr/sbin/mailq [-v]

/usr/sbin/smtpd  

FLAGS

Set the body type to type. The current values are "7BIT" or "8BITMIME". [Version 8 only] Goes into ARPANET mode. All input lines must end with a CR-LF, and all messages will be generated with a CR-LF at the end. Also, the From: and Sender: fields are examined for the name of the sender. Runs as a daemon. This requires Berkeley Interprocess Communications (IPC). The sendmail command will fork and run in the background, listening on the socket specified in the /etc/services file for incoming SMTP (Simple Mail Transfer Protocol) connections. This is normally run when going to multiuser mode.

Using this flag is equivalent to invoking sendmail as smtpd. This flag is the same as the -bd flag, except that it runs the foreground. This flag can be used for debugging purposes. [Version 8 only] Initializes the alias database. This is the same as invoking the newaliases command. Delivers mail in the usual way (default). Prints a listing of the queue. This is the same as invoking the mailq command. Use the SMTP protocol as described in RFC821 on standard input and output. This flag implies all the operations of the -ba flag that are compatible with SMTP. Runs in address test mode. This mode reads addresses and shows the steps in parsing; it is used for debugging configuration tables. Verifies names only. Does not try to collect or deliver a message. Verify mode is normally used for validating users or mailing lists. Creates the frozen configuration file. This option is obsolete. Uses alternate configuration file. The sendmail command refuses to run as root if an alternate configuration file is specified. Sets debugging value to X. A useful value is 21.n, where n is any nonzero integer less than 100. This produces information regarding address parsing and is typically used with the -bt flag. Higher values of n produce more verbose information. Sets the full name of the sender. Sets the name of the From: user field (that is, the sender of the mail). The -f flag can only be used by trusted users (normally root, daemon, and network) or if the person you are trying to become is the same as the person you are. Sets the hop count to N. The hop count is incremented every time the mail is processed. When it reaches a limit, the mail is returned with an error message, the victim of an aliasing loop. If not specified, Received lines in the message are counted. The maximum hop count is configurable, but defaults to 17 if you do not configure an alternate value. The default value is acceptable in most installations but you may want to increase the value if too many messages are being lost Defines Macro to have Value. This option is normally used only from the sendmail daemon command line. Does not do aliasing or forwarding. Set the Delivery Status Notification (DSN) request condition to dsn. If the remote site understands DSN, it will return a notification based on the value of dsn. This can be either "never" or a comma-separated list of: Request for notification on successful delivery. Request for notification if a message fails to be delivered. Request for notification if the message is delayed for any reason. If the -N flag is omitted, the notification policy is left to the other site. The default values for dsn are failure and delay. [Version 8 only] Sets option X to the specified value. Processing flags specified with -o are described in the Processing Flags section. Set the name of the protocol used to receive the message. This can be a simple protocol name such as UUCP or a protocol and hostname, such as UUCP:ucbvax. [Version 8 only] Processes saved messages in the queue at given intervals. If time is omitted, processes the queue once. The time command is given as a tagged number, with s being seconds, m being minutes, h being hours, d being days, and w being weeks. For example, -q1h30m or -q90m would both set the time-out to 1 hour and 30 minutes. If the time command is specified, the sendmail command will run in background mode. This flag can be used safely with -bd. Limit processed jobs to those containing substr as a substring of the queue ID. [Version 8 only] Limit processed jobs to those containing substr as a substring of one of the recipients. [Version 8 only] Limit processed jobs to those containing substr as a substring of the sender. [Version 8 only] An alternate and obsolete form of the -f flag. Defines what to return on a Delivery Status Notification if the message is bounced. [Version 8 only]
The value of ret can be: Return the entire message. Return headers only. Reads a message for recipients. The To:, Cc:, and Bcc: lines will be scanned for recipient addresses. The Bcc: line will be deleted before transmission. Any addresses in the argument list will be suppressed; that is, they will not receive copies even if listed in the message header. Goes into verbose mode. Alias expansions will be announced, and so forth. Log all traffic in and out of mailers in the indicated log file. This should only be used as a last resort for debugging mailer bugs. It will log a lot of data very quickly.
 

DESCRIPTION

The sendmail command sends a message to one or more recipients, routing the message over whatever networks are necessary. The sendmail command does internetwork forwarding as necessary to deliver the message to the correct place.

The sendmail command is not intended as a user interface routine. Other programs provide user-friendly front ends; sendmail is used only to deliver preformatted messages.

With no flags, sendmail reads its standard input up to an End-of-File or to a line consisting only of a single . (dot), and sends a copy of the message found there to all of the addresses listed. It determines the network(s) to use based on the syntax and contents of the addresses.

Local addresses are looked up in a file and aliased appropriately. Aliasing can be prevented by preceding the address with a \ (backslash). Normally the sender is not included in any alias expansions; for example, if john sends to group, and group includes john in the expansion, then the letter will not be delivered to john.

Tru64 UNIX provides /usr/sbin/sendmail.v8 and an older version based upon Version 5.65 and IDA extensions. By default, /usr/sbin/sendmail is linked to sendmail Version 8.

For additional information on mail, see the sendmail book by O'Reilly & Associates.  

Processing Option Flags

There are a number of optional sendmail processing flags that can be set. Normally, these will only be used by a system administrator. Processing flags can be set either on the command line using the -o flag or in the configuration file. (Refer to the sendmail.cf reference page for details on the sendmail.cf file.)

The processing flags are as follows: Full pathname to the alias file. The minimum number of free blocks (bminblocks) needed on the spool filesystem. [Version 8 only] Sets the blank substitution character to the character specified in the Character parameter. The sendmail daemon replaces unquoted spaces in addresses with Character. The supplied configuration file uses the . (dot) for Character. Causes sendmail to queue messages for that mailer daemon without sending them if an outgoing mailer is marked as expensive to use. The queue can be run when costs are lower or when the queue is large enough to send the message efficiently. Checkpoint the queue file after n successful deliveries. This avoids excessive duplicate deliveries when sending to a large mailing list should the mail delivery be interrupted. Sets the delivery mode to x. Delivery modes are i for interactive (synchronous) delivery, b for background (asynchronous) delivery, and q for queue only (that is, actual delivery is done the next time the queue is run). Tries to automatically rebuild the alias database if necessary. Sets error processing to mode x. Valid modes are the following: Mails the error message to the user's mailbox, but always exits with a 0 (zero) exit status (normal return). Mails the error message to the user's mailbox. Displays the error message on the terminal (default). Throws away the error message and returns the exit status only. Writes the error message to the terminal or mails it if the user is not logged in.

If the text of the message is not mailed by modes m or w and if the sender is a local user, a copy of the message is appended to the dead.letter file in the sender's home directory. The mode to use when creating temporary files. Saves UNIX compatible style From: lines at the front of messages. Enables GECOS fuzzy-logic name matching.
The GECOS fields is a field in the /etc/passwd file that usually contains the user's full name. You can modify this information by using the chfn routine. If sendmail does not find an exact match for the user name, the Match-GECOS option tries to match the user name against names in the /etc/passwd file.
For example, if user Jane Q. Public's user name is jpq, she will receive mail sent to jane, if she is the only Jane in the /etc/passwd file. Likewise, if John Doe's username is jd, he will receive mail sent to doe, if he is the only Doe in the /etc/passwd file.
The sendmail Version 8 command and previous versions of sendmail differ in how they process GECOS information. If the GECOS option is enabled, sendmail Version 8 is very stringent; it requires a match on the entire name. For instance, if the GECOS field for user jd is "John Doe", then sendmail Version 8 will only work for mail sent to john doe. An older version of sendmail may work with john doe, john, or doe assuming that this is the only john (or the only doe) in the file. The default group ID to use when calling mailers. The SMTP help file. Specifies the maximum hop count.
The maximum hop count option specifies the maximum number of machines that a mail message can be sent to before it is rejected. This limit is used to help prevent infinite mail loops. The default is 17. Depending on the size of your mail system, you may require a higher or lower minimum hop count. Does not interpret a . (dot) on a line by itself as a message terminator. Removes the excess dot inserted by a remote mailer at the beginning of a line if mail is received through SMTP. In addition, if receiving mail through SMTP, any dot at the front of a line followed by another dot is removed. This is the opposite of the action performed by the X mailer flag. Indicate that sendmail should use the Internet domain name server if it can. Send error messages in Multipurpose Internet Mail Extension (MIME) format. [Version 8 only] Set connection cache time out. [Version 8 only] Set connection cache size. [Version 8 only] Specifies the log level to be the value supplied in the number argument. Each number includes the activities of all numbers of lesser value and adds the activity that it represents. Valid levels and the activities that they represent are as follows: Prevents logging. Logs major problems only. Logs message collections and failed deliveries. Logs successful deliveries. Logs messages deferred (for example, because the host is down). Logs messages that are placed in the queue (normal event). Logs unusual but benign incidents (for example, trying to process a locked file). Logs the internal queue ID to external message ID mappings (the default). This can be useful for tracing a message as it travels between several hosts. Logs messages that are of interest when debugging. Logs verbose information regarding the queue. If the sender uses an alias, and that sender is a member of the group named by the alias, then also send to the sender. Validates the right-hand side of alias rewrite rules when the sendmail daemon performs the newaliases function. Applies to versions prior to Version 8. Sets the name of the host network to NetworkName. The sendmail daemon compares the argument of an SMTP HELLO command to HostName.NetworkName (value of HostName comes from the kernel). If these values do not match, it adds the HostName.NetworkName string to the Received: line in the message so that messages can be traced accurately. If set, this message may have old style headers. If not set, this message is guaranteed to have new style headers (that is, commas instead of spaces between addresses). If set, an adaptive algorithm is used that will correctly determine the header format in most cases. Identifies the person who is to receive a copy of all returned mail. Selects the directory in which to queue messages. The directory will be created if it does not exist. The time-out on reads. If none is set, sendmail will wait forever for a mailer. This flag violates the word (if not the intent) of the SMTP specification, so the time-out should probably be fairly large.
The sendmail Version 8 command has additional fine-grained control of timeouts. See the Sendmail Installation and Operation Guide for additional information. This guide can be accessed from the following URL:
http://uwsg.ucs.indiana.edu/usail/mail/op/op.html Saves statistics in the named file. Statistics are only collected if the file exists. This file must be created by the user. The recommended path for this is /var/adm/sendmail/sendmail.st. Statistics can be printed out using /usr/sbin/mailstats. Always instantiates the queue file, even under circumstances where it is not strictly necessary. This provides safety against system crashes during delivery. Sets the time-out on undelivered messages in the queue to the specified time. After delivery has failed (for example, because of a host being down) for this amount of time, failed messages will be returned to the sender. The default in the configuration file is 3 days. Sets the name of the time zone. Sets the default user ID for mailers. Runs in verbose mode. The sendmail daemon delivers each message in the mail queue from a separate process. This option is not required; it can increase system overhead in this environment.
 

Aliases Interpretation

In aliases, the first character of a name can be a vertical bar to cause interpretation of the rest of the name as a command to pipe the mail to. It may be necessary to quote the name to keep sendmail from suppressing the blanks from between arguments. For example, a file can contain a common alias such as: msgs: "|/usr/bin/msgs -s"

Aliases can also have the syntax :include:filename to ask sendmail to read the named file for a list of recipients. For example, an alias such as: poets: :include:/usr/local/lib/poets.list reads /usr/local/lib/poets.list for the list of addresses making up the group.

You can also use the Network Information Service (NIS) to distribute your aliases to other systems.
 

Exit Status

The sendmail command returns an exit status describing what it did. The codes are defined in <sysexits.h>: Successful completion on all addresses. The username was not recognized. A catchall meaning necessary resources were not available. There is a syntax error in the address. There is an internal software error, including bad arguments. There is a temporary operating system error, such as cannot fork. The hostname was not recognized. The message could not be sent immediately, but was queued.  

Links to sendmail

Three additional commands are links to sendmail: Prints the contents of the mail queue. This command is the same as running sendmail with the -bp flag. Builds a new copy of the alias database from the /var/adm/sendmail/aliases file. This command is the same as running sendmail with the -bi flag. Runs sendmail as a daemon. This command is equivalent to invoking sendmail with the -bd flag.  

Mail Addresses

Mail addresses are based on the domain address (Internet) protocol. These addresses have the form: user@host.domain

Note that the configuration file provided with sendmail specifies that blanks in addresses be converted to dots before being transmitted. This convention follows the Internet mail protocol described in RFC822, but does not match the Internet mail protocol described in RFC733 (NIC41952). You can change this setting by setting the OB flag in the sendmail configuration file (see the sendmail.cf(4) reference page).

A domain is a logical grouping of systems that are connected together by physical network links. No direct relationship exists between the actual physical interconnections and the way in which the systems are grouped in the domain. The domain name identifies a specific domain within a larger group of domains. The domain name has the format of a tree structure. Each node (or leaf) on the tree corresponds to a resource set, and each node can create and contain new domains below it. The actual domain name of a node is the path from the root of the tree to that node.

For example, if node hera is part of the domain OSF, which is in turn a subdomain of ORG, a message sent to user geo at that address, uses this format: geo@hera.OSF.ORG

The message router (usually sendmail) must determine how to send the message to its final destination. If the router is at hera, it delivers the message to user geo. If the router is at another system within the OSF domain, it corresponds with the name server for that domain to find out how to deliver the message. If the router is not a part of the OSF domain but is in a domain that is under the ORG domain, it corresponds with the name server for the ORG domain to find out how to deliver the message. The respective name server returns a network address to the router. That network address determines the actual path that the message takes to its destination.

The domain address is read from right to left, with each domain in the address separated from the next domain by a . (dot). This format does not imply any routing. Thus, although the example is specified as an ORG address, the message might actually travel by a different route if that were more convenient or efficient. At one site, the message associated with the sample address goes directly from the sender to node hera over a local area network. At another site, it might be sent over a UUCP network or a combination of other delivery methods.

Normally, the actual routing of a message is handled automatically. However, you can route the message manually through several specified hosts to get it to its final destination. An address using intermediate hosts, called a route address, has the following form: @hosta,@hostb:user@hostc

Explicitly specifying the message routing with these route addresses, while supported, is strongly discouraged by RFC 1123. Instead, allow the mail software (for example sendmail) to handle routing issues.

This address specifies that the message goes first to the remote system represented by hosta, then to the remote system represented by hostb, and finally to the remote system represented by hostc. This path is forced even if there is a more efficient route to hostc.

In some cases you may abbreviate the address rather than entering the entire domain name. In general, systems in the same domain do not need to use the full domain name. For example, a user on node zeus.XYZ.COM can send a message to geo@hera.XYZ.COM by entering only geo@hera because they are in the same local domain, XYZ.COM.

Other mail address formats exist and the mail routing program (sendmail) converts most of these other formats to a format that the network routing system can use. However, if you use the domain address format, the routing program operates more efficiently.

For example, if sendmail receives an address in the following format: @host:user it converts it to the corresponding domain address format: user@host

Similarly, if sendmail receives an address in the following format: host!user the mail routing program routes the message directly to the uucp command. However, when sending mail via uucp, you must include a route address that indicates which UUCP host(s) to send the message through to get to the final destination.

To route messages through the UUCP network, use one of the following domain address formats. Your choice depends on the way in which the systems at your site are connected: @system_name.domain_name:uucp-route!user-ID

For example, the address: @zeus:hera!amy sends a message to user amy on UUCP host hera by way of system zeus. The address: @apollo.802:merlin!lgh sends a message to user lgh on UUCP host merlin via system apollo under the local domain 802. uucp-route:!user-ID@system_name.domain_name
In this case, the address: merlin!arthur!amy@hera.802 sends a message to user amy on system hera under domain 802 via the UUCP link merlin through arthur. system_name.domain_name:uucp-route:!user-ID@system_namedomain_name
In this example, the address: @apollo.802:merlin!arthur!amy@hera.802 sends a message to user amy on system hera under domain 802 that first goes through apollo, the gateway node for domain 802, and then through the UUCP link merlin through arthur. (Including 802 in this example is optional because the two domain names are identical.) hosta!hostb!hostc!user
This example is a purely UUCP route address. zeus!hera!kronos!amy sends a message to amy on kronos via the UUCP link zeus through hera. @hosta.UUCP:@hostb.UUCP:user@hostc
This example, like the previous one, is a purely UUCP route address. @zeus.UUCP:@hera.UUCP:amy@kronos.UUCP sends a message to amy on kronos via the UUCP link zeus through hera.
Your host may also be configured to handle DECnet addresses. Under DECnet Phase IV, an address is of the form nodename::username
This is typically converted into a "domain'ized" form, such as user@nodename.dnet.parent-domain (parent-domain is something such as dec.com or OSF.ORG that uniquely identifies your company). Similarly, your host may also handle Phase V type addresses, such as joe@dec:.nyc.mars.
 

NOTES

By default, Tru64 UNIX's sendmail software uses message encoding that uses 8 bits of each byte. Although 8-bit encoding better supports the full range of characters in many non-English languages, 8-bit encoding is not generally recommended because it violates the SMTP protocol used for mail transmission over a TCP/IP network.  

RESTRICTIONS

Tru64 UNIX software does not support the -bz option.  

FILES

Specifies the command path. The configuration file. The raw data for alias names. Sets the option variable A to the full pathname of the aliases file (/var/adm/sendmail/aliases). This file and the aliases.dir file comprise the database of alias names. This file and the aliases.pag file comprise the database of alias names. A frozen configuration.
This option is not supported in Tru64 UNIX. The help file. The collected statistics. The mail queue directory.

Except for /usr/sbin/sendmail and /var/adm/sendmail.cf, the previous pathnames are all specified in the /var/adm/sendmail.cf file, so they may vary on your system.

The process id of the daemon.  

RELATED INFORMATION

Commands: mail(1), mailx(1), rc0(8)

Functions: syslog(3)

Files: aliases(4), forward(4), sendmail.cf(4)

Specifications: RFC819, RFC821, RFC822 delim off


 

Index

NAME
SYNOPSIS
FLAGS
DESCRIPTION
Processing Option Flags
Aliases Interpretation
Exit Status
Links to sendmail
Mail Addresses
NOTES
RESTRICTIONS
FILES
RELATED INFORMATION

This document was created by man2html, using the manual pages.
Time: 02:40:40 GMT, October 02, 2010