Here's a blueprint for v2.0 of the Qfax suite, submitted to the list
for your comments and feedback.  Much of what's proposed here has
already been done, but if you can think of additions or improvements
then by all means speak up before I do something rash and release the
next version :)


(1) More Security:

The efax fax script is replaced by a cluster of binaries that use efax
in various ways.  This makes the system less prone to script-hacking,
and more modular, letting you install certain utilities for the use of
root and/or FaxMaster only, while others can be used by all users.

Qfax will no longer rely on environment variables to determine the
user's login name or home directory; this information will be looked
up with the appropriate library routines such as getlogin() and
getpwnam().

None of the binaries in the Qfax suite will need to be setuid root.
The highest level of permission required is that of uucp, in order to
write and remove lock files, and checking for (uid == euid) is
implemented when this is necessary.


(2) Remote Access via Networking:

As some of you requested, Qfax will now support connections from
remote machines via TCP.  The Qfax daemon (qfaxd) will sit at port
4560 (port number is configurable) on the host with the fax-modem and
await client connections from qfax or qsend on remote machines or the
local host.

Client operations include sending faxes, retrieving faxes from the fax
spool, viewing the incoming and outgoing fax queues, and removing
queued jobs.  Features such as fax viewing and printing remain local
operations, however, as they should be.

Access is restricted by qfaxd, which looks up the client user's
address in an authorization database (fax.auth) before offering any
fax services.


(3) Remote Access by Email:

For those remote users who can't use TCP networking to send faxes,
Qfax will also support a fax-by-e-mail mechanism.  By sending mail to
"fax@your.site.domain" with the appropriate fax information contained
in X-Fax-* headers, users can send faxes from any e-mail-equipped
host.  Naturally, Qfax looks up the requestor's address in the
authorization database (fax.auth) before granting any fax services.


(4) Fax-by-Number Support:

Also by request (thanks Giuseppe Zanetti), Qfax will now understand
e-mail addresses of the form "user@555-1212.fax" for those occasions
when you want to fax someone who isn't in your fax phonebook and don't
feel they're worth adding.  In this case, Qfax relies on the rest of
the cover page information being supplied through X-Fax-* headers in
the body of the message; otherwise default or blank entries are inserted.


(5) Fax Priority and Restriction:

The fax authorization file (fax.auth) allows you to list the users you
want to allow to send faxes, and to assign each of them a base
priority [0-10].  A priority of 0 (or no matching entry) means the
user cannot send faxes at all.  Priorities 1-10 allow local phone
calls only, while 11-20 allow long-distance faxes as well.

User addresses can be specified with wildcards ("generalized regular
expressions," for the technically-inclined), so you can essentially
create permission "masks" such as:

	.*@.*\.mycompany\.com		5

which would grant any user on any host at mycompany.com a base
priority of 5 (local calls only).

The priority system does more than just allow/deny services.  The
user's base priority gets multiplied by the fax priority he sets in
the X-Fax-Priority header of his fax to determine the final priority
of that fax.  This determines the order in which faxes get sent out.
The priority levels I have in mind at the moment are:

	Nice		     1
	Normal (default)     5
	Rush		    10
	Urgent		   100

Thus, if your personal priority is 5 and you want to send a "Rush" fax
to someone, the priority of your fax would be 50.

The idea behind these definitions is to better manage system
resources.  While "Normal" implies "send when you can," "Nice" implies
"send when it's convenient for you" (i.e. when load levels are below a
certain value, when phone rates are lowest, etc.).  "Rush" implies
"send as soon as practical," and "Urgent" implies "send it now!"
Urgent faxes will be sent out immediately if possible, IF the fax's
total priority is 500 or greater; this allows you to restrict this
immediate-send feature to users with a basic priority of 5 or more.


(6) X-Fax-* Headers:

You can now supply virtually all cover page information through
specialized e-mail headers, which can override any defaults from your
phonebooks.  In fact, if you're using fax-by-number or fax-by-e-mail
you HAVE to supply some of the missing cover page information with
these headers.  These include:

	X-Fax-To:
	X-Fax-Attn:
	X-Fax-To-Phone:
	X-Fax-To-Fax:
	X-Fax-From-Phone:
	X-Fax-From-Email:
	X-Fax-Comment-Start:
	X-Fax-Comment-End:
	X-Fax-Priority:
	X-Fax-Attach:

You cannot supply different "From:" or "From Company:" information,
however, as a security feature.  "From Company:" information should be
set centrally on the host where the fax-modem is installed, and
"From:" should be provided directly by the user's host.  You can,
however, supply a different return address with "X-Fax-From-Email" to
have recipients respond to a different e-mail address, and similarly
you can change the return phone number "X-Fax-From-Phone".  You cannot
alter the return fax number, however, since by law (at least in North
America) this must be the phone number of the sending fax machine.  If
you need to direct the recipient to a different fax number, the
"X-Fax-Comment-*" section should suffice.


(7) Attachments and MIME Support:

Qfax will now support attachments of two varieties--its own internal
attachment format, and MIME/Metamail attachments.

By supplying a comma-separated list of files with the "X-Fax-Attach"
header, you can have Qfax include other text or graphics files at the
end of your faxes.  Qfax is GIF-, JPEG-, and DVI-aware at the moment,
but through a user-customizable mailcap-like file (qattach.rc) you can
specify which programs should be invoked to convert files with
particular extensions into G3 faxes.  This attachment system,
incidentally, will work remotely as well--the files for attachment are
attached on the local host BEFORE sending the fax to qfaxd.

For those of you who use MIME/Metamail, your existing mailcap file
can be used for this purpose.  Thanks to Andrew Daviel
(advax@triumf.ca) for making me Metamail-literate and for developing
the Metafax patch for Qfax.  Basically, if your mailer supports
MIME/Metamail extensions, you already have the ability to incorporate
attachments such as graphics files; Qfax now knows how to parse this
mail format and make a multi-part fax out of it.

Naturally, you can't send audio or video files by fax (it would be
pointless to send a uuencoded file by fax :), so you'll be mailed a
nasty message by Qfax if you try :)


(8) Auto-Configuration:

The efax fax script contains a lot of obscure modem configuration
commands that generally require a bit of tweaking before you get the
whole thing working properly.  The "fax test" option is a good
diagnostic, but you still need to be able to understand its output to
make the configuration changes by hand.  Qfax will now offer you a
utility which can figure out what commands your modem will and will
not support, and can make the necessary configuration changes for you.
You can still do everything by hand if you like, but for those who
seem to be having trouble getting everything configured, this may be a
valued addition.


(9) Address Look-Ups for Received Faxes:

When a fax is received, Qfax will now try to identify the sender by
looking up the sender's station identifier in the central phonebook
(fax.db).  If it finds a matching entry, the sender's company name
will be used to identify the fax a bit more clearly.  In other words,
instead of sending FaxMaster a note saying "I received a fax," the
note might read "I received a fax from ACME Corp."  If it can't find a
matching entry, the note will read "I received a fax from +6045551212"
or whatever the station identifier string happened to be.  If the
station identifier is empty (null), the note will read "I received a
fax from an unknown sender."


(10) Debugging Features:

There will also be more debugging support in v2.0, since a number of
you were having a hard time figuring out what was wrong, and where
Qfax was failing.  By invoking qfaxd and qfax with a debugging flag
such as "-xn" where n is a debug level from 0 through 9, you can have
these programs log significant events and error messages to a file.


(11) Bug Fixes:

Qfax now understands that the "From:" and "To:" fields in a mail
header can be written several ways (thanks again to Andrew Daviel for
pointing this out and doing a little header research :).  It's now
much more flexible in interpreting these fields.  Since mailers like
Sendmail allow you to customize the format of your mail headers,
there's no way Qfax can be expected to handle EVERY conceivable
format, but it will correctly interpret the following:

	user@domain
	<user@domain>
	user@domain (Full Name)
	user@domain <Full Name>
	Full Name (user@domain)
	Full Name <user@domain>
	"Full Name" (user@domain)
	"Full Name" <user@domain>
	"Full Name, Other Information, ..." (user@domain)
	"Full Name, Other Information, ..." <user@domain>

Only outgoing headers matter to Qfax, since it doesn't receive faxes
as e-mail, so generally you have control over the format your mailer
uses to write the "To:" and "From:" headers in your outgoing mail
(have a look at your sendmail.cf file, for example).  I'm not going to
have a lot of sympathy, then, for those who can't get Qfax to work
with their esoteric header formats; there's only so far Qfax can be
expected to bend in the name of accommodation.  I WILL provide a short
tutorial on how to modify your sendmail.cf file to write headers in a
reasonably "standard" format that Qfax understands, however.

As you can imagine, Qfax 2.0 is a very different beast than its
predecessor, so I will not be shipping patches for 1.x.  Likewise, the
fax.rc files you now have will become obsolete, replaced by a number
of more specific and modular config files.
