HylaFax faxserver under Ubuntu / Debian

Queue status

# shows fax in the queue waiting to be sent
faxstat -s
 
# shows faxes sent
faxstat -d
 
#shows faxes received
faxstat -r
 
# Delete fax
faxrm JOB_ID
 
# or if you can´t delete run as creator
sudo -u <USERNAME> faxrm JOB_ID

HylaFax spool directory

/var/spool/hylafax/

delete all send faxes

for i in $(ls /var/spool/hylafax/doneq); do
   faxrm ${i:1}
done

get rejected fax nubers

faxstat -d | grep REJECT | cut -d" " -f 7 > fax_rejected.txt

delete rejected jobs

faxstat -d | grep REJECT | cut -d" " -f 1 > fax_rejected_ids.txt
for i in $(cat fax_rejected_ids.txt); do
    faxrm $i;
done

Links
http://www.linuxfocus.org/Deutsch/March2001/article196.shtml