Browse Source

Test for emails with no subject lines

Bob Mottram 8 years ago
parent
commit
1f7165ece3
1 changed files with 7 additions and 0 deletions
  1. 7
    0
      src/freedombone-base-email

+ 7
- 0
src/freedombone-base-email View File

@@ -1088,6 +1088,13 @@ function create_procmail {
1088 1088
         echo 'LOGFILE=$HOME/log/procmail.log' >> /home/$MY_USERNAME/.procmailrc
1089 1089
         echo 'LOGABSTRACT=all' >> /home/$MY_USERNAME/.procmailrc
1090 1090
         echo '' >> /home/$MY_USERNAME/.procmailrc
1091
+        echo '# Test for an empty or missing subject line' >> /home/$MY_USERNAME/.procmailrc
1092
+        echo 'SUBJ_=$(formail -xSubject: \' >> /home/$MY_USERNAME/.procmailrc
1093
+        echo "        | expand | sed -e 's/^[ ]*//g' -e 's/[ ]*\$//g')" >> /home/$MY_USERNAME/.procmailrc
1094
+        echo ':0' >> /home/$MY_USERNAME/.procmailrc
1095
+        echo '  * SUBJ_ ?? ^^^^' >> /home/$MY_USERNAME/.procmailrc
1096
+        echo '/dev/null' >> /home/$MY_USERNAME/.procmailrc
1097
+        echo '' >> /home/$MY_USERNAME/.procmailrc
1091 1098
         echo $"# Tripwire reports which have no violations don't need to be logged" >> /home/$MY_USERNAME/.procmailrc
1092 1099
         echo ':0 BD:' >> /home/$MY_USERNAME/.procmailrc
1093 1100
         TRIPWIRE_VIOLATIONS_STR=$'Total violations found:  0'