Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > by-pkgid > 34c5c55f7d8c84bbf02adfd29ef9b779 > files > 46

maildrop-1.7.0-12mdv2008.1.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML
><HEAD
><link rel='stylesheet' type='text/css' href='manpage.css'>
  <!-- $Id: maildrop.sgml,v 1.6 2004/07/27 01:36:41 mrsam Exp $ -->
  <!-- Copyright 1998 - 2002 Double Precision, Inc.  See COPYING for -->
  <!-- distribution information. -->
<meta name="MSSmartTagsPreventParsing" content="TRUE">
<link rel="icon" href="icon.gif" type="image/gif" />
<TITLE
>maildrop</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><H1
><A
NAME="MAILDROP"
></A
>maildrop</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN10"
></A
><H2
>Name</H2
>maildrop&nbsp;--&nbsp;mail delivery filter/agent</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN13"
></A
><H2
>Synopsis</H2
><P
><B
CLASS="COMMAND"
>maildrop</B
> [option...] [-d <VAR
CLASS="REPLACEABLE"
>user</VAR
>] [<VAR
CLASS="REPLACEABLE"
>arg</VAR
>...]</P
><P
><B
CLASS="COMMAND"
>maildrop</B
> [option...] [<VAR
CLASS="REPLACEABLE"
>filename</VAR
>] [<VAR
CLASS="REPLACEABLE"
>arg</VAR
>...]</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN28"
></A
><H2
>DESCRIPTION</H2
><P
><B
CLASS="COMMAND"
>maildrop</B
> is a replacement local mail delivery agent that
includes a mail filtering language.
The system administrator can either
replace the existing mail delivery agent with <B
CLASS="COMMAND"
>maildrop</B
>,
or users may
run <B
CLASS="COMMAND"
>maildrop</B
> using the 'forward to program' mechanism of
the existing mail delivery agent.</P
><P
><B
CLASS="COMMAND"
>maildrop</B
> first reads the E-mail message on
standard input.
Trailing carriage return characters are automatically stripped.
An E-mail message consists of header lines, followed by a blank line, followed
by the contents of the message. The message may contain an mbox-style
<TT
CLASS="LITERAL"
>From_</TT
>
line before the first header line. If the message does not contain a
<TT
CLASS="LITERAL"
>From_</TT
>
line, <B
CLASS="COMMAND"
>maildrop</B
> will create one (if needed).</P
><P
>If the file <TT
CLASS="FILENAME"
>/etc/maildrop/maildroprc</TT
> exists, mail
delivery or mail filtering instructions are read from that file.
<B
CLASS="COMMAND"
>maildrop</B
>'s delivery/filtering instructions may direct
<B
CLASS="COMMAND"
>maildrop</B
> to save the
message in specific mailbox, discard it, return it to sender, or forward it to
a different E-mail address.</P
><P
>If <TT
CLASS="FILENAME"
>/etc/maildrop/maildroprc</TT
> does not exist, or
its mail delivery instructions do not completely dispose of this message,
<B
CLASS="COMMAND"
>maildrop</B
> then reads the mail delivery instructions
from <TT
CLASS="FILENAME"
>$HOME/.mailfilter</TT
>.
If it doesn't exist, or its mail delivery instructions do not completely
dispose of the message, <B
CLASS="COMMAND"
>maildrop</B
>
then saves the E-mail message
in the default mailbox.</P
><P
><B
CLASS="COMMAND"
>maildrop</B
> knows how to deliver mail to an standard mailbox
files; it
also knows how to deliver to maildirs. A <TT
CLASS="LITERAL"
>maildir</TT
> is a
directory-based mail format used by the
<TT
CLASS="APPLICATION"
><A
HREF="http://www.courier-mta.org"
TARGET="_top"
>Courier</A
></TT
>
and
<TT
CLASS="APPLICATION"
><A
HREF="http://www.qmail.org"
TARGET="_top"
>Qmail</A
></TT
>
mail servers.
Many other mail servers also know how to read maildirs.
When delivering to mailbox files, <B
CLASS="COMMAND"
>maildrop</B
> will lock the
mailbox for the duration of the delivery.</P
><P
>At least one mail program writes an empty line before a From_ header when
saving a message into a file. <B
CLASS="COMMAND"
>maildrop</B
> ignores
empty lines at
the beginning of messages.
Therefore, <B
CLASS="COMMAND"
>maildrop</B
> requires that every
message must have at least one header line.</P
><P
>This is the general mail delivery behavior.
There are minor differences in behavior depending on
<B
CLASS="COMMAND"
>maildrop</B
> delivery mode, which is determined based on
how
<B
CLASS="COMMAND"
>maildrop</B
> was started.
<B
CLASS="COMMAND"
>maildrop</B
> uses three different primary operating modes:</P
><P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
>Manual mode</DT
><DD
><P
>A file containing filtering instructions -
<VAR
CLASS="REPLACEABLE"
>filename</VAR
>
is specified as an argument to the <B
CLASS="COMMAND"
>maildrop</B
> command.
<B
CLASS="COMMAND"
>maildrop</B
> reads this
<VAR
CLASS="REPLACEABLE"
>filename</VAR
> (after
<TT
CLASS="FILENAME"
>/etc/maildrop/maildroprc</TT
>)
and follows the instructions in it.
Unless the message is explicitly forwarded, bounced,
deleted, or delivered to a specific mailbox, it will be delivered to the
user's system mailbox.</P
></DD
><DT
>Delivery mode</DT
><DD
><P
><B
CLASS="COMMAND"
>maildrop</B
>
is the mail server's mail delivery agent.
<B
CLASS="COMMAND"
>maildrop</B
> runs in
delivery mode when no <VAR
CLASS="REPLACEABLE"
>filename</VAR
>
is specified on the command line.
<B
CLASS="COMMAND"
>maildrop</B
> changes the current directory to the user's
home directory, then reads <TT
CLASS="FILENAME"
>/etc/maildrop/maildroprc</TT
>,
then <TT
CLASS="FILENAME"
>$HOME/.mailfilter</TT
>.</P
></DD
><DT
>Embedded mode</DT
><DD
><P
><B
CLASS="COMMAND"
>maildrop</B
> functions as a part of another application.
The embedded mode is used by the
<TT
CLASS="APPLICATION"
><A
HREF="http://www.courier-mta.org"
TARGET="_top"
>Courier</A
></TT
>
mail server to integrate mail filtering directly
into the process of receiving mail from a remote mail relay, thus rejecting
unwanted mail before it is even accepted for local mail delivery.
Embedded mode is used when either the -m, or the -M, option is specified,
and is described below.
See below for a more extensive description of the embedded mode.</P
></DD
></DL
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN90"
></A
><H2
>SECURITY</H2
><P
>It is safe to install <B
CLASS="COMMAND"
>maildrop</B
> as a root setuid program.
<TT
CLASS="APPLICATION"
><A
HREF="http://www.courier-mta.org"
TARGET="_top"
>Courier</A
></TT
>
installs <B
CLASS="COMMAND"
>maildrop</B
> as a root setuid program by default,
in order to be able to use <B
CLASS="COMMAND"
>maildrop</B
> in embedded mode.
If root runs <B
CLASS="COMMAND"
>maildrop</B
> (or it is setuided to root)
the <VAR
CLASS="OPTION"
>-d</VAR
> option may be used to
specify the message's recipient. <B
CLASS="COMMAND"
>maildrop</B
>
immediately resets its userid to the one specified by the
<VAR
CLASS="OPTION"
>-d</VAR
> option. The
user's
<TT
CLASS="FILENAME"
>$HOME/.mailfilter</TT
>
is read (if it exists), and the message
is delivered to the indicated user.</P
><P
>The system administrator can configure <B
CLASS="COMMAND"
>maildrop</B
> to restrict
the <VAR
CLASS="OPTION"
>-d</VAR
> option for everyone except the mail system
itself.</P
><P
>If in delivery mode the user's home directory has the sticky bit set,
<B
CLASS="COMMAND"
>maildrop</B
> immediately terminates with an exit code of
<SPAN
CLASS="ERRORCODE"
>EX_TEMPFAIL</SPAN
>, without doing anything.
Mail servers interpret the
<SPAN
CLASS="ERRORCODE"
>EX_TEMPFAIL</SPAN
> exit code as a request to reschedule the
message
for another delivery attempt later. Setting the sticky bit allows
<TT
CLASS="FILENAME"
>$HOME/.mailfilter</TT
> to be edited while
temporarily holding all incoming mail.</P
><P
><B
CLASS="COMMAND"
>maildrop</B
> also terminates with
<SPAN
CLASS="ERRORCODE"
>EX_TEMPFAIL</SPAN
> if the user's home directory has world write
permissions.</P
><P
><B
CLASS="COMMAND"
>maildrop</B
> immediately terminates with
<SPAN
CLASS="ERRORCODE"
>EX_TEMPFAIL</SPAN
> if the <TT
CLASS="FILENAME"
>filename</TT
> is
not owned by the user,
or if it has any group or world permissions. This includes read permissions.
The permissions on
<TT
CLASS="FILENAME"
>$HOME/.mailfilter</TT
> may only include read and
write privileges to the user.</P
><P
>When using the special embedded mode (see below)
<B
CLASS="COMMAND"
>maildrop</B
>
immediately terminates with the exit code set to
<SPAN
CLASS="ERRORCODE"
>EX_TEMPFAIL</SPAN
> if
<TT
CLASS="FILENAME"
>$HOME/.mailfilters</TT
>
is not owned by the user, or if it has any
group or world permissions.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN123"
></A
><H2
>TEMPORARY FILES</H2
><P
><B
CLASS="COMMAND"
>maildrop</B
> is heavily optimized and tries to use as
little resources as possible. <B
CLASS="COMMAND"
>maildrop</B
> reads smalle
messages into
memory, then filters and/or delivers the message directly from memory. For
larger messages, <B
CLASS="COMMAND"
>maildrop</B
> accesses the message directly
from the file.
If the standard input is not a file, <B
CLASS="COMMAND"
>maildrop</B
> writes the
message to a
temporary file, then accesses the message from the temporary file. The
temporary file is automatically removed when the message is delivered.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN130"
></A
><H2
>OPTIONS</H2
><A
NAME="OPTIONS"
></A
><P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
>-A "<VAR
CLASS="REPLACEABLE"
>Header: value</VAR
>"</DT
><DD
><P
>Adds an additional header to the message. Specifying
<I
CLASS="EMPHASIS"
>-A "Foo: Bar"</I
> effectively adds this header to the
message being delivered.</P
><P
>The mail transport agent usually adds additional headers when delivering a
message to a local mailbox. The way it's usually done is by the mail
transport agent sending the message using a pipe to the local delivery
agent - such as <B
CLASS="COMMAND"
>maildrop</B
> - and adding some additional
headers in the
 process.
