source: server/mail/courier/courier-config.xml@ 9262ca5

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_1 v5_1-pre1 xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 9262ca5 was 9262ca5, checked in by Igor Živković <igor@…>, 20 years ago

courier corrections

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

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