4. Remote Faxing

Contents of this section

If you want to send the fax via e-mail to a remote fax server, you should use the function tex-send-fax-mail (C-c C-m). Apart from the different function name, the handling is the same as for tex-send-fax above. The way the fax takes is:

That is, each file is encoded if appropriate and concatenated together with a smart e-mail header. Each fax appendix is represented by a MIME attachment. You could view everything with a MIME-compatible mailer. Or send a fax directly from Netscape or Z-Mail to the fax server. Have a look at faxmail if you like. It's straightforward. Since I leave the handling and conversion of files to faxspool (why re-invent the wheel?), it's simple too. The bad news is that the file formats you can send are restricted to those which are recognized by faxspool.

4.1 Setting up the remote fax server

You have to set up a "fax" e-mail alias (or whatever you like to name it) in your /etc/aliases, just like,

fax: |/usr/local/etc/mgetty+sendfax/mail2fax.pl

Plus, you must maintain the file fax.allow (as you have to with faxspool). Simply put anyone's e-mail address into the file who should be able to fax. fax.allow must be world readable because mail2fax.pl will run as "nobody". "nobody" must certainly be in fax.allow, too.

In mail2fax.pl, you should adjust all the directories and paths in the first section to reflect your actual setup. Please note that mail2fax.pl needs Perl 5 and mmencode from the metamail package.

faxmail, its counterpart, needs metamail as well. Be sure to adjust the MAILER shell variable at the beginning of the script. faxmail must be installed on the fax "client" machines! It's best to install the entire package on each machine. Only mail2fax.pl needs Perl, so there doesn't need Perl to be installed on the clients.

There's one quirk with faxspool. The script nowhere defines a PATH variable and thus relies on what it's being given from the calling process. sendmail, however, restricts the PATH given to child processes to /bin:/usr/bin for security reasons. This is not enough. In mail2fax.pl, you should define the variable $path to include all necessary directories for the tools called by faxspool (usually /usr/local/bin for the PBMtools and Ghostscript and /usr/TeX/bin for dvips). If you don't do this, faxspool will not be able to process the files given on the command line.

If you are unsure which PATH to set, send yourself a MIME message with attachments. Save it to a file. Then,

su - nobody
PATH=/bin:/usr/bin /usr/local/etc/mgetty+sendfax/mail2fax.pl < <file>

and watch what happens. If faxspool can process everything fine (check with faxq when it's done), you're on the safe side. Otherwise watch why and where faxspool fails (a set -x near the beginning helps!) and add the respective directory to the $path string in mail2fax.pl. Easy, isn't it? OK, it could be smarter.

You have three options for sending faxes via e-mail:

4.2 Without tsfax, without faxmail

If you don't use tsfax nor faxmail to send MIME faxes to the fax server, be sure to include the following lines in exactly this sequence in your e-mail:

Fax-Res: $RES
Fax-Dest: $DEST
Fax-No: $PHONE

Replace $RES by -n if you want normal resolution, else leave it empty. $DEST is the name of the recipient, $PHONE his fax number.

Sending MIME attached appendices works fine from Netscape. Don't forget to convert HTML pages to Postscript before sending them -- faxspool has no HTML converter. And yes, you can also read such MIME mails with Netscape... So you can CC them to yourself or someone else.

Your first MIME attachment should be your coverpage. Alternatively, you can add a

Fax-Text:

header after the Fax-No: header. Everything from there to the end of this part of the MIME message will be used as a coverpage, albeit a simple one. This is for people who want to use only Netscape or a MIME capable mailer for faxing. See the file sample.mail as an example.

4.3 Without tsfax, with faxmail

faxmail works just like faxspool and has some of the same command line options. Example:

/usr/local/etc/mgetty+sendfax/faxmail -a fax@seneca.muc.de \
      -D "Lola" 01234567890 lola.dvi ~/tmp/germany.gif

If you use faxmail, you don't need to care for the lines above. Your first file (lola.dvi in the above example) becomes the coverpage.

4.4 With tsfax

If you use tsfax to write and send your faxes, you can handle everything from Emacs. The file you write becomes your coverpage as usually. In this case, faxmail cares in the background for the above mentioned lines in your mail message.


Next Chapter, Previous Chapter

Table of contents of this chapter, General table of contents

Top of the document, Beginning of this Chapter