FmlTips のバックアップソース(No.2) - PukiWiki
#contents

** FMLに関するTips [#u1fb4965]
*** メール投稿者の制限 [#b31bb95c]
config.ph (89行)
 $PERMIT_POST_FROM              = "anyone";      <- 誰でもOK!
                                   members_only  <- membersにある人のみ

*** メール投稿排除時の処理 [#t5cd9cb1]
config.ph (90行)
 $REJECT_POST_HANDLER           = "reject";      <- 投稿者にエラー通知
                                   ignore        <- fml管理者への報告のみ

*** メールによるコマンド処理の制限 [#ed31c910]
config.ph (115-116行)
 $PERMIT_COMMAND_FROM           = "moderator";
 $REJECT_COMMAND_HANDLER        = "ignore";

*** Reply-To: ヘッダの削除 [#pe4d02b3]
config.ph (最後に追加 1;の行の前)
 $START_HOOK = q{
        &DELETE_FIELD('Reply-To');
 };

*** 特定のアドレスからのメールの宛先を変更する [#g9a68d4c]
members.special内の人からのメールは, actives.specialの人たちに送る.~
config.ph (最後に追加 1;の行の前)
 $START_HOOK = q#
        $SPECIAL_LIST = "$DIR/members.special";
        if (&CheckMember($From_address, $SPECIAL_LIST)) {
            $ACTIVE_LIST = "$DIR/actives.special";
            undef @ACTIVE_LIST;
        }
 #;

** 2006/12/03作業報告 [#u18e922c]
*** ML作成 [#m4164f2f]
 m1-2006,m2-2006,d1-2006,d2-2006,d3-2006,ken-2006,math-staff-2006

*** /etc/postfix/ml/math_all_2006.csh [#z4698e97]
 #!/bin/csh -f
 set filename=/var/spool/ml/math-all-2006/actives.new
 set backup=/var/spool/ml/math-all-2006/actives.old
 set actives=/var/spool/ml/math-all-2006/actives
 #
 cd /etc/postfix/ml
 #
 (echo -n '# '; date) > $filename
 echo "# ====================" >> $filename
 foreach i (math-prof-base math-prof-appl math-aprof-base math-aprof-appl 
            math-lect-base math-lect-appl math-assist-base 
            math-assist-appl 2006/m1 2006/m2 2006/d1 2006/d2 2006/d3 
            2006/ken math-coe ssp math-jimu-sci math-jimu-rc math-jimu-eng 
            math-jimu-coe math-library)
 echo "# $i" >> $filename
 cat $i | grep -v '^#' | grep -v '^ *$' | 
               awk '{printf("%s@math.kyushu-u.ac.jp\n",$1);}' >> $filename
 echo "# ====================" >> $filename
 end
 chown fml.fml $filename
 mv $actives $backup
 mv $filename $actives

*** /etc/postfix/ml/2006/math_students.csh [#h5db53dc]
 #!/bin/csh -f
 set directory=/var/spool/ml
 set allmembers=/var/spool/ml/math-all-2006/actives
 #
 cd /etc/postfix/ml/2006
 #
 foreach i (m1 m2 d1 d2 d3 ken)
  set filename=$directory/$i-2006/actives.new
  set backup=$directory/$i-2006/actives.old
  set actives=$directory/$i-2006/actives
  set members=$directory/$i-2006/members
  sed -e 's/^xyz/# xyz/' $allmembers > $members
  chown fml.fml $members
  (echo -n '# '; date) > $filename
  echo "# ====================" >> $filename
  echo "# $i" >> $filename
  cat $i | grep -v '^#' | grep -v '^ *$' | 
           awk '{printf("%s@math.kyushu-u.ac.jp\n",$1);}' >> $filename
  echo "# ====================" >> $filename
  chown fml.fml $filename
  mv $actives $backup
  mv $filename $actives
 end

*** /etc/postfix/ml/2006/math_staff.csh [#u46085f0]
 #!/bin/csh -f
 set afilename=/var/spool/ml/math-staff-2006/actives.new
 set mfilename=/var/spool/ml/math-staff-2006/members.new
 set abackup=/var/spool/ml/math-staff-2006/actives.old
 set mbackup=/var/spool/ml/math-staff-2006/members.old
 set actives=/var/spool/ml/math-staff-2006/actives
 set members=/var/spool/ml/math-staff-2006/members
 # 
 cd /etc/postfix/ml
 #
 # actives
 #
 (echo -n '# '; date) > $afilename
 echo "# ====================" >> $afilename
 foreach i (math-prof-base math-prof-appl math-aprof-base math-aprof-appl
            math-lect-base math-lect-appl math-assist-base math-assist-appl)
  echo "# $i" >> $afilename
  cat $i | grep -v '^#' | grep -v '^ *$' | 
          awk '{printf("%s@math.kyushu-u.ac.jp\n",$1);}' >>$afilename
  echo "# ====================" >> $afilename
 end
 chown fml.fml $afilename
 mv $actives $abackup
 mv $afilename $actives
 #
 # members
 #
 (echo -n '# '; date) > $mfilename
 echo "# ====================" >> $mfilename
 foreach i (math-prof-base math-prof-appl math-aprof-base math-aprof-appl
            math-lect-base math-lect-appl math-assist-base math-assist-appl
             math-jimu-sci math-jimu-rc math-jimu-eng math-jimu-coe 
             math-library)
  echo "# $i" >> $mfilename
  cat $i | grep -v '^#' | grep -v '^ *$' | 
         awk '{printf("%s@math.kyushu-u.ac.jp\n",$1);}' >>$mfilename
  echo "# ====================" >> $mfilename
 end
 chown fml.fml $mfilename
 mv $members $mbackup
 mv $mfilename $members

*** crontab -e [#t3bed298]
 58 23 * * * /etc/postfix/ml/math_all_2006.csh
 55 23 * * * /etc/postfix/ml/2006/math_students.csh
 50 23 * * * /etc/postfix/ml/2006/math_staff_2006.csh


トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSSPDF