Changed DOMAIN.txt to try to explain terms like domain, workgroup,
[kai/samba.git] / docs / textdocs / Faxing.txt
1 Contributor:    Gerhard Zuber <zuber@berlin.snafu.de>
2 Date:                   August 5th 1997.
3 Status:                 Current
4
5 Subject:        F A X I N G   with  S A M B A
6 ==========================================================================
7
8 This text describes how to turn your SAMBA-server into a fax-server
9 for any environment, especially for Windows.
10    Author: Gerhard Zuber <zuber@berlin.snafu.de>
11    Version: 1.4
12    Date: 04. Aug. 1997
13
14 Requirements:
15    UNIX box (Linux preferred) with SAMBA and a faxmodem
16    ghostscript package
17    mgetty+sendfax package
18    pbm package (portable bitmap tools)
19
20 FTP sites:
21    sunsite.unc.edu:/pub/Linux/system/Serial/mgetty+sendfax*
22    tsx-11.mit.edu:/pub/linux/sources/sbin/mgetty+sendfax
23    ftp.leo.org:/pub/comp/networking/communication/modem/mgetty/mgetty1.1.6-May05.tar.gz
24
25    pbm10dec91.tgz
26    ftp.leo.org:/pub/comp/networking/communication/modem/mgetty/pbm10dec91.tgz
27    sunsite.unc.edu: ..../apps/graphics/convert/pbmplus-10dec91-bin.tar.gz
28    ftp.gwdg.de/pub/linux/grafik/pbmplus.src.tar.Z (this is 10dec91 source)
29                  or ???   pbm10dec91.tgz pbmplus10dec91.tgz
30
31
32 making mgetty+sendfax running:
33 ==============================
34
35    go to source tree: /usr/src/mgetty+sendfax
36    cp policy.h-dist policy.h
37
38    change your settings: valid tty ports, modem initstring, Station-Id
39
40 #define MODEM_INIT_STRING       "AT &F S0=0 &D3 &K3 &C1\\\\N2"
41
42 #define FAX_STATION_ID  "49 30 12345678"
43
44 #define FAX_MODEM_TTYS  "ttyS1:ttyS2:ttyS3"
45
46    Modem initstring is for rockwell based modems
47    if you want to use mgetty+sendfax as PPP-dialin-server,
48    define AUTO_PPP in Makefile:
49
50 CFLAGS=-O2 -Wall -pipe -DAUTO_PPP
51
52    compile it and install the package.
53    edit your /etc/inittab and let mgetty running on your preferred
54    ports:
55
56 s3:45:respawn:/usr/local/sbin/mgetty ttyS2 vt100
57
58    now issue a
59       kill -HUP 1
60    and enjoy with the lightning LEDs on your modem
61    your now are ready to receive faxes !
62
63
64    if you want a PPP dialin-server, edit 
65       /usr/local/etc/mgetty+sendfax/login.config
66
67 /AutoPPP/ -     ppp     /usr/sbin/pppd auth debug passive modem 
68
69
70    Note: this package automatically decides between a fax call and
71          a modem call. In case of modem call you get a login prompt !
72
73 Tools for printing faxes:
74 =========================
75
76    your incomed faxes are in:
77     /var/spool/fax/incoming
78
79    print it with:
80
81      for i in *
82      do
83      g3cat $i | g3tolj | lpr -P hp
84      done
85
86    in case of low resolution use instead:
87
88      g3cat $i | g3tolj -aspect 2 | lpr -P hp
89
90
91    g3cat is in the tools-section, g3tolj is in the contrib-section
92    for printing to HP lasers.
93
94    If you want to produce files for displaying and printing with Windows, use
95    some tools from the pbm-package like follow
96
97      g3cat $i | g3topbm - |  ppmtopcx - >$i.pcx  
98
99    and view it with your favourite Windows tool (maybe paintbrush)
100
101
102 Now making the fax-server:
103 ===========================
104
105     fetch the file
106        mgetty+sendfax/frontends/winword/faxfilter
107
108     and place it in
109
110       /usr/local/etc/mgetty+sendfax/
111
112     prepare your faxspool file as mentioned in this file
113     edit fax/faxspool.in and reinstall or change the final
114     /usr/local/bin/faxspool too.
115
116             if [ "$user" = "root" -o "$user" = "fax" -o \
117                  "$user" = "lp" -o "$user" = "daemon" -o "$user" = "bin" ]
118
119     find the first line and change the second.
120
121     make sure you have pbmtext (from the pbm-package). This is
122     needed for creating the small header line on each page.
123     Notes on pbmplus:
124     Some peoples had problems with precompiled binaries (especially
125     at linux) with a shared lib libgr.so.x.x. The better way is
126     to fetch the source and compile it. One needs only pbmtext for
127     generating the small line on top of each page /faxheader). Install
128     only the individual programs you need. If you install the full
129     package then install pbmplus first and then mgetty+sendfax, because
130     this package has some changed programs by itself (but not pbmtext).
131
132     make sure your ghostscript is functional. You need fonts !
133     I prefer these from the OS/2 disks
134
135     prepare your faxheader
136       /usr/local/etc/mgetty+sendfax/faxheader
137
138     edit your /etc/printcap file:
139
140 # FAX 
141 lp3|fax:\
142         :lp=/dev/null:\
143         :sd=/usr/spool/lp3:\
144         :if=/usr/local/etc/mgetty+sendfax/faxfilter:sh:sf:mx#0:\
145         :lf=/usr/spool/lp3/fax-log:
146
147
148
149
150     edit your /usr/local/samba/lib/smb.conf
151
152     so you have a smb based printer named "fax"
153
154
155 The final step:
156 ===============
157
158     Now you have a printer called "fax" which can be used via
159     TCP/IP-printing (lpd-system) or via SAMBA (windows printing).
160
161     On every system you are able to produce postscript-files you
162     are ready to fax.
163
164     On Windows 3.1 95 and NT:
165
166     Install a printer wich produces postscript output,
167        e.g.  apple laserwriter
168
169     connect the "fax" to your printer 
170
171
172     Now write your first fax. Use your favourite wordprocessor,
173     write, winword, notepad or whatever you want, and start
174     with the headerpage.
175
176     Usually each fax has a header page. It carries your name,
177     your address, your phone/fax-number.
178
179     It carries also the recipient, his address and his *** fax
180     number ***. Now here is the trick:
181
182     Use the text:
183        Fax-Nr: 123456789
184     as the recipients fax-number. Make sure this text does not
185     occur in regular text ! Make sure this text is not broken
186     by formatting information, e.g. format it as a single entity.
187     (Windows Write and Win95 Wordpad are functional, maybe newer
188     versions of Winword are breaking formatting information).
189
190     The trick is that postscript output is human readable and
191     the faxfilter program scans the text for this pattern and
192     uses the found number as the fax-destination-number.
193
194     Now print your fax through the fax-printer and it will be
195     queued for later transmission. Use faxrunq for sending the
196     queue out.
197
198     Notes of SAMBA smb.conf:
199     Simply use fall through from the samba printer to the unix
200     printer. Sample:
201
202
203  printcap name = /etc/printcap
204  print command = /usr/bin/lpr -r -P %p %s
205  lpq command = /usr/bin/lpq -P %p
206  lprm command = /usr/bin/lprm -P %p %j
207
208
209 [fax]
210     comment = FAX (mgetty+sendfax)
211     path = /tmp
212     printable = yes
213     public = yes
214     writable = no
215     create mode = 0700
216     browseable = yes
217     guest ok = no
218
219
220