procmail
[Top] [All Lists]

Using MIME to ship faxes from HylaFax into the mail system

1996-01-30 18:51:44

HylFax is a fax server that has sources available via anonymous ftp to
sgi.com. To distribute faxes received by HylaFax into the Unix mail
system, using procmail as the interface, put the following in the
FaxMaster's ~/.procmailrc:

    :0:
    * ^from:(_dot_)*fax(_at_)my_domaincom
    {
        :0 c
        * ^subject: +facsimile +received +from
        | ${HOME}/.faxmail

        :0:
        fax
    }

which will invoke the shell script file, named ~/.faxmail, and parse
the received fax file name from the fax notification email sent by
HylaFax, and route a MIME copy of the fax to the specified email
address using the metasend program from the MIME distribution:

    #!/bin/sh
    FILE_NAME=`egrep ^recvq | sed 's/:.*$//' | sed 
's/^/\/usr\/spool\/uucppublic\/fax\//'`
    /usr/local/bin/metasend -b -t someone(_at_)my_domain(_dot_)com -F 
fax(_at_)my_domain(_dot_)com -s "Facsimile mail transmission" -m 
application/fax -f `echo ${FILE_NAME}`

(Note that someone wishing to demonstrate some competency with sed(1)
could eliminate one of the sed invocations.)  The sources to the MIME
distribution are available via anonymous ftp to belcore.com. The faxes
can be viewed directly from a MIME compliant mailer using the viewfax
program, which is also available via anonymous ftp to sgi.com, by
placing the following line in your ~/.mailcap file:

application/fax ; showpicture -viewer 'viewfax -geometry +0+0' %s

I use GNU emacs as my mail user agent, which is not MIME compliant. However,
adding the following function to your ~/.emacs file:

    ;
    ; Rmail mime function
    ;
    (defun rmail-mime ()
        "Rmail mime."
        (interactive)
        (shell-command-on-region (point-min) (point-max) "metamail -m emacs -x 
-d" nil nil) ; pipe the message to metamail
    )

will handle much, but not all, of MIME's functionality, including this
application of reading faxes in the Unix mail system. Or, if VM is
preferred:

    ;
    ; Vm mime function.
    ;
    (defun vm-mime ()
        "Vm mime."
        (interactive)
        (vm-pipe-message-to-command "metamail -m emacs -x -d" 0) ; pipe the 
message to metamail
    )

    John

-- 

John Conover, 631 Lamont Ct., Campbell, CA., 95008, USA.
VOX 408.370.2688, FAX 408.379.9602
john(_at_)johncon(_dot_)com

<Prev in Thread] Current Thread [Next in Thread>