This file is indexed.

/usr/share/doc/HOWTO/ja-html/Virtual-Services-HOWTO-9.html is in doc-linux-ja-html 2006.05.25-1.1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
 <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
 <TITLE>Virtual Services Howto: ²¾ÁÛŪ¤ÊMail/Pop</TITLE>
 <LINK HREF="Virtual-Services-HOWTO-10.html" REL=next>
 <LINK HREF="Virtual-Services-HOWTO-8.html" REL=previous>
 <LINK HREF="Virtual-Services-HOWTO.html#toc9" REL=contents>
</HEAD>
<BODY>
<A HREF="Virtual-Services-HOWTO-10.html">¼¡¤Î¥Ú¡¼¥¸</A>
<A HREF="Virtual-Services-HOWTO-8.html">Á°¤Î¥Ú¡¼¥¸</A>
<A HREF="Virtual-Services-HOWTO.html#toc9">Ìܼ¡¤Ø</A>
<HR>
<H2><A NAME="s9">9. ²¾ÁÛŪ¤ÊMail/Pop</A></H2>

<H2><A NAME="ss9.1">9.1 Qmail ¤ÎÃí°ÕÅÀ</A>
</H2>

<P>¤³¤Î¾Ï¤Ïsendmail¤Î¤ß¤Ë´Ø¤¹¤ëÆâÍƤǤ¹¡£qmail¤Î¾Ï¤ÏHOWTO¤Î¼¡¤Î¥Ð¡¼¥¸¥ç¥ó
¤ÇÄɲä·¤Þ¤¹(<EM>ÌõÃí¡§</EM>Qmail¤Ë´Ø¤¹¤ë¥Þ¥Ë¥å¥¢¥ë¤Ï¡ÖQmail+MH¡×¤Ê¤É¤¬½Ð¤Æ
¤¤¤Þ¤¹)¡£
<H2><A NAME="ss9.2">9.2 ÌäÂê</A>
</H2>

<P>¸½ºß¡¢²¾Áۥ᡼¥ë¤Î¥µ¥Ý¡¼¥È¤Ë´Ø¤¹¤ëÍ×µá¤Ï¤Þ¤¹¤Þ¤¹Áý¤¨¤Æ¤¤¤Þ¤¹¡£Sendmail¤Ï
²¾Áۥ᡼¥ë¤ò¥µ¥Ý¡¼¥È¤¹¤ë¤È¸À¤Ã¤Æ¤¤¤Þ¤¹¤¬¡¢¤½¤ÎÆâÍƤϰۤʤë¥É¥á¥¤¥ó¤«¤é¤Î
¥á¡¼¥ë¼è¤ê¹þ¤ß¤Î¤³¤È¤Î¤è¤¦¤Ç¤¹¡£
¥á¡¼¥ë¤ò¤É¤³¤«¤Ë¥Õ¥©¥ï¡¼¥É¤µ¤»¤ë¤È¤¤¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤·¤«¤·¤â¤·¥í¡¼¥«¥ë
¥Þ¥·¥ó¤Ë¥Õ¥©¥ï¡¼¥É¤·¤¿¤ê<CODE>bob@domain1.com¡¢bob@domain2.com</CODE>¤Ë¥á¡¼¥ë¤¬
Íè¤ë¾ì¹ç¤Ê¤É¤Ç¤ÏƱ¤¸¥á¡¼¥ë¥Õ¥©¥ë¥À¤Ë¤¿¤Þ¤Ã¤Æ¤·¤Þ¤¦¤Ç¤·¤ç¤¦¡£¤³¤ì¤Ï
bob°¸¤Î¥á¡¼¥ë¤¬¼ÂºÝ¤Ï°ã¤¦¿Í°¸¤ÇÃæ¿È¤â°ã¤¦¤Î¤À¤«¤éÌäÂê¤Ç¤¹¡£
<P>
<H2><A NAME="ss9.3">9.3 °­¤¤²ò·èÊýË¡</A>
</H2>

