当前位置:Linux教程 - Linux文化 - 建立电子讨论群(Mailing List)

建立电子讨论群(Mailing List)


1.Preliminaries:
(1) Sendmail version 8
(2) Perl 4.036 to 5.001a and its libraries
牋牋 (but will not work with Perl 5.001!!!)
(3) a C compiler

2.建立一个叫majordom的帐号:
adduser majordom
its group name is majordom too
home directory is /usr/local/majordomo
chmod 775 /usr/local/majordomo

3.获取Majordomo这个软体
su 成 majordom, 然后 get ftp://nctuccca.edu.tw/packages/
mail-server/majordomo/majordomo-1.93.tar.gz 到 /usr/local
majordomo, 然后解压

4.安装过程:
1). 修改 Makefile (usr/local/majordomo/majordomo-1.93/Makefile)

a). W_BIN=/usr/local/majordomo(This is where the source file is.)
b). Uncomment the POSIX section

2). make wrapper

(Notice : the wrapper 是用来set uid的, 所以在Makefile
中的W_UID 与 W_GID 务必要设对!!!)

3). make install
4). make install-archive2
5). make install-wrapper ( this step must be done by root)
6). ln -s /usr/local/majordomo/majordomo.cf /etc/majordomo.cf
7). 在$HOME(/usr/local/majordomo)下

mkdir archives, digests, lists;
chmod 775 archives,digests, lists;
touch Log
chmod 644 Log

8). ln -s /usr/bin/perl /usr/local/bin/perl

(This step is to avoid some Perl script pointing to
/usr/local/perl instead of /usr/bin/perl)

9). Modify some files to avoid some known bugs

a). request-answer

1). near the beginning of the request-answer
插入一行 require "shlock.pl";'
2). 将所有的do_exec_sendmail改成
do_exec_sendmail_in_request_answer
3). 第41行
exec("/usr/lib/sendmail", "-f$list-request", "-t") ||
将-f$list-request 改成 -f$list-approval

b). resend 第348行

&bounce("Approval required");改成
&bounce();

10).edit majordomo.cf

?范例如下:

# $whereami -- What machine am I running on?
# Need modified
$whereami = "girl.ee.ntu.edu.tw";

# $whoami -- Who do users send requests to me as?
$whoami = "majordomo@$whereami";

# $whoami_owner -- Who is the owner of the above, in case of problems?
$whoami_owner = "owner-majordomo@$whereami";

# $homedir -- Where can I find my extra .pl files, like majordomo.pl?
# the environment variable HOME is set by the wrapper
$homedir = "/usr/local/majordomo";

# $listdir -- Where are the mailing lists?
$listdir = "/usr/local/majordomo/lists";

# $digest_work_dir -- the parent directory for digest's queue area
# Each list must have a subdirectory under this directory in order for
# digest to work. E.G. The bblisa list would use:
# /usr/local/mail/digest/bblisa
# as its directory.
$digest_work_dir = '/usr/local/majordomo/digests';

# $log -- Where do I write my log?
$log = "$homedir/Log";

# $mailer -- What program and args do I use to send mail?
# The variable $to can be interpolated into this command line,
# however the $to variable is provided by the person sending mail,
# and much mischief can be had by playing with this variable.
# Use $to with care.
$mailer = "/usr/lib/sendmail -f\$sender -t";

# Majordomo will look for "get" and "index" files related to $list in
# directory "$filedir/$list$filedir_suffix", so set $filedir and
# $filedir_suffix appropriately. For instance, to look in
# /usr/local/mail/files/$list, use:
# $filedir = "/usr/local/mail/files";
# $filedir_suffix = ""; # empty string
# or to look in $listdir/$list.archive, use:
# $filedir = "$listdir";
# $filedir_suffix = ".archive";

$filedir = "/usr/local/majordomo/archives";
$filedir_suffix = "";

