This file is indexed.

/etc/cups/tea4cups.conf is in cups-tea4cups 3.13~alpha0+svn3565-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# $Id: tea4cups.conf 3565 2013-01-04 22:51:15Z jerome $
#
# Tea4CUPS : Tee for CUPS
#
# (c) 2005-2013 Jerome Alet <alet@librelogiciel.com>
# (c) 2005 Peter Stuge <stuge-tea4cups@cdy.org>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
#



# First we set all top-level directives in the [global] section
[global]



# Should we log debugging information to CUPS' error_log file ?
# defaults to No if unset.
#debug : yes



# In which directory will we create our files ? It must already exist !
# This directive MUST be present since there's no sane default value.
# Can be set either in the [global] section or any print queue section.
# The value defined in a print queue section takes precedence over the
# value defined in the [global] section.
#
# directory : /var/spool/tea4cups/
directory : /var/spool/cups/



# Should Tea4CUPS keep the files it creates once all hooks have ended ?
# Defaults to No if unset, meaning that files are automatically deleted
# once all hooks have ended.
# Can be set either in the [global] section or any print queue section.
# The value defined in a print queue section takes precedence over the
# value defined in the [global] section.
# BEWARE : this may use huge amounts of disk space !
#
# keepfiles : yes



# Should we retry to send the job's datas to the real backend in the case
# it fails ? The default when not set is to try to send the datas only once
# to the real backend.
# Can be set either in the [global] section or any print queue section.
# The value defined in a print queue section takes precedence over the
# value defined in the [global] section.
#
# Syntax : "retry: N,S"
#
#           N : number of times to try. If 0, will retry indefinitely, until
#               the backend accepts all the datas without error.
#
#           S : delay in Seconds between two attempts.
#
# The example below would retry up to three times, at 60 seconds interval.
#
# retry : 3,60



# Should we launch some command when the real CUPS backend fails ?
# Can be set either in the [global] section or any print queue section.
# The value defined in a print queue section takes precedence over the
# value defined in the [global] section.
# IMPORTANT : this directive is only taken into account when the number
# of tries as defined in the 'retry' directive above have expired and
# the real backend still fails.
#
# onfail : echo "Original Backend failed" | /usr/bin/mail -s Tea4CUPS root



# Should we pass incoming datas through a filter command
# BEFORE doing anything else ?
# NB : obvisouly the filter command doesn't have any access to
#      the environment variables defined below.
# Can be set either in the [global] section or any print queue section.
# The value defined in a print queue section takes precedence over the
# value defined in the [global] section.
#
# The sample filter below can remove the print job creation date
# from PostScript jobs, in order to more accurately detect duplicate
# jobs (so the MD5SUM would be identical from launch to launch)
#
# filter : /bin/grep -v "%%CreationDate:"



# Should we serialize the launch of all hooks : launch one after
# the other to save some system resources.
# Defaults to No if unset, meaning that all hooks are launched in
# parallel.
#
# NB : in any case, hooks' names are sorted alphabetically and
# are launched in this sort order (obviously when launched in parallel
# this is unnoticeable).
#
# Can be set either in the [global] section or any print queue section.
# The value defined in a print queue section takes precedence over the
# value defined in the [global] section.
#
# serialize : yes



# When executing the contents of a prehook or posthook directive, as
# defined below, tea4cups makes the following environment variables
# available to your own commands :
#
#      TEAPRINTERNAME : The print queue name.
#      TEADIRECTORY : Tea4CUPS output directory.
#      TEADATAFILE : Full name of Tea4CUPS work file (in $TEADIRECTORY).
#      TEAJOBSIZE : Job's size in bytes.
#      TEAMD5SUM : MD5 sum of the job's datas.
#      TEACLIENTHOST : Client's hostname or IP address.
#      TEAJOBID : Job's Id.
#      TEAUSERNAME : Name of the user who launched the print job.
#      TEATITLE : Job's title.
#      TEACOPIES : Number of copies requested.
#      TEAOPTIONS : Options of the print job.
#      TEAINPUTFILE : Job's data file or empty when job read from stdin.
#      TEABILLING : Job's billing code (lp -o job-billing=SomeCode file.ps)
#      TEACONTROLFILE : Job's IPP message file (usually /var/spool/cups/c?????)
#
# Your own commands will mostly be interested in TEADATAFILE which is
# the name of the file from which your commands may extract the final
# job's datas. Don't rely on TEAINPUTFILE, use TEADATAFILE instead
# since the first one may be empty depending on your printer driver.



