1
|
●バックアップ取得
|
2
|
[root@web2 ~]# cp -p /etc/postfix/main.cf /etc/postfix/main.cf.org
|
3
|
|
4
|
●main.cf編集
|
5
|
|
6
|
以下の内容に変更
|
7
|
|
8
|
[root@web2 ~]# diff -c /etc/postfix/main.cf /etc/postfix/main.cf.org
|
9
|
*** /etc/postfix/main.cf Thu Nov 24 11:29:34 2011
|
10
|
--- /etc/postfix/main.cf.org Wed Jun 1 01:29:21 2011
|
11
|
***************
|
12
|
*** 68,74 ****
|
13
|
#
|
14
|
#myhostname = host.domain.tld
|
15
|
#myhostname = virtual.domain.tld
|
16
|
- myhostname = web2.i-generation.jp
|
17
|
|
18
|
# The mydomain parameter specifies the local internet domain name.
|
19
|
# The default is to use $myhostname minus the first component.
|
20
|
--- 68,73 ----
|
21
|
***************
|
22
|
*** 76,82 ****
|
23
|
# parameters.
|
24
|
#
|
25
|
#mydomain = domain.tld
|
26
|
- mydomain = i-generation.jp
|
27
|
|
28
|
# SENDING MAIL
|
29
|
#
|
30
|
--- 75,80 ----
|
31
|
***************
|
32
|
*** 92,98 ****
|
33
|
# to recipient addresses that have no @domain part.
|
34
|
#
|
35
|
#myorigin = $myhostname
|
36
|
! myorigin = $mydomain
|
37
|
|
38
|
# RECEIVING MAIL
|
39
|
|
40
|
--- 90,96 ----
|
41
|
# to recipient addresses that have no @domain part.
|
42
|
#
|
43
|
#myorigin = $myhostname
|
44
|
! #myorigin = $mydomain
|
45
|
|
46
|
# RECEIVING MAIL
|
47
|
|
48
|
***************
|
49
|
*** 106,115 ****
|
50
|
#
|
51
|
# Note: you need to stop/start Postfix when this parameter changes.
|
52
|
#
|
53
|
! inet_interfaces = all
|
54
|
#inet_interfaces = $myhostname
|
55
|
#inet_interfaces = $myhostname, localhost
|
56
|
! #inet_interfaces = localhost
|
57
|
|
58
|
# The proxy_interfaces parameter specifies the network interface
|
59
|
# addresses that this mail system receives mail on by way of a
|
60
|
--- 104,113 ----
|
61
|
#
|
62
|
# Note: you need to stop/start Postfix when this parameter changes.
|
63
|
#
|
64
|
! #inet_interfaces = all
|
65
|
#inet_interfaces = $myhostname
|
66
|
#inet_interfaces = $myhostname, localhost
|
67
|
! inet_interfaces = localhost
|
68
|
|
69
|
# The proxy_interfaces parameter specifies the network interface
|
70
|
# addresses that this mail system receives mail on by way of a
|
71
|
***************
|
72
|
*** 154,161 ****
|
73
|
#
|
74
|
# See also below, section "REJECTING MAIL FOR UNKNOWN LOCAL USERS".
|
75
|
#
|
76
|
! #mydestination = $myhostname, localhost.$mydomain, localhost
|
77
|
! mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
|
78
|
#mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain,
|
79
|
# mail.$mydomain, www.$mydomain, ftp.$mydomain
|
80
|
|
81
|
--- 152,159 ----
|
82
|
#
|
83
|
# See also below, section "REJECTING MAIL FOR UNKNOWN LOCAL USERS".
|
84
|
#
|
85
|
! mydestination = $myhostname, localhost.$mydomain, localhost
|
86
|
! #mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
|
87
|
#mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain,
|
88
|
# mail.$mydomain, www.$mydomain, ftp.$mydomain
|
89
|
|
90
|
***************
|
91
|
*** 409,415 ****
|
92
|
# "Maildir/" for qmail-style delivery (the / is required).
|
93
|
#
|
94
|
#home_mailbox = Mailbox
|
95
|
! home_mailbox = Maildir/
|
96
|
|
97
|
# The mail_spool_directory parameter specifies the directory where
|
98
|
# UNIX-style mailboxes are kept. The default setting depends on the
|
99
|
--- 407,413 ----
|
100
|
# "Maildir/" for qmail-style delivery (the / is required).
|
101
|
#
|
102
|
#home_mailbox = Mailbox
|
103
|
! #home_mailbox = Maildir/
|
104
|
|
105
|
# The mail_spool_directory parameter specifies the directory where
|
106
|
# UNIX-style mailboxes are kept. The default setting depends on the
|
107
|
***************
|
108
|
*** 667,677 ****
|
109
|
# readme_directory: The location of the Postfix README files.
|
110
|
#
|
111
|
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
|
112
|
-
|
113
|
- smtpd_sasl_auth_enable = yes
|
114
|
- smtpd_sasl_local_domain = $myhostname
|
115
|
- smtpd_recipient_restrictions =
|
116
|
- permit_mynetworks
|
117
|
- permit_sasl_authenticated
|
118
|
- reject_unauth_destination
|
119
|
-
|
120
|
--- 665,667 ----
|
121
|
|
122
|
|
123
|
●saslauthd起動
|
124
|
[root@web2 ~]# /etc/rc.d/init.d/saslauthd start
|
125
|
Starting saslauthd: [ OK ]
|
126
|
|
127
|
●saslauthd自動起動設定
|
128
|
[root@web2 ~]# chkconfig saslauthd on
|
129
|
[root@web2 ~]# chkconfig --list saslauthd
|
130
|
saslauthd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
|
131
|
|
132
|
●メールボックス作成
|
133
|
[root@web2 ~]# mkdir -p /etc/skel/Maildir/new
|
134
|
[root@web2 ~]# mkdir -p /etc/skel/Maildir/cur
|
135
|
[root@web2 ~]# mkdir -p /etc/skel/Maildir/tmp
|
136
|
|
137
|
●sendmail停止
|
138
|
[root@web2 ~]# /etc/rc.d/init.d/sendmail stop
|
139
|
Shutting down sm-client: [ OK ]
|
140
|
Shutting down sendmail: [ OK ]
|
141
|
|
142
|
●sendmail自動起動設定解除
|
143
|
[root@web2 ~]# chkconfig --list sendmail
|
144
|
sendmail 0:off 1:off 2:on 3:on 4:on 5:on 6:off
|
145
|
[root@web2 ~]# chkconfig sendmail off
|
146
|
[root@web2 ~]# chkconfig --list sendmail
|
147
|
sendmail 0:off 1:off 2:off 3:off 4:off 5:off 6:off
|
148
|
|
149
|
●メールサーバ切り替え
|
150
|
[root@web2 ~]# alternatives --config mta
|
151
|
|
152
|
There are 2 programs which provide 'mta'.
|
153
|
|
154
|
Selection Command
|
155
|
-----------------------------------------------
|
156
|
*+ 1 /usr/sbin/sendmail.sendmail
|
157
|
2 /usr/sbin/sendmail.postfix
|
158
|
|
159
|
Enter to keep the current selection[+], or type selection number: 2 ←2を選択
|
160
|
|
161
|
●postfix起動
|
162
|
[root@web2 ~]# /etc/rc.d/init.d/postfix start
|
163
|
Starting postfix: [ OK ]
|
164
|
|
165
|
●Postfix自動起動設定
|
166
|
[root@web2 ~]# chkconfig --list postfix
|
167
|
postfix 0:off 1:off 2:on 3:on 4:on 5:on 6:off
|
168
|
[root@web2 ~]# chkconfig postfix on
|
169
|
[root@web2 ~]# chkconfig --list postfix
|
170
|
postfix 0:off 1:off 2:on 3:on 4:on 5:on 6:off
|
171
|
|
172
|
|