[cups] Sending mail from a CentOS7 virtual machine to Fuji Xerox ApeosPort-IV C4475 problem revisted

マスターズ・イアン ian at ncsa.jp
Tue Oct 16 23:04:44 PDT 2018


Hi Gernot

I've answered inline below ...
  
> I had a chance to look at the file, and found a few problems with my documentation, sorry about that.
> (1) the sed expression is missing the final ' before $INPUT.
> (2) each line must be ended with a \, so final expression should be
> 
> sed -e '/@PJL COMMENT Version:4.00/ a\
> @PJL SET JOBATTR="@CNAM=P10316-VM"\
> @PJL SET JOBATTR="@DAID="\
> @PJL SET JOBATTR="@JOAU=3496"\
> @PJL SET JOBATTR="@LUNA=3496"' $INPUT
> 
> Now the logic.
> 1. the test file is read in as the 6th parameter
> 2. a temporary file is created
> 3. the contents of the test file are put into the temporary file
> 4. the sed expression appends 4 lines after the string "@PJL COMMENT Version:4.00"
> 
> I added a couple of debug lines to the file, and commented out the PPD, so in full for testing it is (fxauth.sh, executable):
> 
> #!/bin/bash
> 
> [ -n "$6" ] && exec <"$6"
> # input is regular file
> cleanup() { EXIT_CODE=$? ; rm -f $INPUT &>/dev/null ; exit $EXIT_CODE ; }
> trap 'cleanup' 0 1 2 3 15
> 
> MY_NAME=${0##*/}
> INPUT=$( mktemp /var/spool/cups/tmp/root.XXXXXX ) || exit 1
> cat - >$INPUT
> 
> # check parameters
> echo "file: $INPUT"
> echo "file contents:"
> cat $INPUT
> 
> # prefilter for all printjobs arriving on linux, since authentication is not optional
> 
> #source /etc/cups/ppd/${PRINTER}.fx
> #source /etc/cups/ppd/11F1.fx
> 
> sed -e '/@PJL COMMENT Version:4.00/ a\
> @PJL SET JOBATTR="@CNAM=P10316-VM"\
> @PJL SET JOBATTR="@DAID="\
> @PJL SET JOBATTR="@JOAU=3496"\
> @PJL SET JOBATTR="@LUNA=3496"' $INPUT
> 
> exit $?
> 
> Then I made a test.prn file containing:
> 
> This is a test file
> @PJL COMMENT Version:4.00
> 
> And then simply ran the script as follows:
> 
> hase at hase:~$ ./fxauth.sh 1 2 3 4 5 test.prn
> file: /var/spool/cups/tmp/root.ix5nS8
> file contents:
> This is a test file
> @PJL COMMENT Version:4.00
> This is a test file
> @PJL COMMENT Version:4.00
> @PJL SET JOBATTR="@CNAM=P10316-VM"
> @PJL SET JOBATTR="@DAID="
> @PJL SET JOBATTR="@JOAU=3496"
> @PJL SET JOBATTR="@LUNA=3496"
> 
> As you can see the test file neatly has the lines appended.
> So in your printjob you need to check if you have a similar line you can use to append after, else you might need to change the filter, e.g., if the version is different, or if there is just different stuff there.

OK, I did exactly as you did, just to ceck that I got the same result, and I did.

Then I tried to to the same to my '.prn' file saved under /tmp/... etc, and that was OK too.

Then I looked in the '.prn' file and saw:

@PJL SET JOBATTR=""
@PJL SET JOBATTR=""
@PJL SET JOBATTR=""
@PJL SET JOBATTR=""

and realized that I hadn't created a PrintToFile.fx, so the content wasn't being filled in, when I did a print to file.

After doing that, I can now see those 4 lines filled in correctly, and the job is arriving at the printer, and accessible in my queue after authenticating with my card, but the document is still zero pages long.

The problem doesn't appear to be the authorization, but I'm not really sure what it could be ...

For laffs (or maybe I mean tears), I tried using the CentOS5 mimefx.convs with 4 lines, but the result was the same.

So, to repeatt myself, I can successfully send a .prn made on Windows to the Xerox printer from CentOS7, but not a .prn made on the CentOS7 guest.

Not sure what to do next ... I'll let it mull in my brain a bit

ian

p.s. On your blog, "Step 2: Add to line mimefx.convs" should be "Step 2: Add line to mimefx.convs". It's a very small thing, but it might you having to answer mails about it from people who are as confued as I am about this.

  


More information about the cups mailing list