Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > by-pkgid > 965e33040dd61030a94f0eb89877aee8 > files > 1171

howto-html-en-20080722-2mdv2010.1.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
 <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
 <TITLE> Cyrus IMAP HOWTO: Cyrus IMAP Configuration</TITLE>
 <LINK HREF="Cyrus-IMAP-8.html" REL=next>
 <LINK HREF="Cyrus-IMAP-6.html" REL=previous>
 <LINK HREF="Cyrus-IMAP.html#toc7" REL=contents>
</HEAD>
<BODY>
<A HREF="Cyrus-IMAP-8.html">Next</A>
<A HREF="Cyrus-IMAP-6.html">Previous</A>
<A HREF="Cyrus-IMAP.html#toc7">Contents</A>
<HR>
<H2><A NAME="s7">7. Cyrus IMAP Configuration</A></H2>

<H2><A NAME="ss7.1">7.1 Editing conf files</A>
</H2>

<P>
<OL>
<LI>Edit /etc/syslog.conf and add the following lines at the bottom:
<PRE>
        local6.debug    /var/adm/imapd.log
        auth.debug      /var/adm/auth.log
</PRE>
</LI>
<LI>Edit a new file /etc/imapd.conf and place in it the following lines: 
<PRE>
        configdirectory: /var/imap
        partition-default: /var/spool/imap
        admins: cyrus root
        srvtab: /var/imap/srvtab
        allowanonymouslogin: no
        sasl_passwd_check: shadow
</PRE>
</LI>
</OL>
<P>If you don't want your password check to be the default sasldb, you must specify
which one of PAM, kerberos_v4, passwd, shadow you wish to use. If PAM is the
authentication you desire for example, you would type: 
<P><CODE>sasl_passwd_check: pam</CODE>
<P>instead of the line above
<H2><A NAME="ss7.2">7.2 Creating the necessary directories</A>
</H2>

<P>This list of instructions will set up all the directories necessary for imap.
<P>
<OL>
<LI><CODE>mkdir /var/adm</CODE></LI>
<LI><CODE>touch /var/adm/imapd.log /var/adm/auth.log</CODE></LI>
<LI><CODE>mkdir /var/imap /var/spool/imap /var/imap/srvtab</CODE></LI>
<LI><CODE>chown cyrus /var/imap /var/spool/imap /var/imap/srvtab</CODE></LI>
<LI><CODE>chgrp mail /var/imap /var/spool/imap /var/imap/srvtab</CODE></LI>
<LI><CODE>chmod 750 /var/imap /var/spool/imap /var/imap/srvtab</CODE></LI>
<LI><CODE>su cyrus</CODE></LI>
</OL>
<P>You are now the user cyrus. This is necessary for the files to have the correct owner and group.
Continue: 
<P>
<OL>
<LI><CODE>tools/mkimap</CODE></LI>
<LI><CODE>cd /var/imap</CODE></LI>
<LI><CODE>chattr +S . user quota user/* quota/*</CODE></LI>
<LI><CODE>chattr +S /var/spool/imap</CODE></LI>
<LI><CODE>exit</CODE></LI>
</OL>
<P>You are now root again. The last command: 
<P><CODE>chattr +S /var/spool/mqueue</CODE>
<H2><A NAME="ss7.3">7.3 More configuration file editing</A>
</H2>

<P>
<OL>
<LI>Edit <EM>/etc/services</EM> and check for the following lines. If they do not exist, add them: 
<PRE>
        pop3    110/tcp
        imap    143/tcp
        imsp    406/tcp
        kpop    1109/tcp
        sieve   2000/tcp
</PRE>
</LI>
<LI>Edit <EM>/etc/inetd.conf</EM> and comment out any imap and pop3 lines and add the following: 
<PRE>
        imap    stream  tcp     nowait  cyrus   /usr/cyrus/bin/imapd    imapd
        pop3    stream  tcp     nowait  cyrus   /usr/cyrus/bin/pop3d    pop3d
</PRE>
</LI>
<LI>Edit <EM>/etc/sendmail.mc</EM> with care not to add extra spaces and add the following lines(do not copy and paste directly from this text as the tabs won't be added correctly):
<PRE>
  MAILER(local)
  MAILER(cyrus)
  define(`confLOCAL_MAILER',`cyrus') 
  LOCAL_RULE_0
  R$=N                   $: $#local $: $1
  R$=N &lt; @ $=w . >       $: $#local $: $1
  Rbb + $+ &lt; @ $=w . >   $#cyrusbb $: $1
</PRE>

Use tabs to separate the data (i.e. R$=N has three tabs between it and $: $#local $: $1) 
Then run:
<CODE>m4 sendmail.mc > sendmail.cf</CODE></LI>
<LI>Edit <EM>/etc/group</EM> and add the user daemon to the mail group.</LI>
</OL>
<H2><A NAME="ss7.4">7.4 If you use postfix instead of sendmail</A>
</H2>

<P>Postfix is a mail-deliver alternative to sendmail. Most linux installations use sendmail by default. If you use postfix, ignore configuration #3 from the last section and uncomment or add the following line in <EM>/etc/postfix/master.cf</EM>
<P>
<PRE>
cyrus   unix    -       n       n       -       -       pipe    flags=R user=cyrus      argv=/usr/sbin/cyrdeliver -e -m ${extension} ${user}
</PRE>
<P>Also add or uncomment this line in <EM>/etc/postfix/main.cf</EM>
<P><CODE>local_transport = cyrus</CODE>
<HR>
<A HREF="Cyrus-IMAP-8.html">Next</A>
<A HREF="Cyrus-IMAP-6.html">Previous</A>
<A HREF="Cyrus-IMAP.html#toc7">Contents</A>
</BODY>
</HTML>