# What command should I use to process an "index" request?
$index_command = "/bin/ls -lLG |/usr/bin/sed -e 's/^........................//' -e '1s/.*/ SIZE DATE NAME/'";
#$index_command = "/bin/ls -lL | /usr/bin/awk '{print $5, $6, $7, $8, $9}'";


# If you want to use FTPMAIL, rather than local access, for file transfer
# and access, define the following:
# $ftpmail_address = "[email protected]";
# $ftpmail_location = "FTP.$whereami";

# if you want the subject of the request to be included as part of the
# subject of the reply (useful when automatically testing, or submitting
# multiple command sets), set $return_subject to 1.
$return_subject = 1;

# If you are using majordomo at the -request address, set the
# following variable to 1. This affects the welcome message that is
# sent to a new subscriber as well as the help text that is generated.
$majordomo_request = 0;

# Set the umask for the process. Used to set default file status for
# config file.
umask(007);

# Very Important!!!!!!!!!!!!!!!!!!
# the safe locations for archive directories. This should be defined as
# a series of root anchored directory paths as will be used as prefixes
# to the file names specified to the archive2.pl script.
@archive_dirs = ( "/usr/local/majordomo/archives/sample", "/usr/spool/archive/firewalls" );


# Set this to 1 if you want to use the experimental mechanism for allowing
# / in user names. People with lots of X.400 addresses on their lists or
# HP mail whatever may want to set this. However use it at your own risk.
$analyze_slash_in_address = 0;

#
# these tune the experimental matching that is done for addresses with / in
# them. If you haven't turned on the experimental analyze_slash_in_address
# they are ignored. See the source for full explanation of these variables.
#
# if set to 1 ignore the requirement that addresses have an @ sign in the
# address component after the last /.
$no_x400at=0;
# if set to 1 do not look for "/c=" and "/ad=" or "/am=" in the address.
# X.400 seems to require these components.
$no_true_x400=0;

1;


11).Edit /etc/aliases(after you edit the /etc/aliases
you should run newaliases to make it work)

owner-owner: postmaster
#
#Majordomo
#
owner-majordomo: long, nobody
majordomo: "|/usr/local/majordomo/wrapper majordomo"

majordom: owner-majordomo
#Needed "just in case" for Majordomo version 1.9x:
Majordomo-Owner: owner-majordomo
nobody: /dev/null

#
# Sample mailing list
#
# Adding "nobody" prevents expansion to "long" under sendmail v8:
owner-sample: long, nobody
sample-owner: long, nobody
#sample: "|/usr/local/majordomo/wrapper resend -p bulk -M 10000 -R -l sample -f sample-owner -h girl.ee.ntu.edu.tw -s sample-outgoing"
sample: "|/usr/local/majordomo/wrapper resend -l sample -h girl.ee.ntu.edu.tw sample-outgoing"
sample-approval: owner-sample
sample-outgoing: :include:/usr/local/majordomo/lists/sample, sample-archive,
"|/usr/local/majordomo/wrapper digest -r -C -l sample-digest sample-digest-outgoing"
#
# For digest version list
#
sample-digest: sample
sample-digest-outgoing: "|/usr/local/majordomo/wrapper request-answer sample-digest"
owner-sample-digest: owner-sample
owner-sample-digest-outgoing: owner-sample
owner-sample-digest-request: owner-sample
sample-digest-approval: sample-approval
#
# End of the digest version list
#
owner-sample-outgoing: owner-sample
sample-archive: "|/usr/local/majordomo/wrapper archive -f /usr/local/majordomo/archives/sample/sample -m -a"
owner-sample-archive: owner-sample
#
# For someone who may use listname-request to ask questions
#sample-request: "|/usr/local/majordomo/wrapper request-answer sample"
sample-request: "|/usr/local/majordomo/wrapper majordomo -l sample"
owner-sample-request: owner-sample
#
# End of listname-request version


——摘自:交大资科Linux WWW 资讯系统