~ubuntu-branches/ubuntu/karmic/cyrus-imapd-2.2/karmic

« back to all changes in this revision

Viewing changes to debian/README.Debian.simpleinstall

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2006-02-15 17:40:07 UTC
  • Revision ID: james.westby@ubuntu.com-20060215174007-tu5fx5wasxrw4596
Tags: 2.2.12-3ubuntu1
Build using Berkeley DB 4.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Cyrus IMAP for Debian, Simple Install Guide
 
2
$Id: README.Debian.simpleinstall 229 2005-12-08 23:26:29Z astronut $
 
3
-------------------------------------------
 
4
 
 
5
   "All systems administrators have their horror stories. For me, it was
 
6
    setting up a HP Color Bubblejet under Linux using ghostscript before
 
7
    linuxprinting.org was alive.  Well that was a piece of cake compared
 
8
    to what I am about to describe in this document."
 
9
         --  "Hosting email for virtual domains using Postfix and Cyrus"
 
10
                                             Haim Dimermanas, 2001-08-01
 
11
 
 
12
           "I warned you to read all the documentation first, didn't I?"
 
13
                                    --  Henrique M. Holschuh, 2002-10-01
 
14
 
 
15
 
 
16
This document describes how to get Cyrus running with a simple configuration
 
17
that you can then tweak to your real needs.
 
18
 
 
19
READ README.Debian AS WELL. I MEAN IT!  Cyrus is easy, all the trouble is
 
20
in SASL, and even that becomes easy after you understand how SASL works.
 
21
 
 
22
IMPORTANT: Cyrus is a closed-box email system.  Your system will access your
 
23
email through LMTP, IMAP and POP3 *only*.  No direct file access to the email
 
24
store is supposed to take place.
 
25
 
 
26
 
 
27
To setup Cyrus so that you can administer it (i.e. create users),
 
28
and get email inside it for those users:
 
29
 
 
30
 1. Make sure libsasl2-modules, libsasl2 and sasl2-bin are installed
 
31
 
 
32
 2. Make sure /etc/sasldb2 is readable by group sasl.  Pay attention
 
33
    to overrides (dpkg-statoverride)!
 
34
 
 
35
 3. Make sure user cyrus belongs to group sasl (cyrus-common-2.2's install
 
36
    tries to do this automatically for you).
 
37
 
 
38
 4. Edit /etc/cyrus.conf, and make sure the services you need are
 
39
    enabled.  These are most probably "imap", "pop3", "lmtpunix".
 
40
 
 
41
 5. Edit /etc/imapd.conf, and make sure you have some admin users
 
42
    listed in the entry "admins:".  I suggest using "cyrus" as your
 
43
    admin.
 
44
 
 
45
    I also suggest enabling plain text logins, and setting 
 
46
    sasl_minimum_layer: 0
 
47
 
 
48
    If you have unixhierarchysep enabled in imapd.conf, change all
 
49
    "." in mailbox names mentioned on this document to "/", since Cyrus 
 
50
    will use "/" as the hierarchy separator instead of the default ".".
 
51
    I suggest you just leave unixhierarchysep set to false for now.
 
52
 
 
53
 6. Restart Cyrus  (/etc/init.d/cyrus2.2 restart)
 
54
 
 
55
 7. Use saslpasswd2 -c  to create an account for your admin:
 
56
    saslpasswd2 -c cyrus
 
57
 
 
58
 8. Use sasldblistusers2 to make sure step 7 worked fine.
 
59
 
 
60
 9. Add other users to SASL likewise (saslpasswd2 -c).
 
61
 
 
62
10. Log in cyrus as the administrator, and create the mailboxes:
 
63
    cyradm --user cyrus localhost
 
64
    cm user.bob
 
65
    cm user.anna
 
66
    cm user.clark...
 
67
    ^D
 
68
 
 
69
    (notice that there is an "user." in front of the mailbox name!)
 
70
    You must use "user/bob", "user/anna" instead if you have the
 
71
    unixhierarchysep option enabled in imapd.conf.
 
72
 
 
73
    For this to work, you obviously need the cyrus-admin-2.2 package
 
74
    installed.
 
75
 
 
76
11. Try to login as a normal user, using imtest or a IMAP/POP3 client.
 
77
    If you have trouble with mutt and CRAM-MD5 or DIGEST-MD5, edit
 
78
    /etc/imapd.conf, and look for sasl_mech_list.  Set it to:
 
79
    sasl_mech_list: plain cram-md5
 
80
    (this will disable digest-md5, which causes trouble with mutt).
 
