<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <META NAME="GENERATOR" CONTENT="lfparser_2.13"> <META NAME="LFCATEGORY" CONTENT="Applications"> <!-- this is used be a number of tools: =LF=AUTHOR: HackLinux =LF=CAT___: Applications =LF=TITLE_: The Easy Fax Server! =LF=NUMBER: 196 --> <TITLE>lf196, Applications: The Easy Fax Server!</TITLE> <!-- stylesheet added by lfparser: --> <style type="text/css"> <!-- td.top {font-family: Arial,Geneva,Verdana,Helvetica,sans-serif; } pre { font-familiy:monospace,Courier } p.cl { color:#EE9500 } a.nodec { text-decoration:none } p.trans { font-size:8pt; text-align:right } p.clbox { width:50%; alignment:center; background-color:#FFD700; border-style:none; border-width:medium; border-color:#FFD700; padding:0.5cm ; text-align:center } p.foot { background-color:#AAAAAA; color:#FFFFFF; border-style:none; border-width:medium; border-color:#AAAAAA; padding:0.5cm ; margin-top:0.1cm; margin-right:1cm; margin-left:1cm; text-align:center } --> </style> </HEAD> <BODY bgcolor="#ffffff" text="#000000"> <!-- this is generated html code. NEVER use this file for your translation work. Instead get the file with the same article number and .meta.shtml in its name. Translate this meta file and then use lfparser program to generate the final article --> <!-- lfparser can be obtained from http://main.linuxfocus.org/~guido/dev/lfparser.html --> <!-- 2pdaIgnoreStart --> <!-- start navegation bar --> <!-- top navegation bar --> <TABLE cellspacing="0" cellpadding="0" border="0" align="center" width="90%"> <TR bgcolor="#2e2292"> <TD class="top"><TABLE cellspacing="0" cellpadding="0" border="0" width= "100%"> <TR><TD width="144"><IMG src="../../common/images/logolftop.gif" alt="[LinuxFocus-icon]" width="350" height="45" align="left" border="0"></TD> <TD class="top"> <TABLE width="100%"> <TR align="right"> <TD class="top"><A class="nodec" href="../index.shtml"><FONT color= "#DDDDDD">Home</FONT></A> | <A class= "nodec" href="../map.html"><FONT color= "#DDDDDD">Map</FONT></A> | <A class= "nodec" href="../indice.html"><FONT color= "#DDDDDD">Index</FONT></A> | <A class="nodec" href="../Search/index.html"><FONT color= "#DDDDDD">Search</FONT></A> </TD> </TR> <TR align="right"> <TD class="top"> <HR width="100%" noshade size="1"> </TD> </TR> </TABLE> </TD> </TR> </TABLE> </TD> </TR> </TABLE> <!-- end top navegation bar --> <!-- blue bar --> <TABLE cellspacing="0" cellpadding="0" border="0" align="center" width="90%"> <TR bgcolor="#00ffff"> <TD><IMG src="../../common/images/transpix.gif" width="1" height= "2" alt=""></TD> </TR> </TABLE> <!-- end blue bar --> <!-- bottom navegation bar --> <TABLE cellspacing="0" cellpadding="0" border="0" align="center" width="94%"> <TR bgcolor="#000000"> <TD> <TABLE cellspacing="0" cellpadding="1" border="0" width= "100%"> <TR align="center"> <TD class="top"><A class="nodec" href="../News/index.html"><FONT color= "#FFFFFF">News</FONT></A> </TD> <TD><FONT color="#FFFFFF">|</FONT> </TD> <TD><A class="nodec" href="../Archives/index.html"><FONT color= "#FFFFFF">Archives</FONT></A> </TD> <TD><FONT color="#FFFFFF">|</FONT> </TD> <TD><A class="nodec" href="../Links/index.html"><FONT color= "#FFFFFF">Links</FONT></A> </TD> <TD><FONT color="#FFFFFF">|</FONT> </TD> <TD><A class="nodec" href="../aboutus.html"><FONT color= "#FFFFFF">About LF</FONT></A> </TD> <TD> </TD> </TR> </TABLE> </TD> </TR> </TABLE> <!-- end bottom navegation bar --> <!-- stop navegation bar --> <!-- SSI_INFO --> <!-- tr_staticssi include virtual --> <!-- tr_staticssi exec cmd --> <!-- addedByLfdynahead ver 1.1 --><TABLE ALIGN="right" border=0><TR><TD ALIGN="right"><FONT SIZE="-1" FACE="Arial,Helvetica">This article is available in: <A href="../../English/March2001/article196.shtml">English</a> <A href="../../Castellano/March2001/article196.shtml">Castellano</a> <A href="../../Deutsch/March2001/article196.shtml">Deutsch</a> <A href="../../Francais/March2001/article196.shtml">Francais</a> <A href="../../Nederlands/March2001/article196.shtml">Nederlands</a> <A href="../../Russian/March2001/article196.shtml">Russian</a> <A href="../../Turkce/March2001/article196.shtml">Turkce</a> <A href="../../Arabic/March2001/article196.shtml">Arabic</a> </FONT></TD></TR></TABLE><br> <!-- 2pdaIgnoreStop --> <!-- SHORT BIO ABOUT THE AUTHOR --> <TABLE ALIGN=LEFT BORDER=0 hspace=4 vspace=4 WIDTH="30%" > <TR> <TD> <!-- 2pdaIgnoreStart --> <!-- PALM DOC --> <TABLE BORDER=0 hspace=4 vspace=4> <TR> <TD> <font size=1> <img src="../../common/images/2doc.gif" width=34 align=left border=0 height=22 alt="convert to palm"><a href="http://cgi.linuxfocus.org/cgi-bin/2ztxt">Convert to GutenPalm</a><br>or <a href="http://cgi.linuxfocus.org/cgi-bin/2pda">to PalmDoc</a></font> </TD> </TR> </TABLE> <!-- END PALM DOC --> <!-- 2pdaIgnoreStop --> <br> <IMG src="../../common/images/hacklinux.jpg" alt="HackLinux" height= "150" width="100"> <BR>by <A href= "mailto:contact@hacklinux.org">HackLinux</A> <BR><BR> <I>About the author:</I><BR> <P>It's been a long time since I used Windows and it feels good...</P> <BR><i>Content</i>: <UL> <LI><A HREF="#lfindex0">Introduction</A></LI> <LI><A HREF="#lfindex1">Installation</A></LI> <LI><A HREF="#lfindex2">Configuration of Hylafax</A></LI> <LI><A HREF="#lfindex3">If problems arise</A></LI> <LI><A HREF="#lfindex4">Starting Hylafax</A></LI> <LI><A HREF="#lfindex5">Using Hylafax</A></LI> <LI><A HREF="#lfindex6">Using Hylafax on a network</A></LI> <LI><A HREF="#lfindex7">Configuration of the server</A></LI> <LI><A HREF="#lfindex8">Configuration of a client</A></LI> <LI><A HREF="#lfindex9">Mailing with Fax</A></LI> <LI><A HREF="#lfindex10">Resources</A></LI> <LI><A HREF="#lfindex11"> Notes from the author</A></LI> <LI><A HREF="http://cgi.linuxfocus.org/cgi-bin/lftalkback?anum=196&lang=en">Talkback form for this article</A></LI> </UL> </TD></TR></TABLE> <!-- HEAD OF THE ARTICLE --> <br> <H2>The Easy Fax Server!</H2> <IMG src="../../common/images/illustration196.gif" alt= "www.hylafax.org" border="1" hspace="10" height="120" width="350"> <!-- ABSTRACT OF THE ARTICLE --> <P><i>Abstract</i>: <P> This article explains how to configure a Linux box as a fax server! </P> <HR size="2" noshade align="right"><BR> <!-- BODY OF THE ARTICLE --> <A NAME="lfindex0"> </A> <H2>Introduction</H2> <P>Here is a configuration for a fax server using <B>Hylafax 4.0pl2.rjc11</B> and a <B>Mandrake 7.1</B> distribution</P> <P>On the server side, Hylafax consists of 3 daemons :</P> <UL> <LI><B>faxq</B> - the main server</LI> <LI><B>hfaxd</B> - manages network connections</LI> <LI><B>faxgetty</B> - manages dialogs with modem(s)<BR> </LI> </UL> <P>On the client side, one finds the following programs (which can also run on the server) :</P> <UL> <LI><B>sendfax</B> - to send faxes</LI> <LI><B>faxstat</B> - to check the queue</LI> <LI><B>faxrm</B> - to remove jobs from the queue</LI> </UL> <P>Relevant configuration files are found in the <TT>/var/spool/fax/etc/</TT> folder</P> <A NAME="lfindex1"> </A> <H2>Installation</H2> <P>I strongly advise you to install the following packages (included with Mandrake 7.1) :<BR> </P> <UL> <LI><A href= "ftp://ftp.cs.wisc.edu/pub/ghost/aladdin/">ghostscript</A></LI> <LI><A href="ftp://rufus.w3.org/linux/redhat/">libtiff</A></LI> </UL> <P>These resources are also available on the official site <A href= "http://www.hylafax.org/links.html">http://www.hylafax.org/links.html</A></P> <P>If <B>Hylafax</B> is not installed by default, one simply has to add the needed RPM packages:</P> <PRE> <CODE>rpm -ivh hylafax-common-4.0pl2.rjc11-3mdk rpm -ivh hylafax-client-4.0pl2.rjc11-3mdk rpm -ivh hylafax-server-4.0pl2.rjc11-3mdk </CODE> </PRE> <A NAME="lfindex2"> </A> <H2>Configuration of Hylafax</H2> <P>In order to configure the server, run the command:</P> <PRE> <CODE><B>faxsetup</B> <B>-server</B> (as root)</CODE> </PRE> <P>The default settings are ok to use almost every question asked, except for:</P> <UL> <LI><CODE>Country code [1]? enter 33 for France</CODE></LI> <LI><CODE>Area code []? enter 1 for Paris</CODE></LI> <LI><CODE>Long distance dialing prefix [1]? enter 0</CODE></LI> <LI><CODE>International dialing prefix [011]? enter 00</CODE></LI> <LI><CODE>Dial string rules file [etc/dialrules]? enter etc/dialrules.europe</CODE></LI> <LI><CODE>Serial port that modem is connected to []? enter ttyS0 (for COM1) or ttyS1 (for COM2)</CODE></LI> </UL> <P><B>Hylafax</B> does not launch the daemon <B>faxgetty</B> by default. This has to be done by hand:</P> <P>1 - Edit file <B>/etc/inittab</B> and insert the following line at the end of the file:</P> <PRE> <CODE>mo:2345:respawn:/usr/sbin/faxgetty -D ttyS0</CODE> </PRE> the command <B>kill -HUP 1</B> is necessary to restart <B>faxgetty</B> <P>Or</P> <P>if you want to use the <B>rc.local</B> file:</P> 2 - Add to <TT>/etc/rc.d/rc.local</TT> the following line: <BR> <PRE> <CODE>/usr/sbin/faxgetty -D /dev/ttyS0</CODE> </PRE> <P>and launch the command:</P> <PRE> <CODE>faxgetty -D /dev/ttyS0</CODE> </PRE> <P><U>Note :</U> The command <B>faxaddmodem</B> allows you to add one or more modems afterwards.</P> <P>After these manipulations, the file <B>/var/spool/fax/etc/config.ttyS0</B> (for com1) has been created for <B>faxgetty</B>.<BR> It contains your modem configuration for /dev/ttyS0<BR> The file <B>/usr/share/fax/hfaxd.conf</B> contains the <B>hfaxd</B> daemon configuration, I did not touch it!</P> <A NAME="lfindex3"> </A> <H3>If problems arise</H3> <P>To detect the modem, use the <B>probemodem</B> command. Moreover, there are typical configurations available in /var/spool/fax/config/</P> <P>My modem is a 3Com US Robotics 56k, therefore I choose the file <B>usr-2.0</B> which I copied into /var/spool/fax/etc/ while renaming it to config.ttyS0 and modifying it as follows:</P> <PRE> <CODE><FONT size= "2"># Configuration for using the Class 2.0 command interface # with a USR v.34 Courier or Sporster modem. # # CONFIG: CLASS2.0: USRobotics*-* # CountryCode: 33 AreaCode: 1 #FAXNumber: your number ex (for france): 0134123412 LongDistancePrefix: 0 InternationalPrefix: 00 DiadStringRules: etc/dialrules.europe (Important .europe !) ServerTracing: 1 SessionTracing: 11 RecvFileMode: 0600 LogFileMode: 0600 DeviceMode: 0600 RingsBeforeAnswer: 1 SpeakerVolume: off GettyArgs: "-h %l dx_%s" #LocalIdentifier: "Your Company" (uncomment if wanted on the fax) #TagLineFont: etc/lutRS18.pcf (idem) #TagLineFormat: "De %%l|%c|Page %%p sur %%t" (idem) #MaxRecvPages: 25 ModemType: Class2.0 # use class 2.0 interface ModemRate: 57600 # 38400 DCE-DTE communication rate ModemFlowControl: rtscts # XON/XOFF flow control assumed <B>ModemDialCmd: ATDT0%s # I added 0 because I go through a PABX !!</B> #ModemNoFlowCmd: AT&H0&I0&R1 # setup modem for no flow control ModemHardFlowCmd: AT&H1&I0&R2 # setup modem for hardware flow control #ModemSoftFlowCmd: AT&H2&I2&R1 # setup modem for software flow control #ModemSetupDTRCmd: ATS13=1&D2 # setup so DTR drop resets modem #ModemSetupDCDCmd: AT&C1 # setup so DCD reflects carrier (or not) ModemResultCodesCmd: ATQ0X4 # enable extended result codes #ModemSetupAACmd: AT+FAA=1 #ModemSetVolumeCmd: "ATM0 ATM1 ATM1 ATM1 ATM1" Class2BUGCmd: AT+FBU=0 Class2CQQueryCmd: !(0),(0) # override modem response Class2NRCmd: AT+FNR=1,1,1,0 </FONT> </CODE> </PRE> <P>Next the following lines are added to /var/spool/fax/etc/host:</P> <PRE> localhost 192.168.1 </PRE> <P>All machines from domain 192.168.1.0 are allowed to use the fax!</P> <A NAME="lfindex4"> </A> <H2>Starting Hylafax</H2> In order to run <B>Hylafax</B> automatically at startup, use the command <B>drakxservices</B> (with Mandrake) or <B>setup</B> (with Red Hat),<BR> next run manually the command: <PRE> <CODE>/etc/rc.d/init.d/hylafax start </CODE> </PRE> If <B>faxgetty</B> does not exist in the process list (ps -e) try: <PRE> <CODE>/usr/sbin/faxgetty -D /dev/ttyS0</CODE> </PRE> <A NAME="lfindex5"> </A> <H2>Using Hylafax</H2> To send a fax : <PRE> <CODE>sendfax -n -d number file1 file2 ..</CODE> </PRE> To check the result: <PRE> <CODE>faxstat -s (shows fax in the queue waiting to be sent) faxstat -d (shows faxes sent) faxstat -r (shows faxes received) </CODE> </PRE> <P>To remove a fax from the queue:</P> <PRE> <CODE>faxrm number_of_job</CODE> </PRE> To clean the spool : <PRE> <CODE>faxqclean</CODE> </PRE> To show statistics : <PRE> <CODE>faxcron</CODE> </PRE> <A NAME="lfindex6"> </A> <H2>Using Hylafax on a network</H2> <A NAME="lfindex7"> </A> <H3>Configuration of the server</H3> <P>For network use, I chose the resources available from <A href= "http://www.hylafax.org/links.html">http://www.hylafax.org/links.html</A><BR> Particularly <B>Printfax</B> and <B>Repond</B>, on site <A href= "http://www.boerde.de/%7Ehorstf/">http://www.boerde.de/~horstf/</A>:</P> <P>Download these three files:</P> <UL> <LI>printfax.pl (perl script)</LI> <LI>respond.zip (contains respond.exe)</LI> <LI>smb_conf.add (module to add to /etc/smb.conf)</LI> </UL> <P>Copy script <B>printfax.pl</B> in /usr/bin/ and modify it such that it works with hylafax :</P> <PRE> <CODE><FONT size="2">### Format of commandline # $cmdlinefmt='mgetty'; $cmdlinefmt='hylafax'; ### The faxspoolprogram ### for mgetty+sendfax: # $faxspool = '/usr/bin/faxspool'; ### for hylafax: $faxspool = '/usr/bin/sendfax'; ### Additional faxspool args (e.g. header, coverpage) ### empty: @faxspool_args = qw(-n); ### for mgetty+sendfax with a special header: # @faxspool_args = qw( -h /usr/local/etc/mgetty+sendfax/faxheader.smb); ### for hylafax with send email when job is done or requeued and use ### a4 sized paper: # @faxspool_args = qw(-D -R -s a4); </FONT> </CODE> </PRE> <P><U>Note :</U>Cross check your script version of <B>printfax.pl</B>, as modifications might have taken place!</P> <P>Add module <B>smb_conf.add</B> in <B>/etc/smb.conf</B> using copy/paste:</P> <PRE> <CODE> [Fax] comment = Fax Printer public = yes postscript = yes print command = ( /usr/bin/printfax.pl %I %s %U %m; rm %s ) & printable = yes writable = no path = /var/spool/samba </CODE> </PRE> <P>Check line <B>print command</B> especially with windows2000</P> <P>Samba must now be restarted,</P> <PRE> <CODE>/etc/rc.d/init.d/smb restart</CODE> </PRE> <A NAME="lfindex8"> </A> <H3>Configuration of a client</H3> <P>Here is a typical Client Configuration for WINDOWS 95,98,NT,2000... Install Respond.zip, which contains config.exe and respond.exe files :</P> <UL> <LI>Copy these two files in c:\windows (or else)</LI> <LI>Make a link for respond.exe in menu START->PROGRAMS->Start (You will have to find how to do that with win2000)</LI> <LI>Run respond.exe or restart the computer (your choice)</LI> </UL> <P>Next a networked printer must be created:</P> <UL> <LI>Click on START->printers->add</LI> <LI>Choose your network printer</LI> <LI>Select "browse" and choose the FAX printer on the network (Samba printer)</LI> <LI>Select the driver HP -> HP Laserjet 4/4m postscript</LI> <LI>Do not print a test page</LI> <LI>Once the printer is created, go to START ->Printers and click the FAX printer (properties)</LI> <LI>In the properties dialog click the details tab and the button of the spooler</LI> <LI>Check "Start printing after the last page"</LI> </UL> <P>This is the end of the road, open <B>Wordpad</B>, type any text and print it on the fax printer! The respond dialog box then appears (if you started respond.exe) asking you the fax number, just enter the number and Ok, your fax is going to be sent to the fax server <B>hylafax</B></P> <P>In order to check the correct behaviour, go to the server and type <B>faxstat -s</B>, your fax should be there.</P> <P>Typical Client Configuration for Linux :</P> <P>Use available utilities on the Hylafax site!</P> <A NAME="lfindex9"> </A> <H2>Mailing with Fax</H2> <P>Mailing with the fax is done locally on the server with StarOffice.<BR> <BR> On the other hand, your database can be anywhere on the network and is accessed using StarOffice(ODBC,JDBC,...) Use the <B>spadmin</B> utility and configure the telefax output: <B>faxspool (PHONE) (TMP)</B></P> <P>Inside the document to fax put @@#num_tel_fax@@ transparently with a database field name instead of num_tel_fax</P> <P>Read the StarOffice help, everything is explained!<BR> <BR> The drawback of this method is that you have to install StarOffice on the fax server :-( Fax Mailing through the network using respond is not straightforward with StarOffice because a fax number must be entered manually for every recipient!<BR> I am investigating at the moment an alternative solution. <A name= "s8"></A></P> <A NAME="lfindex10"> </A> <H2>Resources</H2> <P><A href= "http://www-phase.c-strasbourg.fr/inform/faxdoc/expose_fax/fonctionnement.html"> <FONT face="Arial, Helvetica, sans-serif" size= "-1">http://www-phase.c-strasbourg.fr/inform/faxdoc/expose_fax/fonctionnement.html</FONT></A><BR> <A href="http://www.hylafax.org"><FONT face= "Arial, Helvetica, sans-serif" size= "-1">http://www.hylafax.org</FONT></A></P> <A NAME="lfindex11"> </A> <H2> Notes from the author</H2> <P>If you find this document incomplete or filled with faults, please wrtite to <A href= "mailto:contact@hacklinux.org">contact@hacklinux.org</A> And if you have some spare time, think about signing the no patents request! </P> <!-- vim: set sw=2 ts=2 et: --> <!-- 2pdaIgnoreStart --> <A NAME="talkback"> </a> <h2>Talkback form for this article</h2> Every article has its own talkback page. On this page you can submit a comment or look at comments from other readers: <center> <table border="0" CELLSPACING="2" CELLPADDING="1"> <tr BGCOLOR="#C2C2C2"><td align=center> <table border="3" CELLSPACING="2" CELLPADDING="1"> <tr BGCOLOR="#C2C2C2"><td align=center> <A href="http://cgi.linuxfocus.org/cgi-bin/lftalkback?anum=196&lang=en"><b> talkback page </b></a> </td></tr></table> </td></tr></table> </center> <HR size="2" noshade> <!-- ARTICLE FOOT --> <CENTER><TABLE WIDTH="95%"> <TR><TD ALIGN=CENTER BGCOLOR="#9999AA"> <A HREF="../../common/lfteam.html">Webpages maintained by the LinuxFocus Editor team</A> <BR><FONT COLOR="#FFFFFF">© HackLinux, <a href="../../common/copy.html">FDL</a> <BR><a href="http://www.linuxfocus.org">LinuxFocus.org</a></FONT> <BR><a href="http://cgi.linuxfocus.org/cgi-bin/lfcomment?lang=en&article=article196.shtml" target="_TOP">Click here to report a fault or send a comment to LinuxFocus</A><BR></TD> <TD BGCOLOR="#9999AA"><!-- TRANSLATION INFO --> <font size=2>Translation information:</font><TABLE> <tr><td><font size=2>fr</font></td> <td><font size=2>-></font></td> <td><font size=2>--</font></td> <td><font size=2><a href="mailto:contact@hacklinux.org"><FONT COLOR="#FFFFFF">HackLinux</FONT></a></font></td> </tr> <tr><td><font size=2>fr</font></td> <td><font size=2>-></font></td> <td><font size=2>en</font></td> <td><font size=2><a href="mailto:johnperr@linuxfocus.org"><FONT COLOR="#FFFFFF">John Perr</FONT></a></font></td> </tr> </TABLE></TD> </TR></TABLE></CENTER> <p><font size=1>2001-04-27, generated by lfparser version 2.13</font></p> <!-- 2pdaIgnoreStop --> </BODY> </HTML>