This is an old revision of the document!
Table of Contents
Pktdump
pktdump is a utility to dump the headers and optionally the body of raw FTN packets.
Usage
pktdump [-body] <file1.pkt> [file2.pkt] [...]
Example
/sbbs/exec/pktdump /sbbs/ftn/out/fidonet/*.?ut
scripting examples
At one point in time, I had a lot of pkts that got abandoned due to a misconfiguration of my mailer. This misconfiguration resulted in the mailer not being able to access the pkt files but it could access the BSO .?lo files. When it found it could not access the pkts listed in the flo file, it deleted the flo file resulting in the pkts being abandoned. Since I didn't want that mail to be lost, I wrote some oneliners that use pktdump to retrieve the destination addresses from the pkts and create new flo files for them.
First run through all the pkts and output a list of destination addresses
# make a list of pkt destination addresses /sbbs/exec/pktdump /sbbs/fido/outbound/*.pkt | \ egrep -e "Packet Type .* from $MYFTNADDR to " | \ cut -d " " -f 12 | sort -V | uniq
Now, use one of the above addresses in place of $DESTADDR and your FTN address in place of $MYFTNADDR to move all the pkts for the destination system to the /sbbs/tmp directory.
# choose an address from the above list # get a list of pkts destined there and # move those pkts to the tmp directory /sbbs/exec/pktdump /sbbs/fido/outbound/*.pkt | \ egrep -e "Packet Type .* from $MYFTNADDR to $DESTADDR" | \ cut -d " " -f 1 | tr '\n' '\0' | \ xargs -0 -n1 -i mv '{}' /sbbs/tmp
Now that we have moved the pkts, lets create a flo file with them for the destination address. Put the destination system's net in place of $DESTNET and its node in place of $DESTNODE.
# create a flo file with the pkts printf "$(ls -d -1 $PWD/*.pkt | \ sed 's/^/\^/')\n" > \ $(printf "%04x%04x.flo\n" $DESTNET $DESTNODE)
The above can be done a bit better by not moving the pkts to the tmp directory first but this works fine with some manual work added. Once the flo file is created, it is a simple matter manually to copy/move it to the proper outbound directory and wait for the mailer to transit and delete the pkts listed in it before handling the next system in the list of destinations.
I've not yet spent more time to fix it up into a proper script that doesn't need to move the files at all plus there should be some .bsy file creation to prevent the tosser and mailer from jumping the gun while the pkts are moved and the flo is created.
These example oneliners helped me to recover several thousand pkts that were abandoned over night on my hub system.