Cyrus - Basic Configuration

De gacq wiki
Saltar a: navegación, buscar

To setup Cyrus so that you can administer it (i.e. create users), and get email inside it for those users:

1. Make sure libsasl2-modules, libsasl2 and sasl2-bin are installed

2. Make sure /etc/sasldb2 is readable by group sasl. Pay attention to overrides (dpkg-statoverride)!

3. Make sure user cyrus belongs to group sasl (cyrus21-common's install tries to do this automatically for you).

4. Edit /etc/cyrus.conf, and make sure the services you need are enabled. These are most probably "imap", "pop3", "lmtpunix".

5. Edit /etc/imapd.conf, and make sure you have some admin users listed in the entry "admins:". I suggest using "cyrus" as your admin. I also suggest enabling plain text logins, and setting sasl_minimum_layer: 0

If you have unixhierarchysep enabled in imapd.conf, change all "." in mailbox names mentioned on this document to "/", since Cyrus will use "/" as the hierarchy separator instead of the default ".". I suggest you just leave unixhierarchysep set to false for now.

6. Restart Cyrus (/etc/init.d/cyrus21 restart)

7. Use saslpasswd2 -c to create an account for your admin: saslpasswd2 -c cyrus

8. Use sasldblistusers2 to make sure step 7 worked fine.

9. Add other users to SASL likewise (saslpasswd2 -c).

10. Log in cyrus as the administrator, and create the mailboxes:

   cyradm --user cyrus localhost
   cm user.bob
   cm user.anna
   cm user.clark...
   (notice that there is an "user." in front of the mailbox name!)
   You must use "user/bob", "user/anna" instead if you have the
   unixhierarchysep option enabled in imapd.conf.
   For this to work, you obviously need the cyrus21-admin package

11. Try to login as a normal user, using imtest or a IMAP/POP3 client.

   If you have trouble with mutt and CRAM-MD5 or DIGEST-MD5, edit
   /etc/imapd.conf, and look for sasl_mech_list.  Set it to:
   sasl_mech_list: plain cram-md5
   (this will disable digest-md5, which causes trouble with mutt).

12. Setup your MTA to deliver email inside Cyrus. Basically that can

   be done (easily) by:
   a)  running /usr/sbin/cyrdeliver  (SLOW)
       You need the lmtpunix service enabled in /etc/cyrus.conf for this
       to work.
   b)  delivering using LMTP to /var/run/cyrus/socket/lmtp
       You need the lmtpunix service enabled in /etc/cyrus.conf for this
       to work.
       Just make sure (and use dpkg-statoverride to do that) that your
       MTA can get to /var/run/cyrus/socket/lmtp.  It works just like any
       file in a Unix system.
   Cyrus REQUIRES a valid RFC2822 message, and will refuse messages with
   bad headers (such as that From foobar header, notice the missing ':'),
   embedded NULLs or any other crap.

That's it. See /usr/share/doc/cyrus21-common/README.{postfix,exim,sendmail} for help on how to setup your MTA to correctly deliver to Cyrus.


Comandos para dejarlo andando en Sarge -

apt-get install cyrus21-admin cyrus21-common cyrus21-doc cyrus21-imapd cyrus21-clients cyrus21-pop3d
apt-get install libsasl2 sasl2-bin libsasl2-modules

vi /etc/default/saslauthd

/etc/init.d/saslauthd start

vi /etc/imapd.conf
    admins: cyrus
    sasl_minimum_layer: 0
    sasl_mech_list: PLAIN
    sasl_pwcheck_method: saslauthd
    sasl_auxprop_plugin: sasldb

saslpasswd2 -c cyrus

/etc/init.d/cyrus21 restart

# Probar que funcione
imtest -a cyrus localhost


Crear usuario

geacequ:/etc# cyradm --user cyrus localhost
IMAP Password:
localhost.localdomain> cm user.prueba
localhost.localdomain> exit
geacequ:/etc# saslpasswd2 -c prueba
Again (for verification):

Listas usuarios


Cambiar passwords

saslpasswd2 -c prueba

Borrar cuentas

To delete a mailbox, you must fix give the admin user 'create' permissions on the mailbox. To many people's suprise, the admin does not have this permission by default. Then you can delete the mailbox with 'dm'.

localhost> lam user.test
test lrswipcda
localhost.localdomain> dm user.test
deletemailbox: Permission denied
localhost> sam user.test cyrus c 
localhost> lam user.test
test lrswipcda
cyrus c
localhost> dm user.test
saslpasswd2 -c test