author | Pascal Volk <user@localhost.localdomain.org> |
Thu, 28 Jun 2012 17:51:23 +0000 | |
branch | v0.6.x |
changeset 566 | 007786e58fb7 |
parent 564 | 55148bc6348e |
child 577 | 4f9079dd4b65 |
permissions | -rw-r--r-- |
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
1 |
Installation Prerequisites |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
2 |
You should already have installed and configured Postfix, Dovecot and |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
3 |
PostgreSQL. |
268
beb8f4421f92
VMM: added new modules password and pycompat.hashlib.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
248
diff
changeset
|
4 |
|
beb8f4421f92
VMM: added new modules password and pycompat.hashlib.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
248
diff
changeset
|
5 |
The Virtual Mail Manager depends on: |
beb8f4421f92
VMM: added new modules password and pycompat.hashlib.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
248
diff
changeset
|
6 |
- Python (>= 2.4.0) |
356
61e732e4cb3e
Updated INSTALL and setup.py.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
271
diff
changeset
|
7 |
- Psycopg 2¹ or pyPgSQL² |
14
ebc9b864bc9a
* 'update_config_0.3.x-0.4.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
11
diff
changeset
|
8 |
|
268
beb8f4421f92
VMM: added new modules password and pycompat.hashlib.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
248
diff
changeset
|
9 |
If you are using Python <= 2.5.0: |
beb8f4421f92
VMM: added new modules password and pycompat.hashlib.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
248
diff
changeset
|
10 |
- if you want to store your users' passwords as PLAIN-MD4 digest in |
356
61e732e4cb3e
Updated INSTALL and setup.py.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
271
diff
changeset
|
11 |
the database, vmm will try to use Crypto.Hash.MD4 from PyCrypto³. |
268
beb8f4421f92
VMM: added new modules password and pycompat.hashlib.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
248
diff
changeset
|
12 |
- if you are using Dovecot >= v1.1.0 and you want to store your users' |
beb8f4421f92
VMM: added new modules password and pycompat.hashlib.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
248
diff
changeset
|
13 |
passwords as SHA256 or SSHA256 hashes, vmm will try to use |
beb8f4421f92
VMM: added new modules password and pycompat.hashlib.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
248
diff
changeset
|
14 |
Crypto.Hash.SHA256 from PyCrypto². For SHA256/SSHA256 you should have |
beb8f4421f92
VMM: added new modules password and pycompat.hashlib.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
248
diff
changeset
|
15 |
at least use PyCrypto in version 2.1.0alpha1. |
beb8f4421f92
VMM: added new modules password and pycompat.hashlib.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
248
diff
changeset
|
16 |
|
beb8f4421f92
VMM: added new modules password and pycompat.hashlib.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
248
diff
changeset
|
17 |
When the Crypto.Hash module couldn't be imported, vmm will use |
beb8f4421f92
VMM: added new modules password and pycompat.hashlib.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
248
diff
changeset
|
18 |
dovecotpw/doveadm, if the misc.password_scheme setting in the vmm.cfg |
beb8f4421f92
VMM: added new modules password and pycompat.hashlib.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
248
diff
changeset
|
19 |
is set to PLAIN-MD4, SHA256 or SSHA256 |
beb8f4421f92
VMM: added new modules password and pycompat.hashlib.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
248
diff
changeset
|
20 |
|
356
61e732e4cb3e
Updated INSTALL and setup.py.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
271
diff
changeset
|
21 |
[1] Psycopg: <http://initd.org/psycopg/> (Debian: python-psycopg2) |
61e732e4cb3e
Updated INSTALL and setup.py.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
271
diff
changeset
|
22 |
[2] pyPgSQL: <http://pypgsql.sourceforge.net/> (Debian: python-pgsql) |
61e732e4cb3e
Updated INSTALL and setup.py.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
271
diff
changeset
|
23 |
[3] PyCrypto: <http://www.pycrypto.org/> (Debian: python-crypto) |
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
24 |
|
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
25 |
|
564
55148bc6348e
INSTALL: Added description how to create additional dove* user/group.
Pascal Volk <user@localhost.localdomain.org>
parents:
563
diff
changeset
|
26 |
Create additionally a user and groups for improved security |
55148bc6348e
INSTALL: Added description how to create additional dove* user/group.
Pascal Volk <user@localhost.localdomain.org>
parents:
563
diff
changeset
|
27 |
We will create the system user `doveauth'. This user is used in the |
55148bc6348e
INSTALL: Added description how to create additional dove* user/group.
Pascal Volk <user@localhost.localdomain.org>
parents:
563
diff
changeset
|
28 |
authentication process. On a Debian GNU/Linux System use this command: |
55148bc6348e
INSTALL: Added description how to create additional dove* user/group.
Pascal Volk <user@localhost.localdomain.org>
parents:
563
diff
changeset
|
29 |
|
55148bc6348e
INSTALL: Added description how to create additional dove* user/group.
Pascal Volk <user@localhost.localdomain.org>
parents:
563
diff
changeset
|
30 |
adduser --system --home /nonexistent --no-create-home --group \ |
55148bc6348e
INSTALL: Added description how to create additional dove* user/group.
Pascal Volk <user@localhost.localdomain.org>
parents:
563
diff
changeset
|
31 |
--disabled-login --gecos "Dovecot IMAP/POP3 authentication user" \ |
55148bc6348e
INSTALL: Added description how to create additional dove* user/group.
Pascal Volk <user@localhost.localdomain.org>
parents:
563
diff
changeset
|
32 |
doveauth |
55148bc6348e
INSTALL: Added description how to create additional dove* user/group.
Pascal Volk <user@localhost.localdomain.org>
parents:
563
diff
changeset
|
33 |
|
55148bc6348e
INSTALL: Added description how to create additional dove* user/group.
Pascal Volk <user@localhost.localdomain.org>
parents:
563
diff
changeset
|
34 |
This will create the doveauth user and group. |
55148bc6348e
INSTALL: Added description how to create additional dove* user/group.
Pascal Volk <user@localhost.localdomain.org>
parents:
563
diff
changeset
|
35 |
For Dovecot >= 2.0 we create also the group `dovemail'. Dovecot will assign |
55148bc6348e
INSTALL: Added description how to create additional dove* user/group.
Pascal Volk <user@localhost.localdomain.org>
parents:
563
diff
changeset
|
36 |
this group to all Dovecot processes. |
55148bc6348e
INSTALL: Added description how to create additional dove* user/group.
Pascal Volk <user@localhost.localdomain.org>
parents:
563
diff
changeset
|
37 |
On a Debian GNU/Linux bases system run: |
55148bc6348e
INSTALL: Added description how to create additional dove* user/group.
Pascal Volk <user@localhost.localdomain.org>
parents:
563
diff
changeset
|
38 |
|
55148bc6348e
INSTALL: Added description how to create additional dove* user/group.
Pascal Volk <user@localhost.localdomain.org>
parents:
563
diff
changeset
|
39 |
addgroup --system dovemail |
55148bc6348e
INSTALL: Added description how to create additional dove* user/group.
Pascal Volk <user@localhost.localdomain.org>
parents:
563
diff
changeset
|
40 |
|
55148bc6348e
INSTALL: Added description how to create additional dove* user/group.
Pascal Volk <user@localhost.localdomain.org>
parents:
563
diff
changeset
|
41 |
|
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
42 |
Configuring PostgreSQL |
165
7e50e4c49ed7
INSTALL: Adapted pgsql configuration steps to that in the wiki.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
135
diff
changeset
|
43 |
(for more details see: http://vmm.localdomain.org/PreparingPostgreSQL) |
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
44 |
|
165
7e50e4c49ed7
INSTALL: Adapted pgsql configuration steps to that in the wiki.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
135
diff
changeset
|
45 |
* /etc/postgresql/8.4/main/pg_hba.conf |
7e50e4c49ed7
INSTALL: Adapted pgsql configuration steps to that in the wiki.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
135
diff
changeset
|
46 |
[ if you prefer to connect via TCP/IP ] |
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
47 |
# IPv4 local connections: |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
48 |
host mailsys +mailsys 127.0.0.1/32 md5 |
165
7e50e4c49ed7
INSTALL: Adapted pgsql configuration steps to that in the wiki.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
135
diff
changeset
|
49 |
[ if you want to connect through a local Unix-domain socket ] |
7e50e4c49ed7
INSTALL: Adapted pgsql configuration steps to that in the wiki.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
135
diff
changeset
|
50 |
# "local" is for Unix domain socket connections only |
7e50e4c49ed7
INSTALL: Adapted pgsql configuration steps to that in the wiki.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
135
diff
changeset
|
51 |
local mailsys +mailsys md5 |
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
52 |
|
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
53 |
# reload configuration |
165
7e50e4c49ed7
INSTALL: Adapted pgsql configuration steps to that in the wiki.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
135
diff
changeset
|
54 |
/etc/init.d/postgresql-8.4 force-reload |
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
55 |
|
563
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
56 |
* Create a database superuser if necessary: |
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
57 |
# as root run: su - postgres |
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
58 |
# if you have sudo privileges run: sudo su - postgres |
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
59 |
# create your superuser, which will be able to create users and databases |
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
60 |
createuser -s -d -r -E -e -P $USERNAME |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
61 |
|
563
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
62 |
* As superuser create the database and db users for vmm, Postfix and Dovecot |
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
63 |
connecting to PostgreSQL: |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
64 |
psql template1 |
128
cf8116625866
Converted VirtualMailManager and Postconf to new-style classes.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
127
diff
changeset
|
65 |
|
165
7e50e4c49ed7
INSTALL: Adapted pgsql configuration steps to that in the wiki.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
135
diff
changeset
|
66 |
# create users, group and the database |
563
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
67 |
CREATE ROLE vmm LOGIN ENCRYPTED PASSWORD 'DB PASSWORD for vmm'; |
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
68 |
CREATE ROLE dovecot LOGIN ENCRYPTED password 'DB PASSWORD for Dovecot'; |
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
69 |
CREATE ROLE postfix LOGIN ENCRYPTED password 'DB PASSWORD for Postfix'; |
165
7e50e4c49ed7
INSTALL: Adapted pgsql configuration steps to that in the wiki.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
135
diff
changeset
|
70 |
CREATE ROLE mailsys WITH USER postfix, dovecot, vmm; |
7e50e4c49ed7
INSTALL: Adapted pgsql configuration steps to that in the wiki.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
135
diff
changeset
|
71 |
CREATE DATABASE mailsys WITH OWNER vmm ENCODING 'UTF8'; |
7e50e4c49ed7
INSTALL: Adapted pgsql configuration steps to that in the wiki.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
135
diff
changeset
|
72 |
\q |
7e50e4c49ed7
INSTALL: Adapted pgsql configuration steps to that in the wiki.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
135
diff
changeset
|
73 |
|
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
74 |
# connect to the new database |
165
7e50e4c49ed7
INSTALL: Adapted pgsql configuration steps to that in the wiki.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
135
diff
changeset
|
75 |
psql mailsys vmm -W -h 127.0.0.1 |
127
97a9f6dd954b
Updated documentation
Pascal Volk <neverseen@users.sourceforge.net>
parents:
100
diff
changeset
|
76 |
# either import the database structure for Dovecot v1.0.x/v1.1.x |
563
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
77 |
\i vmm-y.x.z/pgsql/create_tables.pgsql |
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
78 |
# or import the database structure for Dovecot v1.2.x/v2.x |
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
79 |
\i vmm-x.y.z/pgsql/create_tables-dovecot-1.2.x.pgsql |
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
80 |
# leave psql |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
81 |
\q |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
82 |
|
563
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
83 |
# set permissions for your Dovecot and Postfix users |
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
84 |
# see python set-permissions.py -h for details |
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
85 |
python vmm-x.y.z/pgsql/set-permissions.py -a -H 127.0.0.1 -U vmm |
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
86 |
|
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
87 |
Create directory for your mails |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
88 |
mkdir /srv/mail |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
89 |
cd /srv/mail/ |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
90 |
mkdir 0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
91 |
chmod 771 /srv/mail |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
92 |
chmod 751 /srv/mail/* |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
93 |
|
563
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
94 |
|
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
95 |
For Dovecot >= 2.0 read the file Configure.Dovecot_2 |
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
96 |
Configuring Dovecot v1.x |
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
97 |
|
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
98 |
* /etc/dovecot/dovecot.conf |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
99 |
# all your other settings |
75
af813ede1e19
* 'create_optional_types_and_functions.pgsql'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
30
diff
changeset
|
100 |
#disable_plaintext_auth = no |
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
101 |
mail_location = maildir:~/Maildir |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
102 |
first_valid_uid = 70000 |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
103 |
first_valid_gid = 70000 |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
104 |
protocol lda { |
75
af813ede1e19
* 'create_optional_types_and_functions.pgsql'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
30
diff
changeset
|
105 |
postmaster_address = postmaster@YOUR-DOMAIN.TLD |
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
106 |
} |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
107 |
auth default { |
91 | 108 |
mechanisms = cram-md5 login plain |
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
109 |
passdb sql { |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
110 |
args = /etc/dovecot/dovecot-sql.conf |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
111 |
} |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
112 |
userdb sql { |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
113 |
args = /etc/dovecot/dovecot-sql.conf |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
114 |
} |
564
55148bc6348e
INSTALL: Added description how to create additional dove* user/group.
Pascal Volk <user@localhost.localdomain.org>
parents:
563
diff
changeset
|
115 |
user = doveauth |
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
116 |
socket listen { |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
117 |
master { |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
118 |
path = /var/run/dovecot/auth-master |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
119 |
mode = 0600 |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
120 |
} |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
121 |
client { |
563
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
122 |
path = /var/spool/postfix/private/dovecot-auth |
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
123 |
mode = 0660 |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
124 |
user = postfix |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
125 |
group = postfix |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
126 |
} |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
127 |
} |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
128 |
} |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
129 |
|
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
130 |
* /etc/dovecot/dovecot-sql.conf |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
131 |
driver = pgsql |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
132 |
connect = host=localhost dbname=mailsys user=dovecot password=$Dovecot_PASS |
563
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
133 |
default_pass_scheme = CRAM-MD5 |
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
134 |
password_query = SELECT userid AS "user", password FROM dovecotpassword('%Ln', '%Ld') WHERE %Ls |
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
135 |
user_query = SELECT home, uid, gid, mail FROM dovecotuser('%Ln', '%Ld') |
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
136 |
|
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
137 |
Provide a root SETUID copy of Dovecot's deliver agent for Postfix |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
138 |
|
563
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
139 |
/!\ Only required with Dovecot v.1.x. |
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
140 |
With Dovecot >= v2.0 use Dovecot's lmtp! |
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
141 |
|
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
142 |
mkdir -p /usr/local/lib/dovecot |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
143 |
chmod 700 /usr/local/lib/dovecot |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
144 |
chown nobody /usr/local/lib/dovecot |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
145 |
cp /usr/lib/dovecot/deliver /usr/local/lib/dovecot/ |
247
dbcb29ac89fa
INSTALL: simplified the 'SETUID copy of deliver' part
Pascal Volk <neverseen@users.sourceforge.net>
parents:
135
diff
changeset
|
146 |
chown root:`id -g nobody` /usr/local/lib/dovecot/deliver |
127
97a9f6dd954b
Updated documentation
Pascal Volk <neverseen@users.sourceforge.net>
parents:
100
diff
changeset
|
147 |
chmod u+s,o-rwx /usr/local/lib/dovecot/deliver |
97a9f6dd954b
Updated documentation
Pascal Volk <neverseen@users.sourceforge.net>
parents:
100
diff
changeset
|
148 |
|
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
149 |
|
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
150 |
|
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
151 |
Start or restart Dovecot |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
152 |
|
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
153 |
|
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
154 |
Configuring Postfix's master.cf |
563
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
155 |
|
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
156 |
/!\ Only required with Dovecot v.1.x. |
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
157 |
# Add Dovecot's deliver agent |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
158 |
dovecot unix - n n - - pipe |
378
af56cee51e67
INSTALL: Updated "user_query".
Pascal Volk <neverseen@users.sourceforge.net>
parents:
365
diff
changeset
|
159 |
flags=DORhu user=nobody argv=/usr/local/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop} -n -m ${extension} |
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
160 |
|
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
161 |
|
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
162 |
|
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
163 |
Configuring Postfix's main.cf |
100
b581e747e720
INSTALL, man/*: small enhancement and corrections
Pascal Volk <neverseen@users.sourceforge.net>
parents:
92
diff
changeset
|
164 |
# relocated users from the database |
b581e747e720
INSTALL, man/*: small enhancement and corrections
Pascal Volk <neverseen@users.sourceforge.net>
parents:
92
diff
changeset
|
165 |
#relocated_maps = pgsql:/etc/postfix/pgsql-relocated_maps.cf |
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
166 |
|
563
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
167 |
# transport settings from our database |
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
168 |
transport_maps = pgsql:/etc/postfix/pgsql-transport_maps.cf |
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
169 |
|
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
170 |
# virtual domains |
75
af813ede1e19
* 'create_optional_types_and_functions.pgsql'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
30
diff
changeset
|
171 |
virtual_mailbox_domains = pgsql:/etc/postfix/pgsql-virtual_mailbox_domains.cf |
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
172 |
virtual_alias_maps = pgsql:/etc/postfix/pgsql-virtual_alias_maps.cf |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
173 |
virtual_minimum_uid = 70000 |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
174 |
virtual_uid_maps = pgsql:/etc/postfix/pgsql-virtual_uid_maps.cf |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
175 |
virtual_gid_maps = pgsql:/etc/postfix/pgsql-virtual_gid_maps.cf |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
176 |
virtual_mailbox_base = / |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
177 |
virtual_mailbox_maps = pgsql:/etc/postfix/pgsql-virtual_mailbox_maps.cf |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
178 |
|
563
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
179 |
# dovecot LDA (only recommended with Dovecot v1.x) |
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
180 |
#dovecot_destination_recipient_limit = 1 |
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
181 |
#virtual_transport = dovecot: |
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
182 |
|
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
183 |
# dovecot lmtp |
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
184 |
virtual_transport = lmtp:unix:private/dovecot-lmtp |
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
185 |
|
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
186 |
# dovecot SASL |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
187 |
smtpd_sasl_type = dovecot |
563
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
188 |
smtpd_sasl_path = private/dovecot-auth |
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
189 |
smtpd_sasl_auth_enable = yes |
92 | 190 |
# Keep smtpd_sasl_local_domain identical to Dovecot's auth_default_realm: |
191 |
# empty. Both are empty by default. Let it commented out. |
|
192 |
# Read more at: http://wiki.dovecot.org/Authentication/Mechanisms/DigestMD5 |
|
193 |
#smtpd_sasl_local_domain = |
|
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
194 |
smtpd_sasl_security_options = noplaintext, noanonymous |
75
af813ede1e19
* 'create_optional_types_and_functions.pgsql'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
30
diff
changeset
|
195 |
#smtpd_sasl_security_options = noanonymous |
af813ede1e19
* 'create_optional_types_and_functions.pgsql'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
30
diff
changeset
|
196 |
#broken_sasl_auth_clients = yes |
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
197 |
|
14
ebc9b864bc9a
* 'update_config_0.3.x-0.4.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
11
diff
changeset
|
198 |
smtpd_recipient_restrictions = |
ebc9b864bc9a
* 'update_config_0.3.x-0.4.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
11
diff
changeset
|
199 |
permit_mynetworks |
ebc9b864bc9a
* 'update_config_0.3.x-0.4.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
11
diff
changeset
|
200 |
permit_sasl_authenticated |
ebc9b864bc9a
* 'update_config_0.3.x-0.4.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
11
diff
changeset
|
201 |
reject_unauth_destination |
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
202 |
|
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
203 |
|
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
204 |
Installing the Virtual Mail Manager and configure the rest |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
205 |
|
563
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
206 |
Installing from Mercurial or vmm-x.y.z.tar.gz |
356
61e732e4cb3e
Updated INSTALL and setup.py.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
271
diff
changeset
|
207 |
after cloning from the hg repo or extracting the archive change into the |
61e732e4cb3e
Updated INSTALL and setup.py.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
271
diff
changeset
|
208 |
new directory and type: |
30 | 209 |
./install.sh |
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
210 |
edit all the pgsql-*.cf files in /etc/postfix |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
211 |
|
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
212 |
reload postfix |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
213 |
|
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
214 |
# configure the Virtual Mail Manager |
563
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
215 |
# vmm.cfg(5) - configuration file for vmm |
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
216 |
# |
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
217 |
# For Dovecot v1.x use 'dovecot:' as domain.transport |
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
218 |
# When using Dovecot v2.x use 'lmtp:unix:private/dovecot-lmtp' as |
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
219 |
# domain.transport |
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
220 |
vmm configure |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
221 |
|
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
222 |
# for help type |
563
b17a9d7a59ae
INSTALL: Updated documentation.
Pascal Volk <user@localhost.localdomain.org>
parents:
378
diff
changeset
|
223 |
# vmm(1) - command line tool to manage email domains/accounts/aliases |
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
224 |
vmm help |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
225 |