Hylafax Mailing List Archives

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

[hylafax-users] BUG FIX: for RelayFax recipes



If any of you are using my recipes (for RelayFax client, usually) please
update your .procmailrc and .faxitrc files to those attached.  .procmailrc
as distributed was using company-specific settings here, and .faxitrc had a
minor typo in one recipe that resulted in confirmed, no-coverpage faxes to
be sent twice to each recipient.

The attached rc files fix these problems (also, if you were one of the
original users of this, the new files allow for multiple recipients).

Thanks.

Lee Howard

# - .procmailrc file for use with Deerfield's RelayFax as a Windows client
# and HylaFAX as the fax server
# - faxes should be directed to the user where this .procmailrc file is placed
# - faxes may also be sent manually by attaching a tif or ps file to an e-mail
# with the fax number being the subject line

RETURNPATH=`grep -e "return-path" -i | sed "s/^.*<//;s/>//"`
MAILSUBJECT=`grep -e "^subject" -i | sed 's/[Ss]ubject. //g' | sed 's/\ //g'`
PRINTEDFAX=`grep -e PRINTEDFAX | sed -e 's/PRINTEDFAX: //g'`
FAXDESTINATION=`egrep -e '^(FAX|CC)NUMBER' | sed -e 's/^.*NUMBER: \([^,]*\), "\([^"]*\)", "[^"]*"/\2\@\1 ¿/'`
FAXTOCOMPANY=`egrep -e '^(FAX|CC)NUMBER' | sed 's/^[^,]*, "[^"]*", "\([^"]*\)"/\1 ¿/'`
FAXPASSWORD=`grep -e FAXPASSWORD | sed -e 's/FAXPASSWORD: //g'`
FROMNAME=`grep -e FROMNAME | sed -e 's/FROMNAME: //g'`
FROMMAIL=`grep -e FROMLINE | sed -e 's/FROMLINE: //g'`
FROMLINE=$FROMMAIL\ \($FROMNAME\)
NOCOVERPAGE=`grep -e NOCOVERPAGE | sed -e 's/NOCOVERPAGE: //g'`
CONFIRMSEND=`grep -e CONFIRMSEND | sed -e 's/CONFIRMSEND: //g'`
FAXSUBJECT=`grep -e FAXSUBJECT | sed -e 's/FAXSUBJECT: //g'`
COMMENTS=`grep -e COMMENTS | sed -e 's/COMMENTS: //g'`
ATTACHMENTNAME=`grep -e 'Content-Type.*name=' | sed -e 's/^.*name=//g' | sed -e 's/\"//g'`
ATTACHMENTFILENAME=`grep -e '.*filename=' | sed -e 's/^.*filename=//g' | sed -e 's/\"//g'`
METAMAIL_TMPDIR="$HOME/faxtmp"
PASSWDCHECK=`grep -e "$RETURNPATH $FAXPASSWORD" $HOME/faxuserlist`
HOST=`hostname -f`

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

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

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

:0
* PRINTEDFAX ?? ^^TRUE^^
{ INCLUDERC=.faxitrc }

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

:0
* ! FAXDESTINATION ?? ^^^^
{
 FAXTOWHOM=`echo $FAXDESTINATION | sed 's/^\([^¿]*\) ¿.*/\1/'`
 FAXTOAT=`echo $FAXTOCOMPANY | sed 's/^\([^¿]*\) ¿.*/\1/'`
 TONAME=`echo $FAXTOWHOM | sed 's/^\([^\@]*\)@.*/\1/'`
 TONUMBER=`echo $FAXTOWHOM | sed 's/^[^\@]*@\(.*\)/\1/'`
 FAXDESTINATION=`echo $FAXDESTINATION | sed 's/^[^¿]* ¿\(.*\)/\1/'`
 FAXTOCOMPANY=`echo $FAXTOCOMPANY | sed 's/^[^¿]* ¿\(.*\)/\1/'`
 :0
 * NOCOVERPAGE ?? ^^TRUE^^
 {
  :0
  * CONFIRMSEND ?? ^^TRUE^^
  {
   :0 ic:faxtmp.lock
   | sendfax -f "$FROMLINE" -R -n -d "$FAXTOWHOM" $METAMAIL_TMPDIR/$ATTACHMENTNAME

   :0
   { INCLUDERC=.faxitrc }
  }
  :0 ic:faxtmp.lock
  | sendfax -f "$FROMLINE" -n -d "$FAXTOWHOM" $METAMAIL_TMPDIR/$ATTACHMENTNAME

  :0
  { INCLUDERC=.faxitrc }
 }
 :0
 * CONFIRMSEND ?? ^^TRUE^^
 {
  :0
  * ATTACHMENTNAME ?? ^^^^
  {
   :0 ic:faxtmp.lock
   | (faxcover -c "$COMMENTS" -f "$FROMNAME" -n "$TONUMBER" -r "$FAXSUBJECT" -t "$TONAME" -x "$FAXTOAT" | sendfax -n -f "$FROMMAIL" -R -d "$FAXTOWHOM")

   :0
   { INCLUDERC=.faxitrc }
  }
  :0 ic:faxtmp.lock
  | sendfax -f "$FROMLINE" -R -r "$FAXSUBJECT" -c "$COMMENTS" -x "$FAXTOAT" -d "$FAXTOWHOM" $METAMAIL_TMPDIR/$ATTACHMENTNAME

  :0
  { INCLUDERC=.faxitrc }
 }
 :0
 * ATTACHMENTNAME ?? ^^^^
 {
  :0 ic:faxtmp.lock
  | (faxcover -c "$COMMENTS" -f "$FROMNAME" -n "$TONUMBER" -r "$FAXSUBJECT" -t "$TONAME" -x "$FAXTOAT" | sendfax -n -f "$FROMMAIL" -d "$FAXTOWHOM")

  :0
  { INCLUDERC=.faxitrc }
 }
 :0 ic:faxtmp.lock
 | sendfax -f "$FROMLINE" -r "$FAXSUBJECT" -c "$COMMENTS" -x "$FAXTOAT" -d "$FAXTOWHOM" $METAMAIL_TMPDIR/$ATTACHMENTNAME

 :0
 { INCLUDERC=.faxitrc }
}
:0 i
/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