Using a qmail specific bulk mailer with majordomo allows majordomo to be run without any source modifications.
People not already using majordomo may want to look instead at Dan Bernstein's ezmlm package which is designed to work with qmail. For those of you with existing majordomo expertise, mailing lists and/or user communities, press on!
majodomo-inject is no longer maintained, since Russ Allbery and I merged its functionality with Russ's script mjinject.
ftp://ftp.eyrie.org/pub/software/majordomo/mjinject
Usage is close enough to identical that this documentation should still be OK except for command line options. The non optional arguments are the same. Updates to the documentation are welcome!
The majordomo-inject script accepts a message on standard input, passes it once through qmail-inject and then sends it to qmail-queue for every delivery address specified in a file of addresses.
Variable Envelope Return Paths (VERP) are always used. See RFCVERP in the qmail distribution for more details on VERP.
Advantages to using majordomo-inject instead of qmail's "sendmail" wrapper from majordomo are:
- mail to large lists is faster since only qmail-queue is called for each message rather than the sendmail wrapper, qmail-inject, and then qmail-queue.
- there is no externally visible outgoing alias, so spammers cannot bypass majordomo and send directly to the list¹.
¹Note that this protection can be achieved easily without using majordomo-inject; see localmailcheck below.
Usage:
majordomo-inject /path/to/addressfile sender
The address file is a standard majordomo list file of addresses suitable for provision to qmail-queue. These addresses should have no comments; the "strip" option in the majordomo list configuration file should be turned on. (This is the default.)
No changes are required with majordomo 1.94.3. I expect any 1.94.x version will work, but 1.93 will not work without changes to resend.
Follow the majordomo installation instructions normally except that in the majordomo.cf file define "$mailer" to be:
$mailer = "/usr/local/bin/majordomo-inject $listdir/$opt_l";
The "sendmail" wrapper provided with qmail is just fine to use as the bounce mailer:
$bounce_mailer = "$sendmail_command -oi -oee -f\$sender -t";
List configuration is done according to the normal majordomo NEWLIST instructions except that I recommend sender be set to be "list-owner" rather than "owner-list".
Using list-owner is more in line with the way qmail works and eases the setup of automated bounce handling.
Existing lists might prefer to continue to use owner-list so that subscribers filtering on the Sender: header do not have to update their filters.
Where the majordomo NEWLIST instructions talk about sendmail aliases, use qmail instead. I have used .qmail files in /var/qmail/alias but the other qmail alias formats should also be OK.
Note that no list-outgoing alias is required!
The following examples assume a mailing list "farc".
The setup described here is minimal, with no automated bounce handling, digesting or archiving. For bounce handling see Russell Nelson's bounce manager on http://www.qmail.org/.
Digesting, archiving etc are configured normally as per the majordomo instructions, substituting qmail aliases for sendmail ones.
This is the usual list submission address, specifying the list (-l farc) and the envelope sender (farc-owner). VERP will be added to farc-owner. (If required farc-owner@some.host may be used and the VERP component will be inserted correctly after farc-owner.)
.qmail-farc |/home/majordomo/wrapper resend -l farc farc-owner
The traditional (and traditionally unused :-) -request address.
.qmail-farc-request |/home/majordomo/wrapper majordomo -l farc
Standard majordomo -approval alias. Substitute a mail address, Mailbox or Maildir as appropriate for OWNER.
.qmail-farc-approval OWNER
This alias won't be used if you change sender in the list configuration file to list-owner rather than owner-list, but define it just in case.
.qmail-owner-farc OWNER
Normally unused by majordomo, these aliases are recommended for use with qmail for VERP bounce handling.
.qmail-farc-owner OWNER
.qmail-farc-owner-default OWNER
Should not be required.
.qmail-farc-default OWNER
Finally, a catchall for all owner-* addresses. This should also not be required if you have changed the sender on all your lists to list-owner instead of owner-list before you commenced using the lists. Define it just in case.
.qmail-owner-default OWNER
If protection of an outgoing alias is all you need then this code does the trick without needing majordomo-inject.
For the first line of .qmail-list, insert:
|/path/to/localmailcheck
A sample localmailcheck script is:
#! /bin/sh
sed -n '/^Received: /p;/^$/q' |
egrep -q 'invoked from network' && {
echo ""
echo "Non-local mail to this address is administratively disabled."
echo ""
exit 100
}
exit 0