#!/bin/rc # 2022-04-19T21:06:29-04:00 rfork en fn fixheader{ { sed 1q $D/rawunix cat $D/rawheader echo 'List-ID: <'$LIST.$DOMAIN'>' echo 'List-Help: ' echo X-Glyph: ➈ echo -n 'X-Bullshit: ' bullshit echo } >>$TMP.header >>[2]$TMP.errors } fn fixmsg{ cat $TMP.header $D/rawbody >$TMP.med >>[2]$TMP.errors } fn index{ awk -v fileid'='$2^: '{print fileid $0}' >>/mail/box/$1/index >>[2]$TMP.errors } fn blingdex{ <$TMP.med index $LIST `{sed -n 19p $D/info} >>[2]$TMP.errors } fn try{ <$TMP.med /bin/upas/ml -p -r $REPLY /mail/box/$LIST/address-list $LIST >>[2]$TMP.errors } fn die{ {echo ACHTUNG! this list does not accept html messages.; echo $status; echo; echo errors:; cat $TMP.errors; echo; echo message:; cat $TMP.raw} | mail -s $LIST^@^$DOMAIN^' '^FAILED $*; cleanup; exit } fn cleanup{ rm -f $TMP $TMP.* } @{ rfork en {<$TMP.raw sed '/^$/,$ s/^From / From /'; echo} >$TMP /bin/upas/fs -f $TMP D=/mail/fs/mbox/1 if(~ `{file $D/body} *HTML* && ! ~ `{cat $D/from} *code.9front.org sl@stanleylieber.com) # sorry, but fuck you die `{cat $D/from} fixheader && fixmsg && try || die cleanup exit } >/dev/null >[2=1] &