On Wed, 22 May 2002, Edward Wildgoose wrote:
I am guessing that this ought to be in the FAQ by now, however, a quick squiz
at the archives is not turning up much so here goes:
I am building an auto-responder which should email back a file attachment to
the sender ("image/tiff" generally). The reply message should be a
multi-part with a plain text section explaining that there is a file attached
(otherwise some people think they just got a blank email....) this will be
static text, and the attachment itself, which updates every few hours
(usually a tiff format image file, ie content type "image/tiff")
I would be grateful for any pointers to either:
a) quick way to generate the message body ready for piping directly to
sendmail
b) demo script for using mailto or similar
./mpack -s "The subject" -o mimefile.out pic.gif
sed '/^Subject/d;/^This is/,/via anonymous/d' mimefile.out |
cat file.text - | formail ... | sendmail -i ...
Notes:
1> mpack(1) makes Subject line that you do not want if you
add text to the message.
2> mpack like the add the banner: "This is a MIME encoded..."
Other command:
metasend -b -e base64 -f pic.gif -m "Image/gif; name=pic.gif" -o mimefile.out
cat file.text mimefile.out | formail .... | sendmail ....
Notes:
1> Here you do not need patch by sed(1).
2> metasend(1) can biuld header more reach then mpack - I do not
like it because I want to add the text.
3> the "-b" means batch; the two programs are nagger whene
working with stdiout.
Bye,
Udi
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail