procmail
[Top] [All Lists]

Re: procmail, sending files with mime?

1998-05-07 22:01:15
On 7 May 1998, Paul Evad - Kudosnet Communications 
<pevad(_at_)kudosnet(_dot_)com>
wrote:
well, after much mucking about.... I finally managed to get something
to work :-)

Here is the result: (watch for wrapping...)
[...]
  -I"MIME-Version: 1.0"\
  -I"Content-Type: multipart/mixed; boundary=\"fls3jekls3=_sd3\"";\
  echo "--fls3jekls3=_sd3";\
  echo "Content-Type: APPLICATION/xx; name=\"$MATCH\"";\
  echo "Content-Transfer-Encoding: base64";\
  echo "";\
  /usr/bin/mimencode -b $MATCH;\
  echo "--fls3jekls3=_sd3--") | $SENDMAIL -oi -t
[...]

    Two minor nits:

(1) You should use the "application/octet-stream" media type for unknown
    attachments instead of "APPLICATION/xx" (RFC 2046);

(2) According to RFC 2183, the filename part belongs in a separate
    "Content-Disposition:" header, not in the "Content-Type:" (although
    Pine and some versions of Emacs perpetuate the old syntax).  Any
    decent MIME-capable mailer should be able to find the filename in
    both cases.  See also RFC 2112.

    Consequently, you should replace

        echo "Content-Type: APPLICATION/xx; name=\"$MATCH\"";\

above by something like

        echo "Content-Type: application/octet-stream";\
        echo "Content-Disposition: attachment; filename=\"$MATCH\"";\

    Regards,

    Liviu

-- 
Dr. Liviu Daia                   e-mail:   daia(_at_)stoilow(_dot_)imar(_dot_)ro
Institute of Mathematics         web page: http://www.imar.ro/~daia
of the Romanian Academy          PGP key:  finger 
daia(_at_)stoilow(_dot_)imar(_dot_)ro

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