Insert rule after previous rules
This commit is contained in:
parent
fb94a7c28e
commit
d40d1e4aa6
|
@ -98,12 +98,24 @@ if [ ! -d "$LISTDIR" ]; then
|
|||
fi
|
||||
|
||||
chown -R $MYUSERNAME:$MYUSERNAME $LISTDIR
|
||||
|
||||
if ! grep -q "Subject:.*()\[$SUBJECTTAG\]" $PM; then
|
||||
echo "" >> $PM
|
||||
echo ":0" >> $PM
|
||||
echo " * ^Subject:.*()\[$SUBJECTTAG\]" >> $PM
|
||||
echo "$LISTDIR/new" >> $PM
|
||||
chown $MYUSERNAME:$MYUSERNAME $PM
|
||||
if ! grep -q "End of rule" $PM; then
|
||||
echo "" >> $PM
|
||||
echo "/# Email rule for $MAILINGLIST subject \[$SUBJECTTAG\]" >> $PM
|
||||
echo ":0" >> $PM
|
||||
echo " * ^Subject:.*()\[$SUBJECTTAG\]" >> $PM
|
||||
echo "$LISTDIR/new" >> $PM
|
||||
echo "/# End of rule" >> $PM
|
||||
chown $MYUSERNAME:$MYUSERNAME $PM
|
||||
else
|
||||
sed -i "/End of rule/a
|
||||
/# Email rule for $MAILINGLIST subject \[$SUBJECTTAG\]
|
||||
:0
|
||||
* ^Subject:.*()\[$SUBJECTTAG\]
|
||||
$LISTDIR/new
|
||||
/# End of rule" $PM
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -f "$MUTTRC" ]; then
|
||||
|
|
Loading…
Reference in New Issue