procmail
[Top] [All Lists]

Re: Return an attachement...

1998-11-11 10:47:22
Jean Caron wrote:

Hi all,

I would like to return a file as an attachement based on the subject. The
filename is static (always the same). I figured out how to return the file
as the body of the message, but that's not good, the format is all wrong.
It's a binary file, it must be sent as an attachement. I have read through
PROCMAILEX and everything else I could find. I tried stuff like formail -i
"Attchmnt: /file/name". It doesn't work.

Any suggestion ?

I don't believe sendmail, when used as an MTA can "do" MIME??

*maybe* you could craft your own "mime-emulating" message using formail
to insert the right header:

...apologies if below [untested] recipe is a red herring, but I'd be
curious to know if it works.
--
Doug Monroe
Lucent Technologies

:0
| (formail -A"Content-Type: multipart/mixed\;
 boundary="------------C1BC5999FB7A73F0B7EF99B8";\
# may also -need- content-length: header??
echo "";\
echo "This is a multi-part message in MIME format.";\
echo "--------------C1BC5999FB7A73F0B7EF99B8";\
echo "Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit"; \
echo "";\
echo "heres some plain text message";\
echo "followed by the 'attached' file (inserted by 'cat filename')";\
echo "--------------C1BC5999FB7A73F0B7EF99B8";\
echo "Content-Type: application/msword";\
echo " name=\"foo.doc\"";\
echo "Content-Transfer-Encoding: base64";\
echo "Content-Disposition: inline\;";\
echo " filename=\"foo.doc\"";\
   cat /path/to/foo.doc;\  # HERES WHERE THE FILE GETS INSERTED
echo "--------------C1BC5999FB7A73F0B7EF99B8--";\
) | $SENDMAIL -oi -t