Last updated: January 23, 1995 bobj@uic.edu 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 are 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=SmsDFMuL, S=16, R=26, E=\r\n, A=faxmailer $h $u This is also documented in Dirk's documentation. The S flag means to run the mailer program as the root user. This is needed for one reason. If mail comes in via SMTP, the faxmailer script is run as user daemon. If the mail originates on the same machine that your MX points to, then the script is run as the user submitting the fax via mail. If this happens, I get a Perl "Insecure Dependancy Error" which I don't try to understand, but never the less, it doesn't work. If you won't have users on the same machine submitting faxes, then you can do without the S flag, and the processes will be run as daemon. The E=\r\n must be there so that the perl script knows when the end of header has been reached. One change from Dirk's code here is that faxmailer.c (for me anyway) did not work as supplied. I had to change the setruid() call to setuid(). The way it's distributed, I get a mailer configuration error. 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 sendmail 8.6.9 requires the trailing dot. Other sendmails may vary. This command tells sendmail that when it sees mail destined for fax.uic.edu to route the mail to the 'fax' mailer defined above. Note: If you're using the .mc config files in Berkeley sendmail, you can use LOCAL_RULE_0 R$+ < @ fax.uic.edu. > $#fax$@fax$:$1 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 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 program is not setuid, but is run as root because of the S flag in the mailer definition. 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 /var/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 on various types of architectures, with various degrees of expertise. 5. Replace /var/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 %! as the first non-blank line after the header in order for it to be recognized as a PS file. 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 do a check of the top of the body for any lines which might begin with PostScript-like code. 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 assume it's also easier to add restrictions for 900 and 976 numbers in the US (in the US, those numbers cost lots of money just for connecting). I am running this on an RS/6000, with AIX 3.2.5, and sendmail 8.6.9, and it works. 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 as well as some mail which is sent to my account. Change the $human variable. 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! Bob Jackiewicz