Installing Majordomo from the FreeBSD Ports Collection

By Weldon Whipple <weldon@whipple.org>


Introduction

This document describes additional steps I follow when configuring Majordomo on FreeBSD, after installing it from the "ports" collection.

To install from ports, enter the following command sequence as root:

cd /usr/ports/mail/majordomo; make; make install

Step 1: Move or Eliminate aliases.majordomo

The "Post-Install Notes for Majordomo" say to add a second aliases file named /usr/local/majordomo/aliases.majordomo to your sendmail.cf file. This has two problems:

  1. The FreeBSD make system won't detect changes to secondary aliases files referenced in sendmail.cf. You will need to explicitly invoke newaliases to generate/update secondary aliases db files.
  2. Sendmail complains about the "safety" of the file, saying that it doesn't have permission to generate the aliases.majordomo.db file from the aliases.majordomo file.

Solution

Move the /usr/local/majordomo/aliases.majordomo file to the /etc/mail directory. Better still, eliminate the file altogether and put the mailing list aliases in /etc/mail/aliases.

If you decide to use a separate aliases.majordomo file, add the following line to your sendmail mc file:


define(`ALIAS_FILE',`/etc/mail/aliases,/etc/mail/aliases.majordomo')
and regenerate your sendmail.cf file.
According to a footnote on page 978 of the 3rd edition of the "Bat" book, "When an argument to an m4 define command contains one or more commas, that argument should be enclosed in double half-quotes." Following those instructions, the correct syntax would probably be:

define(`ALIAS_FILE',``/etc/mail/aliases,/etc/mail/aliases.majordomo'')
However, single half-quotes seem to work just fine.

Step 2: Remove Postmaster from the RHS of Majordomo Aliases

The aliases.majordomo file distributed with Majordomo includes the following two aliases:


majordomo-owner: Postmaster
owner-test-l: Postmaster

Incoming mail to the test-l mailing list will arrive at the server successfully, but will likely fail when sendmail tries to deliver it to the list subscribers. In the /var/log/maillog, you will see a series of entries, beginning with one similar to this:


Oct 23 21:01:20 technoids.org sm-mta[13891]: h9NL1K9M013890: h9NL1K9M013891: clone: owner=Postmaster
and followed by entries warning about things like ".forward: transient error", "seteuid(1001) failure (real=0, eff=0): Too many users", etc. The mail will be queued indefinitely.

Solution

Change the right-hand-side (RHS) of aliases that refer to Postmaster; change it to some non-root-equivalent user or e-mail address.

Step 3: Remove Group Writability from Mailing List Files

The default test list files installed in /usr/local/majordomo/lists look something like:


-rw-rw-r--  1 majordom  majordom     59 Oct 23 21:22 test-l
-rw-rw-r--  1 majordom  majordom      0 Oct 23 20:41 test-l-digest
drwxr-xr-x  2 majordom  majordom    512 Oct 23 20:41 test-l-digest.archive
-rw-rw----  1 majordom  majordom  16561 Oct 23 21:01 test-l-digest.config
drwxr-xr-x  2 majordom  majordom    512 Oct 23 21:27 test-l.archive
-rw-rw----  1 majordom  majordom  16497 Oct 23 21:01 test-l.config
-rw-rw-r--  1 majordom  majordom    124 Oct 23 20:41 test-l.info
-rw-rw----  1 majordom  majordom      5 Oct 23 20:41 test-l.passwd

(Note that all non-directories are group writeable.) Sendmail will refuse to deliver to the files, instead sending a message to owner-test-l with a complaint: "Cannot open /usr/local/majordomo/lists/test-l: Group writable file"

Solution

The preferred solution is to remove group writability by issuing the following commands as root:


# cd /usr/local/majordomo/lists
# chmod g-w *

Now if you issue the ls -l command, you will see:


-rw-r--r--  1 majordom  majordom     59 Oct 23 21:22 test-l
-rw-r--r--  1 majordom  majordom      0 Oct 23 20:41 test-l-digest
drwxr-xr-x  2 majordom  majordom    512 Oct 23 20:41 test-l-digest.archive
-rw-r-----  1 majordom  majordom  16561 Oct 23 21:01 test-l-digest.config
drwxr-xr-x  2 majordom  majordom    512 Oct 23 21:27 test-l.archive
-rw-r-----  1 majordom  majordom  16497 Oct 23 21:01 test-l.config
-rw-r--r--  1 majordom  majordom    124 Oct 23 20:41 test-l.info
-rw-r-----  1 majordom  majordom      5 Oct 23 20:41 test-l.passwd

An alternate solution (not recommended) is to add the following line to your sendmail mc file and generate a new sendmail.cf:


define(`confDONT_BLAME_SENDMAIL',`GroupWritableIncludeFile')