Skip to content

Commit 0ca0b84

Browse files
committed
- Improved debian 5 courier installation guide.
- Fixed a problem with the automatic creation of maildir subfolders.
1 parent 8ba82ee commit 0ca0b84

File tree

2 files changed

+57
-97
lines changed

2 files changed

+57
-97
lines changed

docs/INSTALL_DEBIAN_5.0_courier_mydns.txt

Lines changed: 15 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Installation
1414
# if not, then we assign a hostname (for example ispconfig):
1515

1616
echo ispconfig.example.com > /etc/hostname
17+
/etc/init.d/hostname.sh
1718

1819
vi /etc/hosts
1920

@@ -36,14 +37,14 @@ apt-get install ntp ntpdate
3637

3738
opt0.3) Optionally if you want vi editor improvement
3839

39-
apt-get install vim-nox
40+
apt-get -y install vim-nox
4041

4142

4243
# Next is the real deal
4344

4445
1) Install Postfix, Courier, Saslauthd, MySQL, phpMyAdmin, rkhunter, binutils with the following command line (on one line!):
4546

46-
apt-get install postfix postfix-mysql postfix-doc mysql-client mysql-server courier-authdaemon courier-authlib-mysql courier-pop courier-pop-ssl courier-imap courier-imap-ssl libsasl2-2 libsasl2-modules libsasl2-modules-sql sasl2-bin libpam-mysql openssl courier-maildrop getmail4 rkhunter binutils
47+
apt-get -y install postfix postfix-mysql postfix-doc mysql-client mysql-server courier-authdaemon courier-authlib-mysql courier-pop courier-pop-ssl courier-imap courier-imap-ssl libsasl2-2 libsasl2-modules libsasl2-modules-sql sasl2-bin libpam-mysql openssl courier-maildrop getmail4 rkhunter binutils
4748

4849
# Answer the questions from the package manager as follows.
4950

@@ -74,7 +75,7 @@ to:
7475

7576
2) Install Amavisd-new, Spamassassin and Clamav (1 line!):
7677

77-
apt-get install amavisd-new spamassassin clamav clamav-daemon zoo unzip bzip2 arj nomarch lzop cabextract apt-listchanges libnet-ldap-perl libauthen-sasl-perl clamav-docs daemon libio-string-perl libio-socket-ssl-perl libnet-ident-perl zip libnet-dns-perl
78+
apt-get -y install amavisd-new spamassassin clamav clamav-daemon zoo unzip bzip2 arj nomarch lzop cabextract apt-listchanges libnet-ldap-perl libauthen-sasl-perl clamav-docs daemon libio-string-perl libio-socket-ssl-perl libnet-ident-perl zip libnet-dns-perl
7879

7980
# During the installation, the SSL certificates for IMAP-SSL and POP3-SSL are created with the hostname localhost. To change this to the correct hostname (server1.example.com in this tutorial), delete the certificates...
8081

@@ -109,7 +110,7 @@ mkpop3dcert
109110

110111
3) Install apache, PHP5, phpmyadmin, better fastCGI, suexec, Pear and mcrypt (1 line!):
111112

112-
apt-get install apache2 apache2.2-common apache2-doc apache2-mpm-prefork apache2-utils libexpat1 ssl-cert libapache2-mod-php5 php5 php5-common php5-gd php5-mysql php5-imap phpmyadmin php5-cli php5-cgi libapache2-mod-fcgid apache2-suexec php-pear php-auth php5-mcrypt mcrypt php5-imagick imagemagick libapache2-mod-suphp libopenssl-ruby
113+
apt-get -y install apache2 apache2.2-common apache2-doc apache2-mpm-prefork apache2-utils libexpat1 ssl-cert libapache2-mod-php5 php5 php5-common php5-gd php5-mysql php5-imap phpmyadmin php5-cli php5-cgi libapache2-mod-fcgid apache2-suexec php-pear php-auth php5-mcrypt mcrypt php5-imagick imagemagick libapache2-mod-suphp libopenssl-ruby
113114

114115

