<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://legacy.hylafax.org/index.php?action=history&amp;feed=atom&amp;title=As400script2</id>
	<title>As400script2 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://legacy.hylafax.org/index.php?action=history&amp;feed=atom&amp;title=As400script2"/>
	<link rel="alternate" type="text/html" href="https://legacy.hylafax.org/index.php?title=As400script2&amp;action=history"/>
	<updated>2026-11-25T02:11:59Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.2</generator>
	<entry>
		<id>https://legacy.hylafax.org/index.php?title=As400script2&amp;diff=2797&amp;oldid=prev</id>
		<title>Darren: Reverted edits by EinV6f (Talk); changed back to last version by Darren</title>
		<link rel="alternate" type="text/html" href="https://legacy.hylafax.org/index.php?title=As400script2&amp;diff=2797&amp;oldid=prev"/>
		<updated>2007-07-12T04:28:00Z</updated>

		<summary type="html">&lt;p&gt;Reverted edits by &lt;a href=&quot;/content/Special:Contributions/EinV6f&quot; title=&quot;Special:Contributions/EinV6f&quot;&gt;EinV6f&lt;/a&gt; (&lt;a href=&quot;/index.php?title=User_talk:EinV6f&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User talk:EinV6f (page does not exist)&quot;&gt;Talk&lt;/a&gt;); changed back to last version by &lt;a href=&quot;/index.php?title=User:Darren&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User:Darren (page does not exist)&quot;&gt;Darren&lt;/a&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 04:28, 12 July 2007&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Darren</name></author>
	</entry>
	<entry>
		<id>https://legacy.hylafax.org/index.php?title=As400script2&amp;diff=2574&amp;oldid=prev</id>
		<title>Darren: Reverted edits by EinV6f (Talk); changed back to last version by Paul</title>
		<link rel="alternate" type="text/html" href="https://legacy.hylafax.org/index.php?title=As400script2&amp;diff=2574&amp;oldid=prev"/>
		<updated>2007-06-29T04:36:24Z</updated>

		<summary type="html">&lt;p&gt;Reverted edits by &lt;a href=&quot;/content/Special:Contributions/EinV6f&quot; title=&quot;Special:Contributions/EinV6f&quot;&gt;EinV6f&lt;/a&gt; (&lt;a href=&quot;/index.php?title=User_talk:EinV6f&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User talk:EinV6f (page does not exist)&quot;&gt;Talk&lt;/a&gt;); changed back to last version by &lt;a href=&quot;/index.php?title=User:Paul&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User:Paul (page does not exist)&quot;&gt;Paul&lt;/a&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 04:36, 29 June 2007&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Darren</name></author>
	</entry>
	<entry>
		<id>https://legacy.hylafax.org/index.php?title=As400script2&amp;diff=2503&amp;oldid=prev</id>
		<title>Paul: Reverted edits by EinV6f (Talk); changed back to last version by Darren</title>
		<link rel="alternate" type="text/html" href="https://legacy.hylafax.org/index.php?title=As400script2&amp;diff=2503&amp;oldid=prev"/>
		<updated>2007-06-11T12:53:17Z</updated>

		<summary type="html">&lt;p&gt;Reverted edits by &lt;a href=&quot;/content/Special:Contributions/EinV6f&quot; title=&quot;Special:Contributions/EinV6f&quot;&gt;EinV6f&lt;/a&gt; (&lt;a href=&quot;/index.php?title=User_talk:EinV6f&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User talk:EinV6f (page does not exist)&quot;&gt;Talk&lt;/a&gt;); changed back to last version by &lt;a href=&quot;/index.php?title=User:Darren&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User:Darren (page does not exist)&quot;&gt;Darren&lt;/a&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 12:53, 11 June 2007&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Paul</name></author>
	</entry>
	<entry>
		<id>https://legacy.hylafax.org/index.php?title=As400script2&amp;diff=1586&amp;oldid=prev</id>
		<title>Darren at 14:41, 20 December 2005</title>
		<link rel="alternate" type="text/html" href="https://legacy.hylafax.org/index.php?title=As400script2&amp;diff=1586&amp;oldid=prev"/>
		<updated>2005-12-20T14:41:37Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# Captures the spool File&lt;br /&gt;