<P>¥æ¡¼¥¶¡¼Ì¾¤ËÈÖ¹æ¤òÄɲÃ(Î㤨¤Ðbob1, bob2¤Ê¤É)¤·¤¿¤ê¡¢Æ¬¤Ëʸ»ú¤òÆþ¤ì¤Æ
dom1bob, dom2bob¤Ë¤·¤¿¤ê¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¥æ¡¼¥¶¡¼¤Î°ì°ÕÀ­(unique)¤ò
Êݾڤ¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤¹¡£¤³¤ì¤ò΢¤ÇÊÑ´¹¤¹¤ë¤è¤¦¤Ë mail¤äpop ¤ò¥Ï¥Ã¥¯(hack)
¤¹¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¤¬±ø¤¤(messy)ÊýË¡¤Ç¤¹¡£
½Ð¤Æ¤¤¤¯Êý¤Î¥á¡¼¥ë¤â¤Þ¤¿¥Ð¡¼¥Ê¡¼(¥Ø¥Ã¥À)¤Ë<CODE>maindomain.com</CODE>¤¬¤Ä¤¤¤Æ¤¤¤Æ
³Æ¥µ¥Ö¥É¥á¥¤¥ó¤Î¥á¡¼¥ë¥Ð¡¼¥Ê¡¼¤â°ã¤Ã¤¿¤â¤Î¤Ë¤·¤¿¤¤¤Î¤Ç¤¹¡£     
<P>
<H2><A NAME="ss9.4">9.4 Îɤ¤²ò·èÊýË¡</A>
</H2>

<P>³Æ²¾ÁÛ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë³Æ¥É¥á¥¤¥óÍѤÎ<CODE>/etc/passwd</CODE>¤òÍÑ°Õ¤·¤Æ¤¤
¤Þ¤¹¡£¤³¤ì¤Ï<CODE>bob@domain1.com</CODE>¤È<CODE>bob@domain2.com</CODE>¤¬¡¢ÊÌ¡¹¤Î
<CODE>/etc/passwd</CODE>¾å¤Î°ã¤¦¥æ¡¼¥¶¡¼¤Ç¤¢¤ê¡¢¥á¡¼¥ë¤Î¥È¥é¥Ö¥ë¤Ï¤Ê¤¤¤È¤¤¤¦
¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£¤³¤Î¥æ¡¼¥¶¡¼Ã£¤Ë¤Ï¼«Ê¬ÍѤÎspool¥Ç¥£¥ì¥¯¥È¥ê¤¬ÍÑ°Õ¤µ¤ì¤Æ¤¤¤Æ¡¢
³Æ²¾ÁÛ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Î¥á¡¼¥ë¥Õ¥©¥ë¥À¤Ï¸ß¤¤¤Ë°ã¤¦¤â¤Î¤Ç¤¢¤ë¤³¤È¤Ë¤Ê¤ê¤Þ
¤¹¡£
<P>¤·¤«¤·¡¢sendmail¤Ï¤Á¤ç¤Ã¤È¤·¤¿¥½¡¼¥¹¥³¡¼¥É¤Î½¤Àµ¤¬É¬ÍפǤ¹¡£
sendmail¤Ï<CODE>/etc/sendmail.cw</CODE>¤È¸Æ¤Ð¤ì¤ë¥Õ¥¡¥¤¥ë¤ò»ý¤Ã¤Æ¤¤¤Þ¤¹¡£
¤³¤ì¤Ïsendmail¤¬Â¾¤Î¥Û¥¹¥È¤ËžÁ÷¤·¤Ê¤¤¤Ç¥í¡¼¥«¥ë¤ËÇÛÁ÷¤¹¤ëÁ´¤Æ¤Î
¥Û¥¹¥È̾¤ò´Þ¤ó¤Ç¤¤¤ë¥Õ¥¡¥¤¥ë¤Ç¤¹¡£
<P>sendmail¤Ï¥Þ¥·¥ó¾å¤ÎÁ´¥Ç¥Ð¥¤¥¹¤ÎÆâÉô¥Á¥§¥Ã¥¯¤ò¡¢¥í¡¼¥«¥ëIP¤Ç¤³¤Î¥ê¥¹¥È¤ò
½é´ü²½¤¹¤ë¤¿¤á¤Ë¹Ô¤¤¤Þ¤¹¡£                      
¤â¤·Æ±¤¸¥Þ¥·¥ó¾å¤Î²¾Áۥɥᥤ¥ó´Ö¤Ç¥á¡¼¥ë¤òÁ÷¤ë¾ì¹ç¡¢ÌäÂ꤬½Ð¤Æ¤­¤Æ¤·¤Þ¤¤
¤Þ¤¹¡£sendmail¤Ë¤Ï¾¤Î²¾Áۥɥᥤ¥ó¤¬¥í¡¼¥«¥ë¥¢¥É¥ì¥¹¤Ç¤¢¤ê¡¢¥á¡¼¥ë¤â¥í¡¼
¥«¥ë¤Ë¥¹¥×¡¼¥ë¤¹¤ë¤È¤¤¤¦¹Í¤¨¤Ï¤Ê¤¤¤Î¤Ç¤¹¡£
<P>Î㤨¤Ð<CODE>bob@domain1.com</CODE>¤µ¤ó¤¬<CODE>fred@domain2.com</CODE>¤Ë¥á¡¼¥ë¤òÁ÷¤Ã¤¿¤È
¤·¤Þ¤¹¡£<CODE>domain1.com</CODE>¤Îsendmail¤Ï<CODE>domain2.com</CODE>¤¬¥í¡¼¥«¥ë¤Ç¤¢¤ë¤È
ȽÃǤ¹¤ë¤Î¤Ç<CODE>domain1.com</CODE>¤Ë¥á¡¼¥ë¤ò¥¹¥×¡¼¥ë¤·¤Æ¤·¤Þ¤¤¡¢·ë²Ì¤È¤·¤Æ
<CODE>domain2.com</CODE>¤Ë¥á¡¼¥ë¤¬ÆϤ¯¤³¤È¤Ï¤¢¤ê¤Þ¤»¤ó¡£
¤½¤³¤Çsendmail¤ò½¤Àµ¤·¤Æ¤ä¤ê¤Þ¤¹(Ãø¼Ô¤Ïv8.8.5¤Îsendmail¤Ç¤³¤ì¤ò¹Ô¤¤¡¢ÆäË
ÌäÂê¤Ï¤¢¤ê¤Þ¤»¤ó)¡£<CODE>src/main.c</CODE>¤Î494¹ÔÊÕ¤ê¤òÊÔ½¸¤·¤Þ¤¹¡£
sendmail¤Î¥½¡¼¥¹¤ÏŬÅö¤Ê¥µ¥¤¥È¤ä¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥óCDROM¤«¤éÆþ¼ê¤Ç¤­¤Þ
¤¹¡£
<PRE>
vi v8.8.5/src/main.c # Approximately Line 493
</PRE>

