Insert before encrypt

This commit is contained in:
Bob Mottram 2016-02-11 10:02:11 +00:00
parent d40d1e4aa6
commit 5e37bab6be
1 changed files with 4 additions and 3 deletions

View File

@ -100,7 +100,7 @@ fi
chown -R $MYUSERNAME:$MYUSERNAME $LISTDIR
if ! grep -q "Subject:.*()\[$SUBJECTTAG\]" $PM; then
if ! grep -q "End of rule" $PM; then
if ! grep -q "\# encrypt" $PM; then
echo "" >> $PM
echo "/# Email rule for $MAILINGLIST subject \[$SUBJECTTAG\]" >> $PM
echo ":0" >> $PM
@ -109,12 +109,13 @@ if ! grep -q "Subject:.*()\[$SUBJECTTAG\]" $PM; then
echo "/# End of rule" >> $PM
chown $MYUSERNAME:$MYUSERNAME $PM
else
sed -i "/End of rule/a
sed -i "/\# encrypt/i
/# Email rule for $MAILINGLIST subject \[$SUBJECTTAG\]
:0
* ^Subject:.*()\[$SUBJECTTAG\]
$LISTDIR/new
/# End of rule" $PM
/# End of rule
" $PM
fi
fi