Unix/Solaris10

Majordomo Mailing List

ForceCore 2006. 12. 15. 20:50

http://www.greatcircle.com/majordomo/

1.94.5를 받았다.

압축을 해제했다.

설치매뉴얼은 압축 안의 INSTALL파일이다.

 

데몬이 어쩌구 주저리 주저리 적혀있는데...

중요한 것은 일단은 Makefile을 수정라하는 부분이다.

 

 

 

 

사용자추가

listserv라는 사용자를 추가했다.

majordomo이전의 메일링리스트 서버인데 요즘은 상용화 된듯 -_-;;;

majordomo라는 사용자 이름 및 그룹은 스펠링이 너무 길어서

그냥 listserv라는 요상한 이름을 지어주었다.

그룹도 listserv라는 동명의 그룹을 만들었다.

* 주의: 필자와 같이 majordomo의 HOME_MODE를 750으로 할 생각이라면, 그룹은 메일러데몬과 동일하게 해주어야 한다. postfix나 sendmail이 1그룹이면 majordomo도 1그룹으로 하라.

 

 

 

Makefile 수정

Makefile을 열심히 수정했다. (영어로) 친절한 설명이 있어서 그다지 어렵지 않을 것이다.

서버를 다루는 사람은 무릇 영어를 잘 해야 한다 ㄱ-;;

필자의 Makefile은 아래와 같이 수정되었다.

 

# Put the location of your Perl binary here:
PERL = /bin/perl

 

# What do you call your C compiler?

CC = gcc# was cc

 

# Where do you want Majordomo to be installed?  This CANNOT be the
# current directory (where you unpacked the distribution)
W_HOME = /usr/local/majordomo-$(VERSION)

 

# Where do you want man pages to be installed?
MAN = $(W_HOME)/man

 

# You need to have or create a user and group which majordomo will run as.
# Enter the numeric UID and GID (not their names!) here:

# 아까 추가한 listserv라는 계정의 그룹번호와 uidnumber.
W_USER = 7015
W_GROUP = 1

 

# These set the permissions for all installed files and executables (except
# the wrapper), respectively.  Some sites may wish to make these more
# lenient, or more restrictive.
FILE_MODE = 644
EXEC_MODE = 755
HOME_MODE = 750  # 보안을 위해 751에서 750으로 변경.

 

# If your system is POSIX (e.g. Sun Solaris, SGI Irix 5 and 6, Dec Ultrix MIPS,
# BSDI or other 4.4-based BSD, Linux) use the following four lines.  Do not
# change these values!

# POSIX에는 잘 되어있으니 놔두시오.
WRAPPER_OWNER = root
WRAPPER_GROUP = $(W_GROUP)
WRAPPER_MODE = 4755
POSIX = -DPOSIX_UID=$(W_USER) -DPOSIX_GID=$(W_GROUP)
# Otherwise, if your system is NOT POSIX (e.g. SunOS 4.x, SGI Irix 4,
# HP DomainOS) then comment out the above four lines and uncomment
# the following four lines.
# WRAPPER_OWNER = $(W_USER)
# WRAPPER_GROUP = $(W_GROUP)
# WRAPPER_MODE = 6755
# POSIX =

 

# Define this if the majordomo programs should *also* be run in the same
# group as your MTA, usually sendmail.  This is rarely needed, but some
# MTAs require certain group memberships before allowing the message sender
# to be set arbitrarily.
# MAIL_GID =    numeric_gid_of_MTA


# This is the environment that (along with LOGNAME and USER inherited from the
# parent process, and without the leading "W_" in the variable names) gets
# passed to processes run by "wrapper"
W_SHELL = /bin/sh
W_PATH = /bin:/usr/bin:/usr/ucb
W_MAJORDOMO_CF = /etc/majordomo.cf  # 좀 편한 곳에 배치하기로 했다.

# A directory for temp files..
TMPDIR = /usr/tmp

#--------YOU SHOULDN'T HAVE TO CHANGE ANYTHING BELOW THIS LINE.-------------

이 아래는 그냥 놔두면 알아서 됨 -_-;;

 

 

 

 

설정파일의 생성

 

처음 설치하는 경우라면 sample.cf를 복사해서 majordomo.cf로 이름을 짓는다. 신기하게도 설정파일이 펄언어로 되어있다 -_-;; 수정해야 할 중요 variable:

 

$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?

 

업그레이드 하는 경우라면 config-test를 해보면 무슨 변수가 없는지 테스트 해준다는데 -_- 새로운 설치이므로 넘어가자 -_-;;

 

필자가 건드린 설정은

$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?
이다.

whereami는 당연히 잘 설정해야 하고 (yyy.xxx.ac.kr와 같이)