¤È¤·¤Æ¡¢
<PRE>
load_if_names();
</PRE>

¤È¤¤¤¦²Õ½ê¤ò
<PRE>
/* load_if_names(); Commented out since hurts virtual */
</PRE>

¤È¥³¥á¥ó¥È¥¢¥¦¥È¤·¤Æ¤·¤Þ¤¤¤Þ¤¹(ÌõÃí¡§¤³¤Î´Ø¿ô¤Ï¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î
Áöºº¤ÈÄɲÃ̾¤Î¾ì½ê¤ò¤·¤á¤¹´Ø¿ô¤Çconf.c line 4399¤Ë¤³¤Î´Ø¿ô¼«ÂΤ¬
¤¢¤ê¤Þ¤¹¡£IP¥ê¥¹¥È¤Î¥¹¥­¥ã¥ó¤Ê¤É¤ò¹Ô¤Ã¤Æ¤¤¤Þ¤¹)¡£
¤â¤·²¾Áۥɥᥤ¥ó´Ö¤Î¥á¡¼¥ëÁ÷¿®¤¬É¬Íפʤ餳¤ì¤ò¹Ô¤¦¤À¤±¤Ç¤è¤¤¤³¤È¤ËÃí°Õ¤·¤Æ
²¼¤µ¤¤¡£
<P>
<P>
<P>ÌäÂê¤Ï²ò·è¤µ¤ì¤¿¤Î¤Ç¤¹¤¬¡¢¥á¥¤¥ó¤Î¥¤¡¼¥µ¥Í¥Ã¥È¥Ç¥Ð¥¤¥¹eth0¤Ïºï½ü¤µ¤ì¤Æ¤¤¤Þ
¤»¤ó¡£¤½¤³¤Ç¡¢¤â¤·Æ±°ì¥Þ¥·¥ó¤Î²¾ÁÛIP¤«¤éeth0¾å¤ÎIP¤Ë¥á¡¼¥ë¤òÁ÷¤ë¾ì¹ç¤Ï
¥í¡¼¥«¥ë¤ËÁ÷¤é¤ì¤Þ¤¹¡£Ãø¼Ô¤Ï¥À¥ß¡¼IP<CODE>virtual1.domain.com (10.10.10.157)</CODE>¤È¤·¤Æ»È¤Ã¤Æ¤¤¤Þ¤¹¡£¤³¤Î¥Û¥¹¥È¤Ë¤Ï¥á¡¼¥ë¤òÁ÷¤é¤Ê¤¤¤Î¤Ç¤É¤Î²¾Áۥɥᥤ¥ó
¤â¤¤¤ê¤Þ¤»¤ó¡£¤³¤ì¤Ï¥·¥¹¥Æ¥à¤¬Âç¾æÉפ«¤É¤¦¤«¥Á¥§¥Ã¥¯¤¹¤ë¤¿¤á¤Ë ssh¤Ç¥í¥°¥¤¥ó
¤¹¤ë»þ¤Ë»È¤¦IP¤Ç¤â¤¢¤ê¤Þ¤¹¡£
<P><CODE>/etc/sendmail.cw</CODE>¤ÎÊÔ½¸
<PRE>
vi /etc/sendmail.cw
mail.domain1.com
domain1.com
domain1
localhost
</PRE>

