op.me
上传用户:xu_441
上传日期:2007-01-04
资源大小:1640k
文件大小:225k
- Path The pathname of the mailer
- Flags Special flags for this mailer
- Sender Rewriting set(s) for sender addresses
- Recipient Rewriting set(s) for recipient addresses
- Argv An argument vector to pass to this mailer
- Eol The end-of-line string for this mailer
- Maxsize The maximum message length to this mailer
- maxmessages The maximum message deliveries per connection
- Linelimit The maximum line length in the message body
- Directory The working directory for the mailer
- Userid The default user and group id to run as
- Nice The nice(2) increment for the mailer
- Charset The default character set for 8-bit characters
- Type Type information for DSN diagnostics
- Wait The maximum time to wait for the mailer
- / The root directory for the mailer
- .)b
- Only the first character of the field name is checked.
- .pp
- The following flags may be set in the mailer description.
- Any other flags may be used freely
- to conditionally assign headers to messages
- destined for particular mailers.
- Flags marked with (dg
- are not interpreted by the
- .i sendmail
- binary;
- these are the conventionally used to correlate to the flags portion
- of the
- .b H
- line.
- Flags marked with (dd
- apply to the mailers for the sender address
- rather than the usual recipient mailers.
- .nr ii 4n
- .ip a
- Run Extended SMTP (ESMTP) protocol (defined in RFCs 1869, 1652, and 1870).
- This flag defaults on if the SMTP greeting message includes the word
- .q ESMTP .
- .ip A
- Look up the user part of the address in the alias database.
- Normally this is only set for local mailers.
- .ip b
- Force a blank line on the end of a message.
- This is intended to work around some stupid versions of
- /bin/mail
- that require a blank line, but do not provide it themselves.
- It would not normally be used on network mail.
- .ip c
- Do not include comments in addresses.
- This should only be used if you have to work around
- a remote mailer that gets confused by comments.
- This strips addresses of the form
- .q "Phrase <address>"
- or
- .q "address (Comment)"
- down to just
- .q address .
- .ip C(dd
- If mail is
- .i received
- from a mailer with this flag set,
- any addresses in the header that do not have an at sign
- (c
- .q @ )
- after being rewritten by ruleset three
- will have the
- .q @domain
- clause from the sender envelope address
- tacked on.
- This allows mail with headers of the form:
- .(b
- From: usera@hosta
- To: userb@hostb, userc
- .)b
- to be rewritten as:
- .(b
- From: usera@hosta
- To: userb@hostb, userc@hosta
- .)b
- automatically.
- However, it doesn't really work reliably.
- .ip d
- Do not include angle brackets around route-address syntax addresses.
- This is useful on mailers that are going to pass addresses to a shell
- that might interpret angle brackets as I/O redirection.
- .ip D(dg
- This mailer wants a
- .q Date:
- header line.
- .ip e
- This mailer is expensive to connect to,
- so try to avoid connecting normally;
- any necessary connection will occur during a queue run.
- See also option
- .b HoldExpensive .
- .ip E
- Escape lines beginning with
- .q From
- in the message with a `>' sign.
- .ip f
- The mailer wants a
- .b -f
- .i from
- flag,
- but only if this is a network forward operation
- (i.e.,
- the mailer will give an error
- if the executing user
- does not have special permissions).
- .ip F(dg
- This mailer wants a
- .q From:
- header line.
- .ip g
- Normally,
- .i sendmail
- sends internally generated email (e.g., error messages)
- using the null return address
- as required by RFC 1123.
- However, some mailers don't accept a null return address.
- If necessary,
- you can set the
- .b g
- flag to prevent
- .i sendmail
- from obeying the standards;
- error messages will be sent as from the MAILER-DAEMON
- (actually, the value of the
- .b $n
- macro).
- .ip h
- Upper case should be preserved in host names
- for this mailer.
- .ip i
- Do User Database rewriting on envelope sender address.
- .ip I
- This mailer will be speaking SMTP
- to another
- .i sendmail
- *-
- as such it can use special protocol features.
- This option is not required
- (i.e.,
- if this option is omitted the transmission will still operate successfully,
- although perhaps not as efficiently as possible).
- .ip j
- Do User Database rewriting on recipients as well as senders.
- .ip k
- Normally when
- .i sendmail
- connects to a host via SMTP,
- it checks to make sure that this isn't accidently the same host name
- as might happen if
- .i sendmail
- is misconfigured or if a long-haul network interface is set in loopback mode.
- This flag disables the loopback check.
- It should only be used under very unusual circumstances.
- .ip K
- Currently unimplemented.
- Reserved for chunking.
- .ip l
- This mailer is local
- (i.e.,
- final delivery will be performed).
- .ip L
- Limit the line lengths as specified in RFC821.
- This deprecated option should be replaced by the
- .b L=
- mail declaration.
- For historic reasons, the
- .b L
- flag also sets the
- .b 7
- flag.
- .ip m
- This mailer can send to multiple users
- on the same host
- in one transaction.
- When a
- .b $u
- macro occurs in the
- .i argv
- part of the mailer definition,
- that field will be repeated as necessary
- for all qualifying users.
- .ip M(dg
- This mailer wants a
- .q Message-Id:
- header line.
- .ip n
- Do not insert a UNIX-style
- .q From
- line on the front of the message.
- .ip o
- Always run as the owner of the recipient mailbox.
- Normally
- .i sendmail
- runs as the sender for locally generated mail
- or as
- .q daemon
- (actually, the user specified in the
- .b u
- option)
- when delivering network mail.
- The normal behavior is required by most local mailers,
- which will not allow the envelope sender address
- to be set unless the mailer is running as daemon.
- This flag is ignored if the
- .b S
- flag is set.
- .ip p
- Use the route-addr style reverse-path in the SMTP
- .q "MAIL FROM:"
- command
- rather than just the return address;
- although this is required in RFC821 section 3.1,
- many hosts do not process reverse-paths properly.
- Reverse-paths are officially discouraged by RFC 1123.
- .ip P(dg
- This mailer wants a
- .q Return-Path:
- line.
- .ip q
- When an address that resolves to this mailer is verified
- (SMTP VRFY command),
- generate 250 responses instead of 252 responses.
- This will imply that the address is local.
- .ip r
- Same as
- .b f ,
- but sends a
- .b -r
- flag.
- .ip R
- Open SMTP connections from a
- .q secure
- port.
- Secure ports aren't
- (secure, that is)
- except on UNIX machines,
- so it is unclear that this adds anything.
- .ip s
- Strip quote characters (" and e) off of the address
- before calling the mailer.
- .ip S
- Don't reset the userid
- before calling the mailer.
- This would be used in a secure environment
- where
- .i sendmail
- ran as root.
- This could be used to avoid forged addresses.
- If the
- .b U=
- field is also specified,
- this flag causes the effective user id to be set to that user.
- .ip u
- Upper case should be preserved in user names
- for this mailer.
- .ip U
- This mailer wants UUCP-style
- .q From
- lines with the ugly
- .q "remote from <host>"
- on the end.
- .ip w
- The user must have a valid account on this machine,
- i.e.,
- getpwnam
- must succeed.
- If not,
- the mail is bounced.
- This is required to get
- .q &.forward
- capability.
- .ip x(dg
- This mailer wants a
- .q Full-Name:
- header line.
- .ip X
- This mailer want to use the hidden dot algorithm
- as specified in RFC821;
- basically,
- any line beginning with a dot
- will have an extra dot prepended
- (to be stripped at the other end).
- This insures that lines in the message containing a dot
- will not terminate the message prematurely.
- .ip z
- Run Local Mail Transfer Protocol (LMTP)
- between
- .i sendmail
- and the local mailer.
- This is a variant on SMTP
- defined in RFC 2033
- that is specifically designed for delivery to a local mailbox.
- .ip 0
- Don't look up MX records for hosts sent via SMTP.
- .ip 3
- Extend the list of characters converted to =XX notation
- when converting to Quoted-Printable
- to include those that don't map cleanly between ASCII and EBCDIC.
- Useful if you have IBM mainframes on site.
- .ip 5
- If no aliases are found for this address,
- pass the address through ruleset 5 for possible alternate resolution.
- This is intended to forward the mail to an alternate delivery spot.
- .ip 6
- Strip headers to seven bits.
- .ip 7
- Strip all output to seven bits.
- This is the default if the
- .b L
- flag is set.
- Note that clearing this option is not
- sufficient to get full eight bit data passed through
- .i sendmail .
- If the
- .b 7
- option is set, this is essentially always set,
- since the eighth bit was stripped on input.
- Note that this option will only impact messages
- that didn't have 8(->7 bit MIME conversions performed.
- .ip 8
- If set,
- it is acceptable to send eight bit data to this mailer;
- the usual attempt to do 8(->7 bit MIME conversions will be bypassed.
- .ip 9
- If set,
- do
- .i limited
- 7(->8 bit MIME conversions.
- These conversions are limited to text/plain data.
- .ip :
- Check addresses to see if they begin
- .q :include: ;
- if they do, convert them to the
- .q *include*
- mailer.
- .ip |
- Check addresses to see if they begin with a `|';
- if they do, convert them to the
- .q prog
- mailer.
- .ip /
- Check addresses to see if they begin with a `/';
- if they do, convert them to the
- .q *file*
- mailer.
- .ip @
- Look up addresses in the user database.
- .ip %
- Do not attempt delivery on initial recipient of a message
- or on queue runs
- unless the queued message is selected
- using one of the -qI/-qR/-qS queue run modifiers
- or an ETRN request.
- .pp
- Configuration files prior to level 6
- assume the `A', `w', `5', `:', `|', `/', and `@' options
- on the mailer named
- .q local .
- .pp
- The mailer with the special name
- .q error
- can be used to generate a user error.
- The (optional) host field is an exit status to be returned,
- and the user field is a message to be printed.
- The exit status may be numeric or one of the values
- USAGE, NOUSER, NOHOST, UNAVAILABLE, SOFTWARE, TEMPFAIL, PROTOCOL, or CONFIG
- to return the corresponding EX_ exit code,
- or an enhanced error code as described in RFC 1893,
- .ul
- Enhanced Mail System Status Codes.
- For example, the entry:
- .(b
- $#error $@ NOHOST $: Host unknown in this domain
- .)b
- on the RHS of a rule
- will cause the specified error to be generated
- and the
- .q "Host unknown"
- exit status to be returned
- if the LHS matches.
- This mailer is only functional in rulesets 0, 5,
- or one of the check_* rulesets.
- .pp
- The mailer with the special name
- .q discard
- causes any mail sent to it to be discarded
- but otherwise treated as though it were successfully delivered.
- .pp
- The mailer named
- .q local
- .i must
- be defined in every configuration file.
- This is used to deliver local mail,
- and is treated specially in several ways.
- Additionally, three other mailers named
- .q prog ,
- .q *file* ,
- and
- .q *include*
- may be defined to tune the delivery of messages to programs,
- files,
- and :include: lists respectively.
- They default to:
- .(b
- Mprog, P=/bin/sh, F=lsoDq9, T=DNS/RFC822/X-Unix, A=sh -c $u
- M*file*, P=[FILE], F=lsDFMPEouq9, T=DNS/RFC822/X-Unix, A=FILE $u
- M*include*, P=/dev/null, F=su, A=INCLUDE $u
- .)b
- .pp
- The Sender and Recipient rewriting sets
- may either be a simple ruleset id
- or may be two ids separated by a slash;
- if so, the first rewriting set is applied to envelope
- addresses
- and the second is applied to headers.
- Setting any value zero disables corresponding mailer-specific rewriting.
- .pp
- The Directory
- is actually a colon-separated path of directories to try.
- For example, the definition
- .q D=$z:/
- first tries to execute in the recipient's home directory;
- if that is not available,
- it tries to execute in the root of the filesystem.
- This is intended to be used only on the
- .q prog
- mailer,
- since some shells (such as
- .i csh )
- refuse to execute if they cannot read the home directory.
- Since the queue directory is not normally readable by unprivileged users
- .i csh
- scripts as recipients can fail.
- .pp
- The Userid
- specifies the default user and group id to run as,
- overriding the
- .b DefaultUser
- option (q.v.).
- If the
- .b S
- mailer flag is also specified,
- this user and group will be set as the
- effective uid and gid for the process.
- This may be given as
- .i user:group
- to set both the user and group id;
- either may be an integer or a symbolic name to be looked up
- in the
- .i passwd
- and
- .i group
- files respectively.
- If only a symbolic user name is specified,
- the group id in the
- .i passwd
- file for that user is used as the group id.
- .pp
- The Charset field
- is used when converting a message to MIME;
- this is the character set used in the
- Content-Type: header.
- If this is not set, the
- .b DefaultCharset
- option is used,
- and if that is not set, the value
- .q unknown-8bit
- is used.
- .b WARNING:
- this field applies to the sender's mailer,
- not the recipient's mailer.
- For example, if the envelope sender address
- lists an address on the local network
- and the recipient is on an external network,
- the character set will be set from the Charset= field
- for the local network mailer,
- not that of the external network mailer.
- .pp
- The Type= field
- sets the type information
- used in MIME error messages
- as defined by
- RFC 1894.
- It is actually three values separated by slashes:
- the MTA-type (that is, the description of how hosts are named),
- the address type (the description of e-mail addresses),
- and the diagnostic type (the description of error diagnostic codes).
- Each of these must be a registered value
- or begin with
- .q X- .
- The default is
- .q dns/rfc822/smtp .
- .pp
- The m= field specifies the maximum number of messages to attempt to deliver
- on a single SMTP or LMTP connection.
- .pp
- The /= field specifies a new root directory for the mailer. The path is
- macro expanded and then passed to the
- .q chroot
- system call. The root directory is changed before the Directory field is
- consulted or the uid is changed.
- .pp
- The Wait= field specifies the maximum time to wait for the
- mailer to return after sending all data to it.
- This applies to mailers that have been forked by
- .i sendmail .
- .sh 2 "H *- Define Header"
- .pp
- The format of the header lines that
- .i sendmail
- inserts into the message
- are defined by the
- .b H
- line.
- The syntax of this line is:
- .(b F
- .b H [c
- .b ? c
- .i mflags c
- .b ? |c
- .i ${macro} c
- .b ]c
- .i hname c
- .b :
- .i htemplate
- .)b
- Continuation lines in this spec
- are reflected directly into the outgoing message.
- The
- .i htemplate
- is macro-expanded before insertion into the message.
- If the
- .i mflags
- (surrounded by question marks)
- are specified,
- at least one of the specified flags
- must be stated in the mailer definition
- for this header to be automatically output.
- If a
- .i ${macro}
- is specified,
- the header will be automatically output
- if the macro is set.
- The macro may be set using any of the normal methods,
- including using the
- .b macro
- storage map in a ruleset.
- If one of these headers is in the input
- it is reflected to the output
- regardless of these flags or macros.
- .pp
- Some headers have special semantics
- that will be described later.
- .pp
- A secondary syntax allows validation of headers as they are being read.
- To enable validation, use:
- .(b
- .b H c
- .i Header c
- .b ": $>" c
- .i Ruleset
- .b H c
- .i Header c
- .b ": $>+" c
- .i Ruleset
- .)b
- The indicated
- .i Ruleset
- is called for the specified
- .i Header ,
- and can return
- .b $#error
- to reject the message or
- .b $#discard
- to discard the message
- (as with the other
- .b check_ *
- rulesets).
- The header is treated as a structured field,
- that is,
- comments (in parentheses) are deleted before processing,
- unless the second form
- .b $>+
- is used.
- .pp
- For example, the configuration lines:
- .(b
- HMessage-Id: $>CheckMessageId
- SCheckMessageId
- R< $+ @ $+ > $@ OK
- R$* $#error $: Illegal Message-Id header
- .)b
- would refuse any message that had a Message-Id: header of any of the
- following forms:
- .(b
- Message-Id: <>
- Message-Id: some text
- Message-Id: <legal text@domain> extra crud
- .)b
- A default ruleset that is called for headers which don't have a
- specific ruleset defined for them can be specified by:
- .(b
- .b H c
- .i * c
- .b ": $>" c
- .i Ruleset
- .)b
- or
- .(b
- .b H c
- .i * c
- .b ": $>+" c
- .i Ruleset
- .)b
- .sh 2 "O *- Set Option"
- .pp
- There are a number of
- global
- options that
- can be set from a configuration file.
- Options are represented by full words;
- some are also representable as single characters
- for back compatibility.
- The syntax of this line is:
- .(b F
- .b O