ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/FreeBSDAdmin/Mail/SpamUpdate.sh
Revision: 815
Committed: 2006-07-03T14:03:04-07:00 (19 years ago) by douglas
Content type: text/x-sh
File size: 1248 byte(s)
Log Message:
C99! A start...

File Contents

# User Rev Content
1 douglas 809 #!/usr/local/bin/bash
2     # Spam Update
3     #
4     # Douglas Thrift
5     #
6     # $Id$
7    
8     learn='/usr/local/bin/spamassassin'
9     spam="$HOME/.imap_mail/Spam"
10     negative='False Negative'
11     positive='False Positive'
12     format='mbx'
13     mailutil='/usr/local/bin/mailutil'
14     sed='/usr/bin/sed'
15 douglas 811 indent='s/^/ /'
16     period='s/[^.]$/&./'
17 douglas 809
18 douglas 811 echo "Information:
19     If you receive Spam in your Inbox mailbox, copy it to the $negative mailbox.
20 douglas 809
21 douglas 811 If you receive mail that is not Spam in your Assassin mailbox, copy it to the $positive mailbox.
22 douglas 809
23 douglas 811 Learning and reporting from $negative mailbox:"
24 douglas 809
25 douglas 815 $learn -rR --$format "$spam/$negative" | $sed -e "$indent" -e "$period"
26 douglas 809
27 douglas 811 echo "
28     Learning and revoking from $positive mailbox:"
29 douglas 809
30 douglas 815 $learn -kW --$format "$spam/$positive" | $sed -e "$indent" -e "$period"
31 douglas 809
32 douglas 811 echo "
33     Delivering messages from $positive mailbox:
34     $("`dirname $0`/FalsePositive" 2>&1 | grep -c "^delivered to $HOME/.imap_mail/INBOX$") message(s) delivered.
35 douglas 809
36 douglas 811 Pruning old messages from $negative mailbox:"
37 douglas 809
38 douglas 811 # XXX: ALL is risky, this script should probably be rewritten as a C program
39     $mailutil prune "Spam/$negative" 'ALL' | $sed -e "$indent" -e "$period"
40 douglas 809
41 douglas 811 echo "
42     Pruning old messages from $positive mailbox:"
43    
44     # XXX: see above
45     $mailutil prune "Spam/$positive" 'ALL' | $sed -e "$indent" -e "$period"

Properties

Name Value
svn:executable *
svn:keywords Id