SENDMAIL(1M) SENDMAIL(1M) NAME sendmail, mailq - send network mail SYNOPSIS /usr/lib/sendmail [ flags ] [ address ... ] mailq DESCRIPTION Sendmail sends a message to one or more recipients, routing the message over whatever networks are necessary. Sendmail does internetwork forwarding as necessary to deliver the message to the correct place. Sendmail is not intended as a user-interface routine; other programs provide user-friendly front ends; sendmail is used only to deliver pre- formatted messages. With no flags, sendmail reads its standard input up to an end-of-file or a line with a single dot and sends a copy of the letter 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, e.g., ``john'' sends to ``group'', and ``group'' includes ``john'' in the expansion, then the letter will not be delivered to ``john''. Flags are: -BI type Set the body type to type. Current legal types are 7BIT or 8BITMIME. -ba Go 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. -bd Run as a daemon. -bi Initialize the alias database. -bm Deliver mail in the usual way (default). -bp Print a listing of the queue. -bs Use the SMTP protocol as described in RFC-821. This flag implies all the operations of the -ba flag that are compatible with SMTP. -bt Run in address test mode. This mode reads addresses and shows the steps in parsing; it is used for debugging configuration tables. Page 1 SENDMAIL(1M) SENDMAIL(1M) -bv Verify names only - do not try to collect or deliver a message. Verify mode is normally used for validating users or mailing lists. -bz Create the configuration freeze file. For security reasons, only super-user can use this mode. -c Identical to the c option (see below). -Cfile Use alternate configuration file. If file is not specified, sendmail.cf in the current directory will be used. For security reasons, sendmail refuses to run as root if an alternate configuration file is specified. -dX Set debugging value to X. -ex Identical to the e option (see below). -Ffullname Set the full name of the sender. -fname Sets the name of the ``from'' person (i.e., the sender of the mail). -f can only be used by the special users root, daemon, and network, or if the person you are trying to become is the same as the person you are. -hN Set 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. -I Identical to the -bi flag (see above). -i Identical to the i option (see below). -m Identical to the m option (see below). -n Don't do aliasing. -oXvalue Set option X to the specified value. Options are described below. -pprotocol 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''. -qtime Process saved messages in the queue at given intervals. If time is omitted, process the queue once. Time is given as a tagged number, with `s' being seconds, `m' being minutes, `h' being hours, `d' Page 2 SENDMAIL(1M) SENDMAIL(1M) being days, and `w' being weeks. For example, ``-q1h30m'' or ``-q90m'' would both set the timeout to one hour thirty minutes. -rname An alternate and obsolete form of the -f flag. -s Same as setting the f option (see below). -T Identical to the T option (see below). -t Read message for recipients. To:, Cc:, and Bcc: lines will be scanned for people to send to. 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. -v Go into verbose mode. Alias expansions will be announced, etc. -Xlogfile 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. -Zfile Define alternate freeze file. For security reasons, only super-user can use this flag. There are also a number of processing options that may be set. Normally these will only be used by a system administrator. Options may be set either on the command line using the -o flag or in the configuration file. These are described in detail in the IRIX Sendmail Reference appendix of the IRIX Advanced Site and Server Administration Guide. Options are: Afile Use alternate alias file. aN If the alias database is being rebuilt by another process, wait up to N minutes for the rebuild to finish. If the alias database is not rebuilt in N minutes, rebuild the database (if the D option is set) or issue a warning. Bc Set the blank substitution character to c. Unquoted spaces in addresses are replaced by this character. bnblocks[/maxmsgsize] Set the minimum number of free blocks needed on the spool filesystem to accept any message and the maximum allowable message size. If the spool filesystem is too full or the message size is too large, mail will be rejected. Default values are 0 and infinite respectively. Page 3 SENDMAIL(1M) SENDMAIL(1M) c On mailers that are considered ``expensive'' to connect to, don't initiate immediate connection. This requires queueing. CN Checkpoint the queue file after every N successful deliveries (default 10). This avoids excessive duplicate deliveries when sending to long mailing lists interrupted by system crashes. dx Set the delivery mode to x. Delivery modes are `i' for interactive (synchronous) delivery, `b' for background (asynchronous) delivery, and `q' for queue only - i.e., actual delivery is done the next time the queue is run. D Try to automatically rebuild the alias database if necessary. E/file|format Specify one or more headers to be added to error messages. If the value passed to the E option begins with the `/' character, the error header format(s) will be read from the specified file. The error header format(s) will be macro-expanded before being inserted into the error message. ex Set error processing to mode x. Valid modes are `m' to mail back the error message, `w' to ``write'' back the error message (or mail it back if the sender is not logged in), `p' to print the errors on the terminal (default), `q' to throw away error messages (only exit status is returned.) If the text of the message is not mailed back by modes `m' or `w' and if the sender is local to this machine, a copy of the message is appended to the file ``dead.letter'' in the sender's home directory. Fmode The mode to use when creating temporary files. f Save UNIX-style From lines at the front of messages. G Match local mail names against the GECOS portion of the password file. gN The default group id to use when calling mailers. Hfile The SMTP help file. hN The maximum number of times a message is allowed to ``hop'' before sendmail decides it is in a loop. I Insist that the domain name server be running to resolve host names and MX records. Treat ECONNREFUSED errors from the resolver as temporary failures. Page 4 SENDMAIL(1M) SENDMAIL(1M) i Do not take dots on a line by themselves as a message terminator. This is always disabled (that is, dots are always accepted) when reading SMTP mail. Jpath Set the path for searching for users' .forward files. The default is ``$z/.forward''. Path can also be set to a sequence of paths separated by colons; sendmail stops at the first file it can successfully and safely open. j If set, send error messages in MIME format (see RFC1341 and RFC1344 for details). Ktimeout The maximum amount of time a cached connection will be permitted to idle without activity. The format of timeout is the same as for the -q flag above. The default is five minutes. kN The maximum number of open connections that will be cached at a time. The default is one. Setting it to zero defaults to the old behavior, that is, connections are closed immediately. Ln The log level. l If there is an ``Errors-To:'' header, send error messages to the addresses listed there. MXvalue Set macro X to the specified value. This option is intended only for use from the command line. m Send to ``me'' (the sender) too, even if I am in an alias expansion. n Validate the RHS when building the alias database. Ooptions Set server SMTP options. o If set, this message may have old-style headers. If not set, this message is guaranteed to have new-style headers (i.e., commas instead of spaces between addresses). If set, an adaptive algorithm is used that will correctly determine the header format in most cases. Paddr Add addr to the Cc: list of all error messages. poptions Set the privacy options. Page 5 SENDMAIL(1M) SENDMAIL(1M) Qqueuedir Select the directory in which to queue messages. qfactor Slope of queue only function. R Normally, sendmail tries to eliminate any unnecessary explicit routes when sending an error message. If the R option is set, this will be disabled, and the mail will be sent to the first address in the route. rtimeout The timeout on reads; if none is set, sendmail will wait forever for a mailer. The format of timeout is the same as for the -q flag above. Sfile Save statistics in the named file. s Always instantiate the queue file, even under circumstances where it is not strictly necessary. Ttime[/wtime] Set the return and warning timeouts for messages in the queue to the specified times. The format of time and wtime is the same as for the -q flag above. If time is a positive value, messages which sit in the queue for longer than time will be returned to the sender. The default is five days. If wtime is a positive value, a warning message will be sent to the sender of any message which cannot be delivered within wtime and sendmail will continue to attempt delivery. The default is 0. ttzinfo Set the local time zone info to For example, ``PST8PDT''. The default is to use the user's TZ environment variable. uN Set the default user id for mailers. Vfallbackhost If specified, the fallbackhost acts like a very low priority MX on every host. v Run in verbose mode. w If we are best MX, try host directly. (Set by default.) XLA When the system load average exceeds LA, refuse incoming SMTP connections. xLA When the system load average exceeds LA, just queue messages (i.e., don't try to send them). Page 6 SENDMAIL(1M) SENDMAIL(1M) Y Fork jobs during queue runs. yfact Work recipient factor. The indicated factor is added to the priority (thus lowering the priority of the job) for each recipient, i.e., this value penalizes jobs with large numbers of recipients. Zfact Work time factor. The factor is added to the priority every time a job is processed. Thus, each time a job is processed, its priority will be decreased by the indicated value. zfact Work message class factor. The indicated factor (determined by the Precedence: field in the user header and the P lines in the configuration file) and subtracted from the priority. Thus, messages with a higher Priority: will be favored. 7 Strip input to seven bits for compatibility with old systems. This shouldn't be necessary. Sendmail returns an exit status describing what it did. The codes are defined in EX_OK Successful completion on all addresses. EX_NOUSER User name not recognized. EX_UNAVAILABLE Catchall meaning necessary resources were not available. EX_SYNTAX Syntax error in address. EX_SOFTWARE Internal software error, including bad arguments. EX_OSERR Temporary operating system error, such as "cannot fork". EX_NOHOST Host name not recognized. EX_TEMPFAIL Message could not be sent immediately, but was queued. If invoked as newaliases [see newaliases(1M)], sendmail will rebuild the alias database. If invoked as mailq, sendmail will print the contents of the mail queue. FORWARDING MAIL USING SENDMAIL As a personal alternative to aliasing, a user may put a file with the name .forward in his home directory. If this file exists, sendmail redirects mail for that user to the list of recipients in the .forward file. The recipients listed in the .forward file may be separated by commas or new-lines. Programs and files are valid recipients. For example, if user ``jane'' has a .forward file containing: jd@company.com /usr/tmp/mail.log |/usr/local/bin/mymailer Page 7 SENDMAIL(1M) SENDMAIL(1M) sendmail will redirect all incoming messages for ``jane'' to ``jd@company.com'', append a copy of the message to the file /usr/tmp/mail.log (if it has o+w permissions) and pipe a copy of the mes- sage to standard input of /usr/local/bin/mymailer. The user may redirect mail to himself in addition to sending it on to other destinations. This is particularly useful in the event that the user wishes to continue to receive mail in his own mailbox while passing copies of each incoming message on to some alternative destination. For example, if the home directory for user ``john'' contains a .forward file with contents: \john, "|/usr/sbin/vacation john" sendmail will append each incoming message to ``john'''s regular mailbox and send a copy of each message to the /usr/sbin/vacation program. AUTOCONFIGURATION OPTION In addition to the default sendmail.cf configuration file, IRIX includes an optional, autoconfiguring version named sendmail.cf.auto. If you wish to use the autoconfiguring version, you must rename the file /etc/sendmail.cf.auto to be /etc/sendmail.cf (making a backup copy of the existing /etc/sendmail.cf file as necessary) and then restart sendmail. This autoconfiguring version works in conjunction with the configmail(1M) script. When sendmail parses the autoconfiguring version of the sendmail.cf file, it will be directed to call configmail to obtain the values for all critical macros and classes. These values will be calcu- lated at runtime by configmail. For most mail environments, the calculated default values returned by configmail should be sufficient to provide a working sendmail configura- tion. In many cases, sendmail should be able to "configure itself" and begin working without any user intervention. In some situations, it may still be necessary or desirable to manually configure some of the critical configuration parameters. When using the autoconfiguring option, it should not be necessary to make any actual changes to the sendmail.cf file itself in order to do this. The config- mail script provides interactive user interface modes to assist in modi- fying the default configuration, verifying the current configuration parameter settings and getting help information on the various configura- tion parameters themselves. For example, a quick check and adjustment of the most important configuration parameters can be done by issuing the command: "/usr/etc/configmail setup" FILES /etc/sendmail.cf configuration file /etc/sendmail.cf.auto autoconfiguring version of sendmail.cf /etc/sendmail.fc frozen configuration ~/.forward optional per-user forwarding targets Page 8 SENDMAIL(1M) SENDMAIL(1M) The following are actually specified in /etc/sendmail.cf thus, these values are only approximations. /bin/mail to deliver local mail /bin/rmail to receive uucp mail /usr/etc/configmail autoconfiguration script /etc/aliases plain text file of system aliases /etc/aliases.{pag,dir} data base of system aliases /etc/sendmail.hf help file /var/sendmail.st collected statistics /usr/bin/uux to deliver uucp mail /usr/spool/mqueue/* temp files SEE ALSO mail_att(1), mail_bsd(1), rmail(1M), newaliases(1M), configmail(1M), vacation(1), syslog(3), aliases(4), resolver(3N), rc2(1M). Internet Requests For Comments RFC-819, RFC-821, RFC-822. IRIX Advanced Site and Server Administration Guide. sendmail by Bryan Costales with Eric Allman and Neil Rickert, O'Reilly & Associates, Inc. ISBN 1-56592-056-2 WARNING Alias loops are a notorious problem with electronic mail. With sendmail, you must be especially careful when using both local (/etc/aliases and .forward files) and domain-wide (NIS) aliases. For example, if user ``john'' moves from machine ``iris1'' to machine ``iris2'' it may, at first glance, seem logical to just add a local alias on ``iris1'' that forwards mail for ``john'' to ``john@iris2''. However, if you have neglected to update the NIS aliases database, an alias loop will result. This happens because upon receiving mail to ``john@iris2'', host ``iris2'' will attempt to find ``john'' in the local and NIS aliases databases. If the entry for ``john'' has not been properly updated, it may still point to ``john@iris1''. BUGS Not all configuration options are defined here. Page 9