Because <B
CLASS="COMMAND"
>maildrop</B
> receives the message from a pipe,
<B
CLASS="COMMAND"
>maildrop</B
> must either save the message in memory or write
the message into a temporary file.</P
><P
>The <VAR
CLASS="OPTION"
>-A</VAR
> option enables the file containing the message
to be provided to <B
CLASS="COMMAND"
>maildrop</B
> directly, as standard input,
and the additional headers specified on the command line.
Because the standard input is a file,
<B
CLASS="COMMAND"
>maildrop</B
> will not need a temporary file.
Multiple <VAR
CLASS="OPTION"
>-A</VAR
> options may be specified.</P
></DD
><DT
>-d <VAR
CLASS="REPLACEABLE"
>user</VAR
></DT
><DD
><P
>Run <B
CLASS="COMMAND"
>maildrop</B
> in delivery mode for this user ID.</P
><P
>The system administrator may optionally restrict the
<VAR
CLASS="OPTION"
>-d</VAR
> option to be available to the mail system only, so
it may not be available to you.
In all cases, the <VAR
CLASS="OPTION"
>-d</VAR
> option is allowed if
<VAR
CLASS="REPLACEABLE"
>user</VAR
> is the same user who is running
<B
CLASS="COMMAND"
>maildrop</B
>.
Also, for the <VAR
CLASS="OPTION"
>-d</VAR
> option to work at all,
<B
CLASS="COMMAND"
>maildrop</B
> must be executed by root, or
<B
CLASS="COMMAND"
>maildrop</B
> must be a root-owned program with the setuid bit
set.
Absence of a <TT
CLASS="FILENAME"
>filename</TT
>
on
<B
CLASS="COMMAND"
>maildrop</B
>'s command line
implies the <VAR
CLASS="OPTION"
>-d</VAR
> option for the user running
<B
CLASS="COMMAND"
>maildrop</B
>.</P
><P
>If <VAR
CLASS="OPTION"
>-d</VAR
> is not specified, the first argument following all the
options is
a name of the file containing filtering instructions. The remaining
arguments, if any, are assigned to the variables
<VAR
CLASS="VARNAME"
>$1</VAR
>,
<VAR
CLASS="VARNAME"
>$2</VAR
>, and so on (see
<A
HREF="maildropfilter.html#environment"
TARGET="_top"
>"Environment"</A
> and

<A
HREF="maildropfilter.html#varsubst"
TARGET="_top"
>"Variable substitution"</A
>).</P
></DD
><DT
>-f <VAR
CLASS="REPLACEABLE"
>address</VAR
></DT
><DD
><P
>Sets the FROM variable (message envelope sender) to
<VAR
CLASS="REPLACEABLE"
>address</VAR
>.
The system administrator may optionally disable the
<VAR
CLASS="OPTION"
>-f</VAR
> option for users, so it may not be available to you.</P
></DD
><DT
>-m</DT
><DD
><P
>Run <B
CLASS="COMMAND"
>maildrop</B
> in embedded mode.
It's possible to use both the <VAR
CLASS="OPTION"
>-m</VAR
>, and the
<VAR
CLASS="OPTION"
>-d</VAR
> options, but it doesn't make much sense to do so.
Even if you really wanted to run your message through someone else's
<TT
CLASS="FILENAME"
>.mailfilter</TT
>,
that <TT
CLASS="FILENAME"
>.mailfilter</TT
> probably has at least one
instruction which is not allowed in the embedded mode.</P
><P
>The <TT
CLASS="FILENAME"
>filename</TT
> argument to <B
CLASS="COMMAND"
>maildrop</B
>
should be specified.
<TT
CLASS="FILENAME"
>filename</TT
> is a file that includes filtering
instructions to be processed in embedded mode.
The <TT
CLASS="FILENAME"
>-m</TT
> option is used for debugging filter files which
are later placed in
<TT
CLASS="FILENAME"
>$HOME/.mailfilters</TT
>, and used with the
<VAR
CLASS="OPTION"
>-M</VAR
> option.</P
></DD
><DT
>-M <VAR
CLASS="REPLACEABLE"
>filterfile</VAR
></DT
><DD
><A
NAME="MOPTION"
></A
><P
>Run <B
CLASS="COMMAND"
>maildrop</B
> in a special embedded mode.
The <VAR
CLASS="OPTION"
>-d</VAR
>
option is implied when <VAR
CLASS="OPTION"
>-M</VAR
> is used, and if absent it defaults
to the userid running <B
CLASS="COMMAND"
>maildrop</B
>.</P
><P
>All the requirements for the <VAR
CLASS="OPTION"
>-d</VAR
> option apply.
<B
CLASS="COMMAND"
>maildrop</B
> must either
be executed by root, or the <B
CLASS="COMMAND"
>maildrop</B
> program must be owned
by root with the setuid bit set.
<B
CLASS="COMMAND"
>maildrop</B
> immediately gives up root
privileges by changing its user ID to the one specified by <VAR
CLASS="OPTION"
>-d</VAR
>,
then reads
<TT
CLASS="FILENAME"
>$HOME/.mailfilters/<VAR
CLASS="REPLACEABLE"
>filterfile</VAR
></TT
>. For security reasons the name of the file may not begin with a slash or include
periods.
<B
CLASS="COMMAND"
>maildrop</B
> is very paranoid:
both <TT
CLASS="FILENAME"
>$HOME/.mailfilters</TT
>, and
<TT
CLASS="FILENAME"
>$HOME/.mailfilters/<VAR
CLASS="REPLACEABLE"
>filterfile</VAR
></TT
>
must be owned by the user, and may not have any group or world
permissions.</P
><P
>The <VAR
CLASS="OPTION"
>-M</VAR
> option allows for some friendly cooperation between
the user
running the application, and the user who provides a filter for the
embedded mode. The user running the application can use someone else's
canned filter and be assured that the filter is not going to run amok and
start sending mail or create files all over the place. The user who
provides the filter can be assured that the environment variables are
clean, and that there are no surprises.</P
><P
><B
CLASS="COMMAND"
>maildrop</B
> supports the concept of "default" filter files.
If the
file specified by the <B
CLASS="COMMAND"
>-M</B
> option cannot be found in
<TT
CLASS="FILENAME"
>$HOME/.mailfilters</TT
>,
<B
CLASS="COMMAND"
>maildrop</B
> will try to open
<TT
CLASS="FILENAME"
>$HOME/.mailfilters/<VAR
CLASS="REPLACEABLE"
>filterfileprefix</VAR
>-default</TT
>.
<VAR
CLASS="REPLACEABLE"
>filterfileprefix</VAR
> is the initial part
of <VAR
CLASS="REPLACEABLE"
>filterfile</VAR
> up until the last '-' character in
<VAR
CLASS="REPLACEABLE"
>filterfile</VAR
>.</P
><P
>If
<TT
CLASS="FILENAME"
>$HOME/.mailfilters/<VAR
CLASS="REPLACEABLE"
>filterfileprefix</VAR
>-default</TT
>
does not exist, and there are any other dashes left in
<VAR
CLASS="REPLACEABLE"
>filterfileprefix</VAR
>, maildrop
removes the last dash and everything
following it, then tries again.</P
><P
>As a last resort <B
CLASS="COMMAND"
>maildrop</B
>
tries to open <TT
CLASS="FILENAME"
>$HOME/.mailfilters/default</TT
>.</P
><P
>For example, if the parameter to the <VAR
CLASS="OPTION"
>-M</VAR
> option is
<I
CLASS="EMPHASIS"
>mailfilter-lists-maildrop</I
>, <B
CLASS="COMMAND"
>maildrop</B
> will try to open the following files, in order:
<A
NAME="AEN241"
></A
><BLOCKQUOTE
CLASS="BLOCKQUOTE"
><P
CLASS="LITERALLAYOUT"
><TT
CLASS="FILENAME"
>$HOME/.mailfilters/mailfilter-lists-maildrop</TT
><br>
<TT
CLASS="FILENAME"
>$HOME/.mailfilters/mailfilter-lists-maildrop-default</TT
><br>
<TT
CLASS="FILENAME"
>$HOME/.mailfilters/mailfilter-lists-default</TT
><br>
<TT
CLASS="FILENAME"
>$HOME/.mailfilters/mailfilter-default</TT
><br>
<TT
CLASS="FILENAME"
>$HOME/.mailfilters/default</TT
></P
></BLOCKQUOTE
></P
><P
>Note that <B
CLASS="COMMAND"
>maildrop</B
> looks for -default files ONLY if
<VAR
CLASS="OPTION"
>-M</VAR
> is used.</P
></DD
><DT
>-D <VAR
CLASS="REPLACEABLE"
>uuu/ggg</VAR
></DT
><DD
><P
>This option is reserved for use by the version of
<B
CLASS="COMMAND"
>maildrop</B
> that comes integrated with the
<TT
CLASS="APPLICATION"
><A
HREF="http://www.courier-mta.org"
TARGET="_top"
>Courier mail server</A
></TT
>.</P
></DD
><DT
>-V <VAR
CLASS="REPLACEABLE"
>level</VAR
></DT
><DD
><P
>Initialize the <VAR
CLASS="VARNAME"
>VERBOSE</VAR
> variable to
<VAR
CLASS="REPLACEABLE"
>level</VAR
>.
Because <B
CLASS="COMMAND"
>maildrop</B
> parses the
entire  before
running it, this option is used to produce debugging output in the
parsing phase. Otherwise, if <TT
CLASS="FILENAME"
>filename</TT
>
has syntax errors, then
no debugging output is possible because the <VAR
CLASS="VARNAME"
>VERBOSE</VAR
> variable
is not yet set.</P
><P
><VAR
CLASS="OPTION"
>-V</VAR
> is ignored when <B
CLASS="COMMAND"
>maildrop</B
> runs in
delivery mode.</P
></DD
><DT
>-w <VAR
CLASS="REPLACEABLE"
>N</VAR
></DT
><DD
><P
>The <VAR
CLASS="OPTION"
>-w N</VAR
> option places a warning message
into the maildir if the maildir has a quota setting, and after
the message was successfully delivered the maildir was at least
<VAR
CLASS="REPLACEABLE"
>N</VAR
> percent full.
The warning message is copied verbatim from
<TT
CLASS="FILENAME"
>/etc/quotawarnmsg</TT
> with the addition of the
"<TT
CLASS="LITERAL"
>Date:</TT
>" and
"<TT
CLASS="LITERAL"
>Message-Id:</TT
>" headers.
The warning is repeated every 24 hours (at least), until the maildir drops
below
<VAR
CLASS="REPLACEABLE"
>N</VAR
> percent full.</P
></DD
></DL
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN283"
></A
><H2
>DELIVERY MODE</H2
><P
>If a <TT
CLASS="FILENAME"
>filename</TT
> is not specified on the command line, or
if the <VAR
CLASS="OPTION"
>-d</VAR
>
option is used, <B
CLASS="COMMAND"
>maildrop</B
> will run in delivery mode.
In delivery mode,
<B
CLASS="COMMAND"
>maildrop</B
> changes to the home directory of the user
specified by the <VAR
CLASS="OPTION"
>-d</VAR
>
option (or the user who is running <B
CLASS="COMMAND"
>maildrop</B
> if the
<VAR
CLASS="OPTION"
>-d</VAR
> option was not
given) and reads <TT
CLASS="FILENAME"
>$HOME/.mailfilter</TT
> for filtering
instructions. <TT
CLASS="FILENAME"
>$HOME/.mailfilter</TT
> must be owned by the
user, and have no group
or global permissions (<B
CLASS="COMMAND"
>maildrop</B
> terminates if it
does).</P
><P
>If <TT
CLASS="FILENAME"
>$HOME/.mailfilter</TT
> does not exist,
<B
CLASS="COMMAND"
>maildrop</B
> will
simply deliver the message to the user's mailbox.</P
><P
>If the file <TT
CLASS="FILENAME"
>/etc/maildrop/maildroprc</TT
> exists,
<B
CLASS="COMMAND"
>maildrop</B
> reads filtering instructions from this file first,
before reading
<TT
CLASS="FILENAME"
>$HOME/.mailfilter</TT
>. This allows the system administrator
to provide global filtering instructions for all users.</P
><DIV
CLASS="NOTE"
><P
></P
><TABLE
CLASS="NOTE"
WIDTH="100%"
BORDER="0"
><TR
><TD
WIDTH="25"
ALIGN="CENTER"
VALIGN="TOP"
>NOTE:</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
><TT
CLASS="FILENAME"
>/etc/maildrop/maildroprc</TT
> is read only in
delivery mode.</P
></TD
></TR
></TABLE
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN306"
></A
><H2
>VIRTUAL ACCOUNTS</H2
><P
>The <VAR
CLASS="OPTION"
>-d</VAR
> option can also specify a name of a virtual account
or mailbox. See
<A
HREF="makeuserdb.html"
TARGET="_top"
><SPAN
CLASS="CITEREFENTRY"
><SPAN
CLASS="REFENTRYTITLE"
>makeuserdb</SPAN
>(1)</SPAN
></A
>
for more information.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN314"
></A
><H2
>EMBEDDED MODE</H2
><A
NAME="EMBEDDED"
></A
><P
>The embedded mode is used when <B
CLASS="COMMAND"
>maildrop</B
>'s filtering
abilities are
desired, but no actual mail delivery is needed. In embedded mode
<B
CLASS="COMMAND"
>maildrop</B
> is executed by another application, and
<A
HREF="#options"
TARGET="_top"
>is
passed the -m or the -M option.</A
> <B
CLASS="COMMAND"
>maildrop</B
> reads the
message, then runs the filtering rules specified in
<TT
CLASS="FILENAME"
>filename</TT
>.</P
><P
><TT
CLASS="FILENAME"
>filename</TT
>
may contain any filtering instructions EXCEPT the following:
<P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
>` ... `</DT
><DD
><P
>Text strings delimited by back-tick characters (run shell
command) are not allowed.</P
></DD
><DT
><A
HREF="maildropfilter.html#cc"
TARGET="_top"
>cc</A
></DT
><DD
><P
>The <B
CLASS="COMMAND"
>cc</B
> command is not allowed in embedded mode.</P
></DD
><DT
><A
HREF="maildropfilter.html#dotlock"
TARGET="_top"
>dotlock</A
></DT
><DD
><P
>The <B
CLASS="COMMAND"
>dotlock</B
> command is not allowed in embedded mode.</P
></DD
><DT
><A
HREF="maildropfilter.html#flock"
TARGET="_top"
>flock</A
></DT
><DD
><P
>The <B
CLASS="COMMAND"
>flock</B
> command is not allowed in embedded mode.</P
></DD
><DT
><A
HREF="maildropgdbm.html"
TARGET="_top"
>gdbmopen</A
></DT
><DD
><P
>In embedded mode, GDBM
databases may be opened only for reading.</P
></DD
><DT
><A
HREF="maildropfilter.html#log"
TARGET="_top"
>log</A
></DT
><DD
><P
>The <B
CLASS="COMMAND"
>log</B
> command is not allowed in embedded mode.</P
></DD
><DT
><A
HREF="maildropfilter.html#log"
TARGET="_top"
>logfile</A
></DT
><DD
><P
>The <B
CLASS="COMMAND"
>logfile</B
> command is not allowed in embedded mode.</P
></DD
><DT
><A
HREF="maildropfilter.html#to"
TARGET="_top"
>to</A
></DT
><DD
><P
>The <B
CLASS="COMMAND"
>to</B
> command is not allowed in embedded mode.</P
></DD
><DT
><A
HREF="maildropfilter.html#xfilter"
TARGET="_top"
>xfilter</A
></DT
><DD
><P
>The <B
CLASS="COMMAND"
>xfilter</B
> command is not allowed in embedded mode.</P
></DD
></DL
></DIV
></P
><P
>Normally when the <TT
CLASS="FILENAME"
>filename</TT
> does not explicitly delivers
a message,
<B
CLASS="COMMAND"
>maildrop</B
> will deliver the message to the user's default mailbox. This is also disabled in embedded mode.</P
><P
>The <TT
CLASS="FILENAME"
>filename</TT
> may communicate with the parent application
by
using the <A
HREF="maildropfilter.html#echo"
TARGET="_top"
>echo</A
> statement and the
<VAR
CLASS="VARNAME"
>EXITCODE</VAR
> environment variable.</P
><DIV
CLASS="REFSECT2"
><A
NAME="AEN384"
></A
><H3
><TT
CLASS="FILENAME"
>/etc/maildrop/maildroprcs</TT
></H3
><P
>If <B
CLASS="COMMAND"
>maildrop</B
> encounters an
<A
HREF="maildropfilter.html#include"
TARGET="_top"
>include</A
>
statement where the filename
starts with <TT
CLASS="FILENAME"
>/etc/maildrop/maildroprcs/</TT
>,
the normal restrictions
for the embedded mode are suspended while executing the filter file in the
<TT
CLASS="FILENAME"
>/etc/maildrop/maildroprcs</TT
> directory. The restrictions are
also
suspended for any additional filter files that are included from
<TT
CLASS="FILENAME"
>/etc/maildrop/maildroprcs</TT
>. The restrictions resume once
<B
CLASS="COMMAND"
>maildrop</B
> finishes executing the file from
<TT
CLASS="FILENAME"
>/etc/maildrop/maildroprcs</TT
>.</P
><P
>This allows the system administrator to have a controlled environment for
running external commands (via the backticks, or the
<A
HREF="maildropfilter.html#xfilter"
TARGET="_top"
>xfilter</A
> command).</P
><P
>The name of the file may not contain any periods (so that a creative
individual can't write <I
CLASS="EMPHASIS"
>include
"/etc/maildrop/maildroprcs/../../home/user/recipe"</I
>).</P
><P
>Before executing the commands in the
<TT
CLASS="FILENAME"
>/etc/maildrop/maildroprcs</TT
>
file, <B
CLASS="COMMAND"
>maildrop</B
> automatically resets the following variables to their
initial values: <VAR
CLASS="VARNAME"
>DEFAULT</VAR
>, <VAR
CLASS="VARNAME"
>HOME</VAR
>,
<VAR
CLASS="VARNAME"
>LOCKEXT</VAR
>, <VAR
CLASS="VARNAME"
>LOCKSLEEP</VAR
>,
<VAR
CLASS="VARNAME"
>LOCKTIMEOUT</VAR
>, <VAR
CLASS="VARNAME"
>LOCKREFRESH</VAR
>,
<VAR
CLASS="VARNAME"
>LOGNAME</VAR
>, <VAR
CLASS="VARNAME"
>PATH</VAR
>,
<VAR
CLASS="VARNAME"
>SENDMAIL</VAR
>, and <VAR
CLASS="VARNAME"
>SHELL</VAR
>.
Please note that the previous
values of these variables (if they were changed) will NOT be restored once
<B
CLASS="COMMAND"
>maildrop</B
> finishes executing the commands from
<TT
CLASS="FILENAME"
>/etc/maildrop/maildroprcs</TT
>.</P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN414"
></A
><H2
>WATCHDOG TIMER</H2
><P
><B
CLASS="COMMAND"
>maildrop</B
> has a watchdog timer that attempts to abort runaway
filtering. If filtering is not complete within a predefined time interval
(defined by the system administrator, usually five minutes),
<B
CLASS="COMMAND"
>maildrop</B
>
terminates.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN419"
></A
><H2
>FILES</H2
><P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
><TT
CLASS="FILENAME"
>/etc/passwd</TT
></DT
><DD
><P
>Sets user's home directory, and related
variables. If NIS/YP is install, that will be used as well.</P
></DD
><DT
><TT
CLASS="FILENAME"
>/etc/maildrop/maildroprc</TT
></DT
><DD
><P
>Global filtering instructions for delivery mode.</P
></DD
><DT
><TT
CLASS="FILENAME"
>/var/spool/mail</TT
></DT
><DD
><P
>System mailbox (actual directory defined by the system administrator).</P
></DD
><DT
><TT
CLASS="FILENAME"
>/usr/lib/sendmail</TT
></DT
><DD
><P
>Program to forward mail (exact program defined by the system
administrator).</P
></DD
><DT
><TT
CLASS="FILENAME"
>$HOME/.mailfilter</TT
></DT
><DD
><P
>Filtering instructions in delivery mode.</P
></DD
><DT
><TT
CLASS="FILENAME"
>$HOME/.mailfilters</TT
></DT
><DD
><P
>Directory containing files used in special embedded mode.</P
></DD
></DL
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN452"
></A
><H2
>SEE ALSO</H2
><P
><A
HREF="lockmail.html"
TARGET="_top"
><SPAN
CLASS="CITEREFENTRY"
><SPAN
CLASS="REFENTRYTITLE"
>lockmail</SPAN
>(1)</SPAN
></A
>,
<A
HREF="maildropfilter.html"
TARGET="_top"
><SPAN
CLASS="CITEREFENTRY"
><SPAN
CLASS="REFENTRYTITLE"
>maildropfilter</SPAN
>(7)</SPAN
></A
>,
<A
HREF="makedat.html"
TARGET="_top"
><SPAN
CLASS="CITEREFENTRY"
><SPAN
CLASS="REFENTRYTITLE"
>makedat</SPAN
>(1)</SPAN
></A
>,
<A
HREF="maildropgdbm.html"
TARGET="_top"
><SPAN
CLASS="CITEREFENTRY"
><SPAN
CLASS="REFENTRYTITLE"
>maildropgdbm</SPAN
>(7)</SPAN
></A
>,
<A
HREF="maildropex.html"
TARGET="_top"
><SPAN
CLASS="CITEREFENTRY"
><SPAN
CLASS="REFENTRYTITLE"
>maildropex</SPAN
>(7)</SPAN
></A
>,
<A
HREF="reformail.html"
TARGET="_top"
><SPAN
CLASS="CITEREFENTRY"
><SPAN
CLASS="REFENTRYTITLE"
>reformail</SPAN
>(1)</SPAN
></A
>,
<A
HREF="makeuserdb.html"
TARGET="_top"
><SPAN
CLASS="CITEREFENTRY"
><SPAN
CLASS="REFENTRYTITLE"
>makeuserdb</SPAN
>(1)</SPAN
></A
>,
<A
HREF="makemime.html"
TARGET="_top"
><SPAN
CLASS="CITEREFENTRY"
><SPAN
CLASS="REFENTRYTITLE"
>makemime</SPAN
>(1)</SPAN
></A
>,
<A
HREF="reformime.html"
TARGET="_top"
><SPAN
CLASS="CITEREFENTRY"
><SPAN
CLASS="REFENTRYTITLE"
>reformime</SPAN
>(1)</SPAN
></A
>,
<SPAN
CLASS="CITEREFENTRY"
><SPAN
CLASS="REFENTRYTITLE"
>egrep</SPAN
>(1)</SPAN
>,
<SPAN
CLASS="CITEREFENTRY"
><SPAN
CLASS="REFENTRYTITLE"
>grep</SPAN
>(1)</SPAN
>,
,
<A
HREF="courier.html"
TARGET="_top"
><SPAN
CLASS="CITEREFENTRY"
><SPAN
CLASS="REFENTRYTITLE"
>courier</SPAN
>(8)</SPAN
></A
>,
<SPAN
CLASS="CITEREFENTRY"
><SPAN
CLASS="REFENTRYTITLE"
>sendmail</SPAN
>(8)</SPAN
>,
<A
HREF="http://www.qmail.org"
TARGET="_top"
>http://www.qmail.org</A
>.</P
></DIV
></BODY
></HTML
>