import rt 2.0.14
[freeside.git] / rt / etc / config.pm
1 # $Header: /home/cvs/cvsroot/freeside/rt/etc/Attic/config.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $       
2
3 package RT;
4
5 # {{{ Base Configuration
6
7 # $rtname the string that RT will look for in mail messages to
8 # figure out what ticket a new piece of mail belongs to
9
10 # Your domain name is recommended, so as not to pollute the namespace.
11 # once you start using a given tag, you should probably never change it. 
12 # (otherwise, mail for existing tickets won't get put in the right place
13
14 $rtname="example.com";  
15
16 # You should set this to your organization's DNS domain. For example,
17 # fsck.com or asylum.arkham.ma.us. It's used by the linking interface to 
18 # guarantee that ticket URIs are unique and easy to construct.
19
20 $Organization = "example.com";
21
22 # $user_passwd_min defines the minimum length for user passwords. Setting
23 # it to 0 disables this check
24 $MinimumPasswordLength = "5";
25
26 # $Timezone is used to convert times entered by users into GMT and back again
27 # It should be set to a timezone recognized by your local unix box.
28 $Timezone =  'US/Eastern'; 
29
30 # LogDir is where RT writes its logfiles.
31 # This directory should be writable by your rt group
32 $LogDir = "!!RT_LOG_PATH!!";
33
34 # }}}
35
36 # {{{ Database Configuration
37
38 # Database driver beeing used - i.e. MySQL.
39 $DatabaseType="!!DB_TYPE!!";
40
41 # The domain name of your database server
42 # If you're running mysql and it's on localhost,
43 # leave it blank for enhanced performance
44 $DatabaseHost="!!DB_HOST!!";
45
46 # The port that your database server is running on.  Ignored unless it's 
47 # a positive integer. It's usually safe to leave this blank
48 $DatabasePort="!!DB_PORT!!";
49
50
51 #The name of the database user (inside the database) 
52 $DatabaseUser='!!DB_RT_USER!!';
53
54 # Password the DatabaseUser should use to access the database
55 $DatabasePassword='!!DB_RT_PASS!!';
56
57
58 # The name of the RT's database on your database server
59 $DatabaseName='!!DB_DATABASE!!';
60
61 # If you're using Postgres and have compiled in SSL support, 
62 # set DatabaseRequireSSL to 1 to turn on SSL communication
63 $DatabaseRequireSSL=undef;
64
65 # }}}
66
67 # {{{ Incoming mail gateway configuration
68
69
70 # OwnerEmail is the address of a human who manages RT. RT will send
71 # errors generated by the mail gateway to this address.  This address
72 # should _not_ be an address that's managed by your RT instance.
73
74 $OwnerEmail = 'root';
75
76 # If $LoopsToRTOwner is defined, RT will send mail that it believes 
77 # might be a loop to $RT::OwnerEmail 
78
79 $LoopsToRTOwner = 1;
80
81 # If $StoreLoopss is defined, RT will record messages that it believes 
82 # to be part of mail loops.
83 # As it does this, it will try to be careful not to send mail to the 
84 # sender of these messages 
85
86 $StoreLoops = undef;
87
88
89 # $MaxAttachmentSize sets the maximum size (in bytes) of attachments stored
90 # in the database. 
91
92 # For mysql and oracle, we set this size at 10 megabytes.
93 # If you're running a postgres version earlier than 7.1, you will need
94 # to drop this to 8192. (8k)
95
96 $MaxAttachmentSize = 10000000;  
97
98 # $TruncateLongAttachments: if this is set to a non-undef value,
99 # RT will truncate attachments longer than MaxAttachmentLength. 
100
101 $TruncateLongAttachments = undef;
102
103
104 # $DropLongAttachments: if this is set to a non-undef value,
105 # RT will silently drop attachments longer than MaxAttachmentLength. 
106
107 $DropLongAttachments = undef;
108
109 # If $ParseNewMessageForTicketCcs is true, RT will attempt to divine
110 # Ticket 'Cc' watchers from the To and Cc lines of incoming messages
111 # Be forewarned that if you have _any_ addresses which forward mail to
112 # RT automatically and you enable this option without modifying 
113 # "IsRTAddress" below, you will get yourself into a heap of trouble.
114 # And well, this is free software, so there isn't a warrantee, but
115 # I disclaim all ability to help you if you do enable this without
116 # modifying IsRTAddress below.
117
118 $ParseNewMessageForTicketCcs = undef;
119
120 # IsRTAddress is used to make sure RT doesn't add itself as a ticket CC if
121 # the setting above is enabled.
122
123 sub IsRTAddress {
124     my $address = shift;
125
126     # Example: the following rule would tell RT not to Cc 
127     #   "tickets@noc.example.com"
128     # return(1) if ($address =~ /^tickets\@noc.example.com$/i);
129     
130     return(undef)
131 }
132
133 # CanonicalizeAddress converts email addresses into canonical form.
134 # it takes one email address in and returns the proper canonical
135 # form. You can dump whatever your proper local config is in here
136
137 sub CanonicalizeAddress {
138     my $email = shift;
139     # Example: the following rule would treat all email
140     # coming from a subdomain as coming from second level domain
141     # foo.com
142     #$email =~ s/\@(.*).foo.com/\@foo.com/;
143     return ($email)
144 }
145
146 # If $LookupSenderInExternalDatabase is defined, RT will attempt to
147 # verify the incoming message sender with a known source, using the 
148 # LookupExternalUserInfo routine below
149
150 $LookupSenderInExternalDatabase = undef;
151
152 # If $SenderMustExistInExternalDatabase is true, RT will refuse to
153 # create non-privileged accounts for unknown users if you are using 
154 # the "LookupSenderInExternalDatabase" option.
155 # Instead, an error message will be mailed and RT will forward the 
156 # message to $RTOwner.
157 #
158 # If you are not using $LookupSenderInExternalDatabase, this option
159 # has no effect.
160 #
161 # If you define an AutoRejectRequest template, RT will use this   
162 # template for the rejection message.
163
164 $SenderMustExistInExternalDatabase = undef;
165
166 # LookupExternalUserInfo is a site-definable method for synchronizing
167 # incoming users with an external data source. 
168 #
169 # This routine takes a tuple of EmailAddress and FriendlyName
170 #       EmailAddress is the user's email address, ususally taken from
171 #               an email message's From: header.
172 #       FriendlyName is a freeform string, ususally taken from the "comment" 
173 #               portion of an email message's From: header.
174 #
175 # It returns (FoundInExternalDatabase, ParamHash);
176 #
177 #   FoundInExternalDatabase must  be set to 1 before return if the user was
178 #   found in the external database.
179 #
180 #   ParamHash is a Perl parameter hash which can contain at least the following
181 #   fields. These fields are used to populate RT's users database when the user 
182 #   is created
183 #
184 #       EmailAddress is the email address that RT should use for this user.  
185 #       Name is the 'Name' attribute RT should use for this user. 
186 #            'Name' is used for things like access control and user lookups.
187 #       RealName is what RT should display as the user's name when displaying 
188 #            'friendly' names
189
190 sub LookupExternalUserInfo {
191   my ($EmailAddress, $RealName) = @_;
192
193   my $FoundInExternalDatabase = 1;
194   my %params = {};
195   
196   #Name is the RT username you want to use for this user.
197   $params{'Name'} = $EmailAddress;
198   $params{'EmailAddress'} = $EmailAddress;
199   $params{'RealName'} = $RealName;
200
201   # See RT's contributed code for examples.
202   # http://www.fsck.com/pub/rt/contrib/
203   return ($FoundInExternalDatabase, %params); 
204 }
205
206 # }}}
207
208 # {{{ Outgoing mail configuration
209
210 # RT is designed such that any mail which already has a ticket-id associated
211 # with it will get to the right place automatically.
212
213 # $CorrespondAddress and $CommentAddress are the default addresses 
214 # that will be listed in From: and Reply-To: headers of correspondence
215 # and comment mail tracked by RT, unless overridden by a queue-specific
216 # address. 
217
218 $CorrespondAddress='RT::CorrespondAddress.not.set';
219
220 $CommentAddress='RT::CommentAddress.not.set';
221
222
223 #Sendmail Configuration
224
225 # $MailCommand defines which method RT will use to try to send mail
226 # We know that 'sendmailpipe' works fairly well.
227 # If 'sendmailpipe' doesn't work well for you, try 'sendmail' 
228 #
229 # Note that you should remove the '-t' from $SendmailArguments 
230 # if you use 'sendmail rather than 'sendmailpipe'
231
232 $MailCommand = 'sendmailpipe';
233
234 # $SendmailArguments defines what flags to pass to $Sendmail
235 # assuming you picked 'sendmail' or 'sendmailpipe' as the $MailCommand above.
236 # If you picked 'sendmailpipe', you MUST add a -t flag to $SendmailArguments
237
238 # These options are good for most sendmail wrappers and workalikes
239 $SendmailArguments="-oi -t";
240
241 # These arguments are good for sendmail brand sendmail 8 and newer
242 #$SendmailArguments="-oi -t -ODeliveryMode=b -OErrorMode=m";
243
244 # If you selected 'sendmailpipe' above, you MUST specify the path
245 # to your sendmail binary in $SendmailPath.  
246 # !! If you did not # select 'sendmailpipe' above, this has no effect!!
247 $SendmailPath = "/usr/sbin/sendmail";
248
249 # RT can optionally set a "Friendly" 'To:' header when sending messages to 
250 # Ccs or AdminCcs (rather than having a blank 'To:' header.
251
252 # This feature DOES NOT WORK WITH SENDMAIL[tm] BRAND SENDMAIL
253 # If you are using sendmail, rather than postfix, qmail, exim or some other MTA,
254 # you _must_ disable this option.
255
256 $UseFriendlyToLine = 0;
257
258
259 # }}}
260
261 # {{{ Logging
262
263 # Logging.  The default is to log anything except debugging
264 # information to a logfile.  Check the Log::Dispatch POD for
265 # information about how to get things by syslog, mail or anything
266 # else, get debugging info in the log, etc. 
267
268 #  It might generally make
269 # sense to send error and higher by email to some administrator. 
270 # If you do this, be careful that this email isn't sent to this RT instance.
271
272
273 # the minimum level error that will be logged to the specific device.
274 # levels from lowest to highest:  
275 #  debug info notice warning error critical alert emergency 
276
277
278 #  Mail loops will generate a critical log message.
279
280 $LogToScreen = 'error';
281 $LogToFile = 'error';
282 #$LogToFileNamed = "$LogDir/rt.log.".$$.".".$<; #log to rt.log.<pid>.<user>
283 $LogToFileNamed = "$LogDir/rt.log".$<; #log to rt.log.user;
284
285 # }}}
286
287 # {{{ Web interface configuration
288
289
290
291 # Define the directory name to be used for images in rt web
292 # documents.
293
294 # If you're putting the web ui somewhere other than at the root of
295 # your server
296 # $WebPath requires a leading / but no trailing /     
297
298 $WebPath = "";
299
300 # This is the Scheme, server and port for constructing urls to webrt
301 # $WebBaseURL doesn't need a trailing /                                                                            
302
303 $WebBaseURL = "http://RT::WebBaseURL.not.configured:80";
304
305 $WebURL = $WebBaseURL . $WebPath . "/";
306
307
308
309 # $WebImagesURL points to the base URL where RT can find its images.
310 # If you're running the FastCGI version of the RT web interface,
311 # you should make RT's WebRT/html/NoAuth/images directory available on 
312 # a static web server and supply that URL as $WebImagesURL.
313
314 $WebImagesURL = $WebURL."NoAuth/images/";
315
316 # $RTLogoURL points to the URL of the RT logo displayed in the web UI
317
318 $LogoURL = $WebImagesURL."rt.jpg";
319
320 # If $WebExternalAuth is defined, RT will defer to the environment's
321 # REMOTE_USER variable.
322
323 $WebExternalAuth = undef;
324
325 # $MasonComponentRoot is where your rt instance keeps its mason html files
326 # (this should be autoconfigured during 'make install' or 'make upgrade')
327
328 $MasonComponentRoot = "!!MASON_HTML_PATH!!";
329
330 # $MasonLocalComponentRoot is where your rt instance keeps its site-local
331 # mason html files.
332 # (this should be autoconfigured during 'make install' or 'make upgrade')
333
334 $MasonLocalComponentRoot = "!!MASON_LOCAL_HTML_PATH!!";
335
336 # $MasonDataDir Where mason keeps its datafiles
337 # (this should be autoconfigured during 'make install' or 'make upgrade')
338
339 $MasonDataDir = "!!MASON_DATA_PATH!!";
340
341 # RT needs to put session data (for preserving state between connections
342 # via the web interface)
343 $MasonSessionDir = "!!MASON_SESSION_PATH!!";
344
345
346
347 #This is from tobias' prototype web search UI. it may stay and it may go.
348 %WebOptions=
349     (
350      # This is for putting in more user-actions at the Transaction
351      # bar.  I will typically add "Enter bug in Bugzilla" here.:
352      ExtraTransactionActions => sub { return ""; },
353
354      # Here you can modify the list view.  Be aware that the web
355      # interface might crash if TicketAttribute is wrongly set.
356      
357      QueueListingCols => 
358       [
359        { Header     => 'Id',
360          TicketLink => 1,
361          TicketAttribute => 'Id'
362          },
363
364       { Header     => 'Subject',
365          TicketAttribute => 'Subject'
366          },
367        { Header => 'Requestor(s)',
368          TicketAttribute => 'RequestorsAsString'
369          },
370        { Header => 'Status',
371          TicketAttribute => 'Status'
372          },
373
374
375        { Header => 'Queue',
376          TicketAttribute => 'QueueObj->Name'
377          },
378
379
380
381        { Header => 'Told',
382          TicketAttribute => 'ToldObj->AgeAsString'
383          },
384
385        { Header => 'Age',
386          TicketAttribute => 'CreatedObj->AgeAsString'
387          },
388
389        { Header => 'Last',
390          TicketAttribute => 'LastUpdatedObj->AgeAsString'
391          },
392
393        # TODO: It would be nice with a link here to the Owner and all
394        # other request owned by this Owner.
395        { Header => 'Owner',
396          TicketAttribute => 'OwnerObj->Name'
397        },
398    
399  
400        { Header     => 'Take',
401          TicketLink => 1,
402          Constant   => 'Take',
403          ExtraLinks => '&Action=Take'
404          },
405
406       ]
407      );
408
409 # }}}
410
411 # {{{ RT Linking Interface
412
413 # $TicketBaseURI is the Base path of the URI for local tickets
414
415 # You shouldn't need to touch this. it's used to link tickets both locally
416 # and remotely
417
418 $TicketBaseURI = "fsck.com-rt://$Organization/$rtname/ticket/";
419
420 # A hash table of conversion subs to be used for transforming RT Link
421 # URIs to URLs in the web interface.  If you want to use RT towards
422 # locally installed databases, this is the right place to configure it.
423
424 %URI2HTTP=
425     (
426       'http' => sub {return @_;},
427       'https' => sub {return @_;},
428       'ftp' => sub {return @_;},
429      'fsck.com-rt' => sub {warn "stub!";},
430      'mozilla.org-bugzilla' => sub {warn "stub!"},
431      'fsck.com-kb' => sub {warn "stub!"}
432      );
433
434
435 # A hash table of subs for fetching content from an URI
436 %ContentFromURI=   
437     (
438      'fsck.com-rt' => sub {warn "stub!";},
439      'mozilla.org-bugzilla' => sub {warn "stub!"},
440      'fsck.com-kb' => sub {warn "stub!"}
441      );
442
443 # }}}
444
445 # {{{ No User servicable parts inside 
446
447 ############################################
448 ############################################
449 ############################################
450 #
451 #  Don't edit anything below this line unless you really know
452 #  what you're doing
453 #
454 #
455 ############################################
456 ############################################
457
458 # TODO: get this stuff out of the config file and into RT.pm
459
460 #Set up us the timezone
461 $ENV{'TZ'} = $Timezone; #TODO: Bogus hack to deal with Date::Manip whining
462
463 # Configure sendmail if we're using Entity->send('sendmail')
464 if ($MailCommand eq 'sendmail') {
465     $MailParams = $SendmailArguments;
466 }
467
468
469
470 # }}}
471
472
473 1;