root / pykota / trunk / conf / pykota.conf.sample @ 2838

Revision 2838, 40.5 kB (checked in by jerome, 18 years ago)

Improved LDAP specific directives' documentation

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1# PyKota sample configuration file
2#
3#
4# File format :
5#
6#   - A mandatory [global] section :
7#
8#     Contains configuration directives which apply for all printers.
9#     Some directives MUST be set in the [global] section, e.g.
10#     database related directives.
11#
12#   - Any number of optional [PrintQueueName] sections :
13#
14#     Contain directives which apply for a particular print queue only.
15#
16#     Override the values of the same directives present in [global].
17#
18#
19# Directives format :
20#
21#   - Directive's name, followed by ':' followed by the directive's value.
22#
23#   - No leading whitespace : leading whitespace tell the parser that the
24#     current directive is the continuation of the previous one. Use with
25#     care and only when you need it.
26#
27#
28# PyKota - Print Quotas for CUPS and LPRng
29#
30# (c) 2003, 2004, 2005, 2006 Jerome Alet <alet@librelogiciel.com>
31# This program is free software; you can redistribute it and/or modify
32# it under the terms of the GNU General Public License as published by
33# the Free Software Foundation; either version 2 of the License, or
34# (at your option) any later version.
35#
36# This program is distributed in the hope that it will be useful,
37# but WITHOUT ANY WARRANTY; without even the implied warranty of
38# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
39# GNU General Public License for more details.
40#
41# You should have received a copy of the GNU General Public License
42# along with this program; if not, write to the Free Software
43# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
44#
45# $Id$
46#
47
48
49#
50# All directives must be placed below the following line
51[global]
52
53
54
55####################################################################
56# SQLite3 : comment this section out if you use another backend    #
57####################################################################
58
59#storagebackend : sqlitestorage
60#storagename: /etc/pykota/pykota.db
61
62####################################################################
63
64
65
66############################################################################
67# PostgreSQL or MySQL: comment this section out if you use another backend #
68############################################################################
69storagebackend: pgstorage
70# storagebackend: mysqlstorage
71
72# Quota Storage Server hostname (and optional port)
73# e.g. db.example.com:5432
74storageserver: localhost
75
76#
77# name of the Quota Storage Database
78storagename: pykota
79
80#
81# Quota Storage normal user's name and password
82# These two fields contain a username and optional password
83# which may give readonly access to your print quota database.
84#
85# PLEASE ENSURE THAT THIS USER CAN'T WRITE TO YOUR PRINT QUOTA
86# DATABASE, OTHERWISE ANY USER WHO COULD READ THIS CONFIGURATION
87# FILE COULD CHANGE HIS PRINT QUOTA.
88#
89storageuser : pykotauser
90# In the line below change the password's value if needed.
91storageuserpw : readonlypw
92
93############################################################################
94
95
96
97####################################################################
98# LDAP : comment this section out if you use another backend       #
99####################################################################
100# LDAP example, uncomment and adapt it to your own configuration :
101#
102#storagebackend: ldapstorage
103#storageserver: ldap://ldap.example.com:389
104#storagename: dc=example,dc=com
105#
106# NB : the user and password below are the ones contained in
107# the sample LDIF file pykota/initscripts/ldap/pykota-sample.ldif
108# Please adapt these lines to your own needs.
109#
110#storageuser: cn=pykotauser,dc=example,dc=com
111#storageuserpw: ls88DT5j
112
113
114
115# TLS support for LDAP
116#
117# ldaptls can be set to either Yes or No
118# the default value when not set is No, meaning that TLS won't be used.
119#
120#ldaptls: No
121#
122# cacert points to the CA Certificate file to use for TLS.
123# Ensure that every user who can launch PyKota commands can read this file.
124# There's NO default value for this directive.
125#
126#cacert: /etc/pykota/mycertfile
127
128
129
130# Here we define some helpers to know where
131# to plug into an existing LDAP directory
132# NB : THE DIRECTIVES BELOW MUST BE PRESENT WITH AN LDAP BACKEND
133# BUT YOU ARE FREE TO CHANGE THE VALUES.
134#
135#userbase: ou=People,dc=example,dc=com
136#userrdn: uid
137#balancebase: ou=People,dc=example,dc=com
138#balancerdn: uid
139#groupbase: ou=Groups,dc=example,dc=com
140#grouprdn: cn
141#printerbase: ou=Printers,ou=PyKota,dc=example,dc=com
142#printerrdn: cn
143#jobbase: ou=Jobs,ou=PyKota,dc=example,dc=com
144#lastjobbase: ou=LastJobs,ou=PyKota,dc=example,dc=com
145#billingcodebase: ou=BillingCodes,ou=PyKota,dc=example,dc=com
146
147# These two fields are special, they either accept a branch
148# dn, like an ou for example, or the special keywords 'user'
149# and 'group'. If 'user' or 'group' is used, the print quota
150# entries will be created below the user or group entry itself,
151# which will then be used like a branch (you can mix and match
152# different values depending on what you want to do).
153#
154# NB : YOU MUST CHOOSE A VALUE FOR USERQUOTABASE AND A VALUE
155# FOR GROUPQUOTABASE, BUT ONLY ONE LINE OF EACH MUST BE PRESENT.
156#userquotabase: user
157#userquotabase: ou=UQuotas,ou=PyKota,dc=example,dc=com
158#groupquotabase: group
159#groupquotabase: ou=GQuotas,ou=PyKota,dc=example,dc=com
160
161
162
163# How to create new accounts and groups
164# authorized values are "below" and "attach(objectclass name [, fail|warn])"
165#
166# "below" creates the new accounts/groups as standalone entries
167# below the above defined 'userbase' ou
168#
169# attach(objectclass name [, action]) tries to find some existing user/group
170# using the above defined 'userrdn' or 'grouprdn' and 'userbase'
171# 'groupbase', and attach the PyKota specific entries to it.
172# if action is "warn" and no entry exists to attach to, a new
173# entry is created, and a message is logged.
174# if action is "fail" and no entry exists to attach to, program
175# logs an error message and aborts.
176# if action is not set, the default value is "fail".
177#
178# a possible value:  newuser: attach(posixAccount, warn)
179#
180#newuser : below
181#newgroup : below
182
183
184
185# LDAP attribute which stores the user's email address
186#
187#usermail : mail
188
189
190
191# Choose what attribute contains the list of group members
192# common values are : memberUid, uniqueMember, member
193#
194#groupmembers: memberUid
195
196
197
198# Activate low-level LDAP cache yes/no
199# Nothing to do with "storagecaching" which is higher level
200# and database independant.
201# This saves some search queries and may help with heavily
202# loaded LDAP servers.
203# This is EXPERIMENTAL.
204#
205# BEWARE : SETTING THIS TO 'YES' CAUSES PROBLEMS FOR NOW
206# BETTER TO LET IT SET TO 'NO'
207#
208# ldapcache: no
209
210####################################################################
211
212#############################################################
213# END of database specific directives                       #
214#############################################################
215
216
217
218# Should the database caching mechanism be enabled or not ?
219# If unset, caching is disabled. Possible values Y/N/YES/NO
220# caching mechanism works with both relationnal and OpenLDAP backends
221# but may be really interesting only with OpenLDAP.
222#
223# ACTIVATING CACHE MAY CAUSE PRECISION PROBLEMS IN PRINT ACCOUNTING
224# IF AN USER PRINTS ON SEVERAL PRINTERS AT THE SAME TIME.
225# YOU MAY FIND IT INTERESTING ANYWAY, ESPECIALLY FOR LDAP.
226#
227# THERE'S NO GUARANTEE THAT THIS CACHING MECHANISM WILL IMPROVE
228# PERFORMANCE WITH RELATIONNAL BACKENDS. IT MIGHT EVEN MAKE
229# PERFORMANCE DECREASE. AS ALWAYS : YMMV.
230#
231# FYI, I ALWAYS SET IT TO YES !
232#
233storagecaching: No
234
235
236
237# Should full job history be disabled ?
238# If unset or set to No, full job history is kept in the database.
239# Disabling the job history can be useful with heavily loaded
240# LDAP servers, to not make the LDAP tree grow out of control.
241# Disabling the job history with a relationnal backend works too
242# but it's probably less useful than with LDAP.
243#
244disablehistory: No
245
246
247
248# Where to log ?[A
249# supported values : stderr, system (system means syslog, but don't use
250# 'syslog' here). if the value is not set then the default SYSTEM applies.
251#
252logger: system
253
254
255
256# Enable debugging ? Put YES or NO there.
257# debug is set to YES in this sample configuration file, so debugging
258# is activated when configuring PyKota, which helps a lot. After all
259# works, just put NO instead to save some disk space in your logs.
260# NB : When set to YES, there is a very significant impact on performance
261# when managing many users, printers or billing codes at once, because
262# hundreds of thousands of log lines can be generated.
263# When printing a job, typically around 250-300 log lines are generated,
264# so the impact per job is really minimal. Note however that this will
265# add up over a large number of jobs.
266#
267debug : Yes
268
269
270
271# The URL to PyKota's logo when used from the CGI scripts.
272# You can use your own logo by modifying the URL below.
273# If not defined, the default URL is the same as the
274# one defined below :
275#
276logourl : http://www.librelogiciel.com/software/PyKota/pykota.png
277
278
279
280# The destination to which the web browser will be redirected
281# when you click on the logo defined above.
282# If not defined, the default URL is the same as the
283# one defined below :
284#
285logolink : http://www.librelogiciel.com/software/
286
287
288
289# Mail server to use to warn users
290# If the value is not set then localhost is used.
291#
292smtpserver: localhost
293
294
295
296# Crash messages' recipient : in addition to the log files
297# each software crash can be sent to the author of PyKota
298# or any other person of your choice. By default this
299# is disabled for privacy concerns (see below). The address
300# pykotacrashed@librelogiciel.com reaches PyKota's author.
301# The 'adminmail' (defined a bit below) is CCed.
302#
303# Privacy concerns : what is sent is only :
304#
305#        - a copy of the software's traceback
306#        - a copy of the software's command line arguments
307#        - a copy of the software's environment variables
308#
309# suggested value :
310#
311# crashrecipient: pykotacrashed@librelogiciel.com
312
313
314
315# Email domain
316# If the value is not set, and the mail attribute for the user
317# is not set in the PyKota storage, be it LDAP (see usermail directive
318# above) or a relationnal one, then email messages are sent to
319# username@smtpserver
320#
321# If the value is set, then email messages are sent to
322# username@maildomain using the SMTP server defined above
323#
324# Set the appropriate value below, example.com set as per RFC2606.
325#
326maildomain: example.com
327
328
329
330# Should we force usernames to be all lowercase when printing ?
331# Default is No.
332# This is a [global] option only.
333# Some people reported that WinXP sends mixed case usernames
334# setting 'utolower: Yes' solves the problem.
335# Of course you have to use lowercase only when adding
336# users with edpykota, because ALL database accesses are
337# still case sensitive.
338#
339# If utolower is Yes, the usernames received from the printing
340# system is converted to lowercase at the start of printing,
341# BUT ONLY when printing.
342#
343# If utolower is No, which is the default, strict case checking
344# is done, this means that users 'Jerome' and 'jerome' are
345# different. Printer and groups names are ALWAYS case sensitive.
346#
347utolower: No
348
349
350
351# Should we split usernames on a specific separator when printing ?
352# Default is No, i.e. if the value is unset.
353# This is a [global] option only.
354# This option adds support for Samba's Winbind utility, which
355# prefixes usernames with domain name and separator character.
356# Of course if you set this then you have to use NO separator when
357# adding users with edpykota.
358#
359# If winbind_separator is set, the usernames received from the printing
360# system are split on the separator's value, and only the last part
361# (real username) is used.
362#
363# If winbind_separator is not set, which is the default, strict
364# username equality checking will be done (modulo the setting
365# of the 'utolower' directive), this means that users 'DOMAIN1/jerome',
366# 'Domain2/jerome' and 'jerome' are different.
367#
368# winbind_separator: /
369
370
371
372# When creating users or groups accounts, should we reject users
373# or groups which are unknown from the system ?
374# The default if unset is NO. This means that by default, you
375# can create users or groups for which `getent passwd username`
376# or `getent group groupname` returns nothing.
377#
378# Allowed values : Yes | No
379# Default value : No
380#
381# reject_unknown: No
382
383
384
385# Do we want to hide jobs' title, filename and options for privacy
386# reasons ?
387# This may be required in some countries (Italy comes to mind).
388# Allowed values are YES and NO.
389# If unset, the default value is NO, meaning that jobs' title, filename
390# and options will be saved into the history.
391# This option can't be set on a per printer basis, only into the
392# [global] section.
393#
394privacy : no
395
396
397
398# When the real CUPS backend fail, should we modify the
399# user's page counters and account balance or not ?
400# Also should we retry and if yes then how often and how many times ?
401# If you trust your users, set it to "nocharge".
402# If you think they found some mean to kill the real CUPS backend,
403# then set it to "charge".
404# If your print queues get regularly disabled by CUPS when the printers
405# are switched off, you might want to set it to "retry:N:S" where
406# N is the number of times the operation should be retried, and S is
407# the delay in seconds during which PyKota will sleep before trying again.
408# This 'retry' feature works in a way similar to Till Kamppeter's beh
409# backend wrapper which offers this functionnality but is actually not
410# compatible with PyKota (because of my own inability to master regular
411# expressions).
412# If N is 0, PyKota will retry indefinitely each S seconds until the
413# backend succeeds, so you should use this with caution. If N is 0,
414# of course neither "charge" nor "nocharge" will be honored.
415# You can combine "charge" or "nocharge" with "retry:N:S" if you want,
416# by separating the values with a comma as shown in the examples below.
417# If unset, the default value is "nocharge", meaning that users won't be
418# charged whenever a CUPS backend fails. This is the OPPOSITE
419# behavior compared to PyKota versions prior to 1.24alpha2.
420# This value can be set either globally or on a per printer basis
421# If both are defined, the printer option has priority.
422#
423# onbackenderror : charge,retry:5:60
424# onbackenderror : retry:0:300
425# onbackenderror : retry:3:300,nocharge
426# onbackenderror : charge
427onbackenderror : nocharge
428
429
430
431# Should we strip off some characters from the beginning of
432# print jobs' titles ? This can be used to remove smbprn.??????
433# which sometimes appear when printing in raw mode from Windows
434# through Samba.
435# This setting only applies at printing time.
436# When not set, titles are used as received from the printing system.
437# The default is to not strip any character off of jobs' titles.
438# This value can be set either globally or on a per printer basis
439# If both are defined, the printer option has priority.
440#
441# striptitle : smbprn.??????
442
443
444
445# Should we launch a command to overwrite the job's ticket ?
446# This allows a command to overwrite the username and/or the
447# billing code used, or to deny or cancel the job.
448# If unset no command is launched and the job's username and
449# billing code are used as they are received.
450# To overwrite the job's ticket, the command has to print
451# on its standard output one or more of the following lines,
452# without any prefix or space character :
453#
454#    USERNAME=the_username_we_want_to_overwrite_with
455#    BILLINGCODE=the_billingcode_we_want_to_overwrite_with
456#    AUTH=NO (equivalent to DENY below)
457#    DENY
458#    CANCEL
459#
460# NB : the output is entirely read, and the latest value
461# seen is used, so you command can output several usernames
462# or billing codes and only the latest ones will be used.
463# If only USERNAME= lines are printed, the billing code,
464# if any, is used unchanged.
465# If only BILLINGCODE= lines are printed, the username is
466# used unchanged.
467# If DENY or CANCEL is output, the username can't be overwritten.
468#
469# This value can be set either globally or on a per printer basis
470# If both are defined, the printer option has priority.
471#
472# examples :
473#
474# overwrite_jobticket : /usr/bin/pknotify --destination $PYKOTAJOBORIGINATINGHOSTNAME:7654 --timeout 180 --denyafter 3 --checkauth --ask "Username:username:$PYKOTAUSERNAME" "Password:password:"
475# overwrite_jobticket : /path/to/some/script/or/command
476
477
478
479# What should we do when we print and the billing code used is
480# not present in the database ?
481# The default value is 'create' which adds the billing code to the
482# database.
483# Other values can be :
484#       deny
485#     which silently rejects the job.
486# or :
487#       deny(your script here)
488#     if you put the path to a script or command here, it is executed, for
489#     example you can open a popup window explaining why the job was
490#     rejected.
491#
492# This value can be set either globally or on a per printer basis
493# If both are defined, the printer option has priority.
494#
495# unknown_billingcode : deny
496# unknown_billingcode : deny(/usr/bin/pknotify --destination $PYKOTAJOBORIGINATINGHOSTNAME:7654 --timeout 60 --notify "The billing code specified is not allowed")
497# unknown_billingcode : deny(/path/to/some/script)
498# unknown_billingcode : create
499
500
501
502# Where should we store our (temporary) files when printing ?
503# if unset, defaults to a system directory dedicated to temporary
504# files and evaluated at runtime (see Python's documentation
505# for the tempfile.gettempdir() function).
506# This value can be set either globally or on a per printer basis
507# If both are defined, the printer option has priority.
508# On my system, when not set, the /var/spool/cups/tmp directory is used.
509# directory : /tmp
510# directory : /var/spool/cups
511
512
513
514# Should we keep our work files on disk after printing ?
515# If unset, temporary files are deleted once the work is finished.
516# If set to yes, files are kept on disk in the 'directory'
517# named with the previous directive.
518# This value can be set either globally or on a per printer basis
519# If both are defined, the printer option has priority.
520# Default value is No, meaning temporary files are deleted
521# You should set it to yes only during installation to not
522# waste disk space during normal use.
523#
524# keepfiles : yes
525keepfiles : no
526
527
528
529# What is the accounting backend to use : this defines the way PyKota
530# will compute the number of pages printed. This directive is the most
531# important one in PyKota's configuration.
532#
533# NB : This directive is MANDATORY, there's no default value when not set.
534#
535# Supported values :
536#
537# - software([/path/to/some/script[ --with-args]])
538# - hardware(snmp[:community]|pjl[:port]|/path/to/some/script[ --with-args])
539#
540# Hardware asks the printer for its lifetime page counter through either
541# SNMP, PJL-over-TCP, or through any command of your choice. This is
542# the recommended way to use PyKota, although it might not work with some
543# printers. The page counter is asked twice per job : before the job
544# is sent to the printer, and after it has been entirely sent.
545# The big advantages of hardware accounting are lighter CPU usage compared
546# to software accounting described below, although it can take more time
547# because of necessary internal counter stabilization delays, and the fact
548# that paper jams don't cause users to be charged for pages they couldn't
549# print.
550# For hardware accounting, two special values are accepted in addition
551# to a script name : snmp and pjl. 'snmp' asks PyKota to use its internal
552# SNMP code, 'pjl' asks PyKota to internally send a specially crafter PJL
553# job to the printer's TCP port 9100 (by default).
554#
555# Software counts pages by parsing the print job's datas, either internally
556# when no script is specified, or through any script of your choice.
557# This works with ALL printers, provided you've got a script to parse
558# datas produced by your printer driver. PyKota's internal parser, also
559# available under the name 'pkpgcounter', recognizes several page description
560# languages, but may occasionally fail for some printer drivers.
561# You can however use any other command, provided it can read the datas to
562# parse from its standard input, and prints a single integer on its standard
563# output, representing the number of pages in the print job.
564# Software accounting unfortunately may overcharge users in case of paper
565# jams.
566#
567# You can get hints on which configuration is best for your printers by
568# typing : pkturnkey --doconf
569#
570# In the lines below "%(printer)s" is automatically replaced at run time
571# with your printer's Fully Qualified Domain Name for network printers,
572# if PyKota can extract it from its environment.
573#
574# Examples :
575#
576# accounter : hardware(snmp)
577# accounter : hardware(snmp:private)
578# accounter : hardware(pjl)
579# accounter : hardware(pjl:9101)
580# accounter : hardware(/usr/share/pykota/waitprinter.sh %(printer)s && /usr/bin/snmpget -v1 -c public -Ov %(printer)s mib-2.43.10.2.1.4.1.1 | cut -f 2,2 -d " ")
581# accounter : hardware(/usr/bin/npadmin --pagecount %(printer)s)
582# accounter : hardware(/usr/share/pykota/papwaitprinter.sh "MyPrinter:LaserWriter@*" && /usr/bin/pap -p "MyPrinter:LaserWriter@*" /usr/share/pykota/pagecount.ps  2>/dev/null | /bin/grep -v status | /bin/grep -v Connect | /usr/bin/tail -1)
583# accounter : hardware(/bin/cat /usr/share/pykota/pagecount.pjl >/dev/lp0 && /usr/bin/head -2 </dev/lp0 | /usr/bin/tail -1)
584# accounter : hardware(/opt/local/net-snmp/bin/snmpwalk -v 1 -Cc -c public %(printer)s | grep mib-2.43.10.2.1.4.1.1 | cut -d " " -f4)
585# accounter : hardware(/opt/local/net-snmp/bin/snmpwalk -v 1 -Cc -c public -Ov %(printer)s | grep Counter32 | tail -2 | head -1 | cut -d " " -f2)
586# accounter : software(/usr/bin/pkpgcounter)
587# accounter : software()
588#         
589# This directive can be set either globally or per printer or both.
590# If both are defined, the printer option has priority.
591#         
592# IF YOU PLAN TO USE YOUR OWN SCRIPTS FOR HARDWARE ACCOUNTING,     
593# YOU ABSOLUTELY HAVE TO BE SURE YOU HAVE A SCRIPT WHICH WAITS FOR THE
594# PRINTER BEING READY BEFORE ASKING FOR ITS INTERNAL PAGE COUNTER.
595#         
596# PYKOTA'S 'snmp' and 'pjl' HARDWARE ACCOUNTING METHODS DO THE CORRECT WORK
597# INTERNALLY, BUT SOME OF THE EXAMPLES ABOVE DON'T, YOU HAVE BEEN WARNED.
598#
599# WITH THE SPECIAL MAGIC hardware(snmp) AND hardware(pjl) VALUES, PYKOTA
600# TAKES CARE OF ALL THIS FOR YOU, SO PLEASE UNDERSTAND THAT IT IS PREFERABLE
601# TO USE THESE TWO METHODS : THEY WORK FINE, REQUIRE LITTLE TO NO CPU,
602# AND DO ALL THE HARD WORK AUTOMATICALLY. IF YOU REALLY NEED TO YOU CAN USE
603# YOUR OWN EXTERNAL COMMANDS AS DESCRIBED ABOVE, JUST BE CAREFUL WITH THIS.
604#         
605# Sane default :
606#
607accounter: software()
608
609
610
611# What is the "pre"-accounter used for precomputing the job's size.
612#
613# Supported values are :
614#
615#  preaccounter: software()       
616#  preaccounter: software(/path/to/your/script)
617#
618# NB : the preaccounter directive doesn't support hardware() for obvious
619# reasons. If unset, "software()" is assumed. If you use your own script,
620# ensure that it only prints the job's number of pages (or an estimation
621# of it) on its standard output.
622#
623# You may want to define for example 'preaccounter : software(/bin/echo 1)'
624# in the case your printer supports an hardware accounter but pkpgcounter
625# can't parse your printer driver's datas.
626#
627# This value can be set either globally or on a per printer basis
628# If both are defined, the printer option has priority.
629#
630# Sane default :
631#
632preaccounter: software()
633
634
635
636# What should we do if the accounter's subprocess doesn't return
637# a valid result (for example doesn't return an integer on its stdout)
638#
639# Valid values are : 'continue' and 'stop'. 'stop' is the default
640# if unset.
641#
642# 'continue' means try to process as usual, this may introduce
643# accounting errors and free jobs. This was the default behavior
644# until v1.20alpha5.
645#
646# 'stop' means fail and stop the print queue. If an accounter
647# error occurs, most of the time this is a misconfiguration, so
648# stopping the print queue is usually the better thing to do
649# until the admin has fixed the configuration.
650#
651# This value can be set either globally or on a per printer basis
652# If both are defined, the printer option has priority.
653#
654# NB : This directive shouldn't do much now because in case
655# of external accounter error, PyKota just loops.
656#
657# onaccountererror: continue
658onaccountererror: stop
659
660
661
662# Print Quota administrator
663# These values can be set either globally or per printer or both.
664# If both are defined, the printer option has priority.
665# If these values are not set, the default admin root
666# and the default adminmail root@localhost are used.
667admin: John Doe
668adminmail: root@localhost
669
670
671
672# Who should we send an email to in case a quota is reached ?
673# possible values are : DevNull, User, Admin, Both, External(some command)
674# The Both value means that the User and the Admin will receive
675# an email message.
676# The DevNull value means no email message will be sent.
677# This value can be set either globally or per printer or both.
678# If both are defined, the printer option has priority.
679# If the value is not set, then the default BOTH applies.
680#
681#   Format of the external syntax :
682#
683#       mailto: external(/usr/bin/mycommand >/dev/null)
684#
685#   You can use :
686#
687#       '%(action)s'            will contain either WARN or DENY
688#       '%(username)s'          will contain the user's name
689#       '%(printername)s'       will contain the printer's name
690#       '%(email)s'             will contain the user's email address
691#       '%(message)s'           will contain the message if you want
692#                               to use it.
693#
694#   on your command line, to pass arguments to your command.
695#   Examples :
696#
697#     mailto: external(/usr/bin/callpager %(username)s "Quota problem on %(printername)s" >/dev/null)
698#
699#   To automatically send a WinPopup message (this may only work with a PDC,
700#   here the same machine does Samba as PDC + CUPS) :
701#
702#     mailto: external(echo "%(message)s" | /usr/bin/iconv --to-code utf-8 --from-code iso-8859-15 | /usr/bin/smbclient -M "%(username)s" 2>&1 >/dev/null)
703#
704#   NB : I use ISO-8859-15, but Windows expects UTF-8, so we pipe the message
705#        into iconv before sending it to the Windows user.
706#
707# or more simply :
708#
709#     mailto: external(/usr/share/pykota/mailandpopup.sh %(username)s %(printername)s "%(email)s" "%(message)s" 2>&1 >/dev/null)
710#
711#   NB : The mailandpopup.sh shell script is now included in PyKota
712#
713#   NB : in ANY case, don't forget to redirect your command's standard output
714#        somewhere (e.g. >/dev/null) so that there's no perturbation to the
715#        underlying layer (filter or backend)
716#
717mailto : both
718
719
720
721# The value of the zero for account balance limitations.
722# If an user his limited by balance, he can print until
723# his balance reaches the value defined here. If unset,
724# the default value is 0. Any floating point value
725# is accepted.
726# You'll want to use this to give free credits to your users
727# at the start of the year for example.
728#
729# This option can only appear in the global section
730#
731# balancezero : -0.25
732#
733balancezero: 0.0
734
735
736
737# Grace delay in days
738# This value can be set either globally or per printer or both.
739# If both are defined, the printer option has priority.
740# If the value is not set then the default seven (7) days applies.
741#
742gracedelay : 7
743
744
745
746# Poor man's threshold
747# If account balance reaches below this amount, a warning message
748# is sent through the 'mailto' directive above.
749#
750# If unset, default poor man's threshold is 1.0.
751# This option can only appear in the global section
752#
753poorman : 1.0
754
755
756
757# Poor man's warning message
758# The warning message that is sent if the "poorman" value is reached
759# Again this must appear in the global section
760#
761poorwarn : Your Print Quota account balance is low.
762 Soon you'll not be allowed to print anymore.
763
764
765
766# Soft limit reached warning message
767# The warning message that is sent if the soft quota limit is reached
768# May appear either globally or on a per-printer basis
769#
770softwarn: Your Print Quota Soft Limit is reached.
771 This means that you may still be allowed to print for some
772 time, but you must contact your administrator to purchase
773 more print quota.
774
775
776
777# Hard limit reached error message
778# The error message that is sent if the hard quota limit is reached
779# May appear either globally or on a per-printer basis
780#
781hardwarn: Your Print Quota Hard Limit is reached.
782 This means that you are not allowed to print anymore.
783 Please contact your administrator at root@localhost
784 as soon as possible to solve the problem.
785
786
787
788# Default policy to apply when either :
789#
790#       - Printer doesn't exist in PyKota's database
791#       - User doesn't exist in PyKota's database
792#       - User has no quota entry for this Printer in PyKota's database
793#
794# Value can be either allow or deny or external(some command here)
795#
796# This value can be set either globally or per printer or both.
797# If both are defined, the printer option has priority.
798# If the value is not set then the default policy DENY applies.
799# There's no policy wrt inexistant groups, they are ignored.
800#
801# external policy can be used to launch any external command of your choice,
802# for example to automatically add the user to the quota database, and set
803# page limits on the current printer if he is unknown :
804#
805#   policy: external(/usr/bin/pkusers --add --skipexisting %(username)s && /usr/bin/edpykota --add --skipexisting --printer %(printername)s --softlimit 50 --hardlimit 60 %(username)s)
806#
807# NB : If you want to limit users by their account balance value, it is preferable to
808# use the following policy to automate user account creation on first print :
809#
810#   policy: external(/usr/bin/autopykota --initbalance 25.0)
811#
812#   This will automatically add the user if he doesn't already exist, and
813#   set his initial balance value to 25.0 (for example). If the user already
814#   exists then his balance value will not be modified.
815#   Please don't use autopykota if you want to limit your users by page
816#   quota, and in any case, carefully read autopykota's help or manpage
817#   and understand its goal before using it in your own configuration.
818#
819# Of course you can launch any command of your choice with this, e.g. :
820#
821#   policy: external(/usr/local/bin/myadminscript.sh %(username)s)
822#
823# You can use :
824#
825#       '%(username)s'          will contain the user's name
826#       '%(printername)s'       will contain the printer's name
827#
828#   On your command line, to pass arguments to your command.
829#
830# If the printer, user, or user quota entry still doesn't exist after
831# external policy command was launched (the external command didn't add it),
832# or if an error occured during the execution of the external policy
833# command, then the job is rejected.
834#
835# By default, we reject all jobs from users not in the database :
836#
837policy: deny
838
839
840
841# Pre and Post Hooks
842# These directives allow the easy plug-in of any command of your choice
843# at different phases of PyKota's execution.
844# Pre and Post Hooks can access some of PyKota's internal information
845# by reading environment variables as described below.
846# The actual phase of PyKota's execution is available in the
847# PYKOTAPHASE environment variable.
848# Pre and Post Hooks can be defined either globally, per printer,
849# or both. If both are defined, the printer specific hook has
850# priority.
851#
852# List of available environment variables :
853# NB : Most of these variables are also available during the execution
854# of external commands defined in the accounter and mailto
855# directives.
856#
857# PYKOTADIRECTORY : The directory containing cupspykota's temporary files
858# PYKOTADATAFILE : The name of the temporary file which contains the
859#                  job's datas
860# PYKOTAFILENAME : The name of the file which contains the job's datas or
861#                  empty if datas come from stdin
862# PYKOTACONTROLFILE : The name of the IPP message file
863# PYKOTAMD5SUM : Contains an hexadecimal digest of the md5 sum of the job's datas
864# PYKOTAPHASE : BEFORE or AFTER the job is sent to the printer
865# PYKOTAACTION : ALLOW or DENY or WARN for current print job
866# PYKOTAUSERNAME : user's name
867# PYKOTAPRINTERNAME : printer's name
868# PYKOTAPGROUPS : list of printers groups the current printer is a member of
869# PYKOTAJOBID : job's id
870# PYKOTATITLE : job's title
871# PYKOTACOPIES : number of copies
872# PYKOTAOPTIONS : job's options
873# PYKOTABALANCE : user's account balance
874# PYKOTALIFETIMEPAID : user's grand total paid
875# PYKOTALIMITBY : user print limiting factor, for example 'quota' or 'balance'
876# PYKOTAPAGECOUNTER : user's page counter on this printer
877# PYKOTALIFEPAGECOUNTER : user's life time page counter on this printer
878# PYKOTASOFTLIMIT : user's soft page limit on this printer
879# PYKOTAHARDLIMIT : user's hard page limit on this printer
880# PYKOTADATELIMIT : user's soft to hard limit date limit on this printer
881# PYKOTASTATUS : contains "CANCELLED" when SIGTERM was received by PyKota
882#                else is not set.
883# PYKOTAJOBSIZEBYTES : contains the job's size in bytes. Always available.
884# PYKOTAPRECOMPUTEDJOBSIZE : contains the precomputed job's size
885# PYKOTAPRECOMPUTEDJOBPRICE : contains the precomputed job's price
886# PYKOTAJOBORIGINATINGHOSTNAME : contains the client's hostname if
887#                                it is possible to retrieve it.
888# PYKOTAPRINTERHOSTNAME : the printer's hostname or IP address for network
889#                         printers, or "localhost" if not defined or not
890#                         meaningful.
891# PYKOTAWARNCOUNT : the number of times the user was forbidden to print but a banner
892#                   page was still printed on the current printer.                   
893# PYKOTAOVERCHARGE : user's overcharging factor.
894# PYKOTAJOBBILLING : Job's billing code if present (CUPS only)
895# PYKOTAREASON : if the job was denied or a warning needs to be issued, contains
896#                the message to send to the user.
897#
898
899
900
901# PreHook : gets executed after being sure the user, printer and user quota
902# entry on the printer both exist in the PyKota database, and after
903# checking if the user is allowed to print or not, but just before
904# the job is sent to the printer (if allowed)
905# prehook has access to many environment variables :
906#
907# PYKOTAACTION contains either "ALLOW", "WARN" or "DENY" and
908# represents the action which is to be done wrt the print job.
909# PYKOTAPHASE contains 'BEFORE' during execution of prehook
910#
911# uncomment the line below to see what environment variables are available
912# prehook: /usr/bin/printenv >/tmp/before
913
914
915
916# PostHook : gets executed after the job has been added to the history.
917# posthook has access to all the environment variables defined above,
918# as well as two additionnal environment variables : PYKOTAJOBPRICE
919# and PYKOTAJOBSIZE.
920# PYKOTAPHASE contains 'AFTER' during execution of posthook.
921#
922# uncomment the line below to see what environment variables are available
923# posthook: /usr/bin/printenv >/tmp/after
924
925
926
927# AccountBanner : how should banner accounting be done ?
928#
929# If enabled, banner pages printed from StartingBanner and/or EndingBanner
930# (depending on the value) will be included in the accounting for the
931# print job
932#
933# If disabled, banner pages printed from StartingBanner and EndingBanner will
934# *not* be included in the accounting for the print job
935#
936# IMPORTANT : CUPS generated banners are ALWAYS accounted for, although you
937#             can refund them by using negative prices on printers.
938#
939# Allowed values : Starting | Ending | None | Both
940#
941#       - Starting : only the starting banner will be accounted for.
942#       - Ending : only the ending banner will be accounted for.
943#       - Both : both starting and ending banners will be accounted for.
944#       - None : banners will not be accounted for.
945#
946# Default value :
947# accountbanner: Both
948
949
950
951# Maximal number of times the banner will still be printed if
952# the user is forbidden to print.
953#
954# This option can be set either globally or on a per printer basis.
955# Allowed values are 0 or any positive integer.
956# Default value is 0, which means that the banner won't be printed
957# at all if the user is forbidden to print.
958#
959maxdenybanners: 0
960
961
962
963# StartingBanner : if defined will print a banner before the rest of the job
964# is printed. The argument can be a printable file, or an executable file.
965# If not executable, the file will be printed as is. If executable, the
966# file will be executed and its standard output will be sent to the printer.
967#
968# In any case, the banner content which will be sent to the printer
969# MUST be in a format your printer will accept !!!
970#
971# The pkbanner command included in PyKota can automatically generate
972# starting and ending banners in the PostScript format. You can use
973# this command in a pipe through GhostScript if your printer doesn't
974# accept PostScript as an input format.
975# NB : pkbanner's default page size is A4
976#
977# startingbanner: /home/joe/mystaticbanner.ps
978# startingbanner: /usr/bin/pkbanner --pagesize=A4 --logo="/home/joe/mylogo.jpeg" --url="http://tech.example.com"
979# startingbanner: /usr/bin/pkbanner | gs -q -dNOPAUSE -dBATCH -dPARANOIDSAFER -sOutputFile=- -sDEVICE=lj5mono -
980# startingbanner: /usr/bin/pkbanner
981
982
983
984# EndingBanner : if defined will print a banner after the job
985# has been printed. The argument can be a printable file, or an executable file.
986# If not executable, the file will be printed as is. If executable, the
987# file will be executed and its standard output will be sent to the printer.
988#
989# In any case, the banner content which will be sent to the printer
990# MUST be in a format your printer will accept !!!
991#
992# The pkbanner command included in PyKota can automatically generate
993# starting and ending banners in the PostScript format. You can use
994# this command in a pipe through GhostScript if your printer doesn't
995# accept PostScript as an input format.
996# NB : pkbanner's default page size is A4
997#
998# A static banner page
999# endingbanner: /home/joe/mystaticbanner.ps
1000#
1001# A banner with personnalized logo and url
1002# endingbanner: /usr/bin/pkbanner --pagesize=A4 --logo="/home/joe/mylogo.jpeg" --url="http://tech.example.com"
1003#
1004# A banner in the format accepted by the printer
1005# endingbanner: /usr/bin/pkbanner | gs -q -dNOPAUSE -dBATCH -dPARANOIDSAFER -sOutputFile=- -sDEVICE=lj5mono -
1006#
1007# A banner with more info on it, extracted from the yellow pages.
1008# the string "Phone 111222333444" will be added to the banner page
1009# if extractphone.sh returns 111222333444 for the current user.
1010# endingbanner: /usr/bin/pkbanner Phone `extractphone.sh $PYKOTAUSERNAME`
1011#
1012# Default PyKota banner
1013# endingbanner: /usr/bin/pkbanner
1014
1015
1016
1017# How should enforcement be done for this printer ?
1018#
1019# "laxist" is the default if value is not set, and allows users
1020# to be over quota on their last job.
1021#
1022# "strict" tries to prevent users from ever being over quota.
1023#
1024# Enforcement can be defined either globally, per printer,
1025# or both. If both are defined, the printer specific enforcement
1026# setting has priority.
1027#
1028# valid values : "strict" or "laxist"
1029#
1030# default value when not set is "laxist"
1031#
1032# enforcement : laxist
1033enforcement : strict
1034
1035
1036
1037# Should we trust the job size on this printer ?
1038#
1039# "trustjobsize : yes" is the default, the jobsize, either computed
1040# by the hardware or by software is trusted.
1041#
1042# "trustjobsize : >N:precomputed" : uses the precomputed value
1043#                                   if jobsize > N pages
1044# "trustjobsize : >N:25" : uses 25 if jobsize is >N pages
1045#
1046# General form : ">n:m" where n is a positive integer, and m is
1047# either the word 'precomputed' or a positive integer.
1048# The special form "yes" is also accepted and is the default.
1049#
1050# This directive can be set either globally or on a per printer
1051# basis. Use this directive when hardware accounting for a particular
1052# printer produces some glitches due to the printer returning
1053# incorrect answers.
1054#
1055# NB : DON'T MODIFY THIS IF YOU DON'T NEED TO. THIS IS ONLY TO BE USED
1056# AS A WORKAROUND FOR SOME PRINTERS. IT'S PROBABLY BETTER TO ALWAYS
1057# SET THIS DIRECTIVE TO 'yes'. THIS DIRECTIVE WILL ONLY BE HONORED
1058# IF PYKOTA DETECTS A DIFFERENCE BETWEEN THE PRECOMPUTED JOB SIZE
1059# AND THE JOB SIZE AS COMPUTED BY PYKOTA EITHER USING HARDWARE OR
1060# SOFTWARE.
1061#
1062trustjobsize : yes
1063
1064
1065
1066# Should we deny duplicate jobs ?
1067#
1068# A duplicate is a job sent twice (or more) in a row to the same printer
1069# by the same user.
1070#
1071# This can be defined either globally or on a per printer basis
1072# The default value is 'no', meaning that duplicate jobs are
1073# allowed.
1074#
1075# NB : if an user prints a job, a second user prints another
1076#      job, and the first user prints the first job again,
1077#      this is NOT considered as a duplicate since the two
1078#      identical jobs printed by the first user are not
1079#      one just after the other.
1080#
1081# Possible values are 'yes', 'no', or any other string.
1082# If the string is not recognized as a truth value,
1083# it is considered to be a command to launch.
1084# PyKota launches the command and parses its standard
1085# output. The special keywords 'ALLOW' and 'DENY' are
1086# recognized, allowing an external tool to decide if
1087# the job is to be allowed or denied.
1088#
1089# denyduplicates : /usr/bin/myowncommand with some arguments
1090# denyduplicates : yes
1091denyduplicates : no
1092
1093
1094
1095# Sets the delay in seconds after which two identical jobs are
1096# not considered as being a duplicate.
1097#
1098# This can be defined either globally or on a per printer basis
1099# The default value if not set is 0, for 0 seconds.
1100# duplicatesdelay : 300
1101duplicatesdelay : 0
1102
1103
Note: See TracBrowser for help on using the browser.