# Some prehooks and posthooks
#
# Prehooks are guaranteed to be launched
# BEFORE the job's datas are sent to the printer, and
# posthooks are guaranteed to be launched AFTER the job's
# datas have been sent to the printer.
#
# prehook names are completely free BUT THEY MUST BEGIN WITH 'prehook_'
# posthook names are completely free BUT THEY MUST BEGIN WITH 'posthook_'
#
# An additionnal environment variable is made available to posthooks,
# named TEASTATUS which contains the exitcode of the real CUPS backend.
# If defined, the normal value is 0, meaning that the real CUPS backend exited
# successfully. Any other value indicates that a problem occured
# in the CUPS backend which handles the transmission of the job
# to the printer. See the output of 'man backend' for details.
#
# prehook_0 : echo "Your print job has been accepted" | smbclient -M $TEAUSERNAME
# posthook_0 : echo "Your print job has been printed with status $TEASTATUS" | smbclient -M $TEAUSERNAME
#
# NB : as a special feature, any prehook which exits with a -1 status (255)
# causes the job to NOT be sent to the real backend, effectively cancelling it.
# None of the posthooks gets executed in this case, but all
# remaining prehooks are still executed.
#
#posthook_0 : cat $TEADATAFILE >/tmp/$TEAJOBID.prn



# Another example : a PDF generator which creates PDF documents
# in the user's home directory under the names JOB-iiii.pdf
# where iiii is the job id :
#
# Beware : using ~$TEAUSERNAME here doesn't work because the ~ is not expanded.
# NB : for this to work you might have to print with 'lp -o raw'
#
# prehook_rawpdf : /bin/cat $TEADATAFILE | su $TEAUSERNAME -c "ps2pdf - `/usr/bin/getent passwd $TEAUSERNAME | /usr/bin/cut -f 6,6 -d :`/JOB-$TEAJOBID.pdf"
#
# The posthook below will log all error or warning messages sent by ps2pdf
# to a job specific file in /tmp/. See the explanation on how pre and post
# hooks can communicate at the end of this sample configuration file.
#
# posthook_rawpdf : /bin/cat >/tmp/log_of_pdf_creation_for_job_$TEAJOBID



# Sample section for print queue HP2100
# Uncomment and adapt to your needs.
#
#[HP2100]
#
# By using a same hook name as in the [global] section, the new
# value takes precedence
#
#posthook_0 : cat $TEADATAFILE >/tmp/$TEAUSERNAME-$TEAJOBID.prn



# An empty value deletes a value defined in the [global] section
# so this particular hook doesn't get executed on this printer.
#
#prehook_rawpdf :



# A reflector which produces 4 copies each time :
#
#posthook_4copies : lp -dotherprinter -n4 $TEADATAFILE



# A simple accounting mechanism
#
#prehook_accounting : echo $TEAPRINTERNAME $TEAJOBID $TEAUSERNAME $TEABILLING `pkpgcounter $TEADATAFILE` >>/var/log/printaccounting.log


# Some additionnal hooks to forbid duplicate jobs :
# The prehook will use the history file to filter out duplicate jobs
# checkdupes is an hypothetical command which exits -1 if the current print
# job is a duplicate (same MD5 sum already found in history).
#
# NB : Beware of some software which embed the job printing time into the
# PostScript job : two identical jobs may have different MD5 checksums
# if they differ only by the value of the '%%CreationDate:' PostScript
# comment !
#
#prehook_to_filter_duplicates : /usr/local/bin/checkdupes $TEAMD5SUM /tmp/jobmd5sums
#posthook_to_filter_duplicates : echo "$TEAJOBID : $TEAMD5SUM" >>/tmp/jobmd5sums



# A particular prehook can send datas to the posthook
# of the same name automatically through pipes :
# The file /tmp/result1 will contain the output of prehook_dialog1
# prehook_dialog1 : echo "This is pipe #1"
# posthook_dialog1 : cat >/tmp/result1
# The file /tmp/result2 will contain the output of prehook_dialog2
# prehook_dialog2 : echo "This is pipe #2"
# posthook_dialog2 : cat >/tmp/result2