115116
# When phpMyAdmin is asking weather to configure itself automatically, select "Apache2"
@@ -125,25 +126,7 @@ a2enmod suexec rewrite ssl actions include
125126

126127
4) Install pure-ftpd and quota
127128

128-
apt-get install pure-ftpd-common pure-ftpd-mysql quota quotatool
129-
130-
# Edit the file /etc/default/pure-ftpd-common to change the start mode from "inetd" to "standalone"
131-
and set VIRTUALCHROOT=true
132-
133-
vi /etc/default/pure-ftpd-common
134-
135-
# Edit the file /etc/inetd.conf to prevent inetd from trying to start ftp.
136-
# To do this, comment line starting like "ftp stream tcp" by adding "#"-sign in front of the line.
137-
138-
vi /etc/inetd.conf
139-
140-
# Then execute:
141-
142-
/etc/init.d/openbsd-inetd restart
143-
144-
# Some additional settings for pureftpd
145-
146-
echo 'yes' > /etc/pure-ftpd/conf/DontResolve
129+
apt-get -y install pure-ftpd-common pure-ftpd-mysql quota quotatool
147130

148131
# Enable TLS in pureftpd
149132
echo 1 > /etc/pure-ftpd/conf/TLS
@@ -262,25 +245,18 @@ update-rc.d mydns defaults
262245

263246
apt-get install vlogger webalizer
264247

265-
Change the following line in /etc/webalizer/webalizer.conf from
266-
267-
#Incremental no
268-
269-
to
270-
271-
Incremental yes
272248

273249
7) Install Jailkit (optional, only needed if you want to use chrroting for SSH users)
274250

275251
apt-get install build-essential autoconf automake1.9 libtool flex bison debhelper
276252
cd /tmp
277-
wget http://olivier.sessink.nl/jailkit/jailkit-2.7.tar.gz
278-
tar xvfz jailkit-2.7.tar.gz
279-
cd jailkit-2.7
253+
wget http://olivier.sessink.nl/jailkit/jailkit-2.11.tar.gz
254+
tar xvfz jailkit-2.11.tar.gz
255+
cd jailkit-2.11
280256
./debian/rules binary
281257
cd ..
282-
dpkg -i jailkit_2.7-1_*.deb
283-
rm -rf jailkit-2.7*
258+
dpkg -i jailkit_2.11-1_*.deb
259+
rm -rf jailkit-2.11*
284260

285261
8) Install fail2ban (optional but recomended, because the monitor tries to show the log)
286262
More info at: http://www.howtoforge.com/fail2ban_debian_etch
@@ -289,26 +265,10 @@ apt-get install fail2ban
289265

290266
9) Install ISPConfig 3
291267

292-
# There are two possile scenarios, but not both:
293-
9.1) Install the latest released version
294-
9.2) Install directly from SVN
295-
296-
9.1) Installation of last version from tar.gz
297-
298-
cd /tmp
299-
wget http://www.ispconfig.org/downloads/ISPConfig-3.0.0.9-rc2.tar.gz
300-
tar xvfz ISPConfig-3.0.0.9-rc2.tar.gz
301-
cd ispconfig3_install/install/
302-
303-
9.2) Installation from SVN
304-
305-
apt-get install subversion
306-
cd /tmp
307-
svn export svn://svn.ispconfig.org/ispconfig3/trunk/
308-
cd trunk/install
309-
310-
311-
9.1+9.2) Now proceed with the ISPConfig installation.
268+
cd /tmp
269+
wget http://www.ispconfig.org/downloads/ISPConfig-3.0.2.tar.gz
270+
tar xvfz ISPConfig-3.0.2.tar.gz
271+
cd ispconfig3_install/install/
312272

313273
# Now start the installation process by executing:
314274

