phrase

phrase

phrase (822)

RFC 2822 から

  • [1] word = atom / quoted-string ;; RFC 2822 3.2.6
  • [2] phrase = 1*word / obs-phrase ;; RFC 2822 3.2.6
  • [3] obs-phrase = word *(word / "." / CFWS) ;; RFC 2822 4.1

[4] obs-phrase"." が含まれているのは、名前の頭文字などで quoted-string の外で使う DQN が多かったせいです (4.1)。

  • [5] quoted-stringatom も周りの CFWS は省略可能ですから、 atom1"quoted-string1"atom2 とか "quoted-string1""quoted-string2" とかもありですね。意味があるのかと問われればないと思いますけど、 parser はこういうのも覚悟しないといけないということで。

MIME

[6] RFC 2047 5. (3) が最新の定義です。次のようにあります。 また、説明によると encoded-word は必ず隣接する他のものと linear-white-space で区切られる必要があります。

  • [7] phrase = 1*( encoded-word / word )

[8] >>1-3,>>6-7 を考慮に ABNF で書き直すと、

  • [9] phrase = 1*(word / encoded-word) / obs-phrase
  • [10] encoded-word = CFWS <RFC 2047 encoded-word> CFWS

但し phrase が行全体の初めや終わりに来る場合は CFWS は要りませんから、この部分だけ ABNF で表すのは無理ですね...

[12] RFC 5536 - Netnews Article Format ( 版) <http://tools.ietf.org/html/rfc5536#section-2.1>