1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200
|
<HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.52
from spec on 25 November 2000 -->
<TITLE>Exim Specification - 42. Using Exim to handle mailing lists</TITLE>
</HEAD>
<body bgcolor="#FFFFFF" text="#00005A" link="#FF6600" alink="#FF9933" vlink="#990000">
Go to the <A HREF="spec_1.html">first</A>, <A HREF="spec_41.html">previous</A>, <A HREF="spec_43.html">next</A>, <A HREF="spec_59.html">last</A> section, <A HREF="spec_toc.html">table of contents</A>.
<P><HR><P>
<H1><A NAME="SEC789" HREF="spec_toc.html#TOC789">42. Using Exim to handle mailing lists</A></H1>
<P>
<A NAME="IDX1723"></A>
Exim can be used to run simple mailing lists, but for large and/or complicated
requirements, the use of additional specialized mailing list software is
recommended.
</P>
<P>
The <EM>forwardfile</EM> director can be used to handle mailing lists where each list
is maintained in a separate file, which can therefore be managed by an
independent manager. The <EM>domains</EM> director option can be used to run these
lists in a separate domain from normal mail. For example:
<PRE>
lists:
driver = forwardfile
domains = lists.ref.book
no_more
file = /opt/lists/$local_part
no_check_local_user
forbid_pipe
forbid_file
errors_to = $local_part-request@lists.ref.book
</PRE>
<P>
The domain <EM>lists.ref.book</EM> must appear as one of the domains in the
<EM>local_domains</EM> configuration option. This director is used only when an
address refers to that domain. Because the <EM>no_more</EM> option is set, if the
local part of the address does not match a file in the <EM>/opt/lists</EM> directory,
causing the director to decline, no subsequent directors are tried, and the
whole delivery fails.
</P>
<P>
The <EM>no_check_local_user</EM> option stops Exim insisting that the local part is
the login id of a local user, and because no user or group is specified, no
check is made on the ownership of the file. The <EM>forbid_pipe</EM> and
<EM>forbid_file</EM> options prevent a local part from being expanded into a file
name or a pipe delivery.
</P>
<P>
<A NAME="IDX1724"></A>
The <EM>errors_to</EM> option specifies that any delivery errors caused by addresses
taken from a mailing list are to be sent to the given address rather than the
original sender of the message. However, before acting on this, Exim verifies
the error address, and ignores it if verification fails.
</P>
<P>
For example, using the configuration above, mail sent to
<EM>dicts@lists.ref.book</EM> is passed on to those addresses contained in
<EM>/opt/lists/dicts</EM>, with error reports directed to
<EM>dicts-request@lists.ref.book</EM>, provided that this address can be verified.
There could be a file called <EM>/opt/lists/dicts-request</EM> containing
the address(es) of this particular list's manager(s), but other approaches,
such as setting up an earlier director (possibly using the <EM>prefix</EM> or <EM>suffix</EM>
options) to handle addresses of the form <EM>owner-xxx</EM> or <EM>xxx-request</EM>, are also
possible.
</P>
<P>
<H2><A NAME="SEC790" HREF="spec_toc.html#TOC790">42.1 Syntax errors in mailing lists</A></H2>
<P>
If an entry in a forward file contains a syntax error, Exim normally defers
delivery of the entire message. This may not be appropriate when the list is
being maintained automatically from address texts supplied by users. If the
<EM>skip_syntax_errors</EM> option is set on the <EM>forwardfile</EM> director, it just
skips entries that fail to parse, noting the incident in the log.
If in addition <EM>syntax_errors_to</EM> is set to a verifyable address, messages
about skipped addresses are sent to it.
</P>
<H2><A NAME="SEC791" HREF="spec_toc.html#TOC791">42.2 NFS-mounted mailing lists</A></H2>
<P>
It is not advisable to have list files that are NFS mounted, since the absence
of the mount cannot be distinguished from a non-existent file. One way round
this is to use an <EM>aliasfile</EM> director where the alias file is local and
contains a list of the lists, and each alias expansion is simply an `include'
item to get the list from a separate, NFS mounted file. If
<EM>no_freeze_missing_include</EM> is set for the <EM>aliasfile</EM> director, an
unavailable file then just causes delivery to be deferred.
</P>
<H2><A NAME="SEC792" HREF="spec_toc.html#TOC792">42.3 Re-expansion of mailing lists</A></H2>
<P>
<A NAME="IDX1725"></A>
Exim remembers every individual address to which a message has been delivered,
in order to avoid duplication, but it normally stores only the original
recipient addresses with a message. If all the deliveries to a mailing list
cannot be done at the first attempt, the mailing list is re-expanded when the
delivery is next tried. This means that alterations to the list are taken into
account at each delivery attempt, and addresses that have been added to
the list since the message arrived will thus receive a copy of the message,
even though it pre-dates their subscription.
</P>
<P>
If this behaviour is felt to be undesirable, the <EM>one_time</EM> option can be set
on the <EM>forwardfile</EM> director. If this is done, any addresses generated by the
director that fail to deliver at the first attempt are added to the message as
`top level' addresses, and the parent address that generated them is marked
`delivered'. Thus expansion of the mailing list does not happen again at the
subsequent delivery attempts. The disadvantage of this is that if any of the
failing addresses are incorrect, correcting them in the file has no effect on
pre-existing messages.
</P>
<P>
The original top-level address is remembered with each of the generated
addresses, and is output in any log messages. However, any intermediate parent
addresses are not recorded. This makes a difference to the log only if
<EM>log_all_parents</EM> is set, but for mailing lists there is normally only one
level of expansion anyway.
</P>
<H2><A NAME="SEC793" HREF="spec_toc.html#TOC793">42.4 Closed mailing lists</A></H2>
<P>
<A NAME="IDX1726"></A>
The examples so far have assumed open mailing lists, to which anybody may
send mail. It is also possible to set up closed lists, where mail is accepted
from specified senders only. This is done by making use of the generic
<EM>senders</EM> option. The following example uses the same file for each list, both
as a list of recipients and as a list of permitted senders. In this case, it is
necessary to set up a separate director to handle the `-request' address.
<PRE>
# Handle mail to xxx-request@lists.ref.book;
# anybody can mail to this address.
lists_request:
driver = forwardfile
domains = lists.ref.book
suffix = -request
file = /opt/lists/${local_part}${local_part_suffix}
no_check_local_user
# Handle mail to xxx@lists.ref.book;
# only the subscribers to a list may mail to it.
# Use one_time to prevent multiple expansions.
lists:
driver = forwardfile
domains = lists.ref.book
no_more
require_files = /opt/lists/$local_part
senders = lsearch;opt/lists/$local_part
file = /opt/lists/$local_part
no_check_local_user
forbid_pipe
forbid_file
one_time
skip_syntax_errors
errors_to = $local_part-request@lists.ref.book
</PRE>
<P>
The <EM>require_files</EM> option is needed to ensure that the file exists before
trying to search it via the <EM>senders</EM> option; an attempt to search a
non-existent file causes Exim to panic. If the file does not exist -- that is,
if the mailing list is unknown, the director declines, but because <EM>no_more</EM> is
set, no further directors are tried, and so Exim gives up.
</P>
<P><HR><P>
Go to the <A HREF="spec_1.html">first</A>, <A HREF="spec_41.html">previous</A>, <A HREF="spec_43.html">next</A>, <A HREF="spec_59.html">last</A> section, <A HREF="spec_toc.html">table of contents</A>.
</BODY>
</HTML>
|