whoami는listserv@$whoami로 하였다.

$whoami_owner는 문제가 생기면 문의 할 메일주소인듯 하다. 그래서 postmaster라고 했다.

$log는 메이저도모 디렉토리에 한다길래 마음에 안 들긴 했는데... /var/log에 쉽게 넣을 수는 없게 되어있다 -_-;; 할 수 없이...

# ln -s ~listserv/Log /var/log/majordomo.log

라고 소프트링크를 거는 것으로 만족했다.

 

 

 

 

컴파일

 

$ make wrapper

# make install

# make install-wrapper

순으로 하면 순조롭게 된다.

$ cd /usr/local/majordomo-1.94.5; ./wrapper config-test

make install-wrapper가 끝나면 이런 명령을 내려서 config-test를 해보라고 하는데...

/etc/majordomo.cf를 소프트 링크 하든지 직접 이동시키든지 하면 된다.

 

디 엔드... -_-;; config-test를 해서 안 되는 것을 차례로 고쳐주면 된다.

필자의 경우는 /etc/majordomo.cf가 없어서 6개가 에러가 떴다가 이를 만들어주니 1개로 줄었다. 그 나머지 한개는 /var/log/majordomo를 디렉토리로 -_- 만들어서 발생한 것이었다. 파일로 만드니 괜찮았다.

!! 제대로 된 테스트를 위해서는 root로서 실행시키지 말 것.

 

 

 

 

메일러 데몬과 연동

 

Postfix, Sendmail모두 큰문제는 없을 것으로 예상된다. 메일을 보내는 부분은 sendmail이라는 바이너리를 통해 이루어지는데 postfix는 sendmail과의 호환성에 따라 문제 없이 돌아간다. aliases를 물려주면 된다.... 필자는 postfix를 쓰는데 -_-.. Sendmail은 INSTALL에 적혀있으니 넘어가겠다.

 

touch /etc/postfix/majordomo.aliases

로 파일 생성.

이를 majordomo home directory로,

/usr/local/majordomo-1.94.5/majordomo.aliases로 softlink했다.

반대로 하면 newaliases명령이 안 듣는다 -_-;;

 

/etc/postfix/main.cf에 들어간다.

alias_maps = dbm:/etc/postfix/aliases,dbm:/etc/postfix/majordomo.aliases
alias_database = dbm:/etc/postfix/aliases,dbm:/etc/postfix/majordomo.aliases

 

요로코롬 했음. 그리고 majordomo.aliases의 내용은

주의할 것: "|/usr/local/... 에서 "다음에 오는 글자는 bar이다. small L 이나 대문자 i이 아니다.

majordomo: "|/usr/local/majordomo-1.94.5/wrapper majordomo"
listserv: "|/usr/local/majordomo-1.94.5/wrapper majordomo"
owner-majordomo: postmaster
majordomo-owner: postmaster

위와 비슷하게 한다.

 

 

 

제대로 되나 테스트

 

majordomo의 메일링 리스트가 있는 디렉토리로 들어간다. touch test라고 명령을 내려서 테스트용 메일링리스트를 만든다.

 

echo 'lists' | mail listserv

이런 명령을 내려본다.

 

dmesg를 쳐보니 execvp /usr/local/majordomo-1.94.5/wrapper: Permission denied

이런 메시지가 나왔다.

 

해결 방법은 두가지.

1. /usr/local/majordomo-1.94.5 디렉토리를 751로 풀어버린다 (-_-)

2. postfix/sendmail과 같은 그룹으로 실행되게 한다. (daemon그룹)

 

말은 쉬운데 잘 안 된다 ㄱ-;;;

 

음... 2번으로 하고 싶은 경우... 프로그램을 재컴파일 하고 재설치할 필요가 없다 +_+!!!

sendmail은 경우는 재컴파일은 아니고 권한을 좀 다시 바꾸긴 해야 하는데 -0-

postfix는 좋은 성질을 가지고 있다.

majordomo.aliases 파일의 소유자와 소유그룹을 메이저도모의 uidnumber와 gidnumber와 일치시키면 되는 것이다!

http://www.csh.rit.edu/~jon/projects/majordomo/

여기서 postfix의 aliases 소유자 가정에 대해 읽고 퍼즐을 풀 수 있었다.

이 글은 좋은 글이다... wrapper라는 것 없이도 majordomo를 실행할 수 있는 방법에 대해 말하고 있는데 필자는 귀찮아서 여기까지만 하겠다...;

 

echo 'lists' | mail listserv

명령을 내려서 성공하면....

자신에게 메일이 올 것이다.

 

--

>>>> lists
listserv@yyy.xxx.ac.krserves the following lists:

  test

Use the 'info <list>' command to get more information
about a specific list.
>>>>