procmail
[Top] [All Lists]

Re: procmail, sending files with mime?

1998-05-07 06:22:41
On May 7, 11:50am, Jari Aalto+list.procmail wrote:
Subject: Re: procmail, sending files with mime?

|Wed 98-05-06 Paul Evad - Kudosnet Communications 
<pevad(_at_)kudosnet(_dot_)com>
list.procmail
| I'm trying to hack together a quick autoresponder that will mail a file to
| a user, based on the contents of the subject line.
| [code]
| However, this doesn't send the file all that cleanly. We will be dealing
| with .zip, .sit, .hqx, .exe and possibly some .gz files and I'd like to
| send them as mime attachments so the user's mail program deals with them
| properly.

I have written two Procmail file servers that solved my distribution
problems. Take a look at TPFS (tiny prcomail file server)
and successor MPFS (mime procmail file server). I no longer develop
TPFS, because the MPFS is more modulirized and much better maintainable.

A bit old moldule description that I've done can be found at:

    ftp://cs.uta.fi/pub/ssjaaa/pm-code.html

and the modules are included in kit:

    pm-code.shar        or pm-code.zip

See X-info above how to send request to file server.
jari
Hi,
        Here is what I use to autorespond with a MIME file. Here is the recipe
that does it.  Obviously, you need to have mimencode on your system to do the
encoding.  This would work with any sort of file, though you might want to
modify the file type for different files.  Note that you could send any number
of files using this method.
        What this does is:
*       Define the message as mime
*       Define the boundary.
*       Put in a boundary ( The fls3jekls3=_sd3\" stuff.  It can be any unique
string that you want)
*       Define the content type of the response text (TEXT/PLAIN in this case).
*       Reply with a message (the file pdf.rsp)
*       Put in a boundary
*       Define the content type of the response text (APPLICATION/PDF).
*       Encode and append the PDF copy of my resume (saroffm.pdf)
*       Put in a boundary

#This sends my resume as a mime attachment to anyone who wants a
#copy of my resume in PDF (Acrobat) format
:0ch
* ^Subject:.*send pdf resume
* !^X-Loop: msaroff(_at_)pca\(_dot_)net
| (formail -r \
     -I"X-Loop: msaroff(_at_)pca\(_dot_)net"\
     -I"MIME-Version: 1.0"\
     -I"Content-Type: multipart/mixed; boundary=\"fls3jekls3=_sd3\"";\
   echo "--fls3jekls3=_sd3";\
   echo "Content-type: TEXT/PLAIN; charset=US-ASCII";\
   echo "";\
   cat $HOME/pdf.rsp;\
   echo "--fls3jekls3=_sd3";\
   echo "Content-Type: APPLICATION/PDF; name=\"saroffm.pdf\"";\
   echo "Content-Transfer-Encoding: base64";\
   echo "Content-Description:";\
   echo "";\
   /usr/bin/mimencode -b $HOME/saroffm.pdf;\
   echo "--fls3jekls3=_sd3--") | $SENDMAIL -t


--
--
Matthew Saroff
Do not reply directly to this message.  Reply to
msaroff(_at_)pobox(_dot_)com

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