| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
 | Conditional Automated Request Shuffler 
Initial Design. 		<jesse@fsck.com> 9 Nov 99
#Try to find out what queue the incoming ticket is in
#Try to find out the default action for this invocation
#Read the ticket from STDIN
#Obtain the actor
#Obtain the serial # if we have one
#If the ticket has a ticket-id
	#if this is a 'comment'
		#add the current mime objects as a 'comment'
	#if this is 'correspondence'
		#add the current mime object as 'correspondence'
#if this ticket does not yet have a ticket id
  #For now:
	#Create a new ticket
  #In the distant future
	#load the regexp table matching this queue
	#check the message agains the regexp table, ordered by precedence
		#when we get a match
			#get the ruleset for that regexp from the actions table
  			#evaluate the ruleset in order of precedence.
			   #if we get an 'exit' stop proccesing ALL rulesets
wpw  			   #if we get a 'forward,' forward it to 'value'.
   			   #if we get a 'create,' create a request in 'value'
			   #elseif we get a 'map', add this as additional correspondence on ticket 'value'
    
		           #if we get an 'associate', associate the ticket number returned from the 
			   'create' or 'map' with the master ticket from 'value'
			   #if we get a 'reply', 
				#load the reply template with id 'value'      
				#replace strings in the template
				#send the template
CREATE TABLE Rules {
ID int AUTO_INCREMENT,
Desc varchar(120),
Regexp varchar(80),
Precedence int,
MatchField varchar(20), #Can be a headername or 'any' all header names
                        #end in :
CREATE TABLE Actions {
Rule int,
Action varchar(20), # Create, Forward, Squelch, Owner, Area, Associate
Value varchar(20), #queue or email address
Desc varchar(120)
}
CREATE TABLE Autoreplies {
ID int AUTO_INCREMENT,
Content text
);
 |