------------------------------------------------------------------------------- Mailcap and Mime Types The ".mailcap" file is used to find a program for handling a mime (filetype). video/mpeg; xmpeg %s The "/etc/mime.type" file associates filename extensions with mime types For example text/plain txt text/html htm html Netscape used a different format type=text/html exts=htm,html ------------------------------------------------------------------------------- Basic Base64 Encoding/Decoding... (Moved to misc/cryto_base64.txt) ------------------------------------------------------------------------------- Using mhbuild Add attachments to the mailfile (with headers) #image/x_png; name="arc.png" arc.png Then filter in VI using... :%!mhbuild - ------------------------------------------------------------------------------- General Mail Mime Attachment handling Attachment Filename The file name must be added to the "Content-Type:" line of the attachment. EG: ------- =_aaaaaaaaaa0 Content-Type: application/octet-stream; name=".plan" Content-ID: <10662.1005524452.1@kobold> Content-Transfer-Encoding: base64 Boundary Lines Note that two extra "-" are prepended to the actual boundary lines to the bundary marked given in the header of a mime mail. EG: In the header you have... Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" In the body you have... ------- =_aaaaaaaaaa0 The header has 5 "-" characters but the actual boundary line has 7. Example... MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <10662.1005524452.0@kobold> ------- =_aaaaaaaaaa0 Content-Type: application/octet-stream; name=".plan" Content-ID: <10662.1005524452.1@kobold> Content-Transfer-Encoding: base64 CkFudGhvbnkgVGh5c3NlbiA8YW50aG9ueUBjaXQuZ3UuZWR1LmF1PgogIFdXVyBIb21lIFBh Z2U6ICAgICAgIGh0dHA6Ly93d3cuc2N0Lmd1LmVkdS5hdS9+YW50aG9ueS8KICBKb2IgRGVz LS0tCgo= ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <10662.1005524452.2@kobold> Anthony Thyssen ( System Programmer ) http://www.cit.gu.edu.au/~anthony/ ------- =_aaaaaaaaaa0-- ------------------------------------------------------------------------------- Using mhbuild Add attachments to the mailfile (with headers) #image/x_png; name="arc.png" arc.png Then filter in VI using... :%!mhbuild - ------------------------------------------------------------------------------- General Mail Mime Attachment handling Attachment Filename The file name must be added to the "Content-Type:" line of the attachment. EG: ------- =_aaaaaaaaaa0 Content-Type: application/octet-stream; name=".plan" Content-ID: <10662.1005524452.1@kobold> Content-Transfer-Encoding: base64 Boundary Lines Note that two extra "-" are prepended to the actual boundary lines to the bundary marked given in the header of a mime mail. EG: In the header you have... Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" In the body you have... ------- =_aaaaaaaaaa0 The header has 5 "-" characters but the actual boundary line has 7. Example... MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <10662.1005524452.0@kobold> ------- =_aaaaaaaaaa0 Content-Type: application/octet-stream; name=".plan" Content-ID: <10662.1005524452.1@kobold> Content-Transfer-Encoding: base64 CkFudGhvbnkgVGh5c3NlbiA8YW50aG9ueUBjaXQuZ3UuZWR1LmF1PgogIFdXVyBIb21lIFBh Z2U6ICAgICAgIGh0dHA6Ly93d3cuc2N0Lmd1LmVkdS5hdS9+YW50aG9ueS8KICBKb2IgRGVz LS0tCgo= ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <10662.1005524452.2@kobold> Anthony Thyssen ( System Programmer ) http://www.cit.gu.edu.au/~anthony/ ------- =_aaaaaaaaaa0-- -------------------------------------------------------------------------------