~rgrjr/rgrjr-scripts

27e3ffd2fc5a9a55ccb3361010f63aa82535f13e — Bob Rogers 1 year, 7 months ago 6c65bdf
Document the List-ID: thing

* email/qmail-deliver.pl:
   + Expand the message processing bullets to add the List-ID: thing.
   + Clarify the message processing intro paragraph.
   + Shorten DESCRIPTION to make it less redundant wrt the message
     processing intro.
1 files changed, 44 insertions(+), 24 deletions(-)

M email/qmail-deliver.pl
M email/qmail-deliver.pl => email/qmail-deliver.pl +44 -24
@@ 538,7 538,7 @@ __END__

=head1 NAME

qmail-deliver.pl - deliver mail like qmail-local, with whitelists/blacklists
qmail-deliver.pl - deliver mail like qmail-local, with whitelisting, etc.

=head1 SYNOPSIS



@@ 566,16 566,11 @@ C<qmail-deliver.pl> may also check source and destination addresses
against lists specified by command-line options.  The list options are
L</--whitelist>, L</--blacklist>, L</--deadlist>, and
L</--host-deadlist>;
these name files which contain lists of email addresses.  
In these addresses, "?" and "*" are considered wildcards
which match any single character and zero or more characters
respectively.  All of these command-line options may be repeated in order to
specify multiple files of addresses.
In order to work, the list file options also require a
F<.qmail-spam> file and optionally (for the deadlists) a
F<.qmail-dead> file as the destination for emails with matching addresses,
though they may just contain the line
F</dev/null> in order to discard matching emails.
these name files which contain lists of email addresses and (in the
case of L</--host-deadlist>) host names, and may be repeated in order
to specify multiple files of addresses, one per line.  In these
addresses, "?" and "*" are considered wildcards which match any single
character and zero or more characters respectively.

The L</--add-local>, L</--network-prefix>, L</--list-host>,
and L</--relay-ip> options


@@ 587,10 582,14 @@ defenses.

=head2 Message processing

Note that list processing only happens if (a) at least one list was
specified and (b) a F<.qmail-spam> file exists, since F<.qmail-spam>
is what tells C<qmail-deliver.pl> what to do with messages that fail
the testing implied by the address lists.
Note that the origin forgery detection done by
C<forged-local-address.pl> and address list processing (the first six
steps described below) only happen if a F<.qmail-spam> file exists,
since F<.qmail-spam> is what tells C<qmail-deliver.pl> what to do with
messages that fail the testing implied by the address lists and the
C<forged-local-address.pl> parameters.  Note that F<.qmail-spam> may
simply contain the line F</dev/null> in order to discard matching
emails.

=over 4



@@ 614,32 613,53 @@ and all addresses in the "Sender:", "From:", and "Reply-To:" fields.

=over 4

=item 1.
=item 3.

If we find a sender with "name" of all digits, the message is sent to
F<.qmail-dead> if that exists, else to F<.qmail-spam>.

=item 2.
=item 4.

If we find a blacklisted sender, the message is sent to
F<.qmail-spam>).

=item 3.
=item 5.

If we find a dead host, the message is sent to F<.qmail-dead> if that
exists, else to F<.qmail-spam>.

=item 4.
=item 6.

If the message has gotten this far and there is a whitelist, and the
If the message has gotten this far and there is a whitelist, and
B<no sender matches> any whitelisted address, then the message is sent
to F<.qmail-grey> if that exists, else to F<.qmail-spam>.

=item 5.
=back

At this point, the message has made it past all hurdles, so it is just
a matter of finding where it should go.

=over 4

=item 7.

If the email "localpart" has an extension (e.g. "rogers-foo") and
there is a C<.qmail> file with that extension (e.g. F<.qmail-foo">),
then we use that C<.qmail> file for delivery.

=item 8.

If the email comes from a mailing list that provides a "List-ID:"
header (see RFC2919, vintage 2001), which may specify an ID that looks
like "emacs-devel.gnu.org", and there is a C<.qmail> file named
F<.qmail-list-emacs-devel.gnu.org>, then we use that C<.qmail> file
for delivery.

=item 9.

Otherwise (there is no whitelist or some sender matched it), the
message is sent through normal Qmail dot-file processing, honoring the
usual recipient address extensions.
Otherwise (no email list or extension), then we use the default
F<.qmail> file, or the F<Maildir> if F<.qmail> does not exist.  (Note
that C<qmail-deliver.pl> does not deliver to mbox files.)

=back