server/plugins-available/mail_plugin.inc.php

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -119,27 +119,6 @@ function user_insert($event_name,$data) {
119119
//exec("su -c 'maildirmake ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
120120
$app->system->maildirmake($maildomain_path,$mail_config['mailuser_name']);
121121

122-
if(!is_dir($data['new']['maildir'].'/.Sent')) {
123-
//exec("su -c 'maildirmake -f Sent ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
124-
//$app->log('Created submaildir Sent: '."su -c 'maildirmake -f Sent ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name'],LOGLEVEL_DEBUG);
125-
$app->system->maildirmake($maildomain_path,$mail_config['mailuser_name'],'Sent');
126-
}
127-
if(!is_dir($data['new']['maildir'].'/.Drafts')) {
128-
//exec("su -c 'maildirmake -f Drafts ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
129-
//$app->log('Created submaildir Drafts: '."su -c 'maildirmake -f Drafts ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name'],LOGLEVEL_DEBUG);
130-
$app->system->maildirmake($maildomain_path,$mail_config['mailuser_name'],'Drafts');
131-
}
132-
if(!is_dir($data['new']['maildir'].'/.Trash')) {
133-
//exec("su -c 'maildirmake -f Trash ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
134-
//$app->log('Created submaildir Trash: '."su -c 'maildirmake -f Trash ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name'],LOGLEVEL_DEBUG);
135-
$app->system->maildirmake($maildomain_path,$mail_config['mailuser_name'],'Trash');
136-
}
137-
if(!is_dir($data['new']['maildir'].'/.Junk')) {
138-
//exec("su -c 'maildirmake -f Junk ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
139-
//$app->log('Created submaildir Junk: '."su -c 'maildirmake -f Junk ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name'],LOGLEVEL_DEBUG);
140-
$app->system->maildirmake($maildomain_path,$mail_config['mailuser_name'],'Junk');
141-
}
142-
143122
exec('chown -R '.$mail_config['mailuser_name'].':'.$mail_config['mailuser_group'].' '.escapeshellcmd($data['new']['maildir']));
144123
$app->log("Set ownership on ".escapeshellcmd($data['new']['maildir']),LOGLEVEL_DEBUG);
145124

@@ -150,6 +129,27 @@ function user_insert($event_name,$data) {
150129
}
151130
}
152131

