Browse Source

Keep email encryption as the final step in procmail

jessie
Bob Mottram 6 years ago
parent
commit
cd5291851b
  1. 21
      src/freedombone-addlist

21
src/freedombone-addlist

@ -101,22 +101,19 @@ chown -R $MYUSERNAME:$MYUSERNAME $LISTDIR
if ! grep -q "Subject:.*()\[$SUBJECTTAG\]" $PM; then
if ! grep -q "\# encrypt" $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 "/\# encrypt/i
/# Email rule for $MAILINGLIST subject \[$SUBJECTTAG\]
filter="
# Email rule for $MAILINGLIST subject [$SUBJECTTAG]
:0
* ^Subject:.*()\[$SUBJECTTAG\]
$LISTDIR/new
/# End of rule
" $PM
# End of rule
"
echo "$filter" >> $PM
else
filter=$(echo "# Email rule for $MAILINGLIST subject [$SUBJECTTAG]\n:0\n * ^Subject:.*()\\\[$SUBJECTTAG\\\]\n$LISTDIR/new\n# End of rule\n")
sed "/# encrypt/i ${filter}" $PM
fi
chown $MYUSERNAME:$MYUSERNAME $PM
fi
if [ ! -f "$MUTTRC" ]; then

Loading…
Cancel
Save