procmail
[Top] [All Lists]

Re: Return an attachement...

1998-11-11 15:28:48
On Wed, 11 Nov 1998, Liviu Daia wrote:

On 11 November 1998, Doug Monroe <monroe(_at_)lucent(_dot_)com> wrote:
# may also -need- content-length: header??

    Don't.  Some [*insert your favorite deprecatory adjective here*]
gateways will mess with it sooner or later.

It's not just that; content-length is NOT a standard header, it's an
internal tag for a particular (and slightly broken) variant of the
"From "-separated mailbox format.  It should never have been allowed
to leak out into the world.

echo "";\
echo "This is a multi-part message in MIME format.";\

    Nah, that's a Pine-ism

Actually, it's something recommended by several revisions of the MIME
standards.  The stuff before the first boundary string is a "preamble"
intended for display by old mailers that don't understand MIME.  Any
decent MIME mailer will hide it.

Content-Transfer-Encoding: 7bit"; \
echo "";\
echo "heres some plain text message";\
echo "followed by the 'attached' file (inserted by 'cat filename')";\

    Another newline here.

Actually not required.  If no newline is present, MIME says to interpret
the preceding part as if it did not end with a newline.  That may or may
not be what was meant (probably not).

echo "--------------C1BC5999FB7A73F0B7EF99B8";\
echo "Content-Type: application/msword";\
echo " name=\"foo.doc\"";\

    Don't write the name twice, forget about "name=..." and just use
"Content-Disposition:".

He really is better off doing both -- some mailers that don't know about
the content-disposition header will recognize the name parameter.

   cat /path/to/foo.doc;\  # HERES WHERE THE FILE GETS INSERTED

    Replace that by

      mmencode </path/to/foo.doc;\
      echo ;\

Shouldn't that be "mmencode -b"?