ezmlm-moderate verifies the cookie sent as part of the action request, and if correct attempts to find the corresponding message in dir/mod/pending/. If the message is found, it is either rejected or posted to the list, depending on the action request.
Posts to the list are handled by piping the message to ezmlm-send(1) located in the ezmlm binary directory, as set at compile time. This is usually the directory that ezmlm-moderate resides in. ezmlm-send(1) is provided with dir as the first argument.
If the optional second argument is given, ezmlm-moderate pipes the message to that program. No additional parameters are supplied.
dir is passed as an argument to ezmlm-send(1), but NOT to any program specified as the optional ezmlm-moderate command line argument.
ezmlm-moderate does not bother to correctly set sender. ezmlm-send(1) doesn't care, and any other program that might be used can parse the sender from the first line of the message, which is always Return-Path: <address@host.domain> as build from SENDER originally passed to ezmlm-store(1).
If the message is rejected, an optional moderator comment is copied into the notification to the message sender. A moderator comment is any text in the -reject request found between two lines with ``%%%'' starting in one of the first 5 positions of the line. The easiest is to use lines consisting of ``%%%'' only. If the characters preceeding the ``%%%'' are found at the beginning of any lines within the comment, the characters are removed. This is to appropriately ignore any ``quote marks'' that you mail program might place at the beginning of lines in a reply.
ezmlm-moderate messages are sent ``From:'' list-owner@listhost. This allows the poster to easily complain to the owner of the list, in case s/he objects. An optional ``Reply-To:'' header can be added via the -r reply-to@host.
Once the message has been successfully accepted or rejected, it is removed from dir/mod/pending/ and a stub is created in dir/mod/accepted/ or dir/mod/rejected/, respectively. This is done in order to be able to notify the senders of later moderation requests about the fate of the message.
A failure to find the message in dir/mod/pending/ is most often caused by the message already having been accepted or rejected by another moderator. Therefore, ezmlm-moderate looks in dir/mod/accepted/ and dir/mod/rejected/ for a message stub. If found, ezmlm-moderate notifies the sender in the form of a fatal error if the fate of the message was different from that intended by the current action request. Otherwise, the fate of the message is silently logged.
If the message is not found, it has timed out and the message or the message stub has been removed by ezmlm-clean(1). In this case, ezmlm-moderate notifies the moderator of the failure, but can no longer discern the fate of the original message. Again, notification is in the form of a fatal error from qmail.
At the beginning of the message, ezmlm-moderate prints a new Mailing-List field with the contents of the TXT_MAILING_LIST message. It rejects the message if there is already a Mailing-List field.
ezmlm-moderate does not distribute bounce messages: if the environment variable SENDER is set, and is either empty or #@[], ezmlm-moderate rejects the message.