# Don&amp;#039;t forget to change the domain names to ones that will for you, since these won&amp;#039;t!&lt;br /&gt;
cat - &amp;gt; /tmp/as.$$&lt;br /&gt;
&lt;br /&gt;
# Declare Variable&lt;br /&gt;
# Paths to temporary files&lt;br /&gt;
FILE_PDF=/tmp/as4$$.pdf &lt;br /&gt;
FILE_AS400=/tmp/as.$$ &lt;br /&gt;
FILE_PS=/tmp/ps.$$ &lt;br /&gt;
&lt;br /&gt;
# Path to e-mail server program&lt;br /&gt;
SENDMAIL=&amp;quot;/usr/sbin/sendmail&amp;quot; &lt;br /&gt;
MIMENCODE=mimencode &lt;br /&gt;
&lt;br /&gt;
# Variable defaults&lt;br /&gt;
UNAME=QUSER 	#IBM Defaults I chose to use while testing&lt;br /&gt;
FNAME=OTHER 	#IBM Defaults I chose to use while testing&lt;br /&gt;
COMMENT=&amp;#039;Please Contact Sender if any Pages are Missing.&amp;#039; # Default Comment for the cover page&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Pedro&amp;#039;s original script did not work for me, so I used getopt to capture the options passed from LPRng to the &amp;quot;printer&amp;quot;&lt;br /&gt;
# Go to the LPRng website to find out what all the letters mean, or uncomment the ECHO $TEMP2 line in the e-mail body&lt;br /&gt;
&lt;br /&gt;
# Grabs all of the options, you need to uncomment this to see all of the data passed&lt;br /&gt;
# TEMP2=`getopt -o &lt;br /&gt;
A:B:C:D:E:F:G:H:I:J:K:L:M:N:O:P:Q:R:T:S:U:V:W:X:Y:Z:a:b:cd:e:f:g:h:i:j:k:l: m:n:o:p:q:r:t:s:u:v:w:x:y:z \&lt;br /&gt;
         -- &amp;quot;$@&amp;quot;`&lt;br /&gt;
# Grabs only the options I wanted, username without domain and the document type&lt;br /&gt;
TEMP=`getopt -a -o N:n:  -- &amp;quot;$@&amp;quot;` &lt;br /&gt;
eval set -- &amp;quot;$TEMP&amp;quot; &lt;br /&gt;
while true ; do&lt;br /&gt;
         case &amp;quot;$1&amp;quot; in&lt;br /&gt;
                 -n)     USER=&amp;quot;$2&amp;quot;; shift 2 ;;&lt;br /&gt;
                 -N)     FNAME=&amp;quot;$2&amp;quot;; shift 2 ;;&lt;br /&gt;
                 *) shift; break ;;&lt;br /&gt;
         esac&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
# I Inherited this as400 and was not willing to setup the rest of the &lt;br /&gt;
network using the same user name scheme&lt;br /&gt;
# The case statement is how I corrected this, I also put user specifc &lt;br /&gt;
comments here.&lt;br /&gt;
&lt;br /&gt;
	case &amp;quot;$USER&amp;quot; in&lt;br /&gt;
		ROB)            UNAME=rsherman ;;&lt;br /&gt;
		JACKIE)         UNAME=jmoore ; COMMENT=&amp;#039;Please be Aware that the &lt;br /&gt;
following Invoice(s) were processed today towards your account and payment &lt;br /&gt;
will be due upon agreed terms.&amp;#039;;;&lt;br /&gt;
         *)			UNAME=$USER ;;&lt;br /&gt;
	esac&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Here is where the spool file is converted to PostScript and the &lt;br /&gt;
# Header with the same name as stored in the variable field&lt;br /&gt;
# $FNAME is applied.  Please look at the ACKFORM example before attempting&lt;br /&gt;
# to create a header file&lt;br /&gt;
/usr/bin/enscript --fancy-header=$FNAME  $FILE_AS400 -p $FILE_PS&lt;br /&gt;
&lt;br /&gt;
# Where you pick the faxnumber&lt;br /&gt;
FAXNUMBER=`sed -ne &amp;#039;/&amp;#039;Fax&amp;#039;/{s/^.*&amp;#039;Fax&amp;#039; : *//g;s/[()]//g;s/[^0-9]\{1,\}.*^M$//g;p;q;}&amp;#039;` &amp;lt; /tmp/as.$$&lt;br /&gt;
&lt;br /&gt;
# Converts the Postscript file to pdf in preparation of e-mailing it back to the user&lt;br /&gt;
ps2pdf $FILE_PS $FILE_PDF&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Begining of the e-mail structure&lt;br /&gt;
        (MIMEBOUNDARY=&amp;quot;NextPart$$&amp;quot;&lt;br /&gt;
          echo &amp;quot;Mime-Version: 1.0&amp;quot;&lt;br /&gt;
          echo &amp;quot;Content-Type: Multipart/Mixed; Boundary=\&amp;quot;$MIMEBOUNDARY\&amp;quot;&amp;quot;&lt;br /&gt;
          echo &amp;quot;Content-Transfer-Encoding: 7bit&amp;quot;&lt;br /&gt;
          echo &amp;quot;To: $UNAME@yourhost.yourdomain&amp;quot;&lt;br /&gt;
          echo &amp;quot;From: Fax Server&amp;lt;fax&amp;gt;&amp;quot;&lt;br /&gt;
          echo &amp;quot;Subject: Outgoing fax job to $FAXNUMBER submitted&amp;quot;&lt;br /&gt;
          echo &amp;quot;&amp;quot;&lt;br /&gt;
          echo &amp;quot;--$MIMEBOUNDARY&amp;quot;;&lt;br /&gt;
          echo &amp;quot;&amp;quot;&lt;br /&gt;
          echo `date`&lt;br /&gt;
          echo &amp;quot;&amp;quot;&lt;br /&gt;
          echo &amp;quot;Your request has been queued for delivery.&amp;quot;&lt;br /&gt;
          echo &amp;quot;There will be an E-Mail confirming delivery of your&amp;quot;&lt;br /&gt;
          echo &amp;quot;fax to $FAXNUMBER.&amp;quot;&lt;br /&gt;
          echo &amp;quot;&amp;quot;&lt;br /&gt;
          echo &amp;quot;&amp;quot;&lt;br /&gt;
          echo &amp;quot;If you do not receive a confirmation in one hour, notify the system administrator.&amp;quot;&lt;br /&gt;
          echo &amp;quot;Attached is a PDF File containing the contents of your fax.&amp;quot;&lt;br /&gt;
          echo &amp;quot;&amp;quot;&lt;br /&gt;
#	  echo	&amp;quot;$TEMP2&amp;quot; # uncomment this line to see all of the LPRng options &lt;br /&gt;
passed&lt;br /&gt;
          echo &amp;quot;--$MIMEBOUNDARY&amp;quot;;&lt;br /&gt;
	 echo &amp;quot;Content-Type: application/pdf; name=\&amp;quot;$FNAME.pdf\&amp;quot;&amp;quot;&lt;br /&gt;
         echo &amp;quot;Content-Description: FAX document&amp;quot;&lt;br /&gt;
         echo &amp;quot;Content-Transfer-Encoding: base64&amp;quot;&lt;br /&gt;
         echo &amp;quot;Content-Disposition: attachment; &lt;br /&gt;
	   filename=\&amp;quot;$FNAME.pdf\&amp;quot;&amp;quot;&lt;br /&gt;
	 echo &amp;quot;Content-Description: FAX document&amp;quot;&lt;br /&gt;
         echo &amp;quot;Content-Transfer-Encoding: base64&amp;quot;&lt;br /&gt;
         echo &amp;quot;Content-Disposition: attachment; &lt;br /&gt;
	   filename=\&amp;quot;$FNAME.pdf\&amp;quot;&amp;quot;&lt;br /&gt;
         echo &amp;quot;&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
#Embeds the PDF in the e-mail and removes it from the temp directory&lt;br /&gt;
&lt;br /&gt;
         $MIMENCODE $FILE_PDF 2&amp;gt;/dev/null&lt;br /&gt;
         $RM -f $FILE_PDF 2&amp;gt;/dev/null&lt;br /&gt;
	 echo &amp;quot;&amp;quot;;&lt;br /&gt;
         echo &amp;quot;--$MIMEBOUNDARY--&amp;quot;;&lt;br /&gt;
         echo &amp;quot;&amp;quot;;&lt;br /&gt;
         ) | 2&amp;gt;&amp;amp;1 $SENDMAIL -ffax -oi $UNAME@yourhost.yourdomain&lt;br /&gt;
&lt;br /&gt;
# If there is no fax number this keeps the script from hanging or worse&lt;br /&gt;
         if [ &amp;quot;$FAXNUMBER&amp;quot; = &amp;quot;&amp;quot; ] ; then&lt;br /&gt;
         echo     $UNAME&lt;br /&gt;
         else&lt;br /&gt;
&lt;br /&gt;
# I have the fax being submitted with the default cover page and the comments section being passed through&lt;br /&gt;
         sendfax  -D -R -f $UNAME@yourhost.yourdomain -c &amp;quot;$COMMENT&amp;quot; -d $FAXNUMBER  $FILE_PS&lt;br /&gt;
         fi&lt;br /&gt;
&lt;br /&gt;
# Cleaning up after myself again&lt;br /&gt;
rm -f /tmp/as.$$ $FILE_PDF $FILE_PS&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Darren</name></author>
	</entry>
</feed>