Hylafax Mailing List Archives

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [hylafax-users] procmail recipe for HylaFax



On 2002.03.11 10:16 Aaron Bell wrote:
> Hello,
> 
> I'm using HylaFAX as my fax server currently, but would like to implement
> 
> mail to fax capabilities. I need to be able to send attachments, so I'm
> guessing procmail is the best way for me to go. I'm not sure if I can
> modify the procmail recipe that is out there for RelayFax, since I'll be
> using a strictly e-mail to fax setup; no client software on any of the
> workstations.
> 
> Is there anyone out there who has a procmail recipe for HylaFAX that
> would
> simply pipe the phone number (which would be on the subject line) to
> sendfax?

The RelayFax .procmailrc should do this already (recipient number in the 
Subject: header) except that it requires "FAXPASSWORD: my_faxpassword" to 
be in the body.  You have to realize that you could conceivably suffer 
from abuse if you do not include some type of authentication mechanism 
like this for your user base.  E-mail addresses are easy to spoof.

Granted, the RelayFax recipies are a bit bloated for simple email-to-fax 
requests like you propose, but they wouldn't be hard to clean up:

RETURNPATH=`grep -e "return-path" -i | sed "s/^.*<//;s/>//"`
MAILSUBJECT=`grep -e "^subject" -i | sed -e 's/[Ss]ubject. //g' -e 
's/["@]//g'`
FAXPASSWORD=`grep -e FAXPASSWORD | sed -e 's/FAXPASSWORD: //g'`
METAMAIL_TMPDIR="$HOME/faxtmp"
PASSWDCHECK=`grep -e "$RETURNPATH $FAXPASSWORD" $HOME/faxuserlist`
FAXHOST=`hostname -f`

:0
* ! $PASSWDCHECK ?? ^^$RETURNPATH $FAXPASSWORD^^
* ! ^FROM_DAEMON
* ! ^X-Loop
{
  :0
  | (formail -r -A"X-Loop: $USER@$FAXHOST" ; \
	echo "FAX ERROR: You do not have permission to fax.") | $SENDMAIL 
-t

  :0:faxtmp.lock
  /dev/null
}

# Uncomment this recipe if you wish to have copies CC'ed back to you...
# :0 c
# ! $RETURNPATH

:0 ic:faxtmp.lock
| rm -f $METAMAIL_TMPDIR/*

:0 ic:faxtmp.lock
| metamail -w -x

:0 ic:faxtmp.lock
| rm -f $METAMAIL_TMPDIR/mm.*

:0 i:faxtmp.lock
| sendfax -f "$RETURNPATH" -n -d "$MAILSUBJECT" $METAMAIL_TMPDIR/*

Lee.

____________________ HylaFAX(tm) Users Mailing List _______________________
 To unsub: mail -s unsubscribe hylafax-users-request@hylafax.org < /dev/null



Home
Report any problems to webmaster@hylafax.org

HylaFAX is a trademark of Silicon Graphics Corporation.
Internet connectivity for hylafax.org is provided by:
VirtuALL Private Host Services