Created
August 30, 2012 05:06
-
-
Save nikushi/3522575 to your computer and use it in GitHub Desktop.
受信メールからメーリングリスト名を抽出しつつ、mhonarcに入力しhtml化するmaildropレシピ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HOME="/home/nikushi" | |
WWWBASE="$HOME/public_html/mail" | |
MLNAME="" | |
# is ML ? | |
if ( /^Subject:\s+\[(.+?)(:\s*[0-9]*|\s+[0-9]*|)\]\s+/ ) | |
{ | |
MLNAME=$MATCH1 | |
} | |
if ( $MLNAME eq "" ) | |
{ | |
MLNAME="main" | |
} | |
else | |
{ | |
MLNAME=`echo $MLNAME | tr [A-Z] [a-z]` | |
if ( ! /^(To|CC|Sender):\s+$MLNAME/ ) | |
{ | |
MLNAME="main" | |
} | |
} | |
OUT="$WWWBASE/$MLNAME" | |
RET=`[ ! -d $OUT ] && mkdir $OUT && echo $OUT created` | |
log $RET | |
RET=`mhonarc \ | |
-outdir $OUT \ | |
-rcfile $HOME/etc/mhonarc/mhonarc.mrc \ | |
-idxfname index.html \ | |
-attachmenturl $WWWBASE/attachments \ | |
-attachmentdir $WWWBASE/attachments \ | |
-authsort -nodoc -fileperms 640 -idxsize 100 \ | |
-lang ja_JP.UTF-8 -multipg \ | |
-title $MLNAME \ | |
-ttitle "$MLNAME Thread Index" \ | |
-quiet -add -` | |
log $RET | |
#to "/dev/null" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment