faxspool(1) / faxqueue(5): please comment

Gert Doering (gert@greenie.muc.de)
Sun, 6 Mar 1994 15:34:16 +0100


Hi,

Uwe Fuerst wrote:
> > faxspool(1)           mgetty+sendfax manual           faxspool(1)
> > ....
> > 
> >        If   "phone-number"   contains   non-numeric   characters,
> >        faxspool interprets it as an alias and tries to look it up
> >        in /usr/local/lib/mgetty+sendfax/aliases and $HOME/.faxnrs
> >        .   These  files  have  a very simple format: one line per
> >        alias, alias name first, blank, phone number.
>                                   ^^^^^
> Just an idea: could you extend this to accept <TAB> (or preferable
>               two or more TABs) as well? This would make the files
>               a little more readable

Basically I thought of changing the format to

alias:phone:verbose_to
	    ^^^^^^^^^^ as if specified with "-D <verbose_to>".

- but you're right, TABs have their advantages. Should be easy, though.
I'm just not sure what to do with the "verbose_to" extention - what about

alias<whitespace>phone<whitespace>verbose_to

- easy, except the fact that "verbose_to" may contain whitespace itself
("uwe<tab>099013692<tab>Uwe S. Fuerst").

> >        Access control is handled similar  to  the  way  "crontab"
> >        does it:
[..]
> What happens if both files are there?

In faxspool, fax.allow has precedence, and that's how I understood the
crontab manpage.

Does anybody know how crontab does it?

> >        -M <file name>
> >               Multicasting - read a list of telephone numbers  to
> >               send  the fax to from the given file. Do not use in
> >               conjunction with "-m".
> 
> What format does this file have? Each number in a single line?

I thought of

phone/alias[<whitespace>verbose_to]

- comments anybody? (Nevertheless, it's not implemented yet).

> > FILES
> >        /usr/local/lib/mgetty+sendfax/aliases
[..]
> Well, I'm not very happy with this path values, but I can live
[..]
> time, you could add some "sed ..." lines to the Makefile, changing
> these path values to the configuration settings...

OK, TODO list, number 87.

> >        faxspool cannot do time scheduling
> 
> Is this on your TODO list? If so, you should think of leaving
> it out of the "usage" message one gets when invoking "faxspool"
> w/o any parameters, 'till it's implemented

$ faxspool

faxspool: phone number missing
Usage: faxspool [-p] [-f mailaddr] [-u user] [-q] [-D dest] phone file ...

[FAXQUEUE.5]
> >        pages <file(s)>
[..]
> >               the user that runs faxrunq(1). Required.
> 
> Required? We don't have such a file when we spooled a "fax polling"
> job, do we?

True. Faxrunq even handles it (more or less accidentally ;-) ). Changed
that.

> > PROCESSING
> >        While a given JOB file is processed  by  faxrunq(1),  it's
> >        locked  against  sending  it  multiple times by temorarily
> >        renaming it to JOB.locked,  thus  it  may  happen  that  a
> >        faxq(1) command doesn't show this job.
> 
> What 'bout adding some lines of code to faxq(1) to show this "locked"
> jobs as "currently beeing send" or something like this :-)

Lemme first add code to faxrunq(1) to actually lock it... it's promised,
but I did not yet get around to actually doing it (answering mail all day
;-) ), then I can try to think of a way to avoid having to triple-check
for the JOB file (it may have been moved from JOB.locked to JOB or vice
versa between "ls" ing all the job files and opening them!).

> >        When  a job is successfully sent, it's not deleted but the
> >        JOB file is renamed to JOB.done.  Because of this, you can
> >        still  see  old jobs with "faxq -o". You should regularily
> >        clean up the outgoing fax directory, removing  old  faxes.
> 
> One could do this by a cronjob, similar to the "cleantmp" facility,
> like
> 	find <faxspooldir> -atime +<days> -exec rm -f {} \;

That's what I'm doing right now, but I'm thinking of a "faxcleand" daemon,
that will also notify the fax admin if it finds stale "JOB" files ('cause
faxrunq isn't running), and handle stale JOB.locked files (because faxrunq
crashed for whatever reason).

> (look at "/usr/lib/cleantmp" on SCO systems to get an idea of what
>  I mean)

Yeah... 

> >        When  a  job cannot be sent in five tries, the JOB file is
> >        renamed to JOB.suspended.  To re-queue  this  job,  rename
> >        the JOB file back and remove all the "Status" lines in it.
> 
> This could be done by a yet to be written script faxreq(1) :-)

I include the code line to do it in the mail - so you can just cut'n paste
the command to another window and execute it there... ;-)

gert

-- 
Ok, Ihr habt gewonnen, hier ist eine neue signature...

Gert Doering - Munich, Germany                             gert@greenie.muc.de
fax: +49-89-3243328                         gert.doering@physik.tu-muenchen.de