
This is my entry into the e-mail to fax gateway arena. The details
below work for me; your milage may vary.

First, the standard disclaimer. The University of Illinois, and the University
of Illinois Board of Trustees is not liable for any damage which may result 
from use or abuse of this software. Use it at your own risk.

Second, some thanks. These files are based on Dirk Husemann's mail-to-fax
gateway. The faxmailer-agent perl script is basically his. I've cleaned it
up a bit, removed some extra functionality (which we, at UIC, will not use),
and added better header parsing for incoming mail. Thanks Dirk! You'll need
Dirk's package, also available from sgi.com. Follow the instructions for
installation in his instructions. The below is IN ADDITION TO Dirk's package.

	That said...

"How to set up an e-mial to fax gateway" or
"Finally Figure Out That E-mail Gateway Stuff"

At UIC, we use the e-mail format arbitrary_string@fax.uic.edu for faxes.
This format lets us send faxes to BobJ66834@fax.uic.edu and
JohnA66834@fax.uic.edu. The reasoning behind this is historical at UIC. In
any case, the following instructions will allow you to send e-mail to
somenumber@fax.yournode.yourdomain and have FlexFax (or any other fax package,
I assume) queue the file for transmission. For below, replace "fax.uic.edu"
with whatever you want your fax desination to be called, like "fax.blah.edu".


1. Edit the /etc/sendmail.cf file. There are two lines you must add. First,
define a fax mailer, called fax, with the line

Mfax, P=/usr/local/bin/faxmailer, F=msDFMuL, S=16, R=26, E=\r\n,
	A=faxmailer $h $u

This is also documented in Dirk's documentation.

Second, add this entry to rule set 0. It's best to be the first rule in
S0, since it'll be evaluated first, without any name changes.

R$+ < @ fax.uic.edu >	$#fax#@fax$:$1

It may be necessary to use "fax.uic.edu." instead, as some mailers (like
sendmail 8.6.9) require the trailing dot. This command tells sendmail that
when it sees mail destined for fax.uic.edu to route the mail to the 'fax'
mailer defined above.

2. Have your namserver person add an MX entry for your fax domain.  NOTE:
This entry MUST be an MX record; it can NOT be a CNAME. It just won't work!

3. Copy parser.pl to /usr/local/lib/perl . perser.pl is a Perl library to
handle RFC822 header parsing, so that you don't need to tell people to use
66834/TO=Bob_Jackiewicz@fax.uic.edu. With mine, you can use the standard
"Bob Jackiewicz" <66834@fax.uic.edu> and it'll parse out the name and phone
number. If the name doesn't exist, it'll use the phone number as the To:
on the cover sheet. So, if you can't make a To: field like above, you can
use  <bob_jackiewicz66834@fax.uic.edu> and that will make a nicer To: field
than just a phone number.

Explaination here. Dirk suggests that you make faxmailer set-uid to uucp. I
couldn't get this to work, so my faxmailer runs as daemon.staff. Therefore,
the two ids need to be members of those groups in order to be able to send
back the ORIGINAL text found in the orig directory. If you don't want this
feature, you don't have to do steps 4, 5, and 6.

4. Create directory /usr/spool/fax/orig with permissions 770, owner uucp.staff.
I made this directory so that the original text can be sent back to the
client when the fax dies, for some reason. Telling people to "uudecode, untar,
and resubmit with sendfax..." doesn't go over well for e-mail gateway users.

5. Replace /usr/spool/fax/bin/notify.awk with the one which comes with this
package. This notify.awk will erase the files in the orig directory when done.

6. Make uucp and daemon members of group staff.  This group stuff may
need to be modified to your system's preference. You may want to create a 
new group, called efax which can handle all the permissions for the orig
files. It's up to you. But if things don't work, check your group set.

That's basically it!

I also added the ability to send PostScript files through mail and have
them be recognized as such, and sent out. The mail file must start with
%!PS as the first non-blank line after the header in order for it to be
recognized as a PS file. I've encountered one PS job which ran fine under
my account, but failed when sent as a fax. I haven't figured it out yet.
Also, some mailers might chop records at 80 columns, so you should tell 
your users that they should (if possible) create PS files with lines <= 80
characters.

I also added phone number canonicalization in faxmailer-agent as the
one built in to FlexFax seems a bit flakey (read: I didn't bother
trying to figure it out :-) ). You can keep it or dispose of it as you see
fit.

I put this down from my head, so it may not be complete. There's some
debugging left in, which you can take out. It's simple prints. If you have
any questions, feel free to send me mail. I'll try to help you as best I can.
I can be reached at bobj@uic.edu.

		Good luck!
