Skip to content
Snippets Groups Projects
Commit cd529185 authored by Bob Mottram's avatar Bob Mottram
Browse files

Keep email encryption as the final step in procmail

parent 5e37bab6
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment