This file documents MIME features of FLIM, a Internet message parsing/encoding library for GNU Emacs.
FLIM is a library to provide basic features about message representation or encoding.
Please eval following to use MIME features provided by FLIM:
According to
The definition of RFC 2045 indicates that a MIME message is a tree. An message is a tree, each node is an entity, like following figure. Namely MIME extends message to tree structure.
FLIM uses
前述のように、message 中の各 entity は木の節に当たりますが、この木には
深さと同じ深さの中の順番に従って番号が付けることができます。即ち、
mime-entity では、これと同様の
前述のように、MIME message は entity を単位とした木構造になっているので、
この根である message 全体も mime-entity で表現することができ、buffer
local 変数
Open an entity and return it.
type is representation-type.
location is location of entity. Specification of it is
depended on representation-type.
Parse buffer as message, and set the result to buffer local
variable
If buffer is omitted, current buffer is used.
type is representation-type of created mime-entity.
Buffer local variable to store mime-entity structure of message.
Return list of entities included in the entity.
Return parent entity of the entity.
If message is specified, it is regarded as root instead of
Return non-
Return node-id of entity.
Return entity-number of entity.
Return entity from entity-number in message.
If message is not specified,
Return entity from entity-node-id in message.
If message is not specified,
Return content-type of entity.
Return content-disposition of entity.
Return file name of entity.
Return content-transfer-encoding of entity.
If the entity does not have Content-Transfer-Encoding
field, this function returns default-encoding. If it is
nil,
Return non-nil if contents of entity has been already
code-converted.
Return field-body of field-name field in header of
entity.
The results is network representation.
If entity is omitted,
If field-name field is not found, this function returns
Parse field-name field in header of entity, and
return the result.
Format of result is depended on kind of field. For non-structured
field, this function returns string. For structured field, it returns
list corresponding with structure of the field.
Strings in the result will be converted to internal representation of
Emacs.
If entity is omitted,
If field-name field is not found, this function returns
Insert before point a decoded contents of header of entity.
invisible-fields is list of regexps to match field-name to
hide. visible-fields is list of regexps to match
field-name to hide.
If a field-name is matched with some elements of
invisible-fields and matched with none of
visible-fields, this function don't insert the field.
Return content of entity as byte sequence.
Write content of entity into filename.
Write representation of entity into filename.
Write body of entity into filename.
Return buffer, which contains entity.
Return the start point of entity in the buffer which
contains entity.
Return the end point of entity in the buffer which
contains entity.
Return the start point of header of entity in the buffer
which contains entity.
Return the end point of header of entity in the buffer
which contains entity.
Return the start point of body of entity in the buffer
which contains entity.
Return the end point of body of entity in the buffer which
contains entity.
Entity は抽象化されたデータ表現で、実際のデータ表現としては用途に応じて
さまざまなものが利用できるように設計されています。
ここで、entity がどういう種類の表現を行っているかを示すのが
前節までに述べて来た entity に対する処理は、entity に対してその処理を依
頼することによって実現されています。Entity は自分の
representation-type を知っており、その representation-type に応じて実際
の処理を行う関数を呼び出します。このような関数を
mm-backend は representation-type の名前の先頭に
entity に message を送る。
args は message の引数である。
(すみません。そのうち書きます (^_^;)
(とりあえず、mm*.el を参考にしてください)
Historically, Content-Type field was proposed in RFC 1049. In it,
Content-Type did not distinguish type and subtype, and there are no
mechanism to represent kind of character code like MIME charset.
FLIM provides parser for Content-Type field and structure
Content-Type 欄の形式は以下のように定義されています:
例えば、
ここで、`type' と `subtype' は entity の形式を示すもので、両者を総称し
て、`media-type' と呼ぶことにします。上記の例における `image/jpeg' や
`text/plain' は media-type の1つです。
Content-Type 欄のない entity は
Content-Type 欄の情報を格納するための構造体。
この構造体を参照するには
この構造体の要素は以下の通りである:
content-type の生成子。
content-type の parameter の値を返す。
string を content-type として解析した結果を返す。
現在の buffer の Content-Type 欄を読み取り、解析した結果を返す。
Content-Type 欄が存在しない場合は nil を返す。
Return type/subtype string from type and
subtype.
FLIM は Content-Disposition 欄を構文解析する関数と Content-Disposition
欄の解析結果を格納する構造体
Content-Disposition 欄の解析結果を収めるための構造体。
この構造体を参照するには
この構造体の要素は以下の通りである:
content-disposition の parameter の値を返す。
content-disposition の filename の値を返す。
string を content-disposition として解析した結果を返す。
現在の buffer の Content-Disposition 欄を読み取り、解析した結果を返す。
Content-Disposition 欄が存在しない場合は nil を返す。
FLIM では Content-Transfer-Encoding 欄を構文解析する関数を提供します。こ
れらの関数は Content-Transfer-Encoding 欄の情報は文字列で表現します。
また、Content-Transfer-Encoding に基づいて符号化・復号化を行う関数も提
供されます。
string を content-transfer-encoding として解析した結果を返す。
現在の buffer の Content-Transfer-Encoding 欄を読み取り、解析した結果を
返す。
Content-Transfer-Encoding 欄が存在しない場合は
default-encoding を返す。
Encode region start to end of current buffer
using encoding.
Decode region start to end of current buffer
using encoding.
Alist of encoding vs. corresponding method to encode region.
Each element looks like
Alist of encoding vs. corresponding method to decode region.
Each element looks like
string を encoding として復号した結果を返します。
Alist of encoding vs. corresponding method to decode string.
Each element looks like
Insert file FILENAME encoded by ENCODING format.
Decode and write current region encoded by encoding into
filename.
start and end are buffer positions.
Alist of encoding vs. corresponding method to insert encoded file.
Each element looks like
Alist of encoding vs. corresponding method to write decoded region to
file.
Each element looks like
encoded-word は header で非
また、行儀の悪いことだと言えますが、encoded-word を用いずに非
FLIM はこれらを符号化・復号化する機能を提供します。
Decode MIME encoded-words in header fields.
If code-conversion is
If separator is not nil, it is used as header separator.
Encode header fields to network representation, such as MIME
encoded-word.
It refer variable
MIME 関連機能に関する group.
適切な
本来は APEL の変数である。
MIME 機能に関する実装が一時的に使用する file を作成する directory.
環境変数
Any data represented by 7bit integers is called
Textual string consisted of Control characters between 0 .. 31 and
127, and space represented by 32, and graphic characters between 33
.. 236 are called
Conventional Internet MTA can translate 7bit data,
so it is no need to translate by Quoted-Printable or Base64 for 7bit data.
However if there are too long lines, it can not translate by 7bit MTA
even if it is 7bit data.
Any data represented by 8bit integers is called
Textual string consisted of Control characters between 0 .. 31, 127,
and 128 .. 159, and space represented by 32, and graphic characters
between 33 .. 236 and 160 .. 255 are called
For example,
Traditional Internet MTA can translate only
However 8bit MTA are increasing today.
However if there are too long lines, it can not translate by 8bit MTA
even if it is 8bit data.
The encoding process represents 24-bit groups of input bits as output
strings of 4 encoded characters. Encoded characters represent integer
0 .. 63 or
These 65 characters are subset of all versions of ISO 646, including
US-ASCII, and all versions of EBCDIC. So it is safe even if it is
translated by non-Internet gateways.
Any byte stream is called
It does not require structureof lines. It differs from from 8bit.
In addition, if line structured data contain too long line (more than
998 bytes), it is regarded as binary.
A set of unambiguous rules that establishes a character set and the
one-to-one relationship between the characters of the set and their
bit combinations.
Currently there are following standard primary-types:
And there are various subtypes, for example, application/octet-stream,
audio/basic, image/jpeg,
You can refer registered media types at MEDIA
TYPES.
In addition, you can use private type or subtype using
In this document, it means mail defined in
MIME stands for
According to RFC 2045:
STD 11, RFC 822, defines a message representation protocol specifying
considerable detail about US-ASCII message headers, and leaves the
message content, or message body, as flat US-ASCII text. This set of
documents, collectively called the Multipurpose Internet Mail
Extensions, or MIME, redefines the format of messages to allow for
It is defined in
Coded character set used in
It is defined in
If the data being encoded are mostly US-ASCII text, the encoded form
of the data remains largely recognizable by humans.
A RFC defines format of Internet mail message, mainly
news message is based on RFC 822, so
A RFC defines format of USENET message. It is a subset of
A textual data represented by only
A MIME charset for primary Latin script
mainly written by English or other languages.
It is a 7bit
It is standard coded character set of Internet mail. If MIME charset
is not specified,
In addition,
If you write bug-reports and/or suggestions for improvement, please
send them to the tm Mailing List:
Notice that, we do not welcome bug reports about too old version.
Bugs in old version might be fixed. So please try latest version at
first.
You should write
Bug may not appear only your environment, but also in a lot of
environment (otherwise it might not bug). Therefor if you send mail
to author directly, we must write a lot of mails. So please send mail
to address for tm bugs instead of author.
Via the tm ML, you can report FLIM bugs, obtain the latest release of
FLIM, and discuss future enhancements to FLIM. To join the tm ML,
send empty e-mail to:
FLIM の file は CVS を使って管理されています。このため、以下の方法で最
新の FLIM を入手することができます:
CVS を用いた開発に参加したい方は
FLIM の code の最古の部分は 榎並 嗣智 氏が書いた
その後、守岡 知彦 は
この頃、守岡 知彦 は
守岡 知彦 はやがて、MIME message を閲覧するためのプログラムである
また、後に、守岡 知彦 によって uuencode 用の
tm では後に、守岡 知彦 によって
後に、守岡 知彦 らによって tm の全面書き換え作業が行われ、この過程で、
tm は APEL, MEL, SEMI, EMH, RMAIL-MIME, Gnus-MIME などに分けられました。
このうちの MEL が FLIM の直接の先祖に当たります。
後に、APEL から
この直前から田中 哲 氏がより RFC に忠実な実装を書き始め、これは、現在、
FLIM の枝である ``FLIM-FLAM'' となっています。
(1 2 3)
のような整数のリストとして表現されます。
(3 2 1)
です。
mime-message-structure
に格納することにします。
そして、entity-number や node-id を用いることで
mime-message-structure
における entity の相対的な位置関係を
扱うことができます。
Functions to create mime-entity
mime-message-structure
of buffer as
mime-entity.
Features about message tree
mime-message-structure
.
nil
if entity is root entity
(message).
mime-message-structure
is used.
mime-message-structure
is used.
Functions about attributes of mime-entity
"7bit"
is used as default value.
Information of entity header
mime-message-structure
is used as default value.
nil
.
mime-message-structure
is used as default value.
nil
.
Contents of Entity
Entity as buffer representation
Entity representations and implementations
mm
という
接頭辞を付けた関数名からなる module で、その module 名は同様に
representation-type の名前の先頭に mm
を付けたものになって
います。この module は representation-type の entity が最初に生成される
時に自動的に require されます。
Message-passing for entity
How to make mm-backend
Information of Content-Type field
Format of Content-Type field
``Content-Type'' ``:''
mime-content-type structure
mime-content-type-要素名
という名
前の参照関数を用いる。
Parser
Utility functions
Information of Content-Disposition field
mime-content-disposition structure
mime-content-disposition-要素名
と
いう名前の参照関数を用いる。
Parser for Content-Disposition field
Encoding Method
Parser
Region encoding/decoding
(STRING . FUNCTION)
or
(STRING . nil)
. string is
content-transfer-encoding. function
is region encoder
and nil
means not to encode.
(STRING . FUNCTION)
or
(STRING . nil)
. string is
content-transfer-encoding. function
is region decoder
and nil
means not to decode.
String encoding/decoding
(STRING . FUNCTION)
.
STRING is content-transfer-encoding.
FUNCTION is string decoder.
File encoding/decoding
(STRING . FUNCTION)
. STRING is
content-transfer-encoding. FUNCTION is function to insert encoded
file.
(STRING . FUNCTION)
. STRING is
content-transfer-encoding. FUNCTION is function to write decoded
region to file.
Network representation of header
Header encoding/decoding
nil
, it decodes only
encoded-words. If it is mime-charset, it decodes non-ASCII bit
patterns as the mime-charset. Otherwise it decodes non-ASCII bit
patterns as the default-mime-charset.
eword-field-encoding-method-alist
.
Various Customization
mail
と news
に属する。
MIME_TMP_DIR
, TM_TMP_DIR
,
TMPDIR
, TMP
もしくは TEMP
が設定
されていた場合、それを初期値として用いる。何も設定されていない場合、
"/tmp/"
を用いる。
Appendix
Glossary
7bit
8bit
ASCII
Base64
binary
Coded character set, Character code
media-type
message
MIME
MIME charset
MTA
MUA
Quoted-Printable
RFC 822
RFC 1036
RFC 2045
RFC 2046
RFC 2048
RFC 2049
plain text
us-ascii
How to report bugs
CVS based development
History of FLIM
Concept Index
Function Index
Variable Index