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

# Content
1 #!/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 indent='s/^/ /'
16 period='s/[^.]$/&./'
17
18 echo "Information:
19 If you receive Spam in your Inbox mailbox, copy it to the $negative mailbox.
20
21 If you receive mail that is not Spam in your Assassin mailbox, copy it to the $positive mailbox.
22
23 Learning and reporting from $negative mailbox:"
24
25 $learn -rR --$format "$spam/$negative" | $sed -e "$indent" -e "$period"
26
27 echo "
28 Learning and revoking from $positive mailbox:"
29
30 $learn -kW --$format "$spam/$positive" | $sed -e "$indent" -e "$period"
31
32 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
36 Pruning old messages from $negative mailbox:"
37
38 # 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
41 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