m4¤ò»È¤Ã¤Æ<CODE>/etc/sendmail.cf</CODE>¤ò¹¥¤­¤Ê¤è¤¦¤Ëºî¤ê¤Þ¤¹¡£            
Ãø¼Ô¤Ï°Ê²¼¤Î¤è¤¦¤Ê¤â¤Î¤ò»È¤¤¤Þ¤·¤¿¡£
<PRE>
divert(0)dnl
VERSIONID(`@(#)tcpproto.mc      8.5 (Berkeley) 3/23/96')
OSTYPE(linux)
FEATURE(redirect)
FEATURE(always_add_domain)
FEATURE(use_cw_file)
FEATURE(local_procmail)
MAILER(local)
MAILER(smtp)
</PRE>

(<EM>ÌõÃí¡§</EM>m4¤ÏUNIX¥Þ¥¯¥í¥×¥í¥»¥Ã¥µ¤Ç¡¢¤¿¤¤¤Æ¤¤¤Î¥·¥¹¥Æ¥à¤ËÆþ¤Ã¤Æ¤¤¤Þ¤¹¡£
ºÇ¿·¥Ð¡¼¥¸¥ç¥ó¤Ï<CODE>ftp://prep.ai.mit.edu/pub/gnu/</CODE>¤«¤é
Æþ¼ê¤Ç¤­¤Þ¤¹¡£<CODE>m4 linux.mc > /etc/sendmail.cf</CODE>¤Ê¤É¤È¤·¤Æ»È¤¤¤Þ¤¹¡£
m4¤ÎÎ㤬<CODE>/usr/lib/m4-example</CODE>¤Ë¤¢¤ê¤Þ¤¹¡£¥ª¥×¥·¥ç¥ó¤Ï<CODE>m4 --help</CODE>
¤ÇÄ´¤Ù¤Æ²¼¤µ¤¤)
<P>
<P><CODE>/etc/sendmail.cf</CODE>¤ò²¾Áۥɥᥤ¥ó±þÅú¤¹¤ë¤è¤¦¤ËÊÔ½¸¡£   
<PRE>
vi /etc/sendmail.cf # 86¹ÔÊÕ¤ê¤òÊÔ½¸ 

#  my official SMTP hostname (defined automatically)
#Dj$w.Foo.COM
¤È¤¤¤¦²Õ½ê¤¬¤¢¤ë¤Î¤Ç¡¢¤³¤ì¤ò

#  my official SMTP hostname (defined automatically)
Djdomain1.com
¤È¤·¤Æ¤ª¤­¤Þ¤¹¡£
</PRE>
<P>
<P>sendmail¤Ï¤½¤ì¼«¿È¤Ç¤Ï¤½¤Î¥µ¡¼¥Ó¥¹¤ò»Ï¤á¤ë¤³¤È¤¬¤Ç¤­¤º¡¢inetd¤ò
Ä̤·¤Æµ¯Æ°¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£¤³¤ì¤ÏÌò¤ËΩ¤Ä¤³¤È¤Ç¤â¤Ê¤¯µ¯Æ°»þ´Ö¤ò
ÃÙ¤¯¤·¤Æ¤¤¤ë¤À¤±¤Ç¤·¤ç¤¦¡£ÆɼԤ¬¹â®¤Ê¥µ¥¤¥È¤ò´ÉÍý¤·¤Æ¤¤¤ë¤Ê¤é
²¾ÁÛ¥Þ¥·¥ó¾å¤Ë¾¤Î¥É¥á¥¤¥ó¤òÀêÍ­¤µ¤»¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¤«¤â¤·¤ì¤Þ¤»¤ó¡£
<P><CODE> -bd </CODE>¥Õ¥é¥°¤òÉÕ¤±¤Æµ¯Æ°¤¹¤ë¤³¤È¤Ï·è¤·¤Æ¤·¤Ê¤¤¤Ç²¼¤µ¤¤¡£
(<EM>ÌõÃí¡§</EM>¤³¤Î¥Õ¥é¥°¤Ïsendmail¤ò¥Ç¡¼¥â¥ó¤È¤·¤Æµ¯Æ°¤¹¤ë¥ª¥×¥·¥ç¥ó¤Ç¤¹¡£
¤¯¤ï¤·¤¤¤³¤È¤Ï<CODE>man sendmail</CODE>¤·¤Æ²¼¤µ¤¤)¡£
¤Þ¤¿³Æ¥É¥á¥¤¥ó¤ÇÇÛÁ÷¤·¤Æ¤¤¤Ê¤¤¥á¡¼¥ë¤òÁ÷¤ê½Ð¤¹(queue up)¤¹¤ë¤¿¤á¤Ë
<CODE>sendmail -q</CODE>¤È¼Â¹Ô¤¹¤ëɬÍפ¬¤¢¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£
<P>
<PRE>
#!/bin/sh

# Source function library.
. /etc/rc.d/init.d/functions

case "$1" in
  start)
        echo -n "Starting sendmail: "
        daemon sendmail -q1h
        echo
        echo -n "Starting virtual sendmail: "
        for i in /virtual/*
        do
                if [ ! -d "$i" ]
                then
                        continue
                fi
                if [ "$i" = "/virtual/lost+found" ]
                then
                        continue
                fi
                chroot $i sendmail -q1h
                echo -n "."
        done
        echo " done"
        touch /var/lock/subsys/sendmail
        ;;
  stop)
        echo -n "Stopping sendmail: "
        killproc sendmail
        echo
        rm -f /var/lock/subsys/sendmail
        ;;
  *)
        echo "Usage: sendmail {start|stop}"
        exit 1
esac

exit 0
</PRE>
<P>pop¤ÏÆä˲¿¤â¤»¤º¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¤·¤Þ¤¤¤Þ¤¹¡£virtuald¤Î¥Ñ¡¼¥È¤òÄɲä·¤¿¾å¤Ç
inetd¤Î¥¨¥ó¥È¥ê¡¼¤ò¤¹¤ë¤³¤È¤¬É¬ÍפǤ¹¡£sendmail¤Èpop¤Ë´Ø¤¹¤ëinetd.conf¤Î
¥¨¥ó¥È¥ê¤Ï¡¢
<PRE>
pop-3 stream tcp nowait root /usr/bin/virtuald virtuald /virtual/conf.pop in.qpop -s 
smtp stream tcp nowait root /usr/bin/virtuald virtuald /virtual/conf.mail sendmail -bs
</PRE>

¤È¤Ê¤ê¤Þ¤¹¡£
<P>
<HR>
<A HREF="Virtual-Services-HOWTO-10.html">¼¡¤Î¥Ú¡¼¥¸</A>
<A HREF="Virtual-Services-HOWTO-8.html">Á°¤Î¥Ú¡¼¥¸</A>
<A HREF="Virtual-Services-HOWTO.html#toc9">Ìܼ¡¤Ø</A>
</BODY>
</HTML>