Installing Majordomo

Before you install majordomo you'll need the following: 
•	root access
•	perl
•	exim or sendmail
•	gcc or some other version of cc 

You will want to know the complete paths to:
•	perl
•	exim and sendmail
•	gcc

[T1-user_#]$ which sendmail 
/usr/sbin/sendmail
 [T1-user_#]$ which exim 
/usr/local/sbin/exim
 [T1-user_#]$ which perl
/usr/bin/perl
[T1-user_#]$ which gcc
/usr/bin/gcc
[T1-user_#]$ mv /usr/sbin/sendmail /usr/sbin/sendmail.ORIG (Do this if sendmail exists)
[T1-user_#]$ ln -s /usr/local/sbin/exim /usr/sbin/sendmail

You will also want to know where to find the majordomo source files and your exim configuration file: 

/usr/local/src/majordomo-1_94_5.tar.gz
/usr/local/etc/exim/configure

Standard tools and commands that we will be using include: 

•	adduser
•	gzip or gunzip
•	tar
•	exim_dbmbuild or newaliases
•	chmod & chgrp
•	mkdir 
•	touch

You can get directions for using each of these commands under FreeBSD by typing: 

[T1-user-#]$ man <command> 

(E.g. "man newaliases" will bring up the newaliases manual page) 

We will also be editing several long files (you can use joe, emacs, or vi) and testing lists using the pine email program or the mail utility. 

Tasks for root

1.	Create a user/group to own majordomo: 

We want to run majordomo from a dedicated account in order to avoid the potential security problems that could result from using the majordomo.daemon option. Also to be able to hand off day-to-day management of majordomo to some trusted user other than your root user. 

bash-2.04# adduser -s

Enter username [a-z0-9_-]: majordom
Enter full name []: Majordomo
Enter shell bash csh date ksh no sh [sh]: bash
Enter home directory (full path)
[/home/majordom]: /home/majordom
Uid [1006]:
Enter login class: default []:
Login group majordom [majordom]:
Login group is ``majordom''. Invite majordom into other groups: guest no
[no]:
Enter password []:
Enter password again []:

Name:     majordom
Password: ****
Fullname: Majordomo
Uid:      1006
Gid:      1006 (majordom)
Class:
Groups:   majordom
HOME:     /home/majordom
Shell:    /home/bin/bash
OK? (y/n) [y]:
Added user ``majordom''
Send message to ``majordom'' and: no root second_mail_address
[no]:

Majordomo,

your account ``majordom'' was created.
Have fun!

See also chpass(1), finger(1), passwd(1)

Add anything to default message (y/n) [n]:
Send message (y/n) [y]:
Add another user? (y/n) [y]: n
bash-2.04#

Check if the user created is in the /etc/passwd file.

bash-2.04# grep majordom /etc/passwd

You should see something like this: 

majordom:x:1006:1006:majordomo:/home/majordom:/usr/local/bin/bash

Make a note of the uid/gid (in this case 1006/1006) because you will need them later. 

NOTE:	If you are installing under linux or solaris you can use the existing tools linuxconf/admintool) to create a user (majordom) and group (majordom) and set an initial password and home directory. This home directory will be used to install majordomo files. 

Make changes to the Exim configuration file "configure": 

bash-2.04# cd /usr/local/etc/exim/
bash-2.04# vi configure

If you're not comfortable using vi, use emacs or joe instead! Add majordom to the list of trusted users in /usr/local/etc/exim/configure. Make this entry below the “exim_user = root” and “exim_group = mail”. That part of your file should look like this.

# No local deliveries will ever be run under the uids of these users (a colon-
# separated list). An attempt to do so gets changed so that it runs under the
# uid of "nobody" instead. This is a paranoic safety catch. Note the default
# setting means you cannot deliver mail addressed to root as if it were a
# normal user. This isn't usually a problem, as most sites have an alias for
# root that redirects such mail to a human administrator.

exim_user = root
exim_group = mail

# If you are running Exim under its own uid (recommended), then you should
# set up that uid as a trusted user by de-commenting the following and
# changing the name if necessary.

trusted_users = root:majordom

Using an majordomo.aliases file

We want to create a local aliases file where we can store all the majordomo related aliases. This file can be edited by the majordom account owner (listmaster) and allows a user other than root to manage day to day list creation/deletion/etc.

Find the "system_aliases:" entry in the exim configuration file.  

system_aliases:
  driver = aliasfile
  file = /etc/aliases
  search_type = lsearch
  file_transport = address_file
  pipe_transport = address_pipe
  user = root

Edit the file by adding the following lines for majordomo.aliases in the exim configuration file.

majordomo_aliases:
  driver = aliasfile
  file = /home/majordom/majordomo.aliases
  search_type = lsearch
  file_transport = address_file
  pipe_transport = address_pipe
  user = majordom
  group = majordom

Now save your file and exit your editor 

bash-2.04# cd /home/majordom 

Now we'll create the files you'll need to run majordomo.aliases: 

bash-2.04# cp /usr/local/src/majordomo-1.94.5/majordomo.aliases /home/majordom/

Once you've created the files, set the group ownership for majordomo.aliases to majordom 

bash-2.04# chgrp majordom majordomo.aliases

You can check file permissions and ownership by typing: 

bash-2.04# ls -al *.aliases

-rw-rw-r--   1 root     majordom      410 Sep 15 10:59 majordomo.aliases

The user majordom can now add new list aliases using the majordomo.aliases file. 

Edit majordomo.aliases as follows: 

# majordomo mailinglist aliases
# majordom:majordomo
majordomo: "|/home/majordom/wrapper majordomo"
listmaster: majordom
owner-majordomo: majordom
majordomo-owner: majordom

# test list info
test: "|/home/majordom/wrapper resend -R -l test test-outgoing"
test-outgoing: :include:/home/majordom/lists/test
owner-test: bulley@ghana.com
test-request: "|/home/majordom/wrapper request-answer test"
test-approval: bulley@ghana.com

Once you've added your aliases, run exim_dbmbuild to rebuild/create your .db and update files. 

bash-2.04# exim_dbmbuild /home/majordomo.aliases /home/majordomo.aliases.db

Restart exim by issuing the following commands.

bash-2.04# /usr/local/etc/rc.d/exim.sh stop
bash-2.04# /usr/local/etc/rc.d/exim.sh start

You can test if exim is really running by typing: 

bash-2.04# telnet localhost 25 

Install the majordomo software:

bash-2.04# cd /usr/local/src 

You can find a copy of the majordomo source: majordomo-1_94_5_tar.gz or you can download majordomo-1.94.5.tar.gz.

Via the Web at: 
http://www.greatcircle.com/majordomo/ 

Via anonymous FTP at: 
ftp://ftp.greatcircle.com/pub/majordomo/ 
ftp://ftp.sgi.com/other/majordomo/ 
ftp://ftp.sgi.com/other/majordomo/ 

or from the nearest mirror site.

Uncompress the files in a temporary working directory (NOT your installation dir) for this exercise you can just use the /usr/local/src directory. 

bash-2.04# gunzip majordomo-1_94_5_tar.gz
bash-2.04# tar -xvf majordomo-1_94_5.tar 
bash-2.04# cd majordomo-1.94.5

Edit your Makefile defining: 
•	where Perl and the C compiler are 
•	the Majordomo home directory (home directory for the user majordom) 
•	the location of the manual pages 
•	the user and group that Majordomo will run under 
•	the permissions for the various files and directories

Your changes should look something like this: 

PERL = /usr/bin/perl
CC = /usr/bin/gcc
W_HOME = /home/majordom
W_USER = 1006
W_GROUP = 1006

Notice that I have left the man page and permissions as I found them.

Create a majordomo.cf file and edit it by copying the sample.cf file to majordomo.cf and opening majordomo.cf in your favorite editor.

bash-2.04# cp sample.cf majordomo.cf

Edit the majordomo.cf file. The important variables to set are: 

$whereami		What machine am I on?
$whoami		Who do users send requests to me as?
$whoami_owner		Who is the owner of the above, for problems?
$homedir		Where can I find my extra .pl files?
$listdir		Where are the mailing lists?
$log			Where do I write my log?
$sendmail_command	Where the sendmail program resides.
$mailer	What program and args do I use to send mail to the lists?
$bounce_mailer  What program and args do I use to send administrative messages?

My settings might look like this: 

$whereami = "chat.gh.com";
$whoami = "majordomo\@$whereami";
$whoami_owner = "owner-majordomo\@$whereami";
if ( defined $ENV{"HOME"}) {
$homedir = $ENV{"HOME"};
} else {
$homedir = "/home/majordom";
}
$listdir = "$homedir/lists";
$digest_work_dir = "/home/majordom/digests";
$log = "$homedir/Log";
sub exim $sendmail_command = "/usr/sbin/sendmail";
sub exim $mailer = "$sendmail_command -oi -oee -f\$sender";
sub exim $bounce_mailer = "$sendmail_command -oi -oee -f\$sender -t";

You may also want to change the following: 

$TMPDIR = $ENV{'TMPDIR'} || "/usr/tmp"; 
to: 
$TMPDIR = $ENV{'TMPDIR'} || "/u";

Run make as needed: 

bash-2.04# make wrapper
bash-2.04# make install
bash-2.04# make install-wrapper

STOP! don't run the config-test yet!

bash-2.04# cd /home/majordom 

Now do an ls –al. What are we missing? 

Log, lists, digests 
(all named in majordomo.cf but not created during install)

Tasks for majordom

bash-2.04# su majordom 

Finish the installation by doing the following in /home/majordom: 

bash-2.04# touch Log
bash-2.04# mkdir lists
bash-2.04# mkdir digests

Now if you do an ls -al you should see: 

drwxr-x--x   8 majordom majordom     1024 Sep 15 12:46 .
drwxr-xr-x  14 root     root         1024 Sep 15 10:44 ..
drwxr-xr-x   2 majordom majordom     1024 Sep 15 10:44 Tools
-rwxr-xr-x   1 majordom majordom     5234 Sep 15 10:44 archive2.pl
drwxr-xr-x   2 majordom majordom     1024 Sep 15 10:44 bin
-rwxr-xr-x   1 majordom majordom     2795 Sep 15 10:44 bounce-remind
-rwxr-xr-x   1 majordom majordom    10671 Sep 15 10:44 config-test
-rwxr-xr-x   1 majordom majordom    49673 Sep 15 10:44 config_parse.pl
-rwxr-xr-x   1 majordom majordom    13031 Sep 15 10:44 digest
drwxrwxr-x   2 majordom majordom     1024 Sep 15 10:52 digests
drwxrwxr-x   2 majordom majordom     1024 Sep 15 12:46 lists
-rw-rw-r--   1 majordom majordom      477 Sep 15 12:46 log
-rwxr-xr-x   1 majordom majordom    64251 Sep 15 10:44 majordomo
-rw-rw-r--   1 majordom majordom      410 Sep 15 10:59 majordomo.aliases
-rw-r--r--   1 majordom majordom    10485 Sep 15 10:44 majordomo.cf
-rwxr-xr-x   1 majordom majordom    23763 Sep 15 10:44 majordomo.pl
-rwxr-xr-x   1 majordom majordom      137 Sep 15 10:44 majordomo_version.pl
drwxr-xr-x   4 majordom majordom     1024 Sep 15 10:44 man
-rwxr-xr-x   1 majordom majordom     3532 Sep 15 10:44 request-answer
-rwxr-xr-x   1 majordom majordom    29520 Sep 15 10:44 resend
-rw-r--r--   1 majordom majordom    10462 Sep 15 10:44 sample.cf
-rwxr-xr-x   1 majordom majordom     8060 Sep 15 10:44 shlock.pl
-rwsr-xr-x   1 root     majordom     6735 Sep 15 10:45 wrapper

Now run the config-test: 

[T1-user-#]$ ./wrapper config-test

and you should see a message scroll by that ends: 

----------------------- end of tests -----------------------

Nothing bad found!  Majordomo _should_ work correctly.

If it doesn't, check your configuration file 
(/home/majordom/majordomo.cf) 
closely, and if it still looks okay, consider asking the majordomo-users
mailing list at "majordomo-users@greatcircle.com" for assistance.  Be sure
and fully specify what your problems are, and what type of machine (and
operating system) you are using.

Enjoy!

Lets do a second test just to be sure: 

[T1-user-#]$ cd lists
[T1-user-#]$ touch test
[T1-user-#]$ touch test.info
[T1-user-#]$ echo 'lists' |mail majordomo

If everything worked, the majordom account should have mail message from majordomo.