sendmail(1M)
sendmail, mailq - send network mail
As shipped in IRIX 6.5.7. Last changed in IRIX 6.5.5.
NAME sendmail, mailq - send network mail SYNOPSIS /usr/lib/sendmail [ flags ] [ address ... ] mailq newaliases 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 preformatted 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 networks 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, the letter is not delivered to john. flags (command line options) are: -Btype 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 are 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. -bD Same as -bd except runs in foreground. -bh Print the persistent host status database. -bH Purge the persistent host status database. -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. -bv Verify names only -- do not try to collect or deliver a message. Verify mode is normally used for validating users or mailing lists. Note that this will only check the ability for the current system to deliver to an address, and does not verify the existance of that address on remote systems. -bz Create the configuration freeze file. For security reasons, only superuser can use this mode. -Cfile Use alternate configuration file. If file is not specified, sendmail.cf in the current directory is used. For security reasons, sendmail refuses to run as root if an alternate configuration file is specified. -dX[.Y] Set debugging value X to level Y (defaults to level 1) -ex Identical to the e option (see below). -Ffullname Set the full name of the sender. -fname Sets the name of the "from" person (the sender of the mail). -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 Ignore dots alone on lines by themselves in incoming messages. This should be set if you are reading data from a file. -N Set delivery status notification conditions to dsn, which can be `never' for no notifications or a comma separated list of the values `failure' to be notified if delivery failed, `delay' to be notified if delivery is delayed, and `success' to be notified when the message is successfully delivered. -n Don't do aliasing. -Ooption=value Set option option to the specified value. This form uses long names. Some options are described below. -oXvalue Set option X to the specified value. This form uses single character names only. Some 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' being days, and `w' being weeks. For example, `-q1h30m' or `-q90m' both set the timeout to one hour thirty minutes. If time is specified, sendmail will run in background. This option can be used safely with -bd . -qIsubtr Limit processed jobs to those containing substr as a substring of the queue id -qRsubtr Limit processed jobs to those containing substr as a substring of the recipients -qSsubtr Limit processed jobs to those containing substr as a substring of the sender -Rreturn Set the amount of the message to be returned if the message bounces. The return parameter can be `full' to return the entire message or `hdrs' to return only the headers. -rname An alternate and obsolete form of the -f flag. -s Same as setting the f option (see below). -t Read message for recipients. To:, Cc:, and Bcc: lines are scanned for people to send to. The Bcc: line is deleted before transmission. Any addresses in the argument list are suppressed, that is, they do not receive copies even if listed in the message header. -U Initial (user) submission. This should always be set when called from a user agent such as Mail or exmh and never be set when called by a network delivery agent such as rmail. -Venvid Set the original envelope id. This is propagated across SMTP to servers that support DSNs and is returned in DSN-compliant error messages. -v Go into verbose mode. Alias expansions are announced and so on. -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 logs a lot of data very quickly. -Zfile Define alternate freeze file. For security reasons, only superuser can use this flag. There are a number of processing options that can be set. Normally these are only used by a system administrator. Options can be set either on the command line using the -o flag (for short names), the -O flag (for long names), or in the configuration file. Both the long names and short (single character) names are listed here. These are described in detail in the IRIX Admin: Networking and Mail guide. Options are: AliasFile=file Afile Use alternate alias file. AliasWait=N 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. BlankSub=c Bc Set the blank substitution character to c. Unquoted spaces in addresses are replaced by this character. MinFreeBlocks=nblocks 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 is rejected. Default values are 0 and infinite respectively. HoldExpensive c On mailers that are considered expensive to connect to, don't initiate immediate connection. This requires queueing. CheckpointInterval=N 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. DeliveryMode=x dx Set the delivery mode to x. Only the first character of the mode is significant. Delivery modes are background for background (asynchronous) delivery, defered for defered (hold as is) delivery. interactive for interactive (synchronous) delivery, and q for queue only -- actual delivery is done the next time the queue is run. AutoRebuildAliases D Try to automatically rebuild the alias database if necessary. ErrorHeader=/file|format 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 formats are read from the specified file. The error header formats are macro-expanded before being inserted into the error message. ErrorMode=x ex Set error processing to mode x. Valid modes are m to mail back the error message, e like m, but always exist with a zero exit status, 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. TempFileMode=mode Fmode The mode to use when creating temporary files. Modes are in octal. SaveFromLine f Save UNIX-style From: lines at the front of messages. MatchGecos G Match local mail names against the GECOS portion of the password file. DefaultUser gN The default group ID to use when calling mailers. This option is deprecated in favor of the u mode. HelpFile=file Hfile The SMTP help file. MaxHopCount=N hN The maximum number of times a message is allowed to hop before sendmail decides it is in a loop. IgnoreDots 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. ForwardPath=path 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. SendMimeErrors j If set, send error messages in MIME format (see RFC1341 and RFC1344 for details). ConnectionCacheTimeout=timeout Ktimeout The maximum amount of time a cached connection is permitted to idle without activity. The format of timeout is the same as for the -q flag above. The default is five minutes. ConnectionCacheSize=N kN The maximum number of open connections that are cached at a time. The default is one. Setting it to zero defaults to the old behavior, that is, connections are closed immediately. LogLevel=n Ln Sets the log level. Causes sendmail to log informational messages to the system SYSLOG. Higher values of n log increasingly trivial information. Note that each level logs its own information plus all information logged by lower valued log levels. Possible values for n are: 0 No logging 1 Serious system failures and potential security problems 2 Network problems and protocol failures 3 Forwarding and received message errors 4 Minor errors 5 Received messages/message collection stats 6 Creation of error messages, VRFY and EXPN commands 7 Message delivery failures 8 Successful deliveries 9 Messages being deferred (due to a host being down and so on) 10 Alias/forward expansion 12 Connecting hosts 20 Attempts to run locked queue files 21 Monitor load average computation and process counting. UseErrorsTo 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. MeToo m Send to me (the sender) too, even if I am in an alias expansion. CheckAliases n Validate the RHS when building the alias database. OldStyleHeaders o If set, this message can have old-style headers. If not set, this message is guaranteed to have new-style headers (commas instead of spaces between addresses). If set, an adaptive algorithm is used that correctly determines the header format in most cases. PostMasterCopy=addr Paddr Add addr to the Cc: list of all error messages. PrivacyOptions=opt,opt,... popt,opt,... Set the privacy options. Privacy is really a misnomer; many of these are just a way of insisting on stricter adherence to the SMTP protocol. Possible opt values are: authwarnings Add X-Authentication-Warning: headers goaway Disallow essentially all SMTP status queries needexpnhelo Insist on HELO or EHLO command before EXPN needmailhelo Insist on HELO or EHLO command before MAIL needvrfyhelo Insist on HELO or EHLO command before VRFY noexpn Disallow EXPN entirely novrfy Disallow VRFY entirely noreceipts Ignore Return-Receipt-To: header public Allow open access (the default) restrictmailq Restrict mailq command restrictqrun Restrict -q command line flag R Normally, sendmail tries to eliminate any unnecessary explicit routes when sending an error message. If the R option is set, this is disabled, and the mail is sent to the first address in the route. Timeout.suboption=time rtime Sets a number of different timeouts. If the old syntax is used the mail, rcpt, datainit, datablock, datafinal,and command values will be set. time is specified in the standard sendmail manner. Valid suboptions are: command Wait for the next command connect Wait for the connect(2) to return datablock Wait for each DATA block read datafinal Wait for acknowledgment of final dot datainit Wait for DATA acknowledgment fileopen Wait for an NFS file to open helo wait for HELO or EHLO hoststatus Duration of host status iconnect Wait for the first connect(2) initial Wait for initial greeting message mail Wait for MAIL acknowledgment misc wait for other SMTP commands queuereturn Bounce if still undelivered queuewarn Warn if still undelivered quit Wait for QUIT acknowledgment rcpt Wait for RCPT acknowledgment rset Wait for RSET acknowledgment StatusFilefile Sfile Save statistics in the named file. SuperSafe s Always instantiate the queue file, even under circumstances where it is not strictly necessary. QueueTimeout=time Ttime Set the return and warning timeouts for messages in the queue to the specified times. The format of time is the same as for the -q flag above. If time is a positive value, messages that sit in the queue for longer than time are returned to the sender. The default is five days. TimeZoneSpec ttzinfo Set the local time zone info to tzinfo For example, PST8PDT. If this value set but has no value the enviormentvariable TZ is used. The IRIX sendmail correctly sets this variable without a value by default. DefaultUser=U[:G] uU[:G] Set the default user ID to U. Set the default group ID to G. FallbackMXhost=host Vhost If specified, the host acts like a very low priority MX on every host. Verbose v Run in verbose mode. TryNullMXList w If we are best MX, try host directly. (Set by default.) RefuseLA=load Xload When the system load average exceeds load, refuse incoming SMTP connections. QueueLA=load xload When the system load average exceeds load, just queue messages (don't try to send them). ForkEachJob Y Fork jobs during queue runs. Recipientfactor=fact yfact Work recipient factor. The indicated factor is added to the priority (thus lowering the priority of the job) for each recipient; this value penalizes jobs with large numbers of recipients. RetryFactor=fact 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 is decreased by the indicated value. ClassFactor=fact 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: are favored. SevenBitInput 7 Strip input to seven bits for compatibility with old systems. This shouldn't be necessary. EightBitMode=mode 8mode Set the handling of eight bit input to seven bit destinations to mode `m' (mimeify) will convert to seven-bit MIME format, mode `p' (pass) will pass it as eight bits (but violates protocols), and mode `s' (strict) will bounce the message. MinQueueAge=timeout Sets how long a job must ferment in the queue between attempts to send it. DefaultCharSet=charset Sets the default character set used to label 8-bit data that is not otherwise labeled. DialDelay=sleeptime If opening a connection fails, sleep for sleeptime seconds and try again. Useful on dial-on-demand sites. NoRecipientAction=action Set the behaviour when there are no recipient headers (To:, Cc: or Bcc:) in the message to action: none leaves the message unchanged. add-to adds a To: header with the envelope recipients. add-apparently-to adds an Apparently-To: header with the envelope recipients. add-bcc adds an empty Bcc: header. add-to-undisclosed adds a header reading ``To: undisclosed- recipients:;''. MaxDaemonChildren=N Sets the maximum number of children that an incoming SMTP daemon will allow to spawn at any time to N. ConnectionRateThrottle= N Sets the maximum number of connections per second to the SMTP port to N. DIAGNOSTICS sendmail returns an exit status describing what it did. The codes are defined in <sysexits.h>. 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 Hostname not recognized. EX_TEMPFAIL Message could not be sent immediately, but was queued. If invoked as newaliases (see newaliases(1M)), sendmail rebuilds the alias database. If invoked as mailq, sendmail prints the contents of the mail queue. sendmail will log varying amounts via the syslog(3) facility depending on the setting of the LogLevel (L) option. Further statics can be gathered via use the the StatusFile option and the mailstats(1m) program. FORWARDING MAIL USING SENDMAIL As a personal alternative to aliasing, a user can 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 can be separated by commas or newlines. 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 sendmail redirects 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 message to standard input of /usr/local/bin/mymailer. The user can 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 appends each incoming message to john's regular mailbox and send a copy of each message to the /usr/sbin/vacation program. AUTOCONFIGURATION The default IRIX sendmail.cf configuration file supports the IRIX autoconfiguration feature. This autoconfiguring sendmail.cf file works in conjunction with the configmail(1M) script. When sendmail parses the autoconfiguring sendmail.cf file, it is directed to call configmail to obtain the values for all critical macros and classes. These values are calculated at runtime by configmail. For most mail environments, the calculated default values returned by configmail should be sufficient to provide a working sendmail configuration. 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 configmail script provides interactive user interface modes to assist in modifying the default configuration, verifying the current configuration parameter settings and getting help information on the various configuration parameters themselves. For example, a quick check and adjustment of the most important configuration parameters can be done by giving the command: /usr/etc/configmail setup Silicon Graphics Extensions A number of extensions have been added to this version of sendmail. These features may disapear in the future as stock sendmail provides mechanisms to provide similar functionality. The freeze file and the -bz and -Z options provide the ability to cache the result of file includes and program executions to allow for quick startup of sendmail. The format of the freeze file is similar to the sendmail.cf file. Generation of the freeze file is performed automaticly at boot time if the file /etc/sendmail.fc exists and is not empty. Zero length freeze files are ignored. The directory lookups can be made to via nsd(1M) by using the nsd class. This lookup class is called nsd, and the file argument should be the nsd table the lookup is requested in. eg: nsd:mail.aliases The pathalias database will be used to route UUCP mail if a pathalias database exists. This can be performed by using $[ and $] in rules. See the distributed sendmail.cf for examples. If the file /etc/shells exists it should contain a list of shells (one per line) of shells that a user must have to use a | in a .forward file. If this file does not exist the shells /bin/sh, /usr/bin/sh, /bin/csh, /usr/bin/csh, /sbin/sh, /sbin/csh, /bin/ksh, /sbin/ksh, /usr/bin/ksh, /bin/tcsh, /usr/bin/tcsh will be used as a default list. To disable this feature (which can lead to security problems) put the line ``/SENDMAIL/ANY/SHELL/'' in /etc/shells. Macros and Options defined in the sendmail.cf file (but not on the command line) can be set to the output of a program. Examples of this are in the distributed sendmail.cf. The number of ``sendmail'' processes running on a system will be added to the load average when checking QueueLA and RefuseLA. This functionality can be disabled by adding ",l" to the option value. (eg: Ox20,l) If you system is setup to use capabilities, access control lists, and trusted networking sendmail will support it. A line containing ``+:+'' in the /etc/alias file will automaticly enable NIS alias support. This will produce redundant NIS requests if nsd is used for aliases lookups, and nsd is configured to use nis for aliases. The existance of the file /etc/resolv.conf enables DNS and MX support in sendmail. On systems that are not configured to support DNS, this file MUST not exist. FILES /etc/sendmail.cf configuration file (with autoconfiguration support) /etc/sendmail.fc frozen configuration ~/.forward optional per-user forwarding targets The following filenames 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 configmail(1M), mail_att(1), mail_bsd(1), mailstats(1m), makemap(1m), rc2(1M), rmail(1M), vacation(1), resolver(3N), syslog(3C), aliases(4). Internet Requests For Comments RFC-819, RFC-821, RFC-822. IRIX Admin: Networking and Mail sendmail (2nd Edition) by Bryan Costales with Eric Allman and Neil Rickert, O'Reilly & Associates, Inc. ISBN 1-56592-222-0 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 results. This happens because upon receiving mail to john@iris2, host iris2 attempts to find john in the local and NIS aliases databases. If the entry for john has not been properly updated, it can still point to john@iris1.