Skip to Content.
Sympa Menu

en - Re: [sympa-users] Custom mhonarc script, trouble after upgrade...

Subject: The mailing list for listmasters using Sympa

List archive

Chronological Thread  
  • From: Marco Gaiarin <address@concealed>
  • To: "Stefan Hornburg (Racke)" <address@concealed>
  • Cc: address@concealed
  • Subject: Re: [sympa-users] Custom mhonarc script, trouble after upgrade...
  • Date: Sun, 24 Feb 2019 22:53:36 +0100

Mandi! "Stefan Hornburg (Racke)"
In chel di` si favelave...

> it would be helpful to provide the script.

Oh, sure!

root@eraldo:~# egrep -v "^[[:space:]]*#" /usr/local/sbin/smhawrap | egrep -v
"^$"
LOG="/tmp/smhawrap.log"
BMBOX="/tmp/smhawrap.mbox"
MHONARC="/usr/bin/mhonarc"
GATEBIN="/usr/local/bin/mail2news"
FORMAIL="/usr/bin/formail -I Approved:"
NEWSMAP="/etc/sympa/newsmap"
TMPF=$(tempfile --prefix smhawrap)
cat - | $FORMAIL > $TMPF
case $1 in
-add)
LISTNAME=$(echo ${10} | sed -e
"s/.*listname='\([^']*\)'.*/\1/1")
LISTHOST=$(echo ${10} | sed -e "s/.*hostname=\([^
]*\).*/\1/1")
NGNAME=$(cat $NEWSMAP | grep "^$LISTNAME, $LISTHOST: " | cut
-d ':' -f 2 | tr -d ' ')
if [ -n "$LOG" ]; then
if [ -n "$NGNAME" ]; then
echo "$GATEBIN NEWSGROUP=$NGNAME
LIST=$LISTNAME@$LISTHOST TAG=$LISTNAME" >> $LOG
fi
echo "$MHONARC $1 $2 $3 '$4' $5 $6 $7 $8 $9 \"${10}\"
${11} ${12}" >> $LOG
fi
if [ -n "$BMBOX" ]; then
cat $TMPF >> $BMBOX
fi
if [ -n "$NGNAME" ]; then
cat $TMPF | $GATEBIN NEWSGROUP=$NGNAME
LIST=$LISTNAME@$LISTHOST TAG=$LISTNAME
fi
$MHONARC $1 $2 $3 '$4' $5 $6 $7 $8 $9 "${10}" ${11} ${12} <
$TMPF
;;
-outdir)
if [ -n "$LOG" ]; then
echo "$MHONARC $1 $2 $3 $4" >> $LOG
fi
$MHONARC $1 $2 $3 $4
;;
-modifybodyaddresses)
if [ -n "$LOG" ]; then
echo "$MHONARC $1 $2 $3 '$4' $5 $6 $7 $8 \"${9}\"
${10} ${11}" >> $LOG
fi
$MHONARC $1 $2 $3 '$4' $5 $6 $7 $8 "${9}" ${10} ${11}
;;
*)
if [ -n "$LOG" ]; then
echo "Unknown call: $MHONARC $1 $2 $3 '$4' $5 $6 $7
$8 \"${9}\" ${10} ${11}" >> $LOG
fi
;;
esac
rm -f $TMPF


> To see how bash processes the script, add the following line in the
> beginning of it:
> set -x

Sure but... logs goes to? sympa syslog? where?

Thanks.

--
Non sara` il canto delle sirene che ci innamorera`
noi lo conosciamo bene, l'abbiamo sentito gia` (F. De Gregori)





Archive powered by MHonArc 2.6.19+.

Top of Page