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

Revision 2631, 39.3 kB (checked in by jerome, 18 years ago)

Added support for the CANCEL command in subprocesses launched from the
overwrite_jobticket directive : this will allow end users to be asked
if they really want to proceed to printing once the new version
of pykoticon will be ready.
Several minor fixes.

  • 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[global]
49# Storage backend for quotas
50# only PGStorage (PostgreSQL), LDAPStorage (OpenLDAP or else),
51# and SQLiteStorage (SQLite 3) are supported.
52#
53# MySQL and BerkeleyDB are planned.
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# PostgreSQL : comment this section out if you use another backend #
64####################################################################
65storagebackend: pgstorage
66
67# Quota Storage Server hostname (and optional port)
68# e.g. db.example.com:5432
69storageserver: localhost
70
71#
72# name of the Quota Storage Database
73storagename: pykota
74
75#
76# Quota Storage normal user's name and password
77# These two fields contain a username and optional password
78# which may give readonly access to your print quota database.
79#
80# PLEASE ENSURE THAT THIS USER CAN'T WRITE TO YOUR PRINT QUOTA
81# DATABASE, OTHERWISE ANY USER WHO COULD READ THIS CONFIGURATION
82# FILE COULD CHANGE HIS PRINT QUOTA.
83#
84storageuser: pykotauser
85# storageuserpw: Comment out if unused, or set to Quota Storage user password
86
87####################################################################
88# LDAP : comment this section out if you use another backend       #
89####################################################################
90# LDAP example, uncomment and adapt it to your own configuration :
91#storagebackend: ldapstorage
92#storageserver: ldap://ldap.example.com:389
93#storagename: dc=example,dc=com
94#
95# NB : the user and password below are the ones contained in
96# the sample LDIF file pykota/initscripts/ldap/pykota-sample.ldif
97# Please adapt these lines to your own needs.
98#storageuser: cn=pykotauser,dc=example,dc=com
99#storageuserpw: ls88DT5j
100#
101# TLS support for LDAP
102#
103# ldaptls can be set to either Yes or No
104# the default value when not set is No, meaning that TLS won't be used.
105#ldaptls: No
106#
107# cacert points to the CA Certificate file to use for TLS.
108# Ensure that every user who can launch PyKota commands can read this file.
109# There's NO default value for this directive.
110#cacert: /etc/pykota/mycertfile
111#
112#
113# Here we define some helpers to know where
114# to plug into an existing LDAP directory
115#userbase: ou=People,dc=example,dc=com
116#userrdn: uid
117#balancebase: ou=People,dc=example,dc=com
118#balancerdn: uid
119#groupbase: ou=Groups,dc=example,dc=com
120#grouprdn: cn
121#printerbase: ou=Printers,ou=PyKota,dc=example,dc=com
122#printerrdn: cn
123#jobbase: ou=Jobs,ou=PyKota,dc=example,dc=com
124#lastjobbase: ou=LastJobs,ou=PyKota,dc=example,dc=com
125#billingcodebase: ou=BillingCodes,ou=PyKota,dc=example,dc=com
126
127# These two fields are special, they either accept a branch
128# dn, like an ou for example, or the special keywords 'user'
129# and 'group'. If 'user' or 'group' is used, the print quota
130# entries will be created below the user or group entry itself,
131# which will then be used like a branch (you can mix and match
132# different values depending on what you want to do).
133#userquotabase: user
134#userquotabase: ou=UQuotas,ou=PyKota,dc=example,dc=com
135#groupquotabase: group
136#groupquotabase: ou=GQuotas,ou=PyKota,dc=example,dc=com
137
138#
139# How to create new accounts and groups
140# authorized values are "below" and "attach(objectclass name [, fail|warn])"
141#
142# "below" creates the new accounts/groups as standalone entries
143# below the above defined 'userbase' ou
144#
145# attach(objectclass name [, action]) tries to find some existing user/group
146# using the above defined 'userrdn' or 'grouprdn' and 'userbase'
147# 'groupbase', and attach the PyKota specific entries to it.
148# if action is "warn" and no entry exists to attach to, a new
149# entry is created, and a message is logged.
150# if action is "fail" and no entry exists to attach to, program
151# logs an error message and aborts.
152# if action is not set, the default value is "fail".
153#
154# a possible value:  newuser: attach(posixAccount, warn)
155#newuser : below
156#newgroup : below
157#
158# LDAP attribute which stores the user's email address
159#usermail : mail
160
161#
162# Choose what attribute contains the list of group members
163# common values are : memberUid, uniqueMember, member
164#groupmembers: memberUid
165
166# Activate low-level LDAP cache yes/no
167# Nothing to do with "storagecaching" which is higher level
168# and database independant.
169# This saves some search queries and may help with heavily
170# loaded LDAP servers.
171# This is EXPERIMENTAL.
172#
173# BEWARE : SETTING THIS TO 'YES' CAUSES PROBLEMS FOR NOW
174# BETTER TO LET IT SET TO 'NO'
175# ldapcache: no
176
177#############################################################
178# ALL directives below are common to ALL storage backends   #
179#############################################################
180
181# Should the database caching mechanism be enabled or not ?
182# If unset, caching is disabled. Possible values Y/N/YES/NO
183# caching mechanism works with both PostgreSQL and OpenLDAP backends
184# but may be really interesting only with OpenLDAP.
185#
186# ACTIVATING CACHE MAY CAUSE PRECISION PROBLEMS IN PRINT ACCOUNTING
187# IF AN USER PRINTS ON SEVERAL PRINTERS AT THE SAME TIME.
188# YOU MAY FIND IT INTERESTING ANYWAY, ESPECIALLY FOR LDAP.
189#
190# FYI, I ALWAYS SET IT TO YES !
191#
192storagecaching: No
193
194# Should full job history be disabled ?
195# If unset or set to No, full job history is kept in the database.
196# This will be useful in the future when the report generator
197# will be written.
198# Disabling the job history can be useful with heavily loaded
199# LDAP servers, to not make the LDAP tree grow out of control.
200# Disabling the job history with the PostgreSQL backend works too
201# but it's probably less useful than with LDAP.
202disablehistory: No
203
204
205# Where to log ?
206# supported values : stderr, system (system means syslog, but don't use 'syslog' here)
207# if the value is not set then the default SYSTEM applies.
208logger: system
209
210# Enable debugging ? Put YES or NO there.
211# debug is set to yes in this sample
212# configuration file, so debugging is activated
213# when configuring PyKota. After all works, just
214# put NO instead to save some disk space in your
215# logs.
216debug : Yes
217
218#
219# The URL to PyKota's logo when used from the CGI scripts.
220# You can use your own logo by modifying the URL below.
221# If not defined, the default URL is the same as the
222# one defined below
223logourl : http://www.librelogiciel.com/software/PyKota/pykota.png
224
225#
226# The destination to which the web browser will be redirected
227# when you click on the logo defined above.
228# If not defined, the default URL is the same as the
229# one defined below
230logolink : http://www.librelogiciel.com/software/
231
232#
233# Mail server to use to warn users
234# If the value is not set then localhost is used.
235smtpserver: localhost
236
237# Crash messages' recipient : in addition to the log files
238# each software crash can be sent to the author of PyKota
239# or any other person of your choice. By default this
240# is disabled. The recipient pykotacrashed@librelogiciel.com
241# reaches PyKota's author.
242# The 'adminmail' (defined a bit below) is CCed.
243#
244# Privacy concerns : what is sent is only :
245#
246#        - a copy of the software's traceback
247#        - a copy of the software's command line arguments
248#        - a copy of the software's environment variables
249#
250# suggested value
251# crashrecipient: pykotacrashed@librelogiciel.com
252
253# Email domain
254# If the value is not set, and the mail attribute for the user
255# is not set in the PyKota storage, be it LDAP (see usermail directive
256# above) or PostgreSQL, then email messages are sent to
257# username@smtpserver
258#
259# If the value is set, then email messages are sent to
260# username@maildomain using the SMTP server defined above
261#
262# Set the appropriate value below, example.com set as per RFC2606.
263maildomain: example.com
264
265# Should we force usernames to be all lowercase when printing ?
266# Default is No.
267# This is a global option only.
268# Some people reported that WinXP sends mixed case usernames
269# setting 'utolower: Yes' solves the problem.
270# Of course you have to use lowercase only when adding
271# users with edpykota, because ALL database accesses are
272# still case sensitive.
273#
274# If utolower is Yes, the usernames received from the printing
275# system is converted to lowercase at the start of printing,
276# BUT ONLY when printing.
277#
278# If utolower is No, which is the default, strict case checking
279# is done, this means that users 'Jerome' and 'jerome' are
280# different. Printer and groups names are ALWAYS case sensitive.
281utolower: No
282
283# Should we split usernames on a specific separator when printing ?
284# Default is No, i.e. if the value is unset.
285# This is a global option only.
286# This option adds support for Samba's Winbind utility, which
287# prefixes usernames with domain name and separator character.
288# Of course if you set this then you have to use NO separator when
289# adding users with edpykota.
290#
291# If winbind_separator is set, the usernames received from the printing
292# system are split on the separator's value, and only the last part
293# (real username) is used.
294#
295# If winbind_separator is not set, which is the default, strict
296# username equality checking will be done (modulo the setting
297# of the 'utolower' directive), this means that users 'DOMAIN1/jerome',
298# 'Domain2/jerome' and 'jerome' are different.
299# winbind_separator: /
300
301# When creating users or groups accounts, should we reject users
302# or groups which are unknown from the system ?
303# The default if unset is NO. This means that by default, you
304# can create users or groups for which `getent passwd username`
305# or `getent group groupname` returns nothing.
306#
307# Allowed values : Yes | No
308# Default value : No
309#
310# reject_unknown: No
311
312# Do we want to hide jobs' title, filename and options for privacy
313# reasons ?
314# This may be required in some countries (Italy comes to mind).
315# Allowed values are YES and NO.
316# If unset, the default value is NO, meaning that jobs' title, filename
317# and options will be saved into the history.
318# This option can't be set on a per printer basis, only into the
319# [global] section.
320privacy : no
321
322# When the real CUPS backend fail, should we modify the
323# user's page counters and account balance or not ?
324# If you trust your users, set it to "nocharge".
325# If you think they found some mean to kill the real CUPS backend,
326# then set it to "charge".
327# If unset, the default value is "nocharge", meaning that users won't be
328# charged whenever a CUPS backend fails. This is the OPPOSITE
329# behavior compared to PyKota versions prior to 1.24alpha2.
330# This value can be set either globally or on a per printer basis
331# If both are defined, the printer option has priority.
332# onbackenderror : charge
333onbackenderror : nocharge
334
335# Should we strip off some characters from the beginning of
336# print jobs' titles ? This can be used to remove smbprn.??????
337# which sometimes appear when printing in raw mode from Windows
338# through Samba.
339# This setting only applies at printing time.
340# When not set, titles are used as received from the printing system.
341# The default is to not strip any character off of jobs' titles.
342# This value can be set either globally or on a per printer basis
343# If both are defined, the printer option has priority.
344# striptitle : smbprn.??????
345
346# Should we launch a command to overwrite the job's ticket ?
347# This allows a command to overwrite the username and/or the
348# billing code used, or to deny or cancel the job.
349# If unset no command is launched and the job's username and
350# billing code are used as they are received.
351# To overwrite the job's ticket, the command has to print
352# on its standard output one or more of the following lines,
353# without any prefix or space character :
354#
355#    USERNAME=the_username_we_want_to_overwrite_with
356#    BILLINGCODE=the_billingcode_we_want_to_overwrite_with
357#    DENY
358#    CANCEL
359#
360# NB : the output is entirely read, and the latest value
361# seen is used, so you command can output several usernames
362# or billing codes and only the latest ones will be used.
363# If only USERNAME= lines are printed, the billing code,
364# if any, is used unchanged.
365# If only BILLINGCODE= lines are printed, the username is
366# used unchanged.
367# If DENY or CANCEL is output, but is followed by new USERNAME= or
368# BILLINGCODE= lines, the job is not denied nor cancelled.
369#
370# This value can be set either globally or on a per printer basis
371# If both are defined, the printer option has priority.
372#
373# overwrite_jobticket : /path/to/some/script/or/command
374
375# What should we do when we print and the billing code used is
376# not present in the database ?
377# The default value is 'create' which adds the billing code to the
378# database.
379# Other values can be :
380#       deny
381#     which silently rejects the job.
382# or :
383#       deny(your script here)
384#     if you put the path to a script or command here, it is executed, for
385#     example you can open a popup window explaining why the job was
386#     rejected.
387#
388# This value can be set either globally or on a per printer basis
389# If both are defined, the printer option has priority.
390#
391# unknown_billingcode : deny
392# unknown_billingcode : deny(/path/to/some/script)
393# unknown_billingcode : create
394
395# Where should we store our (temporary) files when printing ?
396# if unset, defaults to a system directory dedicated to temporary
397# files and evaluated at runtime (see Python's documentation
398# for the tempfile.gettempdir() function).
399# This value can be set either globally or on a per printer basis
400# If both are defined, the printer option has priority.
401# On my system, when not set, the /var/spool/cups/tmp directory is used.
402# directory : /tmp
403# directory : /var/spool/cups
404
405# Should we keep our work files on disk after printing ?
406# If unset, temporary files are deleted once the work is finished.
407# If set to yes, files are kept on disk in the 'directory'
408# named with the previous directive.
409# This value can be set either globally or on a per printer basis
410# If both are defined, the printer option has priority.
411# Default value is No, meaning temporary files are deleted
412# keepfiles : yes
413keepfiles : no
414
415
416# What is the accounting backend to use
417#
418# supported values :
419#
420#    - hardware : asks the printer for its lifetime page counter
421#                 via either SNMP, AppleTalk, or any external
422#                 command. This method is the recommended one
423#                 in PyKota since its beginning.
424#
425#                 In the lines below "%(printer)s" is automatically replaced
426#                 at run time with your printer's Fully Qualified Domain Name
427#                 for network printers, if PyKota can extract it from its
428#                 environment.
429#                 e.g. myprinter.example.com
430#
431#         Recommended values :
432#
433#             accounter: hardware(snmp)
434#
435#               Extracts the printer's internal page counter via SNMP.
436#
437#         Or :
438#
439#             accounter: hardware(pjl)
440#
441#               Extracts the printer's internal page counter via PJL queries over port tcp/9100.
442#
443#         Advanced uses :
444#
445#             accounter: hardware(snmp:MyCommunity)
446#
447#               To use a different SNMP community name than the default one (which is 'public')
448#
449#             accounter: hardware(pjl:9101)
450#
451#               To use a different port than the default one (which is 9100)
452#
453#
454#         Other Examples :
455#         
456#             accounter: hardware(/usr/bin/snmpget -v1 -c public -Ov %(printer)s mib-2.43.10.2.1.4.1.1 | cut -f 2,2 -d " ")
457#         
458#         Another untested example, using npadmin :
459#         
460#             accounter: hardware(/usr/bin/npadmin --pagecount %(printer)s)
461#         
462#         Another example, for AppleTalk printers which works fine :
463#         (You may need the pap CUPS backend installed, and copy the
464#         pagecount.ps file from untested/netatalk into /etc or any
465#         appropriate location)
466#         
467#             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)
468#         
469#         An example for parallel printers like the HP Laserjet 5MP :
470#         
471#             accounter: hardware(/bin/cat /usr/share/pykota/pagecount.pjl >/dev/lp0 && /usr/bin/head -2 </dev/lp0 | /usr/bin/tail -1)
472#         
473#         This value can be set either globally or per printer or both.
474#         If both are defined, the printer option has priority.
475#         
476#         Some examples and comments provided by Bob Martel from csuohio.edu
477#         
478#         For several printers I could not get the page count using snmpget.  I
479#         resorted to snmpwalk:
480#         
481#             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)
482#         
483#         The last example is still more ugly, some of the printers only provided
484#         their counters without names, but at least always on the same line:
485#         
486#             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)
487#         
488#         An example using netcat and a preformatted PJL job which you can find
489#         in the untested/pjl directory, which is sent to a JetDirect print
490#         server on port 9100 :
491#         
492#             accounter: hardware(/bin/nc -w 2 %(printer)s 9100 </usr/share/pykota/pagecount.pjl | /usr/bin/tail -2)
493#         
494#         An example using the contributed pagecount.pl script which does
495#         the same as above, but should work on more printers :
496#         
497#             accounter: hardware(LC_ALL=C /usr/share/pykota/pagecount.pl %(printer)s 9100)
498#         
499#         NB : the LC_ALL=C is used because sometimes Perl can correctly set locale and is verbose
500#              about it, causing PyKota to miss the correct answer.
501#
502#         WARNING : In any case, when using an hardware accounter, please test the command line outside
503#                   of PyKota before. This will save you some headaches in case it doesn't work as expected.
504#         
505#         The waitprinter.sh is there to wait until the printer is idle again.
506#         This should prevent a job to be sent to the printer while another one is
507#         not yet finished (not all pages are printed, but the complete job is in
508#         the printer)
509#         
510#   YOU ABSOLUTELY HAVE TO BE SURE YOU HAVE A SCRIPT WHICH WAITS FOR THE
511#   PRINTER BEING READY BEFORE ASKING FOR ITS INTERNAL PAGE COUNTER.
512#         
513#   PYKOTA INCLUDES SUCH SCRIPTS FOR SNMP AND APPLETALK PRINTERS, MORE TO COME
514#
515#   SOME OF THE ABOVE EXAMPLES DON'T USE SUCH A SCRIPT, YOU HAVE BEEN WARNED
516#
517#
518#   WITH THE SPECIAL MAGIC hardware(snmp) AND hardware(pjl) VALUES, PYKOTA
519#   TAKES CARE OF ALL THIS FOR YOU, SO PLEASE UNDERSTAND THAT IT IS PREFERABLE
520#   TO USE THESE TWO METHODS : THEY WORK FINE, REQUIRE LITTLE TO NO CPU,
521#   AND DO ALL THE HARD WORK AUTOMATICALLY. IF YOU REALLY NEED TO YOU CAN USE
522#   YOUR OWN EXTERNAL COMMANDS AS DESCRIBED ABOVE, JUST BE CAREFUL WITH THIS.
523#         
524#
525#    - software : delegates the job's size computation to any
526#                 external command of your choice.
527#
528#                 best choice for this is probably to set it
529#                 this way :
530#
531#                   accounter: software()
532#
533#                 which uses pkpgcounter's code internally to compute
534#                 the size of the job.
535#                 NB : YOU MUST NOW INSTALL pkpgcounter FOR PyKota TO WORK.
536#
537#                 You could obtain exactly the same result with :
538#
539#                   accounter: software(/usr/bin/pkpgcounter)
540#
541#                 But in this case the job would be passed through
542#                 pkpgcounter's parser a second time.
543#
544#                 pkpgcounter is a command line tool which was
545#                 part of PyKota and which can handle several types
546#                 of documents. It is now distributed separately.
547#
548#                 while pkpgcounter is the recommended value if you want
549#                 to use an external command here, you can use whatever
550#                 command you want provided your command accepts the job's
551#                 data on its standard input and prints the job's size in
552#                 pages as a single integer on its standard output.
553#
554# This value can be set either globally or on a per printer basis
555# If both are defined, the printer option has priority.
556#
557# 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 " ")
558# accounter: hardware(snmp)
559# accounter: hardware(pjl)
560# accounter: software(/usr/bin/pkpgcounter)
561#
562# The following, software without any argument, works since PyKota 1.21
563# and uses pkpgcounter's code internally.
564accounter: software()
565
566# What should we do if the accounter's subprocess doesn't return
567# a valid result (for example doesn't return an integer on its stdout)
568#
569# Valid values are : 'continue' and 'stop'. 'stop' is the default
570# if unset.
571#
572# 'continue' means try to process as usual, this may introduce
573# accounting errors and free jobs. This was the default behavior
574# until v1.20alpha5.
575#
576# 'stop' means fail and stop the print queue. If an accounter
577# error occurs, most of the time this is a misconfiguration, so
578# stopping the print queue is usually the better thing to do
579# until the admin has fixed the configuration.
580#
581# This value can be set either globally or on a per printer basis
582# If both are defined, the printer option has priority.
583#
584# NB : This directive shouldn't do much now because in case
585# of external accounter error, PyKota just loops.
586#
587# onaccountererror: continue
588onaccountererror: stop
589
590# Print Quota administrator
591# These values can be set either globally or per printer or both.
592# If both are defined, the printer option has priority.
593# If these values are not set, the default admin root
594# and the default adminmail root@localhost are used.
595admin: John Doe
596adminmail: root@localhost
597
598#
599# Who should we send an email to in case a quota is reached ?
600# possible values are : DevNull, User, Admin, Both, External(some command)
601# The Both value means that the User and the Admin will receive
602# an email message.
603# The DevNull value means no email message will be sent.
604# This value can be set either globally or per printer or both.
605# If both are defined, the printer option has priority.
606# If the value is not set, then the default BOTH applies.
607#
608#   Format of the external syntax :
609#
610#       mailto: external(/usr/bin/mycommand >/dev/null)
611#
612#   You can use :
613#
614#       '%(action)s'            will contain either WARN or DENY
615#       '%(username)s'          will contain the user's name
616#       '%(printername)s'       will contain the printer's name
617#       '%(email)s'             will contain the user's email address
618#       '%(message)s'           will contain the message if you want
619#                               to use it.
620#
621#   On your command line, to pass arguments to your command.
622#   Example :
623#
624#       mailto: external(/usr/bin/callpager %(username)s "Quota problem on %(printername)s" >/dev/null)
625#
626#   To automatically send a WinPopup message (this may only work with a PDC,
627#   here the same machine does Samba as PDC + CUPS) :
628#
629#       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)
630#
631#   NB : I use ISO-8859-15, but Windows expects UTF-8, so we pipe the message
632#        into iconv before sending it to the Windows user.
633#
634# or more simply :
635#
636#       mailto: external(/usr/share/pykota/mailandpopup.sh %(username)s %(printername)s "%(email)s" "%(message)s" 2>&1 >/dev/null)
637#
638#   NB : The mailandpopup.sh shell script is now included in PyKota
639#
640#   NB : in ANY case, don't forget to redirect your command's standard output
641#        somewhere (e.g. >/dev/null) so that there's no perturbation to the
642#        underlying layer (filter or backend)
643#
644mailto: both
645
646#
647# Grace delay in days
648# This value can be set either globally or per printer or both.
649# If both are defined, the printer option has priority.
650# If the value is not set then the default seven (7) days applies.
651gracedelay: 7
652
653#
654# Poor man's threshold
655# If account balance reaches below this amount,
656# a warning message is sent by email
657#
658# If unset, default poor man's threshold is 1.0.
659# This option can only appear in the global section
660poorman: 2.0
661
662# Poor man's warning message
663# The warning message that is sent if the "poorman" value is reached
664# Again this must appear in the global section
665poorwarn: Your Print Quota account balance is low.
666 Soon you'll not be allowed to print anymore.
667
668# Soft limit reached warning message
669# The warning message that is sent if the soft quota limit is reached
670# May appear either globally or on a per-printer basis
671softwarn: Your Print Quota Soft Limit is reached.
672 This means that you may still be allowed to print for some
673 time, but you must contact your administrator to purchase
674 more print quota.
675 
676# Hard limit reached error message
677# The error message that is sent if the hard quota limit is reached
678# May appear either globally or on a per-printer basis
679hardwarn: Your Print Quota Hard Limit is reached.
680 This means that you are not allowed to print anymore.
681 Please contact your administrator at root@localhost
682 as soon as possible to solve the problem.
683
684# one section per printer, or no other section at all if all options
685# are defined globally.
686# Each section's name must be the same as the printer's queue name as defined
687# in your printing system, be it CUPS or LPRng, between square brackets, for
688# example a print queue named 'hpmarketing' would appear in this file as
689# [hpmarketing]
690
691
692# Default policy to apply when either :
693#
694#       - Printer doesn't exist in PyKota's database
695#       - User doesn't exist in PyKota's database
696#       - User has no quota entry for this Printer in PyKota's database
697#
698# Value can be either allow or deny or external(some command here)
699#
700# This value can be set either globally or per printer or both.
701# If both are defined, the printer option has priority.
702# If the value is not set then the default policy DENY applies.
703# There's no policy wrt inexistant groups, they are ignored.
704#
705# external policy can be used to launch any external command of your choice,
706# for example to automatically add the user to the quota storage
707# if he is unknown. Example :
708#
709#   policy: external(/usr/bin/edpykota --add --printer %(printername)s --softlimit 50 --hardlimit 60 %(username)s >/dev/null)
710#
711# NB : If you want to limit users by their account balance value, it is preferable to
712# use the following policy to automate user account creation on first print :
713#
714#   policy: external(/usr/bin/autopykota --initbalance 25.0 >/dev/null)
715#
716#   This will automatically add the user if he doesn't already exist, and
717#   set his initial balance value to 25.0 (for example). If the user already
718#   exists then his balance value will not be modified.
719#   Please don't use autopykota if you want to limit your users by page
720#   quota, and in any case, carefully read autopykota's help or manpage
721#   and understand its goal before using it in your own configuration.
722#
723# Of course you can launch any command of your choice with this, e.g. :
724#
725#   policy: external(/usr/local/bin/myadminscript.sh %(username)s >/dev/null)
726
727# You can use :
728#
729#       '%(username)s'          will contain the user's name
730#       '%(printername)s'       will contain the printer's name
731#
732#   On your command line, to pass arguments to your command.
733#
734#   NB : Don't forget to redirect your command's standard output somewhere
735#        (e.g. >/dev/null) so that there's no perturbation to the underlying
736#        layer (filter or backend)
737#
738# If the printer, user, or user quota entry still doesn't exist after
739# external policy command was launched (the external command didn't add it),
740# or if an error occured during the execution of the external policy
741# command, then the job is rejected.
742#
743policy: deny
744
745# Pre and Post Hooks
746# These directives allow the easy plug-in of any command of your choice
747# at different phases of PyKota's execution.
748# Pre and Post Hooks can access some of PyKota's internal information
749# by reading environment variables as described below.
750# The actual phase of PyKota's execution is available in the
751# PYKOTAPHASE environment variable.
752# Pre and Post Hooks can be defined either globally, per printer,
753# or both. If both are defined, the printer specific hook has
754# priority.
755#
756# List of available environment variables :
757# NB : Most of these variables are also available during the execution
758# of external commands defined in the accounter and mailto
759# directives.
760#
761# PYKOTADIRECTORY : The directory containing cupspykota's temporary files
762# PYKOTADATAFILE : The name of the temporary file which contains the
763#                  job's datas
764# PYKOTAFILENAME : The name of the file which contains the job's datas or
765#                  empty if datas come from stdin
766# PYKOTACONTROLFILE : The name of the IPP message file
767# PYKOTAMD5SUM : Contains an hexadecimal digest of the md5 sum of the job's datas
768# PYKOTAPHASE : BEFORE or AFTER the job is sent to the printer
769# PYKOTAACTION : ALLOW or DENY or WARN for current print job
770# PYKOTAUSERNAME : user's name
771# PYKOTAPRINTERNAME : printer's name
772# PYKOTAPGROUPS : list of printers groups the current printer is a member of
773# PYKOTAJOBID : job's id
774# PYKOTATITLE : job's title
775# PYKOTACOPIES : number of copies
776# PYKOTAOPTIONS : job's options
777# PYKOTABALANCE : user's account balance
778# PYKOTALIFETIMEPAID : user's grand total paid
779# PYKOTALIMITBY : user print limiting factor, for example 'quota' or 'balance'
780# PYKOTAPAGECOUNTER : user's page counter on this printer
781# PYKOTALIFEPAGECOUNTER : user's life time page counter on this printer
782# PYKOTASOFTLIMIT : user's soft page limit on this printer
783# PYKOTAHARDLIMIT : user's hard page limit on this printer
784# PYKOTADATELIMIT : user's soft to hard limit date limit on this printer
785# PYKOTASTATUS : contains "CANCELLED" when SIGTERM was received by PyKota
786#                else is not set.
787# PYKOTAJOBSIZEBYTES : contains the job's size in bytes. Always available.
788# PYKOTAPRECOMPUTEDJOBSIZE : contains the precomputed job's size
789# PYKOTAPRECOMPUTEDJOBPRICE : contains the precomputed job's price
790# PYKOTAJOBORIGINATINGHOSTNAME : contains the client's hostname if
791#                                it is possible to retrieve it.
792# PYKOTAPRINTERHOSTNAME : the printer's hostname or IP address for network
793#                         printers, or "localhost" if not defined or not
794#                         meaningful.
795# PYKOTAWARNCOUNT : the number of times the user was forbidden to print but a banner
796#                   page was still printed on the current printer.                   
797# PYKOTAOVERCHARGE : user's overcharging factor.
798# PYKOTAJOBBILLING : Job's billing code if present (CUPS only)
799# PYKOTAREASON : if the job was denied or a warning needs to be issued, contains
800#                the message to send to the user.
801#
802
803# PreHook : gets executed after being sure the user, printer and user quota
804# entry on the printer both exist in the PyKota database, and after
805# checking if the user is allowed to print or not, but just before
806# the job is sent to the printer (if allowed)
807# prehook has access to many environment variables :
808#
809# PYKOTAACTION contains either "ALLOW", "WARN" or "DENY" and
810# represents the action which is to be done wrt the print job.
811# PYKOTAPHASE contains 'BEFORE' during execution of prehook
812#
813# uncomment the line below to see what environment variables are available
814# prehook: /usr/bin/printenv >/tmp/before
815
816# PostHook : gets executed after the job has been added to the history.
817# posthook has access to all the environment variables defined above,
818# as well as two additionnal environment variables : PYKOTAJOBPRICE
819# and PYKOTAJOBSIZE.
820# PYKOTAPHASE contains 'AFTER' during execution of posthook.
821#
822# uncomment the line below to see what environment variables are available
823# posthook: /usr/bin/printenv >/tmp/after
824
825# AccountBanner : how should banner accounting be done ?
826#
827# NB : CUPS ONLY FOR NOW !
828#
829# If enabled, banner pages printed from StartingBanner and/or EndingBanner
830# (depending on the value) will be included in the accounting for the
831# print job
832#
833# If disabled, banner pages printed from StartingBanner and EndingBanner will
834# *not* be included in the accounting for the print job
835#
836# IMPORTANT : CUPS generated banners are ALWAYS accounted for, although you
837#             can refund them by using negative prices on printers.
838#
839# Allowed values : Starting | Ending | None | Both
840#
841#       - Starting : only the starting banner will be accounted for.
842#       - Ending : only the ending banner will be accounted for.
843#       - Both : both starting and ending banners will be accounted for.
844#       - None : banners will not be accounted for.
845#
846# Default value :
847# accountbanner: Both
848
849# Maximal number of times the banner will still be printed if
850# the user is forbidden to print.
851#
852# NB : CUPS ONLY FOR NOW !
853#
854# This option can be set either globally or on a per printer basis.
855# Allowed values are 0 or any positive integer.
856# Default value is 0, which means that the banner won't be printed
857# at all if the user is forbidden to print.
858maxdenybanners: 0
859
860# StartingBanner : if defined will print a banner before the rest of the job
861# is printed. The argument can be a printable file, or an executable file.
862# If not executable, the file will be printed as is. If executable, the
863# file will be executed and its output will be printed.
864#
865# NB : CUPS ONLY FOR NOW !
866#
867# In any case, the banner content which will be sent to the printer
868# MUST be in a format your printer will accept !!!
869#
870# The pkbanner command included in PyKota can automatically generate
871# starting and ending banners in the PostScript format. You can use
872# this command in a pipe through GhostScript if your printer doesn't
873# accept PostScript as an input format.
874# NB : pkbanner's default page size is A4
875#
876# startingbanner: /home/joe/mystaticbanner.ps
877# startingbanner: /usr/bin/pkbanner --pagesize=A4 --logo="/home/joe/mylogo.jpeg" --url="http://tech.example.com"
878# startingbanner: /usr/bin/pkbanner | gs -q -dNOPAUSE -dBATCH -dPARANOIDSAFER -sOutputFile=- -sDEVICE=lj5mono -
879# startingbanner: /usr/bin/pkbanner
880
881# EndingBanner : if defined will print a banner after the job
882# has been printed. The argument can be a printable file, or an executable file.
883# If not executable, the file will be printed as is. If executable, the
884# file will be executed and its output will be printed.
885#
886# NB : CUPS ONLY FOR NOW !
887#
888# In any case, the banner content which will be sent to the printer
889# MUST be in a format your printer will accept !!!
890#
891# The pkbanner command included in PyKota can automatically generate
892# starting and ending banners in the PostScript format. You can use
893# this command in a pipe through GhostScript if your printer doesn't
894# accept PostScript as an input format.
895# NB : pkbanner's default page size is A4
896#
897# A static banner page
898# endingbanner: /home/joe/mystaticbanner.ps
899#
900# A banner with personnalized logo and url
901# endingbanner: /usr/bin/pkbanner --pagesize=A4 --logo="/home/joe/mylogo.jpeg" --url="http://tech.example.com"
902#
903# A banner in the format accepted by the printer
904# endingbanner: /usr/bin/pkbanner | gs -q -dNOPAUSE -dBATCH -dPARANOIDSAFER -sOutputFile=- -sDEVICE=lj5mono -
905#
906# A banner with more info on it, extracted from the yellow pages.
907# the string "Phone 111222333444" will be added to the banner page
908# if extractphone.sh returns 111222333444 for the current user.
909# endingbanner: /usr/bin/pkbanner Phone `extractphone.sh $PYKOTAUSERNAME`
910#
911# Default PyKota banner
912# endingbanner: /usr/bin/pkbanner
913
914# How should enforcement be done for this printer ?
915#
916# "laxist" is the default if value is not set, and allows users
917# to be over quota on their last job.
918#
919# "strict" tries to prevent users from ever being over quota.
920#
921# Enforcement can be defined either globally, per printer,
922# or both. If both are defined, the printer specific enforcement
923# setting has priority.
924#
925# valid values : "strict" or "laxist"
926#
927# default value
928# enforcement : laxist
929enforcement : strict
930
931# Should we trust the job size on this printer ?
932#
933# "trustjobsize : yes" is the default, the jobsize, either computed
934# by the hardware or by software is trusted.
935#
936# "trustjobsize : >N:precomputed" : uses the precomputed value if jobsize > N pages
937# "trustjobsize : >N:25" : uses 25 if jobsize is >N pages
938#
939# General form : ">n:m" where n is a positive integer, and m is
940# either the word 'precomputed' or a positive integer.
941# The special form "yes" is also accepted and is the default.
942#
943# This directive can be set either globally or on a per printer
944# basis. Use this directive when hardware accounting for a particular
945# printer produces some glitches due to the printer returning
946# incorrect answers.
947#
948# NB : DON'T MODIFY THIS IF YOU DON'T NEED TO. THIS IS ONLY TO BE USED
949# AS A WORKAROUND FOR SOME PRINTERS. IT'S PROBABLY BETTER TO ALWAYS
950# SET THIS DIRECTIVE TO 'yes'. THIS DIRECTIVE WILL ONLY BE HONORED
951# IF PYKOTA DETECTS A DIFFERENCE BETWEEN THE PRECOMPUTED JOB SIZE
952# AND THE JOB SIZE AS COMPUTED BY PYKOTA EITHER USING HARDWARE OR
953# SOFTWARE.
954trustjobsize : yes
955
956# Should we deny duplicate jobs ?
957#
958# A duplicate is a job sent twice (or more) in a row to the same printer
959# by the same user.
960#
961# This can be defined either globally or on a per printer basis
962# The default value is 'no', meaning that duplicate jobs are
963# allowed.
964#
965# NB : if an user prints a job, a second user prints another
966#      job, and the first user prints the first job again,
967#      this is NOT considered as a duplicate since the two
968#      identical jobs printed by the first user are not
969#      one just after the other.
970#
971# Possible values are 'yes', 'no', or any other string.
972# If the string is not recognized as a truth value,
973# it is considered to be a command to launch.
974# PyKota launches the command and parses its standard
975# output. The special keywords 'ALLOW' and 'DENY' are
976# recognized, allowing an external tool to decide if
977# the job is to be allowed or denied.
978#
979# denyduplicates : /usr/bin/myowncommand with some arguments
980# denyduplicates : yes
981denyduplicates : no
Note: See TracBrowser for help on using the browser.