# we are called from spamfilter and the following cases could be: # # 1. spamfilters are unsure # symptom: $SPAM_UNSURE is set (sa-unsure) # reaction: file as unsure # # 2. spamfilters disagree # symptom: $SPAM_DISAGREE is set (sa-ham or sa-spam) # reaction: file as disagreed # # 3. message is spam for sure # symptom: $IS_SPAM is set # reaction: file as spam # # 4a. message needs to be retrained as spam # symptom: $CRM_RETRAIN is set to spam # reaction: retrain filters, report, and file as spam # # 4b. message is spamtrapped # symptom: $SPAMTRAPPED is set # reaction: train filters, report, and file as spam # # 5. message needs to be retrained as ham # symptom: $CRM_RETRAIN is set to ham # reaction: retrain crm114 and resubmit the message to the spamfilter # # 6. spam degree is unknown: # symptom: $SPAM_UNKNOWN contains the reason for skipping the checks # reaction: pass the message # # 7. message is not spam # symptom: none of the above # reaction: pass the message # :0 * SPAM_UNSURE ?? . { LOG="spamfilter: filing as unsure$NL" :0 $INBOX/.retrain.unsure/ } :0 E * SPAM_DISAGREE ?? . { LOG="spamfilter: filing as disagreed$NL" :0 $INBOX/.retrain.disagree/ } :0 E * 1^0 CRM_RETRAIN ?? spam * 1^0 SPAMTRAPPED ?? . { LOG="spamfilter: (re)training as spam$NL" :0 fw |$TRAINER --spam 2>/dev/null IS_SPAM=trained } :0 E * CRM_RETRAIN ?? ham { LOG="spamfilter: retraining as ham$NL" :0 fw |$TRAINER --ham 2>/dev/null # :0 # |$TRAINER --ham 2>/dev/null | $PROCMAIL } # not using flag E because IS_SPAM could have been set further up :0 * IS_SPAM ?? . { LOG="spamfilter: filing as spam$NL" :0 $INBOX/.spam/ } :0 { LOG="spamfilter: allowed to pass$NL" } #:0 E #*$ $SPAM_UNKNOWN #{ do nothing } #:0 E #{ do nothing}