Hi folks,
I need to create a script in .qmail that:
1. if the sender is for example 0293...@domain.dom, I'll use
02935802392 ($LOCAL in .qmail) as number for hylafax to send the fax
(attachment in my mail)
2. if the sender is for example some...@domain.dom, or
some...@domain.dom, I'll send all to abu...@domain.dom
I've created that script, but I've two problems:
a) why logfile is always something like
Date: Thu Sep 16 20:21:08 2004
From: "dott. Andrea Riela" <ari...@domain.dom>
Subj: test
File: !abu...@domain.dom (937)
and not with my "log" instructions?
b) all match the "else" instruction ... probably my rule for checking
the $LOCAL is wrong.
Could you help me?
Thanks for all
Regards
Andrea
my script
---------
SHELL="/bin/sh"
PWD=`pwd`
import LOCAL
import SENDER
#SENDERNAME=`/usr/local/vpopmail/bin/vuserinfo -c $SENDER`
USERHOST=`PWDTMP=${PWD%/*}; echo ${PWDTMP##*/}`
FAXTO=`echo "$LOCAL" | sed -e 's/[^0-9]//g`
TEMP=`/bin/date +%Y%m%d%k%M%S`
logfile "/var/log/hylafax/outbound.log"
VERBOSE=5
if ( "$LOCAL" eq "$FAXTO" )
{
#send the fax
exception {
log "Fax delivering to $LOCAL"
`/bin/mkdir /tmp/$TEMP`
`/usr/local/bin/ripmime -d /tmp/$TEMP`
`/usr/local/bin/sendfax -n -d $LOCAL -f $SENDER -D -s
a4 /tmp/$TEMP`
`/bin/rm -r /tmp/$TEMP`
}
}
else
{
#try to deliver to the spam account
exception {
log "Sending to abuse@$USERHOST"
to "!abuse@$USERHOST"
}
}
exit