this is obsolete doc -- see http://doc.nethence.com/ instead

Setting up Majordomo on FreeBSD 8 with Sendmail 

 

Installation & Base Configuration 

Install the package, 

echo $PACKAGESITE
pkg_add -r majordomo
#tlb

 

Configure Majordomo and deploy the majordomo alias file, 

cd /etc/mail/
ln -s /usr/local/majordomo
cd majordomo/
cp majordomo.cf majordomo.cf.dist
vi majordomo.cf
#$whereami = "";
#takes the long-hostname by default so its best to define just the hostname,
$whereami = "example.local";
cp aliases.majordomo-sample /etc/mail/aliases.majordomo
chmod u+w aliases.majordomo
vi aliases.majordomo

change (the postmaster alias defined in the standard alias file works), 

majordomo-owner: postmaster 

owner-test-l:postmaster 

and apply, 

newaliases aliases.majordomo

 

Setup sendmail to take care of those new aliases and restart the daemon, 

cd /etc/mail/
vi $HOSTNAME.mc
define(`ALIAS_FILE',`/etc/mail/aliases,/etc/mail/aliases.majordomo')
make
make install restart

 

Get the same script as the one from the package according to $PACKAGESITE e.g., 

cd /usr/
wget http://ftp.nerim.net/FreeBSD/releases/amd64/8.4-RELEASE/ports/ports.tgz
ls -ld ports/
tar xzf ports.tgz
cd ~/
chmod u+x /usr/ports/mail/majordomo/scripts/adaptwrapper
/usr/ports/mail/majordomo/scripts/adaptwrapper
(I choose Sendmail here)

Note. Permissions of /usr/local/majordomo/wrapper aren't changed by the adaptwrapper script (majordom suid root already), but it does change the group ownerships for the majordom user. 

 

Final checks 

Check the perms (suid root/majordom) 

ls -l /usr/local/majordomo/wrapper

 

Check the group ownerships, 

grep majordom /etc/passwd
majordom:*:54:54:Majordomo Pseudo User:/usr/local/majordomo:/nonexistent
grep majordom /etc/group
majordom:*:54:majordom,daemon,mailnull

 

Ready to go 

Send an email to your mailing-list manager to query for available mailing-lists, 

'lists' in the body

 

Creating a new mailing-list with archiving 

Create a new mailing-list, 

cd /etc/mail/majordomo/lists/

  listname=events 

touch $listname
mkdir $listname.archive/
chown majordom:majordom $listname $listname.archive/
cd /etc/mail/
cat >> aliases.majordomo <<EOF9

 

owner-$listname:postmaster 

owner-$listname-outgoing:owner-$listname
$listname-approval:owner-$listname
$listname: "|/usr/local/majordomo/wrapper resend -l $listname $listname-outgoing"
$listname-outgoing::include:/usr/local/majordomo/lists/$listname,
       "|/usr/local/majordomo/wrapper archive -a -m -f /usr/local/majordomo/lists/$listname.archive/$listname.archive"
$listname-request: "|/usr/local/majordomo/wrapper majordomo -l $listname"
EOF9

note. -h has been removed. 

apply, 

newaliases aliases.majordomo

 

Setup a prefix to the subject of the list, 

cd /etc/mail/majordomo/
cp $listname.config $listname.config.dist
vi $listname.config
subject_prefix      = [$LIST]

 

Troubleshooting 

If you get this error as delivery return, 

/usr/local/majordomo/wrapper: Permission denied
554 5.3.0 unknown mailer error 126

it it because you forgot to run the adaptwrapper script, see above. 

 

References 

package's DESCR 

Majordomo and MajorCool HOWTO: http://tldp.org/HOWTO/Majordomo-MajorCool-HOWTO/ 

3. Majordomo: http://tldp.org/HOWTO/Majordomo-MajorCool-HOWTO/x253.html 

4. MajorCool: http://tldp.org/HOWTO/Majordomo-MajorCool-HOWTO/x424.html