81
 
 
82
12. Setup your MTA to deliver email inside Cyrus.  Basically that can
 
83
    be done (easily) by:
 
84
 
 
85
    a)  running /usr/sbin/cyrdeliver  (SLOW)
 
86
        You need the lmtpunix service enabled in /etc/cyrus.conf for this
 
87
        to work.
 
88
    b)  delivering using LMTP to /var/run/cyrus/socket/lmtp
 
89
        You need the lmtpunix service enabled in /etc/cyrus.conf for this
 
90
        to work.
 
91
 
 
92
        Just make sure (and use dpkg-statoverride to do that) that your
 
93
        MTA can get to /var/run/cyrus/socket/lmtp.  It works just like any
 
94
        file in a Unix system.
 
95
 
 
96
    Cyrus REQUIRES a valid RFC2822 message, and will refuse messages with
 
97
    bad headers (such as that From foobar header, notice the missing ':'),
 
98
    embedded NULLs or any other crap.
 
99
 
 
100
 
 
101
That's it.  See /usr/share/doc/cyrus-common-2.2/README.{postfix,exim,sendmail}
 
102
for help on how to setup your MTA to correctly deliver to Cyrus.
 
103
 
 
104
 
 
105
LDAP SETUP
 
106
----------
 
107
 
 
108
First, do the steps above and verify that your system is working fine.
 
109
 
 
110
SASL is perfectly capable of trying various authentication methods one after
 
111
another.  We will change our Cyrus setup for SASL to use a LDAP server lookup
 
112
through saslauthd.
 
113
 
 
114
1. Create the configuration for saslauthd to know what it must do:
 
115
 
 
116
   Write the following file to /etc/saslauthd.conf:
 
117
----CUTHERE----
 
118
ldap_servers: ldap://127.0.0.1/
 
119
ldap_version: 3
 
120
ldap_timeout: 10
 
121
ldap_time_limit: 10
 
122
ldap_cache_ttl: 30
 
123
ldap_cache_mem: 32768
 
124
ldap_scope: sub
 
125
ldap_search_base: ou=mail,o=mydomain
 
126
ldap_auth_method: bind
 
127
ldap_filter: maildrop=%u
 
128
----CUTHERE----
 
129
   And of course, edit it to fit your LDAP setup.
 
130
 
 
131
2. Now, configure saslauthd to use LDAP mode and our config file:
 
132
 
 
133
   Modify /etc/default/saslauthd so that it reads:
 
134
   MECHANISMS="ldap"
 
135
   PARAMS="-O /etc/saslauthd.conf"
 
136
 
 
137
   (MECHANISMS can be a space-separated list of authentication
 
138
   mechanisms. If you wanted saslauthd to try LDAP, then PAM, you
 
139
   could use MECHANISMS="ldap pam")
 
140
 
 
141
3. Start saslauthd
 
142
 
 
143
   /etc/init.d/saslauthd restart
 
144
 
 
145
4. Make sure Cyrus will be able to talk to saslauthd
 
146
 
 
147
   Set the following options in /etc/imapd.conf:
 
148
   sasl_mech_list: PLAIN
 
149
   allowapop: no
 
150
   allowplaintext: yes
 
151
   sasl_minimum_layer: 0
 
152
   sasl_pwcheck_method: saslauthd
 
153
 
 
154
   And restart Cyrus.  You'd better understand that the above allows
 
155
   plaintext logins over the network.  There is a LDAP SASL auxprop
 
156
   plugin being worked on that might fix this issue.  As it stands
 
157
   right now, you're better off by only accepting IMAPS (secure IMAP)
 
158
   connections.
 
159
 
 
160
   (sasl_pwcheck_method is a space separated list of SASL methods to
 
161
   try.  If you want to have some local users in /etc/sasldb2, for
 
162
   example, you could have "sasl_pwcheck_method: auxprop saslauthd"
 
163
   and also "sasl_auxprop_plugin: sasldb")
 
164
 
 
165
   One *extremely* important point to notice is that saslauthd works
 
166
   ONLY with plaintext.  APOP, CRAM-MD5, OTP, DIGEST-MD5 and any other
 
167
   "auxprop" SASL mech will *not* work through saslauthd.
 
168
 
 
169
5. That's it.  There is a LDAP auxprop module in the works which can deal
 
170
   with APOP, CRAM-MD5, OTP, DIGEST-MD5 and so on, look for it in the SASL
 
171
   docs and openldap's contrib stuff.
 
172
 
 
173
 -- Henrique de Moraes Holschuh <hmh@debian.org>