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

Email rules before encryption stage

parent cd529185
No related branches found
No related tags found
No related merge requests found
......@@ -88,11 +88,16 @@ if [ ! -d "$LISTDIR" ]; then
fi
chown -R $MYUSERNAME:$MYUSERNAME $LISTDIR
if ! grep -q "Email rule for $EMAILADDRESS -> $GROUP_NAME" $PM; then
echo "# Email rule for $EMAILADDRESS -> $GROUP_NAME" >> $PM
echo ":0" >> $PM
echo " * ^From:.*$EMAILADDRESS" >> $PM
echo "$LISTDIR/new" >> $PM
echo "# End of rule" >> $PM
if ! grep -q "\# encrypt" $PM; then
echo "# Email rule for $EMAILADDRESS -> $GROUP_NAME" >> $PM
echo ":0" >> $PM
echo " * ^From:.*$EMAILADDRESS" >> $PM
echo "$LISTDIR/new" >> $PM
echo "# End of rule" >> $PM
else
filter=$(echo "# Email rule for $EMAILADDRESS -> $GROUP_NAME\n:0\n * ^From:.*$EMAILADDRESS\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