majordomo-inject: a bulk mailer for majordomo and qmail


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.

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:

¹Note that this protection can be achieved easily without using majordomo-inject; see localmailcheck below.



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.)

Majordomo Installation

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 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";

Majordomo List Configuration

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.

Mail Aliases for Majordomo

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

Digesting, archiving etc are configured normally as per the majordomo instructions, substituting qmail aliases for sendmail ones.

List submission address

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 may be used and the VERP component will be inserted correctly after farc-owner.)

|/home/majordomo/wrapper resend -l farc farc-owner

List -request address

The traditional (and traditionally unused :-) -request address.

|/home/majordomo/wrapper majordomo -l farc

List -approval alias

Standard majordomo -approval alias. Substitute a mail address, Mailbox or Maildir as appropriate for OWNER.


owner-list alias

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.


list-owner aliases

Normally unused by majordomo, these aliases are recommended for use with qmail for VERP bounce handling.



Catchall list-default alias

Should not be required.


Catchall owner-list alias

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.



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:


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