Hylafax Mailing List Archives
|
[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
Re: [hylafax-users] Can Hylafax archive old fax messages sent?
Hi Cino,
Basically, I've modified the archive script so that it writes an
archive-index file (my new xferfaxlog). The file gets only updated when
archive is launched, which is happening by cron job. Here's the diff, hope
it helps:
--- /var/spool/hylafax/bin/archive.bak 2004-11-23 10:41:47.000000000 +0100
+++ /var/spool/hylafax/bin/archive 2004-11-30 15:25:45.000000000 +0100
@@ -11,6 +11,7 @@
COMMLOGS=`find log -type f -name "c*" -print | xargs -n50 grep -l "SEND
FAX: JOB $JOBID"`
DOCS=`grep -E $FILETYPES $QFILE | sed 's/.*://g'`
NUMBER=`grep "^number:" $QFILE | sed 's/^number://g'`
+MAIL=`grep "^mailaddr:" $QFILE | sed 's/^mailaddr://g'`
#
# Default archiving is to create a directory in the archive directory
@@ -23,3 +24,33 @@
for log in $COMMLOGS; do cp $log $ARCHIVETO; done
for doc in $DOCS; do cp $doc $ARCHIVETO; done
if [ -r info/$NUMBER ]; then cp info/$NUMBER $ARCHIVETO; fi
+
+#
+# Write the associated logs to one file, which can be queried in order to
find
+# out the status of a document (based on the subject of the message)
+#
+
+basedir="/var/spool/hylafax"
+idx="$basedir/archive-index"
+for log in $COMMLOGS
+do
+ log=`echo $log | sed 's/^log\/c//g'`
+ DATE=`grep $log etc/xferfaxlog | awk -F "\t" '{print $1}'`
+ PAGES=`grep $log etc/xferfaxlog | awk -F "\t" '{print $11}'`
+ DURATION=`grep $log etc/xferfaxlog | awk -F "\t" '{print $12}'`
+ REASON=`grep $log etc/xferfaxlog | awk -F "\t" '{print $14}'`
+ if [ "$REASON" = "\"\"" ]; then
+ REASON="\"SENT OK\""
+ fi
+ DOCS=`echo $DOCS | sed 's/^docq\///g'`
+ pspathfile="$ARCHIVETO/$DOCS"
+ if [ -f $pspathfile ]; then
+ subj=`cat $pspathfile | grep "B(Subject:)" | sed 's/^\(B(Subject:)s1
94 M (\)\(.*\)\()s2 EL\)$/\2/g'`
+ if [ "$subj" = "" ]; then
+ subj="(no subject)"
+ fi
+ else
+ subj="<ERROR: $pspathfile missing>"
+ fi
+ echo -e
"$JOBID\t$DATE\t$pspathfile\t$subj\t$NUMBER\t$MAIL\t$PAGES\t$DURATION\t$REAS
ON" >> $idx
+done
-----Original Message-----
From: Cino [mailto:lists@xxxxxxxxxxxxxxxxx]
Sent: Monday, May 09, 2005 3:40 PM
To: erich.iseli@xxxxxxxxxxxxxxxx
Cc: hylafax-users@xxxxxxxxxxx
Subject: Re: [hylafax-users] Can Hylafax archive old fax messages sent?
Can you share what have you done?
Cino
erich.iseli@xxxxxxxxxxxxxxxx ha scritto:
>Hi Ferenc
>
>Short answer: yes
>
>Longer answer: Hylafax can be set up so that it archives the Postscript
>documents shortly after sending them (or after giving up), along with all
>protocol files about the specific transmission.
>
>-rw-r--r-- 1 uucp uucp 1227 May 9 13:30 c000001242
>-rw-r--r-- 1 uucp uucp 1227 May 9 13:30 c000001243
>-rw-r--r-- 1 uucp uucp 1227 May 9 13:30 c000001244
>-rw-r--r-- 1 uucp uucp 1227 May 9 13:30 c000001246
>-rw-r--r-- 1 uucp uucp 1227 May 9 13:30 c000001250
>-rw-r--r-- 1 uucp uucp 1227 May 9 13:30 c000001253
>-rw-r--r-- 1 uucp uucp 1227 May 9 13:30 c000001258
>-rw-r--r-- 1 uucp uucp 1227 May 9 13:30 c000001260
>-rw-r--r-- 1 uucp uucp 1227 May 9 13:30 c000001261
>-rw-r--r-- 1 uucp uucp 1227 May 9 13:30 c000001262
>-rw-r--r-- 1 uucp uucp 1227 May 9 13:30 c000001263
>-rw-r--r-- 1 uucp uucp 1345 May 9 13:30 c000001264
>-rw-r----- 1 uucp uucp 170578 May 9 13:30 doc1129.ps
>-rw-rw---- 1 uucp 60002 824 May 9 13:06 q1129
>
>This is the directory of one specific job, which had several dialling
>attempts which you can see according to the amount of c0000* files.
>
>One of these files might contain
>
>May 09 13:06:57.01: [ 2366]: --> [10:NO CARRIER]
>May 09 13:06:57.01: [ 2366]: SEND FAILED: JOB 1129 DEST 0434337505 ERR No
>carrier detected
>May 09 13:06:57.01: [ 2366]: SEND FAILED: JOB 1129 DEST 0434337505 ERR No
>carrier detected; too many attempts to dial
>May 09 13:06:57.01: [ 2366]: <-- [5:ATH0\r]
>May 09 13:06:57.14: [ 2366]: --> [2:OK]
>May 09 13:06:57.14: [ 2366]: SESSION END
>
>Finally the q-file will contain information like these:
>
>tts:1115636817
>killtime:1115643833
>retrytime:0
>state:8
>npages:0
>totpages:2
>ntries:0
>ndials:12
>totdials:12
>maxdials:12
>tottries:0
>maxtries:3
>pagewidth:209
>resolution:196
>pagelength:296
>priority:127
>(...)
>
>In addition, there is an xferfaxlog file which lists all jobs along with
the
>number and the success or fail status.
>
>The only thing hylafax doesn't provide is an efficient tool for dealing
with
>this data. I had to write a script which reads a very precise part of the
>postscript file (the topic of the fax) and intermixes it with the
xferfaxlog
>file so that I can easily query if a customer is calling. I just have to
>grep my modified xferfaxlog for their order number and I have the full
>history of attempts, followed by the effective send. And if I need to see
>what they should have received, I can open up the postscript file.
>
>Greetings,
>
>Erich
>
>-----Original Message-----
>From: Medgyessy, Ferenc (Budapest) [mailto:Ferenc.Medgyessy@xxxxxxx]
>Sent: Monday, May 09, 2005 12:46 PM
>To: hylafax-users@xxxxxxxxxxx
>Subject: [hylafax-users] Can Hylafax archive old fax messages sent?
>
>
>Hi,
>
> Before we install Hylafax I ask you to inform me about an important
>utility of this fax program.
>
>Our point of view to find a "clever" sw, which can save all fax messages
>sent with acknowledgement report. (It is important to demonstrate that our
>company sent this and this fax in past, when a customer questions about.)
>
>Can Hylafax do it?
>
>
>Best regards,
>
>Ferenc
>The information in this email and any attachments is confidential and
>intended solely for the use of the individual(s) to whom it is addressed
>or otherwise directed. If you are not a named addressee or otherwise an
>intended recipient, you are requested to immediately notify the sender
>and to delete the email and all attachments from your system.
>
>Visit http://www.sgs.com
>
>____________________ HylaFAX(tm) Users Mailing List _______________________
> To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
> On UNIX: mail -s unsubscribe hylafax-users-request@xxxxxxxxxxx < /dev/null
> *To learn about commercial HylaFAX(tm) support, mail sales@xxxxxxxxx*
>
>____________________ HylaFAX(tm) Users Mailing List _______________________
> To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
> On UNIX: mail -s unsubscribe hylafax-users-request@xxxxxxxxxxx < /dev/null
> *To learn about commercial HylaFAX(tm) support, mail sales@xxxxxxxxx*
>
>
>
>
>
____________________ HylaFAX(tm) Users Mailing List _______________________
To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
On UNIX: mail -s unsubscribe hylafax-users-request@xxxxxxxxxxx < /dev/null
*To learn about commercial HylaFAX(tm) support, mail sales@xxxxxxxxx*
____________________ HylaFAX(tm) Users Mailing List _______________________
To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
On UNIX: mail -s unsubscribe hylafax-users-request@xxxxxxxxxxx < /dev/null
*To learn about commercial HylaFAX(tm) support, mail sales@xxxxxxxxx*