Respond and printfax.pl ======================= Last update 22/05/1999 The Windows program Respond enables you to send faxes from every Windows program via a faxmodem connected to a unix host. It let you specify faxnumber(s), receiver's name, sender's name and has a possibility to send faxes delayed (if supported on the unix side). Other features are phonebook and history. Respond supports every language, because you can change all label text. Respond is especially designed for use with mgetty+sendfax by Gert Doering or Hylafax (www.hylafax.org) and Samba, a LanManager like fileserver for Unix, by Andrew Tridgell and others. To use it with other fax solutions you have to change or replace the printfax.pl script. Respond is available in 16 bit (for Windows 3.x/9x/NT/2000) and in 32 bit (for Windows 9x/NT/2000). There are two 32 bit versions, a big one with compiled in runtime library and a really short one for those, who have Borland's VCL30.DPL installed. The 32 bit Respond only appears as a tray icon in the taskbar. Because the printfax.pl file is a Perl(5) script, you need Perl unless you write your own printfax script/program. If you configured it for other then mgetty+sendfax or Hylafax and Samba, please let me know. Files ----- RSPaabc.ZIP - contains RESPOND.EXE and CONFIG.EXE aa : version number (can be aaa for minor changes and bugfixes) b : 's' for 16 bit, 'l' for 32 bit c : 'b' for (full) binary, 'd' for runtimeless binary, 's' for source printfax.pl - smb.conf 'print command' fprintfax - lpd input filter (only if use a lpd like printer connection instead of Samba) faxlpq - smb.conf 'lpq command' faxlprm - smb.conf 'lprm command' You need at least RESPOND.EXE and printfax.pl (or fprintfax). Installation ------------ The Unix host: 1. Copy the printfax.pl script to /usr/bin and make it executable. 2. Create a [Fax] entry in the smb.conf like in smb_conf.add. or (if and only if you DON'T want to use Samba): Setup a printer with fprintfax as input filter. Set the right permissions for the faxspool dir so lpd can write there. (Note: my linux lpd calls the filter as user bin and group root, not bin). fprintfax expects this commandline: fprintfax [-c] -wwidth -llength -iindent -n user -h host acct-file I don't know if all unix systems call their input filters in this way. fprintfax makes only use of user, host and acct-file. All other will be ignored if no value or the value is concated. printfax.pl and fprintfax only spool the fax. You have to setup your mgetty+sendfax to really send it, e.g. by running faxrunq from cron or faxrunqd from a system startup script. The Windows PC: 1. Copy RESPOND.EXE to a directory of the Windows PC. 2. Create an entry for Respond in the autostart group/folder. 3. Be sure WINPOPUP will be also started at windows startup. This enables you to receive messages about the (un)successful spooling of your faxes. 4. Add a Postscript printer to your Windows configuration and for Windows 3.x bind it to a LPTx port (if you haven't enough LPTx ports, simply add how much you need to section [ports] in WIN.INI) (I suggest to use the driver for the Apple Laserwriter) 5. Connect the Postscript printer to the printer service Fax of the unix host. or (for lpr connection using fprintfax) connect the Postscript printer with your unix fax printer. (Note: you can send any type of file faxspool can convert to g3) If Respond won't start, because it can't find the NETAPI.DLL (especially under WinNT), use the Config program to disable the loading of NETAPI.DLL. May be loading of NETAPI.DLL is disabled by default, so for Windows for Workgroups enable it to let Respond get user name directly instead from System.ini. Version 1.5.0 of printfax has a simple support for one Windows NT terminal server. Every user on this terminal server has to configure his Respond program to listening on a different port. Put the IP address of the terminal server in the variable $termserver_ip and fill the array %respond_port with username-port pairs. If respond detects, that a fax request comes from the terminal server and a user in the array it will use the according port to build a connection. Otherwise it will use the default port. Using Respond ------------- Now you should be able to send faxes by simply print them to the Postscript printer connected with the fax service. After sending the file to the "printer" Respond pops up and let you type in the faxnumber (or numbers, separated by space or comma), receivers name (will be given to faxspool with the -D switch. It seems not very useful to specify a receivers name if you have more then one faxnumber, because it will be used for all numbers), a login name at the unix host (for faxspool switch -f; only for mail about (un)successful sending of your fax; if omitted, the user you connected as to Samba is used instead) and the senders full name (for faxspool switch -F). To fill in faxnumber and receivers name you can open the history/phonebook list by clicking the button or pressing cursor down in faxnumber field. To get more then one entry from the list you have to open it once for every entry. The history/phonebook list allows you to add history entries to the phonebook by pressing the phonebook button. (If you close the phonebook the history window will also be closed. I don't know why so I can't fix this.) To modify the phonebook when no connection is active you have to select 'Phonebook' from the system menu (16 bit version) or the tray icon menu (32 bit version). For Windows taskbar remember to do a right mouse click on the Respond icon to get the menu. ATTENTION: Please do not choose phonebook from menu if a connection is activ and you already opened the phonebook via the history list. By default disabled is the possibility to send faxes delayed. You have to set $usedelay to 1 and $defaultdelay to the default delay send time (same style as for mgetty's -t switch) in the configuration section of printfax.pl. To enable delayed sending in Respond you have to use the Config program to enable a checkbox to mark a fax for delaying or an edit field for more flexibility in the Respond window. Since version 1.3.4 of printfax.pl there is a possibility of using huge list of faxnumbers. Put the list in a file in your home directory on the samba host. If a "faxnumber" starts with a '@' printfax.pl takes the "number" as a filename in your home directory and uses the numbers in this file. If the filename starts with a slash (after the '@') it is treated as an absolute filename, so you can access a file anywhere in the filesystem. The number file can contain more then one number per line seperated by comma and/or space. Lines beginning with '#' are comments. Including of other files works by preceeding the filename with '@' (like above). Every file is included only once and every number is used only once. Remeber that the filenames are handled by printfax.pl And not Respond so you can't use a file resides on your windows pc. Use of filenames can be disabled by setting $allowfile to 0 in printfax.pl. The filename character '@' can be changed in printfax.pl by setting $filechar to what you want but comma and space. Configuration ------------- Configuration has changed since version 1.5. There is now a separate program called Config. This program lets you change the port Respond is listening at, the way of delaying faxes and the labels. The last enables you to use your own language for Respond. It is also possible to disable some of the input fields if you don't need them. Options are normally stored in Win.ini in section [Respond] (Port, Delayed) and [Respond-Labels] (the Labels). Phonebook and history are stored in Respond.ini in the Win dir. For Respond versions below 1.6preview3: If you specify a directory in the command line, Respond and Config use this place for Respond.ini. The switch '-l' says that labels are also stored in the private ini-file instead of Win.ini. With switch '-p' all information (options, labels, history, phonebook) are stored in Respond.ini. For Respond since version 1.6preview3: If you don't want to use these default locations you can use switches as follows: RESPOND [-option(s) directory]... options directory with RESPOND.INI for o configuration data (section [RESPOND]) b labels (section [RESPOND-LABLES]) a private phonebook (section [ALIASES]) c common (readonly) phonebook (section [ALIASES]) h history list (section [HISTORY]) Specify only the directory. The filename 'RESPOND.INI' will be automatically appended by Respond. It is possible to put more then one section in one file except the private and the common phonebook can't be in the same file. Protocol -------- Respond uses a very simple protocol. It listens at a port (5555 by default) and waits for a connection. If a host connects it pops up and the user can fill out the form. The connection will be closed without sending anything if the user cancels the dialog. On confirming Respond sends the values of the dialog elements line by line to the connected host and then closes the connection. Values will be sent in the following order: 1. Faxnumber (or numbers, all in the same line as user typed in) 2. User 3. Receivers name 4. Users full name 5. An empty string or the string 'delayed' (depends on the delay checkbox) or the contents of the delayed edit field 6. The contents of the 'More' field if enabled in Respond Each line ends in CR+LF. If soemthing goes wrong ----------------------- 1. Try to telnet to Respond at the port 5555 (or what you configured): telnet host.respond.runs 5555 Then Respond should popup. If not, you have a TCP/IP problem. Check network configuration/traffic with some tools to find the problem. (Note: If you changed the port in respond you have to change it in printfax.pl too) 2. Look if the printfax.pl script will be called right by samba. There is a variable called $debug in the configuration section of printfax.pl, which you can set to 1 for some debug output. The output goes to syslog if printfax.pl is called from samba. The second debug variable is $nosendondebug. If set to 1 (and $debug = 1) printfax.pl only prints the faxspool call to syslog instead of doing a real call of faxspool. 3. If account file says "failed", faxspool reports an error. Check if faxing user is allowed to fax (mgetty files fax.allow/fax.deny). Check also the permissions of the faxspool dir. The user printfax.pl is called as (possibly the guest user) have to have write access. 4. Possibly your ghostscript doesn't work right. Try to send a fax from commandline by using faxspool. If this works but printfax.pl reports "failed" then 3. should be your problem. If you have problems please don't forget to take a look into the log files. Known problems/bugs/additions ----------------------------- - If phonebook is opened from history list, closing the phonebook closes the history list too. - If phonebook is opened from menu while it is already opened from history list, after closing the first phonebook you get an exception when closing the second (Respond keeps usable). - The samba print command should always run in the background to avoid blocking the smbd process (otherwise every program accessing samba from the pc running Respond would freeze while this Respond is waiting for input). This could be done by enclosing the whole print command in brackets and then appending a '&'. - If the Respond popup is delayed by about one minute you have no nameservice. In this case simply put IP address and hostname of the machine running printfax.pl in the file "hosts" (Win95) or "system32\drivers\etc\hosts" (WinNT) in the Windows directory. - DWinsock can now be found at http://www.delphi32.com/vcl/2122/ - TrayIcon can now be found at http://www.delphi32.com/vcl/2818/ - If printfax.pl can't find smbclient a fax will only be sent to the first receiver if more then one fax number is specified. Be sure that the variable $smbclient contains the right call for smbclient even if you don't want to use the Winpopup feature. - Possibly Windows NT terminal server and Windows 2000 will not work with printfax.pl versions below 1.5.0 if you don't use the lines commented out in smb_conf.add. Author ------ Horst F with the help of (in random order): Heiko Schlittermann Michael St. Laurent Don Hayward Simon Hyde Helmut Lichtenberg Ondrejicka Stefan Bryan Halvorson and others. The last -------- Respond is freeware, so feel free to use. Since version 1.5.0 printfax.pl is published under the GNU General Public License. See file GPL.TXT for details. Suggestions and bug reports send to horstf(al)gmx.de Respond is available from http://www.boerde.de/~horstf/ I'm also interested in who is using Respond, so please send me a short mail if you like it. (Don't suggest to write a Windows printer driver that does the same thing. I know that this is a better way then Respond. But I don't know any such solution and I don't have the knowledge to write a Windows printer driver. I also currently don't want to add database support, please use copy-and-paste instead.)