1 |
<?xml version="1.0" encoding="iso-2022-jp"?> |
<?xml version="1.0" encoding="iso-2022-jp"?> |
2 |
|
<?xml-stylesheet href="/s/simpledoc.css" type="text/css" ?> |
3 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" |
4 |
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
5 |
<html xml:lang="ja" xmlns="http://www.w3.org/1999/xhtml"> |
<html xml:lang="ja" xmlns="http://www.w3.org/1999/xhtml"> |
6 |
<head> |
<head> |
7 |
<title xml:lang="en">Message::* Perl modules</title> |
<title>manakai ($B5l>N(B Message::* Perl modules)</title> |
8 |
<link rel="index" href="./" /> |
<link rel="index" href="./" /> |
9 |
<?xml-stylesheet href="/s/simpledoc"?> |
<link rel="stylesheet" href="/s/simpledoc.css" type="text/css" /> |
|
<link rel="stylesheet" href="/s/simpledoc" /> |
|
10 |
<link rev="made" href="mailto:w@suika.fam.cx" /> |
<link rev="made" href="mailto:w@suika.fam.cx" /> |
11 |
<link rel="copyright" href="/c/pd" title="Public Domain." /> |
<link rel="copyright" href="/c/pd" title="Public Domain." /> |
12 |
<meta name="author" content="$B<cMU(B" /> |
<meta name="author" content="$B<cMU(B" /> |
13 |
<meta name="keywords" content="Perl, module, pm, Message, RFC 822, RFC 2822, RFC 1036, son-of-RFC 1036, MIME, Usefor, HTTP, CGI, header, field" /> |
<meta name="keywords" content="Perl, module, pm, Message, RFC 822, RFC 2822, RFC 1036, son-of-RFC1036, MIME, Usefor, HTTP, CGI, header, field" /> |
14 |
</head> |
</head> |
15 |
<body> |
<body> |
16 |
<h1>Message::* Perl modules</h1> |
<h1>manakai ($B5l>N(B Message::* Perl modules)</h1> |
17 |
|
|
18 |
|
<p>$BCm0U(B: $B$3$NJ8=q$NFbMF$K$O8E$$;vJA$,4^$^$l$F$$$^$9!#(B |
19 |
|
$B:G?7$N>pJs$O(B |
20 |
|
<a href="/~wakaba/-temp/wiki/wiki?manakai">SuikaWiki:manakai</a> |
21 |
|
$B$r$4Mw$/$@$5$$!#(B</p> |
22 |
|
|
23 |
<h2>$B$O$8$a$N$O$8$a$K(B</h2> |
<h2>$B$O$8$a$N$O$8$a$K(B</h2> |
24 |
|
|
25 |
<p>$B$?$H$($P(B Perl $B$G=q$+$l$?(B CGI script, $B$=$l$b7G<(HD$J$s$+$K$O!"(B |
<p>$B$?$H$($P(B Perl $B$G=q$+$l$?(B CGI script, $B$=$l$b7G<(HD$J$s$+$K$O!"(B |
26 |
$B$3$s$J$/$@$i$J$$(B code $B$,:\$C$F$$$?$j$7$^$9!#(B</p> |
$B$3$s$J$_$C$H$b$J$$(B code $B$,:\$C$F$$$?$j$7$^$9!#(B</p> |
27 |
|
|
28 |
<pre class="application-x-perl"> |
<pre class="example"><code class="perl">jcode'convert(*from, "jis"); |
|
jcode'convert(*from, "jis"); |
|
29 |
jcode'convert(*subject, "jis"); |
jcode'convert(*subject, "jis"); |
30 |
jcode'convert(*message, "jis"); |
jcode'convert(*message, "jis"); |
31 |
open (MAIL, "| $sendmail"); |
open (MAIL, "| $sendmail"); |
36 |
print MAIL "$message"; |
print MAIL "$message"; |
37 |
print MAIL "\n"; |
print MAIL "\n"; |
38 |
close (MAIL); |
close (MAIL); |
39 |
</pre> |
</code></pre> |
40 |
|
|
41 |
<p>$B$3$l$G$O;kG'@-$bNI$/$J$$$G$9$7!"$&$C$+$j=$@5$74V0c$($k$H(B |
<p>$B$3$l$G$O;kG'@-$bNI$/$J$$$G$9$7!"$&$C$+$j=$@5$74V0c$($k$H(B |
42 |
$BJQ$J%a%C%;!<%8$rAw?.$7$F$7$^$$$^$9!#(B |
$BJQ$J%a%C%;!<%8$rAw?.$7$F$7$^$$$^$9!#(B |
53 |
my $msg = new Message::Entity; |
my $msg = new Message::Entity; |
54 |
my $hdr = $msg->header; |
my $hdr = $msg->header; |
55 |
$hdr->add ('From')->add ('me@bar.example'); |
$hdr->add ('From')->add ('me@bar.example'); |
56 |
$hdr->add ('To')->add ('foo@bar.example', display_name => 'Mr. foo'); |
$hdr->add ('To')->add (['foo@bar.example', display_name => 'Mr. foo']); |
57 |
$hdr->add ('Subject' => $subject); |
$hdr->add (Subject => $subject); |
58 |
$msg->body ($body); |
$msg->body ($body); |
59 |
|
|
60 |
# $smtp->send $B$O(B SMTP $B$GAw?.$9$k(B method $B$H2>Dj!#(B |
# $smtp->send $B$O(B SMTP $B$GAw?.$9$k(B method $B$H2>Dj!#(B |
64 |
<p><a href="http://www.cpan.org/" xml:lang="en">CPAN</a> $B$rC5$9$H!"(B |
<p><a href="http://www.cpan.org/" xml:lang="en">CPAN</a> $B$rC5$9$H!"(B |
65 |
$B$3$l$K;w$?$h$&$J$3$H$,$G$-$=$&$J%b%8%e!<%k$O$"$k$h$&$G$9$,!"(B |
$B$3$l$K;w$?$h$&$J$3$H$,$G$-$=$&$J%b%8%e!<%k$O$"$k$h$&$G$9$,!"(B |
66 |
$B<B:]$K;H$C$F$_$k$H!"M?$($kCM$K$h$C$F$O(B <a href="urn:ietf:rfc:822">RFC 822</a>/<a href="urn:ietf:rfc:2822">2822</a> $B$K0cH?$9$k(B |
$B<B:]$K;H$C$F$_$k$H!"M?$($kCM$K$h$C$F$O(B <a href="urn:ietf:rfc:822">RFC 822</a>/<a href="urn:ietf:rfc:2822">2822</a> $B$K0cH?$9$k(B |
67 |
$B7k2L$r=PNO$9$k$J$I$NITK~$,$"$j$^$9!#(B ($BNc$($P:#$NNc$G(B |
$B7k2L$r=PNO$9$k$H$+!"$=$b$=$b$=$l0JA0$K!"(B |
68 |
<code xml:lang="en">To:</code> $BNN0h$K;H$C$F$$$k(B |
<code>$hdr->addr ('Foo Bar <foo@bar.example>')</code> |
69 |
<code xml:lang="en">display_name</code> $B$G!V(B.$B!W$,4^$^$l$^$9$,!"(B |
$B$N$h$&$K%a%C%;!<%87A<0$r%b%8%e!<%kFb$K1#F?$7$-$l$F$$$J$$$H$+!"Hs(B |
70 |
RFC 2822 $BE*$K$O?7$7$$%a%C%;!<%8$G$O8_49@-$N$?$a(B |
ASCII $BJ8;z$r9MN8$7$F$$$J$$$H$+$NITK~$,$"$j$^$9!#(B</p> |
71 |
<code xml:lang="en" class="bnf rfc2822">quoted-string</code> |
|
72 |
$B$K$9$kI,MW$,$"$j$^$9!#$7$+$7$=$N$^$^=PNO$5$l$^$9!#(B)</p> |
<p class="note">($B<BAuJ}?K$H$7$F$OIT@5$JCM$O%b%8%e!<%k$KEO$9A0$KCF$/$Y$-$H$$$&9M$(J}$b$"$k$G$7$g$&$1$I!"0lHLE*$JMxMQ$K:]$7$F$O8-$$@_7W$@$H$O;W$($^$;$s!#(B)</p> |
|
|
|
|
<p class="note">$B;29M(B: $B!V(B.$B!W$N>l9g$O(B RFC 2822 $BE*$K$O@5$7$/2r<a(B |
|
|
$B$5$l$J$1$l$P$J$j$^$;$s$,(B ($B=PNO$O$9$Y$-$G$J$$(B)$B!"(B |
|
|
$B$3$l0J30$NJ8;z!"Nc$($P@)8fJ8;z(B <code class="character">ESCAPE</code> $B$G$bF1$8$h$&$K$J$j$^$9!#(B |
|
|
$B$3$A$i$O40A4$K4V0c$$$G$9!#(B</p> |
|
|
<p class="note">$B;29M(B: $B<BAuJ}?K$H$7$F$OIT@5$JCM$O%b%8%e!<%k$K(B |
|
|
$BEO$9A0$KCF$/$Y$-$H$$$&9M$(J}$b$"$k$G$7$g$&!#(B |
|
|
$B$G$b$=$s$J$N$OITJX$G$9!#(B</p> |
|
73 |
|
|
74 |
<p>$B$H$$$&$3$H$G!"$O$8$a$O4{B8$N%b%8%e!<%k$N(B wrapper ($B$"$k$$$OJd40(B) |
<p>$B$H$$$&$3$H$G!"$O$8$a$O4{B8$N%b%8%e!<%k$N(B wrapper ($B$"$k$$$OJd40(B) |
75 |
$B$r=q$/$D$b$j$G$7$?$,!"$J$s$@$+$4$A$c$4$A$c$7$F$$$F!"(B |
$B$r=q$/$D$b$j$G$7$?$,!"$J$s$@$+$4$A$c$4$A$c$7$F$$$F!"(B |
78 |
<h2>$BFC?'(B ($B$H$$$&Dx$N$b$N$G$b$J$$!#(B)</h2> |
<h2>$BFC?'(B ($B$H$$$&Dx$N$b$N$G$b$J$$!#(B)</h2> |
79 |
|
|
80 |
<ol> |
<ol> |
81 |
<li>$B7k9=(B($BFf(B)$B%*%V%8%'%/%H;X8~$G$9!#(B</li> |
<li>$B7k9=%*%V%8%'%/%H;X8~$G$9!#(B</li> |
82 |
<li>RFC 822/2822 $B$N(B <code class="bnf rfc2822">group</code> $B$r2r<a=PMh$^$9!#(B</li> |
<li>RFC 822/2822 $B$N(B <code class="bnf rfc2822">group</code> $B$r2r<a=PMh$^$9!#(B</li> |
83 |
<li><a href="urn:ietf:id:draft-ietf-usefor-msg-id-alt-00">draft-ietf-usefor-msg-id-alt-00</a> $B$K4p$E$$$?Aw?.%"%I%l%9$J$I$K$h$k(B <code class="rfc2822">Message-ID</code> $B$r@8@.=PMh$^$9!#(B</li> |
<li><a href="urn:ietf:id:draft-ietf-usefor-msg-id-alt-00">draft-ietf-usefor-msg-id-alt-00</a> $B$K4p$E$$$?Aw?.%"%I%l%9$J$I$K$h$k(B <code class="rfc2822">Message-ID</code> $B$r@8@.=PMh$^$9!#(B</li> |
84 |
<li>$BJ8;z%3!<%IFHN)(B (CSI) $B$G$9!#(B ($BC"$7(B RFC 822 $B$G$"$kET9g>e(B($BFf(B)$B!"(B |
<li><a href="charset" title="$BJ8;z%3!<%I$N07$$(B">$BJ8;z%3!<%IJQ49=hM}$r30It$KDI$$=P$7$F$$$^$9(B</a>$B!#(B |
85 |
ASCII $B8_49$G$"$kI,MW$O$"$j$^$9!#(B EBCDIC $B$H$+$OL5M}$G$9(B:-<)</li> |
jcode.pl $B$G$b(B Jcode.pm $B$G$b(B Encode::* $B$G$b!"9%$-$J$b$N$r$*;H$$2<$5$$!#(B</li> |
86 |
|
<li>MIME (<a href="urn:ietf:rfc:2045">RFC 2045</a>, |
87 |
|
<a href="urn:ietf:rfc:2046">2046</a>) $B$K$[$\40A4$KBP1~$7$F$$$^$9!#(B</li> |
88 |
</ol> |
</ol> |
89 |
|
|
90 |
<h2>$B3F;EMM$X$NBP1~>u67(B</h2> |
<h2>$B3F;EMM$X$NBP1~>u67(B</h2> |
91 |
|
|
92 |
<ol> |
<ol> |
93 |
<li>$BEE;R%a%$%k$N%a%C%;!<%8(B (RFC 822, RFC 2822) |
<li>$BEE;R%a%$%k$N%a%C%;!<%8(B (RFC 822, RFC 2822) |
94 |
$B$NA45!G=$K(B ($BH4$1$,L5$1$l$P(B) $BBP1~$7$F$$$^$9!#(B |
$B$NA45!G=$KBP1~$7$F$$$^$9!#(B</li> |
|
$BC"$7D9$5@)8B$J$I$O%A%'%C%/$7$F$$$^$;$s!#(B (MIME $B$N(B |
|
|
<code class="mime">Content-Transfer-Encoding</code> |
|
|
$B$H0l=o$K<BAuM=Dj(B)</li> |
|
95 |
<li>$BEE;R%K%e!<%95-;v(B (<a href="/uri-res/N2L?urn:ietf:rfc:1036">RFC 1036</a>, |
<li>$BEE;R%K%e!<%95-;v(B (<a href="/uri-res/N2L?urn:ietf:rfc:1036">RFC 1036</a>, |
96 |
<a href="spec/son-of-RFC1036">son-of-RFC1036</a>, |
<a href="spec/son-of-RFC1036">son-of-RFC1036</a>, |
97 |
<a href="/uri-res/N2L?urn:ietf:id:draft-usefor-article-06"> |
<a href="/uri-res/N2L?urn:ietf:id:draft-usefor-article-06"> |
98 |
draft-usefor-article (06)</a>) $B$NF,NN0h$NB?$/$KBP1~$7$F$$$^$9!#(B</li> |
draft-usefor-article (06)</a>) $B$NF,NN0h$NB?$/$KBP1~$7$F$$$^$9!#(B</li> |
99 |
<li>MIME $B$NK\BNItJ,(B (body part) $B$K$O$^$@BP1~$7$F$$$^$;$s!#(B</li> |
<li>MIME $B$NK\J8ItJ,(B (body part) $B$KBP1~$7$F$$$^$9!#(B |
100 |
<li>MIME $B$NDI2CF,NN0h(B |
<ul> |
101 |
|
<li>$BB?ItJ,(B (multipart) $B$dJ,3d(B (message/partial), |
102 |
|
$B30ItK\J,(B (message/external-body) $B$r07$&$3$H$,=PMh$^$9!#(B</li> |
103 |
|
<li>text/plain; format=flowed |
104 |
|
(<a href="urn:ietf:rfc:2646">RFC 2646</a>) |
105 |
|
$B$KBP1~$7$F$$$^$9!#(B</li> |
106 |
|
<li>Content-Transfer-Encoding $B$O(B Base64, Quoted-Printable |
107 |
|
$B$OL^O@!"(B x-uuencode, x-gzip64 $B$K$bBP1~!#(B |
108 |
|
RFC 2822 $B%a%$%k=PNO%b!<%I$G$O!"K\J8$,(B8$B%S%C%H$G$b<+F0E*$KE,@Z$J(B |
109 |
|
CTE $B$GId9f2=$7$^$9!#(B</li> |
110 |
|
</ul> |
111 |
|
</li> |
112 |
|
<li>MIME $B$NF,NN0h(B |
113 |
(<a href="/uri-res/N2L?urn:ietf:rfc:2045">RFC 2045</a>, |
(<a href="/uri-res/N2L?urn:ietf:rfc:2045">RFC 2045</a>, |
114 |
<code class="mime">Content-Disposition</code>) $B$KBP1~$7$F$$$^$9!#(B |
<code class="mime">Content-Disposition</code>) $B$KBP1~$7$F$$$^$9!#(B |
115 |
$B%Q%i%a!<%?!<CM3HD%(B (<a href="/uri-res/N2L?urn:ietf:rfc:2231">RFC 2231</a>) |
$B%Q%i%a!<%?!<CM3HD%(B (<a href="/uri-res/N2L?urn:ietf:rfc:2231">RFC 2231</a>) |
116 |
$B$bF~=PNO$H$b$K<BAu$7$^$7$?!#(B</li> |
$B$bF~=PNO$H$b$K<BAu$7$^$7$?!#(B</li> |
117 |
<li>MIME $BId9f2=8l(B (<code class="mime bnf">encoded-word</code>) |
<li>MIME $BId9f2=8l(B (<code class="mime bnf">encoded-word</code>) |
118 |
$B$N2rFI$KBP1~$7$F$$$^$9(B:-) $BC"$7JLESJQ49=hM}$r;XDj$9$kI,MW$,$"$j$^$9!#(B |
$B$N2rFI$KBP1~$7$F$$$^$9(B:-)</li> |
|
(<a href="#code">$BJ8;z%3!<%I$N07$$(B</a>$B;2>H(B)</li> |
|
119 |
<li>HTTP/1.0, HTTP/1.1, CGI/1.1, CGI/1.2 $B$NF,NN0h$N$&$A!"(B |
<li>HTTP/1.0, HTTP/1.1, CGI/1.1, CGI/1.2 $B$NF,NN0h$N$&$A!"(B |
120 |
$B$4$/0lIt$KBP1~$7$F$$$^$9!#(B MHTML $B$N(B |
$B$4$/0lIt$KBP1~$7$F$$$^$9!#(B MHTML $B$N(B |
121 |
<code class="mime">Content-Location</code> $B$K$bBP1~$7$F$$$^$9!#(B</li> |
<code class="mime">Content-Location</code> $B$K$bBP1~$7$F$$$^$9!#(B</li> |
122 |
<li>$BF|IU7A<0$G$O(B RFC 822/<a href="urn:ietf:rfc:1123">1123</a>, |
<li>$BF|IU7A<0$G$O(B RFC 822/<a href="urn:ietf:rfc:1123">1123</a>, |
123 |
<a href="urn:ietf:rfc:733">RFC 733</a>, asctime, ISO 8601 (HTML) |
<a href="urn:ietf:rfc:733">RFC 733</a>, asctime, ISO 8601 (HTML) |
124 |
$B$J$I$KBP1~$7$F$$$^$9!#(B</li> |
$B$J$I$KBP1~$7$F$$$^$9!#F|IU$N=PNO$O(B sprintf |
125 |
|
$B$NMM$J=q<0J8;zNs$rM?$($k$3$H$G!"B?<oB?MM$J7A<0$KBP1~!#(B</li> |
126 |
|
<li>X-Moe $B%7%j!<%:$KBP1~$7$F$$$^$9(B:-)</li> |
127 |
</ol> |
</ol> |
128 |
|
|
129 |
<h2>$B@)8B;v9`(B</h2> |
<h2>$B@)8B;v9`(B</h2> |
135 |
$BJ];}$7$F$$$^$9!#$G$9$+$i$"$^$jBg$-$J%a%C%;!<%8$N=hM}$K$O(B |
$BJ];}$7$F$$$^$9!#$G$9$+$i$"$^$jBg$-$J%a%C%;!<%8$N=hM}$K$O(B |
136 |
$B8~$$$F$$$J$$$G$7$g$&!#(B</li> |
$B8~$$$F$$$J$$$G$7$g$&!#(B</li> |
137 |
<li><code>CR</code> $B$d(B <code>LF</code> $B$,C1BN$G=P8=$9$k>l9g!"(B |
<li><code>CR</code> $B$d(B <code>LF</code> $B$,C1BN$G=P8=$9$k>l9g!"(B |
138 |
$B@5$7$/=hM}=PMh$^$;$s!#(B (<code>CRLF</code> $B$HEy2A$H$_$J$7$^$9!#(B) |
$B@5$7$/=hM}=PMh(B<del>$B$^$;$s(B</del><ins>$B$J$$$3$H$,$"$j$^$9(B |
139 |
|
($B6a$$>-Mh$NHG$G2~A1$NM=Dj(B)</ins>$B!#(B (<code>CRLF</code> $B$HEy2A$H$_$J$7$^$9!#(B) |
140 |
$B>-Mh$NHG$G$O%*%W%7%g%s$G@)8f2DG=$K$J$k$+$b$7$l$^$;$s!#(B</li> |
$B>-Mh$NHG$G$O%*%W%7%g%s$G@)8f2DG=$K$J$k$+$b$7$l$^$;$s!#(B</li> |
141 |
<li>$B$"$C$?$iNI$5$=$&$J5!G=$,L$<BAu$+$b$7$l$^$;$s!#(B |
<li>$B@bL@J8(B (document; pod) $B$,$$$$2C8:$G$9(B ($B=q$/$N$,LLE]$@(B)$B!#(B</li> |
|
($BM_$7$$5!G=$,L$<BAu$@$C$?$i!"(B |
|
|
<a href="mailto:w@suika.fam.cx">$BEE;R%a%$%k(B</a>$B$J$I$G65$($F2<$5$$!#(B)</li> |
|
|
<li>$B3F%b%8%e!<%k$N%*%W%7%g%sBN7O$,$"$^$j@0Hw$5$l$F$$$^$;$s!#(B |
|
|
($B$=$l$G$b5$;}$A0-$/$J$$DxEY$K$OBN7OE*$@$H;W$$$^$9!#(B)</li> |
|
|
<li>$B@bL@J8(B (document) $B$,NI$$2C8:$G$9!#(B</li> |
|
|
</ol> |
|
|
|
|
|
<h2>$B:#8e$NM=Dj(B</h2> |
|
|
|
|
|
<ol> |
|
|
<li>$BEE;R%K%e!<%9$NF,NN0h(B (RFC 1036, |
|
|
<a href="spec/son-of-RFC1036">son-of-RFC1036</a>, |
|
|
draft-usefor-article) $B$N40A4<BAu(B</li> |
|
|
<li><del>MIME $B$NF,NN0h$N<BAu!#(B</del></li> |
|
|
<li>$BDI2C(B/$BHsI8=`$NF,NN0h$N<BAu!#(B</li> |
|
|
<li>MIME $BK\BN(B (<code class="bnf rfc822">body</code>) $B$N<BAu!#(B</li> |
|
|
<li><del>$BJ8;zId9fJQ49$N$?$a$N(B hook $B$N<BAu(B?</del></li> |
|
|
<li>documentation$B!#(B</li> |
|
|
<li>$B;HMQNc$N:n@.!#(B</li> |
|
142 |
</ol> |
</ol> |
143 |
|
|
144 |
<h2>$BI,MW4D6-(B</h2> |
<h2>$BI,MW4D6-(B</h2> |
145 |
|
|
146 |
<ol> |
<ol> |
147 |
<li>Perl (perl 5.6 $B0J9_$^$?$O(B<span title="human parser">$B?M4V2r@O<T(B</span>:-)) |
<li>Perl 5.6 $B0J9_(B |
148 |
<p class="note"><code class="bnf rfc822">comment</code> |
<p class="note"><code class="bnf rfc822">comment</code> |
149 |
$B$rI=$9$N$K@55,I=8=(B <code class="regex">(??{ <var>code</var> })</code> |
$B$rI=$9$N$K@55,I=8=(B |
150 |
|
<code class="regex">(??{ <var>code</var> })</code> |
151 |
$B$r;H$C$F$$$k$N$G!"$3$l$r2r<a=PMh$k!"(B |
$B$r;H$C$F$$$k$N$G!"$3$l$r2r<a=PMh$k!"(B |
152 |
5.6 $B0J9_$NHG$G$"$kI,MW$,$"$j$^$9!#(B</p> |
5.6 $B0J9_$NHG$G$"$kI,MW$,$"$j$^$9!#(B</p> |
153 |
</li> |
</li> |
154 |
<li>Digest::MD2, Digest::MD5, Digest::SHA1 |
<li>Digest::MD2, Digest::MD5, Digest::SHA1 |
155 |
<p>Message-ID $B$N@8@.$K$3$l$i$r;HMQ$9$k>l9g$N$_!"(B |
<p>Message-ID $B$N@8@.$K$3$l$i$r;HMQ$9$k>l9g$N$_!"(B |
156 |
<code>Message::Field::MsgID::MsgID</code> $B$,;H$$$^$9!#(B</p> |
Message::Field::MsgID $B$,;H$$$^$9!#(B</p> |
157 |
<p>$B$3$l$i$,MQ0U$5$l$F$$$J$$4D6-$G$O%(%i!<$K$J$k$N$G!"(B |
<p><code class="bnf mime">Content-MD5:</code> $BNN0h$NIU2C$d8!>Z$r9T$&>l9g!"(B |
158 |
($B8=>u$G$O(B) $B>e5-%b%8%e!<%k$N3:EvItJ,$r=q$-49$($FBP=h$7$F2<$5$$!#(B</p> |
Digest::MD5 $B$,I,MW$G$9!#(B (Message::Entity)</p> |
159 |
|
</li> |
160 |
|
<li>MIME::Base64 |
161 |
|
<p>$B$A$J$_$K!"(B Quoted-Printable $B$d(B RFC 2231 $B$N(B |
162 |
|
% $BId9f2=$O<+NO$GI|9f$7$^$9!#(B</p> |
163 |
</li> |
</li> |
164 |
<li>$BJ8;z%3!<%IJQ49=hM}(B |
<li>$BJ8;z%3!<%IJQ49=hM}(B |
165 |
<p>$BF|K\8l%a%C%;!<%8$r07$&$J$iI,?\$G$7$g$&!#(B |
<p>$BF|K\8l%a%C%;!<%8$r07$&$J$iI,?\$G$7$g$&!#(B |
172 |
|
|
173 |
<p>suika.fam.cx $B$N(B SSH account $B$r$*;}$A$N>l9g!"(B CVS $B$+$iF~<j=PMh$^$9!#(B</p> |
<p>suika.fam.cx $B$N(B SSH account $B$r$*;}$A$N>l9g!"(B CVS $B$+$iF~<j=PMh$^$9!#(B</p> |
174 |
|
|
175 |
<p class="example">$ cvs -d :ext:<var xml:lang="en">username</var>@suika.fam.cx:/home/cvs -d perl/lib/Message/</p> |
<p class="example"><samp>$ </samp><kbd>cvs -d :ext:<var xml:lang="en">username</var>@suika.fam.cx:/home/cvs co messaging/manakai</kbd></p> |
176 |
|
|
177 |
|
<p>Web $B$+$i$b<h$j=P$;$^$9(B: |
178 |
|
<code class="uri"><<a href="/gate/cvs/messaging/manakai/">http://suika.fam.cx/gate/cvs/messaging/manakai/</a>></code></p> |
179 |
|
|
180 |
<p>Web $B$+$i$b<h$j=P$;$^$9!#(B <<a href="/gate/cvs/perl/lib/Message/">http://suika.fam.cx/gate/cvs/perl/lib/Message/</a>> (tarball $B$G0l3g<hF@$b=PMh$^$9!#(B)</p> |
<p><a href="/gate/cvs/messaging/manakai/manakai.tar.gz?tarball=1">$B:G?73+H/HG(B |
181 |
|
snapshot $B$N(B tarball $B$r<hF@(B</a>$B$9$k$3$H$b$G$-$^$9!#(B</p> |
182 |
|
|
183 |
<h2>$B%i%$%;%s%9(B</h2> |
<h2>$B%i%$%;%s%9(B</h2> |
184 |
|
|
185 |
<p>Message::* Perl modules $B$O<+M3%=%U%H%&%'%"$G$9!#(B |
<p>manakai $B$O<+M3%=%U%H%&%'%"$G$9!#(B |
186 |
GNU GPL $B$K=>$C$FMxMQ=PMh$^$9!#>\$7$/$O3F%U%!%$%k$r8fMw2<$5$$!#(B</p> |
<a href="http://www.gnu.org/">GNU</a> |
187 |
|
<a href="/c/gnu/gpl">GPL</a> $B$K=>$C$FMxMQ=PMh$^$9!#(B |
188 |
|
$B>\$7$/$O3F9=@.%U%!%$%k$r8fMw2<$5$$!#(B</p> |
189 |
|
|
190 |
<h2>$B;29MJ88%(B</h2> |
<h2>$B4XO"J8=q$J$I(B</h2> |
191 |
|
|
192 |
<ul> |
<ul> |
193 |
<li><a href="spec/">$B4XO"$9$k;EMM=q(B (RFC, Internet-Draft $BEy(B)</a></li> |
<li id="code"><a href="charset">$BJ8;z%3!<%I$N07$$(B</a></li> |
194 |
|
<li><a href="/~wakaba/-temp/wiki/wiki?manakai">SuikaWiki:manakai</a></li> |
195 |
</ul> |
</ul> |
196 |
|
|
197 |
<h2 id="code">$BJ8;z%3!<%I$N07$$(B</h2> |
<h2>$B1~MQ(B</h2> |
|
|
|
|
<p>$BH\$7$$$3$H$GF,$rG:$^$9$N$O7y$J$N$G(B($BON(B)$B!"(B |
|
|
Message::* $B$OId9f2=J}K!FHN)(B (CSI) $B$rL\;X$7$F<BAu$7$F$$$^$9!#(B |
|
|
($BC"$7(B ASCII $B$N$7$,$i$_$@$1$OCG$A@Z$C$F$$$^$;$s(B:-)) |
|
|
0x00 $B!A(B 0x7F $B$,(B ASCII ($B$^$?$O(B ASCII $B$H8+$J$7$FNI$$$b$N(B) $B$G$"$k(B |
|
|
$B>l9g$O!"(B Message::* $B$rDL$7$?$3$H$G%G!<%?$,2u$l$k$3$H$O(B |
|
|
$BL5$$$H;W$$$^$9!#(B</p> |
|
|
|
|
|
<p>($B$b$A$m$s!"(B RFC 822 $B$J$I3F;EMM$K>H$i$7$F@5E}(B($BE*(B)$B$G(B |
|
|
$B$"$kI,MW$,$"$j$^$9!#(B <code class="bnf rfc822">atom</code> |
|
|
$B$K(B8$B%S%C%H!&%3!<%I$,4^$^$l$F$$$k$H@5$7$/07$($^$;$s!#(B) |
|
|
($BAa$$OC$,!"(B <code class="bnf rfc822">quoted-string</code> |
|
|
$B$J$I$G$O(B8$B%S%C%HF)2a$@$H$$$&$3$H$G$9!#2s$j$/$I$/$F$4$a$s$J$5$$!#(B)</p> |
|
|
|
|
|
<p>$B4{Dj$N>uBV$G$OJ8;z%3!<%I$K4X78$9$kJQ49=hM}$O9T$o$l$^$;$s!#(B |
|
|
$B$7$+$7!"%U%C%/4X?t$C$]$$$b$N(B($BFf(B)$B$r;XDj$9$k$3$H$G!"(B |
|
|
$BJQ49=hM}$r$5$;$i$l$^$9!#(B</p> |
|
|
|
|
|
<p>$B;XDj=PMh$k%U%C%/4X?t$C$]$$$b$N$O(B2$B<oN`$G$9!#(B |
|
|
<code>DECODER</code> $B$O!"85$N%a%C%;!<%8$r2r@O$9$k;~(B |
|
|
(<code class="perl">parse ()</code>) $B$KE,598F$S=P$5$l$^$9!#(B |
|
|
<code>ENCODER</code> $B$O!"%a%C%;!<%8$H$7$FJ8;zNs2=$9$k:](B |
|
|
(<code class="perl">stringify ()</code> $B$J$I(B) $B$KE,598F$S=P$5$l$^$9!#(B</p> |
|
|
|
|
|
<p>$B$3$l$i$N4X?t$O!"EvA3!"Ev3:=hM}$,8F$S=P$5$l$kA0$K;XDj$7$F$*$/(B |
|
|
$BI,MW$,$"$j$^$9!#(B |
|
|
<samp class="perl">Message::Entity->parse</samp> $B$J$I$9$kA0$K(B |
|
|
$BDj5A$7$F$*$/$HNI$$$G$7$g$&!#(B</p> |
|
|
|
|
|
<pre class="example perl"> |
|
|
require Message::MIME::Charset; |
|
|
$Message::MIME::Charset::DECODER{'*default'} = sub {jcode::euc ($_[1])}; |
|
|
$Message::MIME::Charset::ENCODER{'*default'} = sub {jcode::jis ($_[1], 'euc')}; |
|
|
</pre> |
|
198 |
|
|
199 |
<p>$B$3$NNc$G$O!"(B jcode.pl $B$rJQ49=hM}$K;H$$$^$9!#(B |
<ul> |
200 |
($B$b$A$m$s!"4{$K(B <code class="perl">require</code> |
<li><a href="/gate/cvs/tool/bunshin/">Bunshin.pm</a> |
201 |
$B$5$l$F$$$k$H2>Dj$7$F$$$^$9!#(B)</p> |
<p>Web $B>e$NO"B3$9$k;q8;(B ($B7G<(HD$N5-;v$N$h$&$J$b$N(B) |
202 |
<p>$B:G=i$N(B <code class="perl">require</code> $B$G!"JQ49=hM}$rC4Ev$7$F$$$k(B |
$B$r@Z$j=P$7$F(B RFC 822 $B7A<0$N%a%C%;!<%8$K$9$k%(%s%8%sItJ,!#(B</p> |
203 |
<code class="perl">Message::MIME::Charset</code> $B$rFI$_9~$_$^$9!#(B |
</li> |
204 |
($B$3$&$7$F$*$+$J$$$H!"8e$+$i4{DjCM(B (= $BL5JQ49(B) $B$G(B |
<li><a href="/gate/cvs/tool/suikawari/">$B$9$$$+$o$j(B</a> |
205 |
<code class="perl">*default</code> $B$,>e=q$-$5$l$F$7$^$$$^$9!#(B)</p> |
<p>Bunshin.pm $B$r;H$C$F!"EE;R%K%e!<%9$K5-;v$rEj9F$9$k(B |
206 |
|
script$B!#(B (cron $B$H$+$+$i8F$S=P$7$F;H$&!#(B)</p> |
207 |
<p>$B$3$N(B code $B$r;H$C$?%9%/%j%W%H$OFbIt=hM}$rF|K\8l(B EUC |
</li> |
208 |
$B$G9T$&$H2>Dj$7$F$$$^$9!#$G$9$+$i!"(B <code class="perl">DECODER</code> |
</ul> |
|
$B$GF|K\8l(B EUC $B$KJQ49$7$^$9!#(B</p> |
|
|
<p>$B$^$?!"F|K\8l%a%C%;!<%8$G$O(B <code>ISO-2022-JP</code> |
|
|
$B$r;H$&$N$,47=,$G$9$+$i!"(B <code class="perl">ENCODER</code> |
|
|
$B$G$O(B 7$B%S%C%H(B JIS $B$KJQ49$7$F$$$^$9!#(B</p> |
|
|
<p>$B=hM}$r9T$&4X?t$O!"0z?t$,(B2$B$D0J>eM?$($i$l$^$9!#(B |
|
|
1$B$DL\$N0z?t$O8F$S=P$7$?(B class module, $B$$$o$f$k(B |
|
|
<code class="perl">$self</code> $B$G$9!#(B($B$3$N>l9g(B self $B$G$O$"$j$^$;$s$,(B:-) |
|
|
$B$G$bIaDL$OI,MW$J$$$G$7$g$&!#(B</p> |
|
|
<p>2$B$DL\$N0z?t$O=hM}BP>]$NJ8;zNs$G$9!#(B</p> |
|
|
<p>3$B$DL\0J9_$N0z?t$O!"DI2C%*%W%7%g%s$N%O%C%7%e$G$9!#(B |
|
|
$B$?$@$7!"8=:_DI2C%*%W%7%g%s$ODj5A$5$l$F$$$^$;$s!#(B</p> |
|
|
<p>$B4X?t$,JV$9CM$O(B($B:#$N$H$3$m(B)$B0l$D$@$1$G$9!#(B |
|
|
$B=hM}$,=*$o$C$?J8;zNs$G$9!#JQ497k2L$H$7$F2?$b$J$/$J$C$F$7$^$C$?$i!"(B |
|
|
$B$b$A$m$s6uJ8;zNs$rJV$7$F9=$$$^$;$s!#(B (<code class="perl">undef</code> |
|
|
$B$h$j$b6uJ8;zNs$NJ}$,K>$^$7$$$G$7$g$&!#(B)</p> |
|
|
|
|
|
<p>$B$5$F!">e5-$NNc$G$O!V(B<code>*default</code>$B!W$N(B EN/DECODER |
|
|
$B$r;XDj$7$^$7$?$,!"$3$3$K$OBe$o$j$K(B charset $BL>$r;XDj=PMh$^$9!#(B</p> |
|
|
|
|
|
<pre class="perl example"> |
|
|
$Message::MIME::Charset::DECODER{'iso-2022-jp'} = sub {jcode::euc ($_[1], 'jis')}; |
|
|
</pre> |
|
|
|
|
|
<p>$B$3$3$G$O!"(B <code>ISO-2022-JP</code> $B$rFbIt%3!<%I$KJQ49$9$k(B |
|
|
$BJ}K!$rDj5A$7$F$$$^$9!#(B charset $BL>(B ($B$*$h$S!V(B<code>*default</code>$B!W(B |
|
|
$B$OI,$:>.J8;z$G=q$$$F2<$5$$(B!)</p> |
|
|
<p>MIME body $B$d!"(B encoded-word, RFC 2231 $B$N3HD%%Q%i%a!<%?!<CM(B |
|
|
$B$J$I!"(B charset $B$,;XDj$5$l$F$$$k;~$O$=$N(B charset $BL>$NJQ494X?t$,(B |
|
|
$B8F$S=P$5$l$^$9!#(B ($B;XDj$5$l$?(B charset $BL>$NJQ494X?t$,L$Dj5A$N;~$O!"(B |
|
|
$B2?$b=hM}$7$^$;$s!#(B) $B$3$l0J30$N>lLL$G$O!"(B <code>*default</code> |
|
|
$B$GDj5A$5$l$?4X?t$,;H$o$l$^$9!#(B</p> |
|
|
|
|
|
<p>$B:G8e$K!"F|K\8l%a%C%;!<%8$r07$&:]$NNc$r5s$2$F$*$-$^$9!#(B</p> |
|
|
|
|
|
<pre class="example perl"> |
|
|
<span class="comment">## jcode.pl $B$r;HMQ(B</span> |
|
|
require 'jcode.pl'; |
|
|
require Message::MIME::Charset; |
|
|
$Message::MIME::Charset::DECODER{'*default'} = sub {jcode::euc ($_[1])}; |
|
|
$Message::MIME::Charset::DECODER{'iso-2022-jp'} = sub {jcode::euc ($_[1], 'jis')}; |
|
|
$Message::MIME::Charset::DECODER{'euc-jp'} = sub {$_[1]}; |
|
|
$Message::MIME::Charset::DECODER{'shift_jis'} = sub {jcode::euc ($_[1], 'sjis')}; |
|
|
$Message::MIME::Charset::ENCODER{'*default'} = sub { |
|
|
my $s = $_[1]; |
|
|
<span class="comment">## $B@55,2=(B</span> |
|
|
jcode::tr(\$s, |
|
|
"\xa3\xb0-\xa3\xb9\xa3\xc1-\xa3\xda\xa3\xe1-\xa3\xfa\xa1\xf5". |
|
|
"\xa1\xa4\xa1\xa5\xa1\xa7\xa1\xa8\xa1\xa9\xa1\xaa\xa1\xae". |
|
|
"\xa1\xb0\xa1\xb2\xa1\xbf\xa1\xc3\xa1\xca\xa1\xcb\xa1\xce". |
|
|
"\xa1\xcf\xa1\xd0\xa1\xd1\xa1\xdc\xa1\xf0\xa1\xf3\xa1\xf4". |
|
|
"\xa1\xf6\xa1\xf7\xa1\xe1\xa2\xaf\xa2\xb0\xa2\xb2\xa2\xb1". |
|
|
"\xa1\xe4\xa1\xe3\xA1\xC0\xA1\xA1" |
|
|
=> '0-9A-Za-z&,.:;?!`^_/|()[]{}+$%#*@=\'"~-><\\ '); |
|
|
jcode::jis ($s, 'euc', 'z') |
|
|
}; |
|
|
</pre> |
|
209 |
|
|
210 |
<pre class="example perl"> |
<h2>$B:#8e$NM=Dj(B</h2> |
|
<span class="comment">## Jcode.pm $B$r;HMQ(B</span> |
|
|
use Jcode; |
|
|
require Message::MIME::Charset; |
|
|
$Message::MIME::Charset::DECODER{'*default'} = sub {jcode::euc ($_[1])}; |
|
|
$Message::MIME::Charset::DECODER{'iso-2022-jp'} = sub {Jcode->new ($_[1], 'jis')->euc}; |
|
|
$Message::MIME::Charset::DECODER{'euc-jp'} = sub {$_[1]}; |
|
|
$Message::MIME::Charset::DECODER{'shift_jis'} = sub {Jcode->new ($_[1], 'sjis')->euc}; |
|
|
$Message::MIME::Charset::DECODER{'utf-8'} = sub {Jcode->new ($_[1], 'utf8')->euc}; |
|
|
$Message::MIME::Charset::ENCODER{'*default'} = sub {Jcode->new ($_[1], 'euc')->jis}; |
|
|
$Message::MIME::Charset::ENCODER{'utf-8'} = sub {Jcode->new ($_[1], 'euc')->utf8}; |
|
|
</pre> |
|
211 |
|
|
212 |
<p>Perl 5.8 $B$G(B Encode $B%b%8%e!<%k$,;H$($k$h$&$K$J$l$P!"(B |
<ol> |
213 |
$B$b$C$H3Z$K$J$k$H4|BT$7$F$$$^$9!#(B</p> |
<li>$BEE;R%K%e!<%9$NF,NN0h(B (RFC 1036, |
214 |
|
<a href="spec/son-of-RFC1036">son-of-RFC1036</a>, |
215 |
|
draft-usefor-article) $B$N40A4<BAu(B</li> |
216 |
|
<li>$BDI2C(B/$BHsI8=`$NF,NN0h$N<BAu!#(B</li> |
217 |
|
<li>documentation$B!#(B</li> |
218 |
|
<li>$B;HMQNc$N:n@.!#(B</li> |
219 |
|
<li>$B4{B8%b%8%e!<%k$,MxMQ=PMh$kItJ,$O!"$=$l$r8F$S=P$9$h$&$K$9$k$+(B |
220 |
|
$B$=$N(B code $B$rN.MQ$9$k!#(B</li> |
221 |
|
<li>$BN`;w%b%8%e!<%k$H$N3&LL$N6&DL2=(B</li> |
222 |
|
<li>HTTP $BMQ$K;H$($k$h$&$K$9$k(B</li> |
223 |
|
</ol> |
224 |
|
|
225 |
<div class="navigation"> |
<div class="navigation"> |
226 |
[<a href="/" title="$B$3$N%5!<%P!<$N<sJG(B">/</a> |
[<a href="/" title="$B$3$N%5!<%P!<$N<sJG(B">/</a> |