[91c2c77d] | 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
|
---|
[c442d19] | 11 | <application>MySQL</application>:</para>
|
---|
[70b838f] | 12 | <screen><userinput>MYSQL_SERVER localhost
|
---|
[91c2c77d] | 13 | MYSQL_USERNAME courier
|
---|
| 14 | MYSQL_PASSWORD (your choice)
|
---|
| 15 | MYSQL_SOCKET /tmp/mysql.sock
|
---|
| 16 | MYSQL_PORT 3306
|
---|
| 17 | MYSQL_DATABASE courier-mail
|
---|
| 18 | MYSQL_USER_TABLE users
|
---|
| 19 | MYSQL_CLEAR_PWFIELD clear
|
---|
| 20 | DEFAULT DOMAIN (your domain)
|
---|
[c442d19] | 21 | MYSQL_QUOTA_FIELD quota</userinput></screen>
|
---|
[91c2c77d] | 22 |
|
---|
| 23 |
|
---|
[c442d19] | 24 | <para>If you utilize <application>PAM</application>:</para>
|
---|
[91c2c77d] | 25 | <screen><userinput><command>cat > /etc/pam.d/esmtp << "EOF</command>
|
---|
| 26 | # Begin /etc/pam.d/esmtp
|
---|
| 27 |
|
---|
| 28 | auth required pam_unix.so try_first_pass
|
---|
| 29 | account required pam_unix.so
|
---|
| 30 | session required pam_unix.so
|
---|
| 31 |
|
---|
| 32 | # End /etc/pam.d/esmtp
|
---|
| 33 | <command>EOF
|
---|
| 34 | cat > /etc/pam.d/pop3 << "EOF</command>
|
---|
| 35 | # Begin /etc/pam.d/pop3
|
---|
| 36 |
|
---|
| 37 | auth required pam_unix.so try_first_pass
|
---|
| 38 | account required pam_unix.so
|
---|
| 39 | session required pam_unix.so
|
---|
| 40 |
|
---|
| 41 | # End /etc/pam.d/pop3
|
---|
| 42 | <command>EOF
|
---|
| 43 | cat > /etc/pam.d/imap << "EOF</command>
|
---|
| 44 | # Begin /etc/pam.d/imap
|
---|
| 45 |
|
---|
| 46 | auth required pam_unix.so try_first_pass
|
---|
| 47 | account required pam_unix.so
|
---|
| 48 | session required pam_unix.so
|
---|
| 49 |
|
---|
| 50 | # End /etc/pam.d/imap
|
---|
| 51 | <command>EOF
|
---|
| 52 | cat > /etc/pam.d/webmail << "EOF</command>
|
---|
| 53 | # Begin /etc/pam.d/webmail
|
---|
| 54 |
|
---|
| 55 | auth required pam_unix.so try_first_pass
|
---|
| 56 | account required pam_unix.so
|
---|
| 57 | session required pam_unix.so
|
---|
| 58 |
|
---|
| 59 | # End /etc/pam.d/webmail
|
---|
[c442d19] | 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
|
---|
| 67 | database:</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
|
---|
| 84 | authmysql file:</para>
|
---|
| 85 |
|
---|
| 86 | <screen><userinput><command>mysql -uroot -p{password} mysql
|
---|
| 87 |
|
---|
| 88 | grant 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
|
---|
| 94 | specified.</para>
|
---|
| 95 |
|
---|
| 96 | <para><filename>/etc/courier/defaultdomain</filename></para>
|
---|
| 97 |
|
---|
| 98 | <screen><userinput><command>cat > /etc/courier/defaultdomain << "EOF"</command>
|
---|
| 99 | {yourdomain}
|
---|
| 100 | <command>EOF</command></userinput></screen>
|
---|
| 101 |
|
---|
| 102 | <para><filename>/etc/courier/locals</filename></para>
|
---|
| 103 |
|
---|
| 104 |
|
---|
[95079c36] | 105 | <screen><userinput><command>cat > /etc/courier/locals << "EOF"</command>
|
---|
[c442d19] | 106 | localhost
|
---|
| 107 | {yourdomain}
|
---|
| 108 | .{yourdomain}
|
---|
| 109 | <command>EOF</command></userinput></screen>
|
---|
| 110 |
|
---|
| 111 | <para><filename>/etc/courier/esmtpacceptmailfor</filename></para>
|
---|
| 112 |
|
---|
| 113 |
|
---|
| 114 | <screen><userinput><command>cat > /etc/courier/esmtpacceptmailfor << "EOF"</command>
|
---|
| 115 | localhost
|
---|
| 116 | {yourdomain}
|
---|
| 117 | .{yourdomain}
|
---|
| 118 | <command>EOF</command></userinput></screen>
|
---|
| 119 |
|
---|
| 120 | <para><filename>/etc/courier/hosteddomains</filename></para>
|
---|
| 121 |
|
---|
| 122 | <screen><userinput><command>cat > /etc/courier/hosteddomains << "EOF"</command>
|
---|
| 123 | {yourdomain}
|
---|
| 124 | .{yourdomain}
|
---|
| 125 | <command>EOF</command></userinput></screen>
|
---|
| 126 |
|
---|
| 127 |
|
---|
| 128 | <para>You will also need to edit the aliases file and change the
|
---|
| 129 | following entry.</para>
|
---|
| 130 |
|
---|
| 131 |
|
---|
| 132 | <para><filename>/etc/courier/aliases/system</filename></para>
|
---|
| 133 |
|
---|
| 134 | <screen><userinput>postmaster: {your adminstrator email}</userinput></screen>
|
---|
| 135 |
|
---|
| 136 | <para>If you want to deny access from some hosts from sending mail you
|
---|
| 137 | will need to edit the <filename>/etc/courier/smtpaccess/default</filename>.</para>
|
---|
| 138 |
|
---|
| 139 | <para>After the above steps are completed you will need to run the
|
---|
| 140 | following commands:</para>
|
---|
| 141 |
|
---|
| 142 | <screen><userinput><command>makesmtpaccess
|
---|
| 143 | makehosteddomains
|
---|
| 144 | makealiases</command></userinput></screen>
|
---|
| 145 |
|
---|
| 146 | <para><emphasis><acronym>SMTP</acronym>/<acronym>SMTMP</acronym>-<acronym>SSL
|
---|
| 147 | </acronym> Configuration</emphasis></para>
|
---|
| 148 |
|
---|
| 149 | <para>This section will enable the <acronym>SMTP</acronym> Server from Courier</para>
|
---|
| 150 |
|
---|
| 151 | <para><filename>/etc/courier/esmtpd</filename></para>
|
---|
| 152 |
|
---|
| 153 | <screen><userinput>ESMTPDSTART=YES</userinput></screen>
|
---|
| 154 |
|
---|
| 155 | <para><filename>/etc/courier/esmtpd-ssl</filename></para>
|
---|
| 156 |
|
---|
| 157 | <screen><userinput>ESMTPDSSLSTART=YES</userinput></screen>
|
---|
[91c2c77d] | 158 |
|
---|
[c442d19] | 159 | <para><emphasis><acronym>POP</acronym>3/<acronym>POP</acronym>3-<acronym>SSL
|
---|
| 160 | </acronym> Configuration</emphasis></para>
|
---|
| 161 |
|
---|
| 162 | <para>This section will enable the <acronym>POP3</acronym> Server from
|
---|
| 163 | Courier</para>
|
---|
| 164 |
|
---|
| 165 |
|
---|
| 166 | <para><filename>/etc/courier/pop3d</filename></para>
|
---|
| 167 |
|
---|
| 168 | <screen><userinput>POP3DSTART=YES</userinput></screen>
|
---|
| 169 |
|
---|
| 170 | <para><filename>/etc/courier/pop3d-ssl</filename></para>
|
---|
| 171 |
|
---|
| 172 | <screen><userinput>POP3DSLLSTART=YES</userinput></screen>
|
---|
| 173 |
|
---|
| 174 | <para><emphasis><acronym>IMAP</acronym>/<acronym>IMAP</acronym>-<acronym>SSL
|
---|
| 175 | </acronym> Configuration</emphasis></para>
|
---|
| 176 |
|
---|
| 177 | <para>This section will enable the <acronym>IMAP</acronym> Server from
|
---|
| 178 | Courier</para>
|
---|
| 179 |
|
---|
| 180 | <para><filename>/etc/courier/imapd</filename></para>
|
---|
| 181 |
|
---|
| 182 | <screen><userinput>IMAPDSTART=YES</userinput></screen>
|
---|
| 183 |
|
---|
| 184 | <para><filename>/etc/courierd/imapd-ssl</filename></para>
|
---|
| 185 |
|
---|
| 186 | <screen><userinput>IMAPDSSLSTART=YES</userinput></screen>
|
---|
| 187 |
|
---|
| 188 | <para><emphasis>Creating Maildirectories for System Users</emphasis></para>
|
---|
| 189 |
|
---|
| 190 |
|
---|
| 191 | <para>This section will explain on how to create MailDirs for
|
---|
| 192 | your system users.</para>
|
---|
| 193 |
|
---|
| 194 | <screen><userinput><command>cd /home/{username}
|
---|
| 195 | maildirmake Maildir
|
---|
| 196 | chown {username}.{username} Maildir -R</command></userinput></screen>
|
---|
| 197 |
|
---|
| 198 | <para><emphasis>Setup for Virtual users</emphasis></para>
|
---|
| 199 |
|
---|
| 200 | <para>This section will explain how to setup Maildir for your virtual
|
---|
| 201 | users.</para>
|
---|
| 202 |
|
---|
| 203 | <screen><userinput><command>echo "vmailman:x:9000:9000:Virtual Mailman:/home/vmailman:/bin/bash" >> /etc/passwd
|
---|
| 204 | echo "vmailman:x:9000:" >> /etc/group</command></userinput></screen>
|
---|
| 205 |
|
---|
| 206 | <para>Now to setup the maildir for these virutal users.</para>
|
---|
| 207 |
|
---|
| 208 | <screen><userinput><command>cd /home/vmailman
|
---|
| 209 | mkdir {virtual_user}
|
---|
| 210 | cd {virtual_user}
|
---|
| 211 | maildirmake Maildir
|
---|
| 212 | chown vmailman.vmailman Maildir -R</command></userinput></screen>
|
---|
| 213 |
|
---|
| 214 | <para>Add the virtual user to the MySQL database. You need to enter at
|
---|
| 215 | least on version of the password either clear text or encrypted.</para>
|
---|
| 216 |
|
---|
| 217 | <screen><userinput><command>mysql -ucourier -p{password} courier-mail
|
---|
| 218 |
|
---|
| 219 | insert into users values('{virtual_users}@{domain.com},
|
---|
| 220 | '{encrypted password or blank}','{clear text password or blank}',
|
---|
| 221 | '{User's Name}',9000,9000,'{location of Maildir}','{Quota in Bytes'});</command></userinput></screen>
|
---|
| 222 |
|
---|
| 223 | <para>example</para>
|
---|
| 224 |
|
---|
| 225 | <screen><userinput>insert into users values ('blfsuser@linuxfromscratch.org','
|
---|
| 226 | ','password','BLFS User',9000,9000,'/home/vmailman/blfsuser','');</userinput></screen>
|
---|
| 227 |
|
---|
| 228 | <para><emphasis>Setup for Web-based Email</emphasis></para>
|
---|
| 229 |
|
---|
| 230 | <para>This section will explain how to setup Courier Web-based email
|
---|
| 231 | system.</para>
|
---|
| 232 |
|
---|
| 233 | <para><emphasis role="strong">Edit note: Remove /usr/libexec with
|
---|
| 234 | configure flag, should be /usr/sbin. Sync apache directory with apache
|
---|
| 235 | install for BLFS.</emphasis></para>
|
---|
| 236 |
|
---|
| 237 | <para>You will need to copy the file webemail from
|
---|
| 238 | <filename>/usr/libexec/courier/webmail</filename> to your <filename>cgi-bin
|
---|
| 239 | </filename> directory of your <application>Apache</application>
|
---|
| 240 | server.</para>
|
---|
| 241 |
|
---|
| 242 | <screen><userinput><command>cp -a /usr/libexec/courier/webmail /var/www/cgi-bin</command></userinput></screen>
|
---|
| 243 |
|
---|
| 244 | <para>You will then need to copy the images to a folder under your
|
---|
| 245 | <filename>htdocs</filename> directory of your
|
---|
| 246 | <application>Apache</application> server. The directory needs to be named
|
---|
| 247 | <filename>webmail</filename> or you need to specify it during the configure
|
---|
| 248 | phase with <command>--enable-imageurl=/url</command>.</para>
|
---|
| 249 |
|
---|
| 250 | <screen><userinput><command>cp -a /usr/share/courier/sqwebmail/images /var/www/htdocs/webmail</command></userinput></screen>
|
---|
| 251 |
|
---|
| 252 |
|
---|
| 253 | </sect3>
|
---|
[91c2c77d] | 254 | </sect2>
|
---|
| 255 |
|
---|