postfix + mailing list – majordomo
Majordomo 為一Mailing-list Manager ,MLM,郵遞名單管理系統,
訂閱要求時,自動把該mail address加入名單
退訂要求時,自動於名單中刪除該mail address
[1.] adduser majordomo -u 45 -g 2 -c "Majordomo User" -d /usr/local/majordomo -s /sbin/nologin
[2.] 下載 majordomo.xx.tar.gz
[3.] tar zxvf majordomo.xx.tar.gz
cd majordomo-xx
vi Makefile
PERL = /usr/bin/perl
W_HOME = /usr/local/majordomoW_USER = 45
W_GROUP = 2
[4.] cp sample.cf majordomo.cf
$whereami = "test.xports.idv.tw";
$whoami = "Majordomo@$whereami";
$whoami_owner = "Majordomo-Owner@$whereami";
$homedir = "/usr/local/majordomo";
$listdir = "$homedir/lists";
$log = "$homedir/Log";$sendmail_command = "/usr/sbin/sendmail";
[5.] make wrapper
[6.] make install
[7.] make install-wrapper
[8.] cd /usr/local/majordomo
[9.] 測式,注意顯示出來的訊息,看到Enjoy!時,就表示設定正確
./wrapper config-test
[10.] vi /usr/local/majordomo/bin/approve
while (<$FILE>) {
if (/^>?From / && ! defined($from_skipped)) {
# Skip any initial "From " or ">From " line
$from_skipped = 1;
next;
}
next if ( /^delivered-to:/i ); # added for postfix # 加入這行
s/^~/~~/;
print MAIL $_;
}
[11.] vi /usr/local/majordomo/aliases.majordomo
# majordomo manager
majordomo: "|/usr/local/majordomo/wrapper majordomo"
owner-majordomo: cross
majordomo-owner: cross# astronomy mailing lists
astronomy: :include:/usr/local/majordomo/lists/astronomy
owner-astronomy: cross
astronomy-request: "|/usr/local/majordomo/wrapper request-answer astronomy"
owner-astronomy-request: cross
astronomy-approval: cross
或者
# majordomo manager
majordomo: "/usr/local/majordomo/wrapper majordomo"
majordomo-owner: cross
owner-majordomo: cross# astronomy mailing lists
astronomy: "|/usr/local/majordomo/wrapper resend -l astronomy -h ssorc.tw astronomy-outgoing"
owner-astronomy: cross
astronomy-outgoing: :include:/usr/local/majordomo/lists/astronomy
owner-astronomy-outgoing: cross
astronomy-request: cross # ?
astronomy-approval: cross
[12.] vi /etc/postfix/main.cf
alias_maps = hash:/etc/aliases, hash:/usr/local/majordomo/aliases.majordomo
alias_database = hash:/etc/aliases, hash:/usr/local/majordomo/aliases.majordomo
[13.] postalias /usr/local/majordomo/aliases.majordomo
[14.] postfix reload
[15.] 用來儲存訂閱astronomy list的使用者的mail address
touch /usr/local/majordomo/lists/astronomy
chown majordown.daemon /usr/local/majordomo/lists/astronomy
[16.] 當訂閱成功時,使用者會收到這個"welcome to astronomy list"的內容
touch /usr/local/majordomo/lists/astronomy.info
echo "welcome to astronomy list" > /usr/local/majordomo/lists/astronomy.info
chown majordown.daemon /usr/local/majordomo/lists/astronomy.info
[17.] 測式Majordomo是否正常,'lists'為Majordomo支援的指令
成功時,會收到Majordomo有那些list
echo 'lists' | mail [email protected]
[18.] 訂閱 list
寄一封信給 [email protected]
內容為
subscribe astronomy
subscribe 為指令
astronomy 為 list
[19.] 使用者會收到一封含有
auth 23ffe54b subscribe mailinglist [email protected]
此內肉的信件,把這段回覆給Majordomo
注意,不要直接回覆Majordomo寄給你含有授權碼的信件,因為如果如此,會無效,所以,
要直接寄內容為
auth 23ffe54b subscribe mailinglist [email protected]
給Majordomo
或者把
auth 23ffe54b subscribe mailinglist [email protected]
這段放在回覆信的最上頭
這樣Majordomo才會先認得指令
[20.] 之後[email protected]這個mail address,就會自動記錄在/usr/local/majordomo/lists/astronomy裡面
[21.] 所以只要寄信給[email protected],就同等寄給在/usr/local/majordomo/lists/astronomy裡的mail address
[22.] 取消訂閱,寄給 mailto:寄給[email protected],內容為
unsubscribe astronomy
[Q1.] fatal: open dictionary: expecting "type:name" form instead of "
[A1.] hash:/usr/local/majordomo/aliases.majordomo
注意格式,不要忘了加 hash
留言