source: server/mail/courier/courier-config.xml@ 1a1da48

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.0 6.1 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb v5_0 v5_0-pre1 v5_1 v5_1-pre1 xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 1a1da48 was 1a1da48, checked in by Larry Lawrence <larry@…>, 21 years ago

courier patch

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@1184 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 10.5 KB
Line 
1<sect2>
2<title>Configuring <application>Courier</application></title>
3
4<sect3><title>Config files</title>
5<para><filename>/etc/courier/authmysqlrc</filename></para>
6</sect3>
7
8<sect3><title>Configuration Information</title>
9
10<para>Make the following changes in this file if you are utilizing
11<application>MySQL</application>:</para>
12<screen><userinput>MYSQL_SERVER localhost
13MYSQL_USERNAME courier
14MYSQL_PASSWORD (your choice)
15MYSQL_SOCKET /tmp/mysql.sock
16MYSQL_PORT 3306
17MYSQL_DATABASE courier-mail
18MYSQL_USER_TABLE users
19MYSQL_CLEAR_PWFIELD clear
20DEFAULT DOMAIN (your domain)
21MYSQL_QUOTA_FIELD quota</userinput></screen>
22
23
24<para>If you utilize <application>PAM</application>:</para>
25<screen><userinput><command>cat &gt; /etc/pam.d/esmtp &lt;&lt; "EOF</command>
26# Begin /etc/pam.d/esmtp
27
28auth required pam_unix.so try_first_pass
29account required pam_unix.so
30session required pam_unix.so
31
32# End /etc/pam.d/esmtp
33<command>EOF
34cat &gt; /etc/pam.d/pop3 &lt;&lt; "EOF</command>
35# Begin /etc/pam.d/pop3
36
37auth required pam_unix.so try_first_pass
38account required pam_unix.so
39session required pam_unix.so
40
41# End /etc/pam.d/pop3
42<command>EOF
43cat &gt; /etc/pam.d/imap &lt;&lt; "EOF</command>
44# Begin /etc/pam.d/imap
45
46auth required pam_unix.so try_first_pass
47account required pam_unix.so
48session required pam_unix.so
49
50# End /etc/pam.d/imap
51<command>EOF
52cat &gt; /etc/pam.d/webmail &lt;&lt; "EOF</command>
53# Begin /etc/pam.d/webmail
54
55auth required pam_unix.so try_first_pass
56account required pam_unix.so
57session required pam_unix.so
58
59# End /etc/pam.d/webmail
60<command>EOF</command></userinput></screen>
61
62<para>This command will create the mysql database for authentication:</para>
63
64<screen><userinput><command>mysqladmin -uroot -p{password} create courier-mail</command></userinput></screen>
65
66<para>This command will setup the table users for the courier-mail
67database:</para>
68
69<screen><userinput><command>mysql -uroot -p{password} courier-mail
70
71 CREATE TABLE users (
72 id char(128) DEFAULT '' NOT NULL,
73 crypt char(128) DEFAULT '' NOT NULL,
74 clear char(128) DEFAULT '' NOT NULL,
75 name char(128) DEFAULT '' NOT NULL,
76 uid int(10) unsigned DEFAULT '65534' NOT NULL,
77 gid int(10) unsigned DEFAULT '65534' NOT NULL,
78 home char(255) DEFAULT '' NOT NULL,
79 quota char(255) DEFAULT '' NOT NULL,
80 KEY id (id(128))
81 );</command></userinput></screen>
82
83<para>This will add the courier user that we specified earilier in the
84authmysql file:</para>
85
86<screen><userinput><command>mysql -uroot -p{password} mysql
87
88grant all privileges on *.* to courier@localhost identified by '{password}' with grant option;</command></userinput></screen>
89
90
91<para><emphasis>General Settings for Mail</emphasis></para>
92
93<para>You will need to create the following files with the contents
94specified.</para>
95
96<para><filename>/etc/courier/defaultdomain</filename></para>
97
98<screen><userinput><command>cat &gt; /etc/courier/defaultdomain &lt;&lt; "EOF"</command>
99{yourdomain}
100<command>EOF</command></userinput></screen>
101
102<para><filename>/etc/courier/me</filename></para>
103
104<screen><userinput><command>cat &gt; /etc/courier/me &lt;&lt; "EOF"</command>
105{servername.yourdomain}
106<command>EOF</command></userinput></screen>
107
108<para><filename>/etc/courier/locals</filename></para>
109
110<screen><userinput><command>cat &gt; /etc/courier/locals &lt;&lt; "EOF"</command>
111localhost
112{yourdomain}
113<command>EOF</command></userinput></screen>
114
115<para><filename>/etc/courier/esmtpacceptmailfor.dir/system</filename></para>
116
117<screen><userinput><command>cat &gt;/etc/courier/esmtpacceptmailfor.dir/system &lt;&lt; "EOF"</command>
118localhost
119{yourdomain}
120<command>EOF</command></userinput></screen>
121
122<para>You will also need to edit the aliases file and change the
123following entry.</para>
124
125<para><filename>/etc/courier/aliases/system</filename></para>
126
127<screen><userinput>postmaster: {your adminstrator email}</userinput></screen>
128
129<para>If you want to deny access from some hosts from sending mail you
130will need to edit the <filename>/etc/courier/smtpaccess/default</filename>.</para>
131
132<para>After the above steps are completed you will need to run the
133following commands:</para>
134
135<screen><userinput><command>makesmtpaccess
136makehosteddomains
137makealiases</command></userinput></screen>
138
139<para><emphasis><acronym>SMTP</acronym>/<acronym>SMTMP</acronym>-<acronym>SSL
140</acronym> Configuration</emphasis></para>
141
142<para>This section will enable the <acronym>SMTP</acronym> Server from Courier</para>
143
144<para><filename>/etc/courier/esmtpd</filename></para>
145
146<screen><userinput>ESMTPDSTART=YES</userinput></screen>
147
148<para><filename>/etc/courier/esmtpd-ssl</filename></para>
149
150<screen><userinput>ESMTPDSSLSTART=YES</userinput></screen>
151
152<para><emphasis><acronym>POP</acronym>3/<acronym>POP</acronym>3-<acronym>SSL
153</acronym> Configuration</emphasis></para>
154
155<para>This section will enable the <acronym>POP3</acronym> Server from
156Courier</para>
157
158
159<para><filename>/etc/courier/pop3d</filename></para>
160
161<screen><userinput>POP3DSTART=YES</userinput></screen>
162
163<para><filename>/etc/courier/pop3d-ssl</filename></para>
164
165<screen><userinput>POP3DSLLSTART=YES</userinput></screen>
166
167<para><emphasis><acronym>IMAP</acronym>/<acronym>IMAP</acronym>-<acronym>SSL
168</acronym> Configuration</emphasis></para>
169
170<para>This section will enable the <acronym>IMAP</acronym> Server from
171Courier</para>
172
173<para><filename>/etc/courier/imapd</filename></para>
174
175<screen><userinput>IMAPDSTART=YES</userinput></screen>
176
177<para><filename>/etc/courierd/imapd-ssl</filename></para>
178
179<screen><userinput>IMAPDSSLSTART=YES</userinput></screen>
180
181<para><emphasis>Creating Maildirectories for System Users</emphasis></para>
182
183
184<para>This section will explain on how to create MailDirs for
185your system users.</para>
186
187<screen><userinput><command>cd /home/{username}
188maildirmake Maildir
189chown {username}.{username} Maildir -R</command></userinput></screen>
190
191<para><emphasis>Setup for Virtual users</emphasis></para>
192
193<para>This section will explain how to setup Maildir for your virtual
194users.</para>
195
196<screen><userinput><command>echo "vmailman:x:9000:9000:Virtual Mailman:/home/vmailman:/bin/bash" &gt;&gt; /etc/passwd
197echo "vmailman:x:9000:" &gt;&gt; /etc/group</command></userinput></screen>
198
199<para>Now to setup the maildir for these virutal users.</para>
200
201<screen><userinput><command>cd /home/vmailman
202mkdir {virtual_user}
203cd {virtual_user}
204maildirmake Maildir
205chown vmailman.vmailman Maildir -R</command></userinput></screen>
206
207<para>Add the virtual user to the MySQL database. You need to enter at
208least on version of the password either clear text or encrypted.</para>
209
210<screen><userinput><command>mysql -ucourier -p{password} courier-mail
211
212insert into users values('{virtual_users}@{domain.com},
213'{encrypted password or blank}','{clear text password or blank}',
214'{User's Name}',9000,9000,'{location of Maildir}','{Quota in Bytes'});</command></userinput></screen>
215
216<para>example</para>
217
218<screen><userinput>insert into users values ('blfsuser@linuxfromscratch.org','
219','password','BLFS User',9000,9000,'/home/vmailman/blfsuser','');</userinput></screen>
220
221<para><emphasis>Setup for Web-based Email</emphasis></para>
222
223<para>This section will explain how to setup Courier Web-based email
224system.</para>
225
226<para>You will need to copy the file webmail from
227<filename>/usr/libexec/courier/webmail/webmail</filename> to your <filename>cgi-bin
228</filename> directory of your <application>Apache</application>
229server.</para>
230
231<screen><userinput><command>cp -a /usr/libexec/courier/webmail/webmail /var/www/cgi-bin</command></userinput></screen>
232
233<para>You will then need to copy the images to a folder under your
234<filename>htdocs</filename> directory of your
235<application>Apache</application> server. The directory needs to be named
236<filename>webmail</filename> or you need to specify it during the configure
237phase with <command>--enable-imageurl=/url</command>.</para>
238
239<screen><userinput><command>cp -a /usr/share/courier/sqwebmail/images /var/www/htdocs/webmail</command></userinput></screen>
240<para><emphasis>Setup for Web-based Email</emphasis></para>
241
242<para>This section will explain how to setup Courier Web-based administration
243system.</para>
244
245<para>You will need to copy the file webadmin from
246<filename>/usr/libexec/courier/webmail/webmin</filename> to your <filename>cgi-bin
247</filename> directory of your <application>Apache</application>
248server.</para>
249
250<screen><userinput><command>cp -a /usr/libexec/courier/webmail/webadmin /var/www/cgi-bin</command></userinput></screen>
251
252<para><filename>/etc/courier/webadmin/password</filename></para>
253
254<screen><userinput><command>cat &gt; /etc/courier/webadmin/password &lt;&lt; "EOF"</command>
255{password}
256<command>EOF</command></userinput></screen>
257
258<para>If you are not using <acronym>SSL</acronym> on your <application>Apache
259</application> server, you will need to add
260<filename>/etc/courier/webadmin/unsecureok</filename>, so you will be able
261to use your web based administration tool.
262
263<screen><userinput><command>touch /etc/courier/webadmin/unsecureok</command></userinput></screen></para>
264</sect3>
265
266<sect3><title>Courier init.d script</title>
267
268<para>The startup script from the <application>Courier</application> package is
269the easiest to use. It will automatically create missing data files, and
270<acronym>SSL</acronym> certificates if they are missing. To install the
271init.d file for <application>Courier</application> you will need to use the
272follow commands:</para>
273
274<screen><userinput><command>cp /usr/src/courier-&courier-version;/courier.sysvinit /etc/rc.d/init.d/courier &amp;&amp;
275chmod 755 /etc/rc.d/init.d/courier</command></userinput></screen>
276
277<para>Create the symbolic links to this file in the relevant
278<filename>rc.d</filename> directory with the following commands:
279
280<screen><userinput><command>cd /etc/rc.d/init.d &amp;&amp;
281ln -sf ../init.d/courier ../rc0.d/K25courier &amp;&amp;
282ln -sf ../init.d/courier ../rc1.d/K25courier &amp;&amp;
283ln -sf ../init.d/courier ../rc2.d/K25courier &amp;&amp;
284ln -sf ../init.d/courier ../rc3.d/S35courier &amp;&amp;
285ln -sf ../init.d/courier ../rc4.d/S35courier &amp;&amp;
286ln -sf ../init.d/courier ../rc5.d/S35courier &amp;&amp;
287ln -sf ../init.d/courier ../rc6.d/K25courier</command></userinput></screen></para>
288
289</sect3>
290</sect2>
291
Note: See TracBrowser for help on using the repository browser.