configure: Modern C++ compilers no-longer support the STL <file.h> syntax
It's been depricated for years now, and finally, support is being
removed from modern compilers. I haven't found a compiler old enough
(even GCC 2.7 suppors the "new" syntax) to not support modern syntax.
faxgetty/faxsend: Correct Include config file parsing
If we're parsing a config file "Include" statement, we recursively call
readConfig, with the new file. We need to make sure our "before/after
parsing" logic isn't defeated by this recursion.
Patrice Fournier [Thu, 19 Jun 2008 20:42:17 +0000 (20:42 +0000)]
notify: have faxq *always* run notify
From Aidan:
This allows the admin to use FaxNotify to directly manipulate when
notifications are sent. The knowledge of when to send the notify emails
is now in notify.sh.in
Patrice Fournier [Fri, 13 Jun 2008 19:04:59 +0000 (19:04 +0000)]
Re-visited tmpdir creation
- Now create private tmpdir in $TMPDIR if it is set by the admin.
- Try to use mktemp first and fallback to directory named
hylafaxtmp-$RANDOM-$RANDOM-$RANDOM-$$
- Use a private TMPDIR variable to make sure CleanupPrivateTmp only
clean OUR tmpdir.
Patrice Fournier [Fri, 30 May 2008 22:06:35 +0000 (22:06 +0000)]
common-functions: enhancements to parseQfile
This enhances parseQfile to:
1) Allow a "prefix" that all variable names start with
2) Allow a specific file to be parsed instead of $QFILE
3) Exports *all* qfile variables
This built on what Lee's work started:
| commit e34950281e6245e19d03bf23ecc5db782f9ab4f2
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Mon Oct 8 16:47:44 2007 +0000
|
| Small modification allows other parseQFile-using scripts to prevent variable
| namespace collisions and "easy" exporting using:
|
| source bin/common-functions
| parseQfile "SOMETHING_"
| export "${!SOMETHING_@}"
Aidan Van Dyk [Fri, 2 May 2008 17:57:59 +0000 (17:57 +0000)]
hfaxd sorting based on the *SortFormat variables
This introduces the following new protocol commands
MDMSORTFMT <format>
JOBSORTFMT <format>
RCVSORTFMT <format>
FILESORTFMT <format>
These commands take the exact same format specification as the related:
MDMFMT <format>
JOBFMT <format>
RCVFMT <format>
FILEFMT <format>
If one of them is set, when the server generates the listing for the
status, sendq/doneq, or recvq, it will sort the list using the specified
format before sending it to the client. They all default to nothing,
which allows hfaxd to send output directly to the client with no sorting.
The administrator can change the default value for these in hfaxd.conf.
It also introduces a new hfaxd boolean config option:
AllowSortFormat
This defaults to true to allow the client to specify the sorting
format, and the administrator can set it to false to not let the client
request a different sorting format. This allows the adminstator to make
sure the server doesn't sort at all, or to only use the sorting set in
hfaxd.conf.
The previous patch that fixed RECV_BEGIN, RECV_END and MODEM_CID triggers
actually brok RECV_START, RECV_PAGE, and RECV_DOC triggers.
This fixes the remaining 3, and combines the MODEM_ and RECV_ paths to
make it more clear what's going on.
This is the real fix for Lee's:
| commit 134af2ec4bbbc0be5e1c75f917b38c5236740a1c
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Sun Mar 16 08:08:21 2008 +0000
|
| Another one of these... make sure that we stay within bounds.
|
| It would seem that the FIFO messages were supposed to have some information
| in them that is not there... for some reason.
Based on:
| commit 18141065e3f30c95d4bb4b20d1a0d7a6414b2af4
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Mon Nov 26 21:59:09 2007 +0000
|
| If the client was disconnecting when not being in the root directory then
| the client's FIFO file was not getting deleted because it was looking
| in the wrong place for it.
| commit de026506294a4b8fcb309d98d4485d8671f9cc19
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Tue Mar 11 17:44:11 2008 +0000
|
| Reinhard Pfau submits some improvements to client FIFO cleanup.
|
| Sourceforge tracker ID 1911860
Before we batch a job, we need to make sure it's "OK" to send, OK being:
- hasn't gover over it's maxdials/maxtries
- It fits in any maxpages restrictions
- JobControl hasn't "rejected" it
- JobControl hasn't "delayed" it with TOD restrictions
Noticed from work Lee did on the old scheduler:
| commit d79fed7a0c46142f9bf9fa1c87f521d40eeb6b27
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Thu Mar 13 18:28:43 2008 +0000
|
| TimeOfDay needs to be considered before batching.
CallID: Initialize answerlength on depricated CIDName/CIDNumber config options
From Lee:
| commit 78e09ec251ea78608a2acab5d2476c0f95768fb3
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Thu Feb 7 21:09:48 2008 +0000
|
| The CallID types are not being initialized when CIDName or CIDNumber are
| being used in lieu of CallIDPattern.
From Michel Petrazzo through Lee:
| commit bd45320fb137a813ae50b790f596fd3903e209fd
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Thu Feb 7 20:15:30 2008 +0000
|
| Michele Petrazzo offers a "restart" enhancement to the init script.
Class1: Be more lenient on handling NO CARRIER response
From Lee:
| commit 1779a3ff4cf0e68f5eb67cbe54b8174e761d29fc
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Wed Jan 16 19:03:42 2008 +0000
|
| The meaning of a direct NO CARRIER response/result to the AT+FRH=3
| command can be interpreted two ways due to wording in ITU T.31.
| The more traditional interpretation is that it is out-of-spec: that
| a NO CARRIER response should only come after a CONNECT message.
| However, T.31 gives sample sessions that illustrate precisely this
| kind of out-of-spec sequence:
|
| <-- AT+FRH=3
| --> NO CARRIER
|
| And the interpretation is clear to indicate that in this case the
| modem detected a carrier, but it apparently was not V.21 HDLC, and
| the NO CARRIER response indicates that the indeterminate carrier
| has dropped. This functionality is more cumbersome than it is
| helpful (its value is not much different than that of an AT+FRS=1
| command), and what it really means is that we just need to re-issue
| the AT+FRH=3 command until we get something useful as this scenario
| will most likely occur on incidence of Phase C premature carrier loss.
From Lee:
| commit 1503c6f60ebf22eaec61b751592046c38d82f288
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Fri Feb 1 01:57:21 2008 +0000
|
| Bernd Krumböck helps get HP-UX socklen_t building tidied up.
From Lee:;
| commit 24d2150b1f467e2fbdf12fe9d487cb5d647323c6
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Wed Dec 26 18:24:27 2007 +0000
|
| Max Mothwurf complained that "last week" means a Sun-Sat or Mon-Sun duration,
| so to be clear that faxcron means "the last seven days" say it that way.
PollLockPokeModem: check on modem when lock file is polled
From Lee:
| commit 78114b9300badd714f44f8b25a919b09605f3ac6
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Thu Dec 6 18:19:28 2007 +0000
|
| Adds PollLockPokeModem
|
| When polling for the presence/removal of a UUCP lockfile, also test to make
| sure the modem is still reachable. This is useful for scenarios where the
| modem is apt to become disconnected while the modem is idle, such as an
| external modem that may lose power, where the administrator wants notification
| of this (as a ‘‘wedged’’ condition).
Time formats: Make them concistantly *always* HH:MM:SS
From Lee:
| commit 640974099533468fbbc4844d9f0f0c88f6310505
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Thu Nov 15 21:31:28 2007 +0000
|
| This causes the fmtTime() time format to always include hours.
|
| Logs like this:
|
| JOB 1086 (sleeping dest +1234 pri 126 tts 4:58 killtime 4:58:00): SLEEP FOR 4:58
|
| Just aren't that intuitive with respect to the "4:58". To some readers that
| may normally mean 4 minutes and 58 seconds... but to others it may look like
| four hours and 58 minutes.
|
| One such "reader" is MySQL where "4:58" will be interpreted as nearly five hours
| instead of nearly five minutes. In order to communicate the proper time one must
| use "0:04:58".
|
| So to interface things one constantly needs to parse the fmtTime()
| output to add the hours (if not present). Let's save everyone a headache and
| simply always include hours to the fmtTime() time format.
|
| JOB 1086 (sleeping dest +1234 pri 126 tts 0:04:58 killtime 4:58:00): SLEEP FOR 0:04:58
|
| That's a lot more clear to understand.
| commit 201b91d031bd987c453f6452a7bb6cc45d17638b
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Tue Dec 11 20:16:50 2007 +0000
|
| Times in excess of 99:59:59 were getting formatted as ??:??:??. This
| will give us the full number of hours, up to a year's time.
Based on orignal work from Lee:
| commit 32525756162d43e98d0df8761c94f9ba262ad37a
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Thu Jan 31 02:26:35 2008 +0000
|
| Remove (unused) old protocol support.
| commit d8f9b19302fd662aba1b554778644e3c6cd2d746
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Thu Jan 31 02:27:22 2008 +0000
|
| Remove old protocol support.
Internal debugging config option from Lee:
| commit fd5fde78af93d32d3b0e8ebbd832da2b32214c4a
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Tue Oct 9 22:35:49 2007 +0000
|
| This adds a new configuration option, SaveRawImage. Which basically instructs
| faxsend and faxgetty to save received or sent image data to file in /tmp/out.fax
| or /tmp/in.fax, respectively.
|
| As this is not something that will have a useful purpose as-is to the general
| user I have left it undocumented... although that's probably very bad of me.
Based on work from Lee:
| commit 36c27b71defb2aec5d6597cca37c3ed03920e0b2
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Fri Jan 4 23:24:31 2008 +0000
|
| This should complete the server-side PCL support implementation.
|
| It also intentionally makes hfaxd reject PJL documents... which seem
| to give some WHFC users fits when they use the wrong printer driver.
| commit ace9e11f2f8054e6de05aded856342216cbc7940
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Fri Jan 25 20:44:41 2008 +0000
|
| This adopts the pcl2fax scripting used by Philip Gwyn.
| commit 9fe7c0ee4f77cbadce2926e8fcb2a07c6012a1d6
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Sat Jan 26 19:18:26 2008 +0000
|
| In order to support PCL best on the server-side we need to begin to trust
| the document type specification that the client supplied during the protocol
| exchange (FORM). This is because there is no sure-fire way to type a PCL
| file. So we need to trust whatever the client specified.
|
| However, we can't trust it in the case of Postscript because that format is,
| unfortunately, the default server setting, and thus clients have traditionally
| been able to get away without specifying the document format when using
| Postscript... and thus even PDF or TIFF documents could have been submitted
| in this fashion with little to no fallout.
| commit 56a957ed2247864d46b89e81451b551ae498225f
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Sat Jan 26 19:21:17 2008 +0000
|
| Support ESC-E detection for PCL.
xferfaxlog: Add recvq fax filename to RECV records
Based on work from Lee:
| commit b1d0cf778a0435c5b2f6af7d16ae10109b8d215c
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Mon Dec 24 18:29:25 2007 +0000
|
| Adds qfile to RECV xferfaxlog records.
From Lee:
| commit 7442d5178e6c1f38594ad31dca0ac97cb92f0356
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Fri Dec 14 19:21:51 2007 +0000
|
| https://sourceforge.net/forum/message.php?msg_id=4675923
|
| points out that NotifyCmd is misdocumented as being available in modem config files
From Lee:
| commit e8b509f041eae9af7e8ee022fc1cc9e2adcb88fe
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Tue Nov 6 04:32:35 2007 +0000
|
| Aha, the destructor attempts to save the values to disk even if the file
| is obviously invalidly named.
Spurred on by:
| commit 0225ec9ccf5fd73cb559d4519d62b6d9842388d0
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Thu Oct 18 21:10:12 2007 +0000
|
| This extends the UNSENT accounting... and it absorbs the KILLED accounting.
libhylafax: Don't tryncate commands at 100 characters at 100 characters
Spurred on by:
| commit dc265ed79edcf6424d44d45e1d3f6ce78a50a77e
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Wed Oct 10 22:50:35 2007 +0000
|
| Let's not truncate job params at 100 characters. So let's make the buffer
| bigger, but let's not send the truncated string to the server.
Based on Lee's commits:
| commit 3f335853e3c7610b0d9b8228988940b672a07ba4
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Fri Oct 5 01:21:51 2007 +0000
|
| Looks like there is potential for infinite looping in recvFrame if the
| modem behavior is just right. We simply set up a timer to prevent it.
| commit 64c904b3e08e582177813746e018aae5cf1080d6
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Thu Oct 18 19:09:05 2007 +0000
|
| t1Timer is in ms ... let's compare seconds with seconds not seconds with ms
Based on Lee's commit:
| commit 967221f223fa762a060f384f2c96145c57a2ddd9
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Tue Oct 23 17:45:13 2007 +0000
|
| Riccardo Magliocchetti contributes "from-mail-address" feature for faxcover.
Based on work from Lee:
| commit 71efb2e351dbfb5a052966f53c0a55e7f682280d
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Wed Nov 28 06:05:25 2007 +0000
|
| Meaningful JobControl output shouldn't be coming in from stderr. Thus, our
| use of stderr only is apt to cause problems. Ignore stderr.
| commit d7cc4704e5c9188daccdc9eed3d9dfcd558a87bd
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Thu Oct 11 16:13:15 2007 +0000
|
| Prefer Class 1.0 over 2 and 2.0
Based on work from Lee:
| commit 83ee24062883e6fed2bafdf502fc45903d79fb77
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Thu Feb 28 18:37:15 2008 +0000
|
| %%c and %%C were backwards
| commit b4bb07f4aef5e038594692025143356b5a9056d0
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Wed Jan 2 20:38:34 2008 +0000
|
| It would be an extremely rare possibility up until now (since apparently no
| commonly-used TIFF creators make a file that passes tiffcheck but also
| produces the file with min-is-black photometrics), but this makes tiffcheck
| also verify that photometric interpretation is min-is-white... otherwise
| a negative image gets faxed.
faxmail: print an error message when a part is discarded
| commit 8e9d78dcafdde09455b42c55f9f5bfa4f762d355
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Tue Oct 2 00:32:35 2007 +0000
|
| output an error message if a part is discarded
Class1: Be more lax in our timeouts wrating for Phase C
| commit 2b6aa6612adb835a84fe012d7bb31a40f9efe2b0
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Wed Feb 6 01:28:57 2008 +0000
|
| Although spec gives the sender T2 (7 seconds) to start sending Phase C image
| data... recordings show us that some may wait even as much as 9.5 seconds.
| In cases where Class1RMPersistence is non-zero (where +FCERROR works or AT+FAR=1)
| it is acceptable to extend this timeout inversely as it is shortened for
| cases where Class1RMPsersistence is zero.
| commit f8a05cb8865b4657f52d011e21836c9dda7e0ecf
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Fri Jan 25 21:38:43 2008 +0000
|
| Deliberately intialize in an unknown format so that the first document
| submitted will cause the FORM hfaxd parameter to be used... rather than
| expecting the server's FORM default to be the same as the client's.
| commit 6adf5fb4ade96622363068a5df8d5443bcb1d874
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Fri Feb 1 02:52:39 2008 +0000
|
| Adds support for <waitfor:VCON> escape.
| commit 2d8b541b88fec449a3cf9f0f0f2fa47febf6c066
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Mon Jan 14 06:00:39 2008 +0000
|
| Adds Class 1.0 for the MT5656ZDX
| commit d1d12bd76d5f617e014b3f036985e44a56bf2037
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Sat Jan 5 21:43:28 2008 +0000
|
| blockNumber was not properly initialized... thus when the compiler wasn't
| initializing it for us, we'd have problems.
Class1: Don't train if we are seeing adequate progress
From Lee:
| commit fc0e1fa89d2566d10c95e6a816922b537ef193fb
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Sun Sep 9 15:32:30 2007 +0000
|
| Training down can often complicate the matter. Don't do it if we're seeing
| adequate progress.
Aidan Van Dyk [Thu, 28 Feb 2008 20:55:09 +0000 (20:55 +0000)]
i18n: Build infrastructure
This allows us to "build" .po and .pot files for HylaFAX.
It builds 3 sets:
libhylafax Strings used in libhylafax
hylafax-client Strings used in hylafax client components
hylafax-server Strings used in hylafax server components
All are merged to one master "hylafax.pot" for translating. The 3
separate catalogs translations are merged out of the master
hylafax.pot/$LANG.po to build the .mo for installation.
Makefile hackery makes me which we only supported "real" makes...
Aidan Van Dyk [Fri, 22 Feb 2008 20:24:23 +0000 (20:24 +0000)]
Protocol: add SITE LOCKWAIT command
This enhancement allows the client to specify how long
to block when flock() tries to lock a file which is already
locked. It defaults to 0 for backwards compatibility.
Aidan Van Dyk [Fri, 22 Feb 2008 20:23:32 +0000 (20:23 +0000)]
hfaxd: Don't update job's last modified time unless it's actually successfull
If the qfile can't be locked the updateJobFromDisk() will fail. In that
case, *don't* change the job's last modified time, so that next time,
it will be tried again.
It happens that in some cases, we are only tryhing to lock a job to
updateJobFromDisk(), and this can happen *before* the qfile was renamed (to the
doneq), but after it was stated (successfully). Opening wiht O_CREAT here
means that we end up "creating" these 0 length files when we shouldn't have
been able to lock it.
So we carefully create the file if we might need it, the lockJob can only
open it O_RDWR
Tim Rice [Thu, 24 Jan 2008 05:18:27 +0000 (05:18 +0000)]
Quiet compiler warnings like
"../src/faxd/ModemConfig.h", line 178: warning: extra ";" ignored
"../src/faxd/ModemConfig.h", line 179: warning: extra ";" ignored
"../src/faxd/Class1.h", line 159: Warning: Identifier expected instead of "}".
"../src/faxd/FaxSendStatus.h", line 40: Warning: Identifier expected instead of "}".
Aidan Van Dyk [Tue, 22 Jan 2008 21:23:30 +0000 (21:23 +0000)]
FaxClient: Quote any " in the string before passing it to server
When issuing the command:
JPARM <param> "<string value>"
We should be quoting any of the " in the string value, or it get's
interpreted strangely by the server.
Aidan Van Dyk [Tue, 22 Jan 2008 19:59:29 +0000 (19:59 +0000)]
faxmail: Remove double-quotes, etc
When the "to" field is used as the coverpage page name, try and remove any
of the "seperator" stuff that can surround them, like quotes, brackets,
etc.
Aidan Van Dyk [Wed, 16 Jan 2008 15:44:03 +0000 (15:44 +0000)]
Fix faxq modem Triggers
If "extra information" was included in the Trigger::post call, the actual
modem information wasn't been included in the trigger. It should always
be included in the trigger.