132+
if(!is_dir($data['new']['maildir'].'/.Sent')) {
133+
//exec("su -c 'maildirmake -f Sent ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
134+
//$app->log('Created submaildir Sent: '."su -c 'maildirmake -f Sent ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name'],LOGLEVEL_DEBUG);
135+
$app->system->maildirmake($maildomain_path,$mail_config['mailuser_name'],'Sent');
136+
}
137+
if(!is_dir($data['new']['maildir'].'/.Drafts')) {
138+
//exec("su -c 'maildirmake -f Drafts ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
139+
//$app->log('Created submaildir Drafts: '."su -c 'maildirmake -f Drafts ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name'],LOGLEVEL_DEBUG);
140+
$app->system->maildirmake($maildomain_path,$mail_config['mailuser_name'],'Drafts');
141+
}
142+
if(!is_dir($data['new']['maildir'].'/.Trash')) {
143+
//exec("su -c 'maildirmake -f Trash ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
144+
//$app->log('Created submaildir Trash: '."su -c 'maildirmake -f Trash ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name'],LOGLEVEL_DEBUG);
145+
$app->system->maildirmake($maildomain_path,$mail_config['mailuser_name'],'Trash');
146+
}
147+
if(!is_dir($data['new']['maildir'].'/.Junk')) {
148+
//exec("su -c 'maildirmake -f Junk ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
149+
//$app->log('Created submaildir Junk: '."su -c 'maildirmake -f Junk ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name'],LOGLEVEL_DEBUG);
150+
$app->system->maildirmake($maildomain_path,$mail_config['mailuser_name'],'Junk');
151+
}
152+
153153
//* Set the maildir quota
154154
if(is_dir($data['new']['maildir'].'/new') && $mail_config['pop3_imap_daemon'] != 'dovecot') {
155155
exec("su -c 'maildirmake -q ".$data['new']['quota']."S ".escapeshellcmd($data['new']['maildir'])."' ".$mail_config['mailuser_name']);
@@ -207,27 +207,6 @@ function user_update($event_name,$data) {
207207
//$app->log("Created Maildir "."su -c 'maildirmake ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name'],LOGLEVEL_DEBUG);
208208
$app->system->maildirmake($maildomain_path,$mail_config['mailuser_name']);
209209

210-
if(!is_dir($data['new']['maildir'].'/.Sent')) {
211-
//exec("su -c 'maildirmake -f Sent ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
212-
//$app->log('Created submaildir Sent: '."su -c 'maildirmake -f Sent ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name'],LOGLEVEL_DEBUG);
213-
$app->system->maildirmake($maildomain_path,$mail_config['mailuser_name'],'Sent');
214-
}
215-
if(!is_dir($data['new']['maildir'].'/.Drafts')) {
216-
//exec("su -c 'maildirmake -f Drafts ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
217-
//$app->log('Created submaildir Drafts: '."su -c 'maildirmake -f Drafts ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name'],LOGLEVEL_DEBUG);
218-
$app->system->maildirmake($maildomain_path,$mail_config['mailuser_name'],'Drafts');
219-
}
220-
if(!is_dir($data['new']['maildir'].'/.Trash')) {
221-
//exec("su -c 'maildirmake -f Trash ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
222-
//$app->log('Created submaildir Trash: '."su -c 'maildirmake -f Trash ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name'],LOGLEVEL_DEBUG);
223-
$app->system->maildirmake($maildomain_path,$mail_config['mailuser_name'],'Trash');
224-
}
225-
if(!is_dir($data['new']['maildir'].'/.Junk')) {
226-
//exec("su -c 'maildirmake -f Junk ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
227-
//$app->log('Created submaildir Junk: '."su -c 'maildirmake -f Junk ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name'],LOGLEVEL_DEBUG);
228-
$app->system->maildirmake($maildomain_path,$mail_config['mailuser_name'],'Junk');
229-
}
230-
231210
exec('chown -R '.$mail_config['mailuser_name'].':'.$mail_config['mailuser_group'].' '.escapeshellcmd($data['new']['maildir']));
232211
$app->log("Set ownership on ".escapeshellcmd($data['new']['maildir']),LOGLEVEL_DEBUG);
233212
//* This is to fix the maildrop quota not being rebuilt after the quota is changed.
@@ -237,6 +216,27 @@ function user_update($event_name,$data) {
237216
}
238217
}
239218

219+
if(!is_dir($data['new']['maildir'].'/.Sent')) {
220+
//exec("su -c 'maildirmake -f Sent ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
221+
//$app->log('Created submaildir Sent: '."su -c 'maildirmake -f Sent ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name'],LOGLEVEL_DEBUG);
222+
$app->system->maildirmake($maildomain_path,$mail_config['mailuser_name'],'Sent');
223+
}
224+
if(!is_dir($data['new']['maildir'].'/.Drafts')) {
225+
//exec("su -c 'maildirmake -f Drafts ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
226+
//$app->log('Created submaildir Drafts: '."su -c 'maildirmake -f Drafts ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name'],LOGLEVEL_DEBUG);
227+
$app->system->maildirmake($maildomain_path,$mail_config['mailuser_name'],'Drafts');
228+
}
229+
if(!is_dir($data['new']['maildir'].'/.Trash')) {
230+
//exec("su -c 'maildirmake -f Trash ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
231+
//$app->log('Created submaildir Trash: '."su -c 'maildirmake -f Trash ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name'],LOGLEVEL_DEBUG);
232+
$app->system->maildirmake($maildomain_path,$mail_config['mailuser_name'],'Trash');
233+
}
234+
if(!is_dir($data['new']['maildir'].'/.Junk')) {
235+
//exec("su -c 'maildirmake -f Junk ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
236+
//$app->log('Created submaildir Junk: '."su -c 'maildirmake -f Junk ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name'],LOGLEVEL_DEBUG);
237+
$app->system->maildirmake($maildomain_path,$mail_config['mailuser_name'],'Junk');
238+
}
239+
240240
// Move mailbox, if domain has changed and delete old mailbox
241241
if($data['new']['maildir'] != $data['old']['maildir'] && is_dir($data['old']['maildir'])) {
242242
if(is_dir($data['new']['maildir'])) {

0 commit comments

Comments
 (0)