<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://studioware.com/wikislax/index.php?action=history&amp;feed=atom&amp;title=Cyrus-IMAP</id>
		<title>Cyrus-IMAP - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://studioware.com/wikislax/index.php?action=history&amp;feed=atom&amp;title=Cyrus-IMAP"/>
		<link rel="alternate" type="text/html" href="http://studioware.com/wikislax/index.php?title=Cyrus-IMAP&amp;action=history"/>
		<updated>2026-05-07T15:11:00Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.29.2</generator>

	<entry>
		<id>http://studioware.com/wikislax/index.php?title=Cyrus-IMAP&amp;diff=27&amp;oldid=prev</id>
		<title>Wikislax: Created page with &quot;{{RightTOC}}  == What is Cyrus-IMAP ? ==  [http://www.cyrusimap.org/index.php Cyrus-IMAP] is an IMAP and POP server. Unlike SMTP, designed to convey mail between Mail Transfer...&quot;</title>
		<link rel="alternate" type="text/html" href="http://studioware.com/wikislax/index.php?title=Cyrus-IMAP&amp;diff=27&amp;oldid=prev"/>
				<updated>2017-12-06T21:31:03Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{RightTOC}}  == What is Cyrus-IMAP ? ==  [http://www.cyrusimap.org/index.php Cyrus-IMAP] is an IMAP and POP server. Unlike SMTP, designed to convey mail between Mail Transfer...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{RightTOC}}&lt;br /&gt;
&lt;br /&gt;
== What is Cyrus-IMAP ? ==&lt;br /&gt;
&lt;br /&gt;
[http://www.cyrusimap.org/index.php Cyrus-IMAP] is an IMAP and POP server. Unlike SMTP, designed to convey mail between Mail Transfer Agents, IMAP and POP are designed to convey mail to clients such as Thunderbird. Cyrus-IMAP is an industrial grade server, handling IMAP folders and quotas. An option in Sendmail affords delivering mail to Cyrus-IMAP rather than writing it into the standard Unix folders '''/var/spool/mail'''. Cyrus-IMAP stores its information in a Berkeley DB database. [http://www.cyrusimap.org/mediawiki/index.php/Downloads#IMAP_Server Download Cyrus-IMAP] and untar under /usr/local. [http://www.cyrusimap.org/docs/cyrus-imapd Documentation] is available online and also in html format under the doc directory.&lt;br /&gt;
&lt;br /&gt;
== Installing Cyrus-imap ==&lt;br /&gt;
&lt;br /&gt;
Required pre-installed sotwares and minimal versions are libsasl 2.17, Berkeley DB 3.0.55, GNU Make, makedepend, Perl 5, OpenSSL 0.9.4 and optionnally libwrap and Net-SNMP. '''--with-auth''' is the authorization module to use, unix or kerberos (krb or krb_pts). '''--with-cyrus-prefix''' is the location of the cyrus-imap executable structure, '''--cyrus-user''' is the cyrus user name, '''--with-dbdir''' is the location of the db executable structure, '''--with-openssl''' is the location of the openssl executable structure, '''--with-perl''' is the location of the perl executable, '''--with-sasl''' is the location of the libsasl executable structure, '''--enable-netscape-hack''' enables X-Netscape extension (administration URLs).&lt;br /&gt;
&lt;br /&gt;
 # tar -C /usr/local -xvf cyrus-imapd-x.y.z.tar.gz&lt;br /&gt;
 # cd /usr/local&lt;br /&gt;
 # chown -R root:root cyrus-imapd-x.y.z&lt;br /&gt;
 # cd cyrus-imapd-x.y.z&lt;br /&gt;
 # .configure --help | less&lt;br /&gt;
 # ./configure --libdir=/usr/local/lib64 \&lt;br /&gt;
 --mandir=/usr/local/man --with-cyrus-prefix=/usr/local --with-cyrus-user=cyrus \&lt;br /&gt;
 --with-dbdir=/usr --with-openssl=/usr/local --with-perl=/usr/bin/perl \&lt;br /&gt;
 --with-sasl=/usr/local --enable-netscapehack&lt;br /&gt;
 # make depend&lt;br /&gt;
 # make all&lt;br /&gt;
 # make install&lt;br /&gt;
 # make clean&lt;br /&gt;
&lt;br /&gt;
== Configuring Cyrus-imap ==&lt;br /&gt;
&lt;br /&gt;
Refer to '''doc/install-configure.html''' and the imapd.conf (5) man pages. First, reconfigure '''syslog.conf''' to use two additional files, then edit '''/etc/imapd.conf''' , create the required directory structures, and last, put together the server certificate (first, encrypted part only) and private unsecure key (second) in file '''/etc/ssl/certs/server.pem''', securitizing with chmod 600.&lt;br /&gt;
&lt;br /&gt;
Cyrus SASL has a number of options that can be configured by the application. To configure these via imapd.conf, simply prefix the appropriate option name with sasl_ (e.g. pwcheck_method becomes sasl_pwcheck_method).&lt;br /&gt;
&lt;br /&gt;
 # touch /var/log/imapd.log /var/log/auth.log&lt;br /&gt;
 # vi /etc/syslog.conf&lt;br /&gt;
 a&lt;br /&gt;
 # this is for cyrus-imapd&lt;br /&gt;
 local6.warning		-/var/log/imapd.log&lt;br /&gt;
 auth.warning		-/var/log/auth.log&lt;br /&gt;
 :x&lt;br /&gt;
 &amp;lt;esc&amp;gt;&lt;br /&gt;
 # cd /etc&lt;br /&gt;
 # vi imapd.conf&lt;br /&gt;
 i&lt;br /&gt;
 admins: postmaster&lt;br /&gt;
 allowpop: no&lt;br /&gt;
 allowplaintext: yes&lt;br /&gt;
 configdirectory: /var/imap&lt;br /&gt;
 lmtp_over_quota_perm_failure: yes&lt;br /&gt;
 ldap_authz: proxyUser&lt;br /&gt;
 ldap_base: dc=domain,dc=com&lt;br /&gt;
 ldap_filter: cn=%u&lt;br /&gt;
 ldap_id: proxyUser&lt;br /&gt;
 ldap_mech: DIGEST-MD5&lt;br /&gt;
 ldap_password: proxyPassword&lt;br /&gt;
 ldap_sasl: yes&lt;br /&gt;
 ldap_uri: ldap://localhost&lt;br /&gt;
 mech_list: PLAIN&lt;br /&gt;
 partition-default: /var/spool/imap&lt;br /&gt;
 sasl_auxprop_plugin: ldapdb&lt;br /&gt;
 sasl_log_level: 0&lt;br /&gt;
 sasl_pwcheck_method: auxprop&lt;br /&gt;
 sendmail: /usr/sbin/sendmail&lt;br /&gt;
 tls_ca_file: /etc/ssl/certs/cacert.pem&lt;br /&gt;
 tls_ca_path: /etc/ssl/certs&lt;br /&gt;
 tls_cert_file: /etc/ssl/certs/server.pem&lt;br /&gt;
 tls_key_file: /etc/ssl/certs/server.pem&lt;br /&gt;
 &amp;lt;esc&amp;gt;&lt;br /&gt;
 :x&lt;br /&gt;
 # cd /var&lt;br /&gt;
 # mkdir imap&lt;br /&gt;
 # useradd -g mail cyrus&lt;br /&gt;
 # chown cyrus:mail imap&lt;br /&gt;
 # chmod 750 imap&lt;br /&gt;
 # cd spool&lt;br /&gt;
 # mkdir imap&lt;br /&gt;
 # chown cyrus:mail imap&lt;br /&gt;
 # chmod 750 imap&lt;br /&gt;
 # su cyrus&lt;br /&gt;
 $ cd /usr/local/cyrus-imap*&lt;br /&gt;
 $ tools/mkimap&lt;br /&gt;
 &amp;lt;ctrl&amp;gt;d&lt;br /&gt;
 # cd /etc/ssl/certs&lt;br /&gt;
 # vi mtacert.pem&lt;br /&gt;
 d59d&lt;br /&gt;
 :$&lt;br /&gt;
 :r ../private/mtakey.pem.unsecure&lt;br /&gt;
 :w server.pem&lt;br /&gt;
 :x&lt;br /&gt;
 # chown cyrus:mail server.pem&lt;br /&gt;
 # chmod 600 server.pem&lt;br /&gt;
&lt;br /&gt;
If using the older ext2fs filesystem, also set the user, quota, and partition directories to update synchronously as described in doc/install-configure.html (for ext3fs this is not necessary). Also set the queue directory of the mail daemon to update synchronously (the example given is for sendmail).&lt;br /&gt;
&lt;br /&gt;
 # cd /var/imap&lt;br /&gt;
 # chattr +S user quota user/* quota/*&lt;br /&gt;
 # chattr +S /var/spool/imap /var/spool/imap/*&lt;br /&gt;
 # chattr +S /var/spool/mqueue&lt;br /&gt;
&lt;br /&gt;
== Configuring Cyrus-imap SASL ==&lt;br /&gt;
&lt;br /&gt;
For SMTP authentication, we use SASL against the OpenLDAP directory installed previously. As only mechanism, we use PLAIN, later ensuring security by forcing SSL encryption over port 465 SMTPS (actually, DIGEST-MD5 and CRAM-MD5 are not widely used, and Microsoft Outlook uses only the LOGIN non standard mechanism). Here is the content of file '''/usr/local/lib/sasl2/Cyrus.conf''' :&lt;br /&gt;
&lt;br /&gt;
 auxprop_plugin: ldapdb&lt;br /&gt;
 ldapdb_id: proxyUser&lt;br /&gt;
 ldapdb_mech: DIGEST-MD5&lt;br /&gt;
 ldapdb_pw: proxyUserPassword&lt;br /&gt;
 ldapdb_uri: ldap://localhost&lt;br /&gt;
 log_level: 0&lt;br /&gt;
 mech_list: PLAIN&lt;br /&gt;
 pwcheck_method: auxprop&lt;br /&gt;
&lt;br /&gt;
As it contains sensitive information, the owner and rights of this file should be set so that it can be read only by its user cyrus:mail.&lt;br /&gt;
&lt;br /&gt;
== Running Cyrus-imap ==&lt;br /&gt;
&lt;br /&gt;
Remove any imap, imaps, pop3, pop3s, kpop, lmtp entry from '''/etc/inetd.conf''', copy '''/etc/cyrus.conf''' from one of the templates provided under '''master/conf'''. Arrange to start '''/usr/local/bin/master''' as root when the system starts and to stop it when the system shuts down. Until the system reboots, you can start the master process by hand. Monitor the progress of the master process by examining the '''imapd.log''' file.&lt;br /&gt;
&lt;br /&gt;
 # vi /etc/inetd.conf&lt;br /&gt;
 # kill -HUP `head -1 /var/run/inetd.pid`&lt;br /&gt;
 # cd /usr/local/cyrus-imap*&lt;br /&gt;
 # cp master/conf/normal.conf /etc/cyrus.conf&lt;br /&gt;
 # vi /etc/cyrus.conf&lt;br /&gt;
  #pop3         cmd=&amp;quot;pop3d&amp;quot; listen=&amp;quot;pop3&amp;quot; prefork=0&lt;br /&gt;
  #pop3s        cmd=&amp;quot;pop3d -s&amp;quot; listen=&amp;quot;pop3s&amp;quot; prefork=0&lt;br /&gt;
  notify        cmd=&amp;quot;notifyd&amp;quot; listen=&amp;quot;/var/imap/socket/notify&amp;quot; proto=&amp;quot;udp&amp;quot; prefork=1&lt;br /&gt;
 &amp;lt;esc&amp;gt;&lt;br /&gt;
 :x&lt;br /&gt;
 # vi /etc/rc.d/rc.local&lt;br /&gt;
 a&lt;br /&gt;
 # start cyrus-imapd&lt;br /&gt;
 if [ -x /usr/local/bin/master ]; then&lt;br /&gt;
 	echo &amp;quot;Starting cyrus-imap: /usr/local/bin/master &amp;amp;&amp;quot;&lt;br /&gt;
 	/usr/local/bin/master &amp;amp;&lt;br /&gt;
 fi&lt;br /&gt;
 &amp;lt;esc&amp;gt;&lt;br /&gt;
 :x&lt;br /&gt;
 # vi /etc/rc.d/rc.local_shutdown&lt;br /&gt;
 a&lt;br /&gt;
 # stop cyrus-imapd&lt;br /&gt;
 if [ -r /var/run/cyrus-master.pid ]; then&lt;br /&gt;
         echo &amp;quot;Stopping cyrus-imapd: kill -INT `cat /var/run/cyrus-master.pid`&amp;quot;&lt;br /&gt;
         kill -INT `cat /var/run/cyrus-master.pid`&lt;br /&gt;
 fi&lt;br /&gt;
 &amp;lt;esc&amp;gt;&lt;br /&gt;
 :x&lt;br /&gt;
 # /usr/local/bin/master &amp;amp;&lt;br /&gt;
&lt;br /&gt;
To test, telnet to local host:&lt;br /&gt;
&lt;br /&gt;
 # telnet localhost imap&lt;br /&gt;
 Trying 127.0.0.1...&lt;br /&gt;
 Connected to localhost.&lt;br /&gt;
 Escape character is '^]'.&lt;br /&gt;
 * OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS AUTH=DIGEST-MD5 AUTH=PLAIN AUTH=LOGIN AUTH=CRAM-MD5 SASL-IR] inner Cyrus IMAP4 v2.4.16 server ready&lt;br /&gt;
 . login postmaster postmasterPassword&lt;br /&gt;
 . OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID LOGINDISABLED ACL RIGHTS=kxte QUOTA MAILBOX-REFERRALS NAMESPACE UIDPLUS NO_ATOMIC_RENAME UNSELECT CHILDREN MULTIAPPEND BINARY SORT SORT=MODSEQ THREAD=ORDEREDSUBJECT THREAD=REFERENCES ANNOTATEMORE CATENATE CONDSTORE IDLE LISTEXT LIST-SUBSCRIBED URLAUTH] User logged in&lt;br /&gt;
 . logout&lt;br /&gt;
 * BYE LOGOUT received&lt;br /&gt;
 . OK Completed&lt;br /&gt;
 Connection closed by foreign host.&lt;br /&gt;
&lt;br /&gt;
== Administering cyrus-imap ==&lt;br /&gt;
&lt;br /&gt;
Cyradm is a client for performing system administration on the Cyrus server. Currently cyradm is not available for use with '''imaps''' so it is necessary to keep '''imap''' configured in '''/etc/cyrus.conf''' to use it. If imap is not otherwise used, it is possible to limit imap listening to “127.0.0.1:imap” and to block the imap port at the firewall level. Cyradm can be launched and used as described below.&lt;br /&gt;
&lt;br /&gt;
 # cd /usr/local/cyrus-imapd-x.y.z&lt;br /&gt;
 # cd lib&lt;br /&gt;
 # make&lt;br /&gt;
 # cd ../perl/imap&lt;br /&gt;
 # perl Makefile.PL&lt;br /&gt;
 # make&lt;br /&gt;
 # make install&lt;br /&gt;
 # cyradm --user postmaster --auth plain localhost&lt;br /&gt;
 Password:&lt;br /&gt;
 Localhost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get the list of available commands type '''help'''. To get help on some particular command type '''help command'''. To list existing mailboxes, type '''lm'''. To create a mailbox type '''cm mailbox'''. To list mailbox rights, type '''lam mailbox'''. To delete a mailbox type '''dm mailbox'''. To set quotas on a mailbox type '''sq mailbox number''' (Kbytes).&lt;br /&gt;
&lt;br /&gt;
User mailboxes names are on the form '''user.name''' and can specify dot-separated subfolders. The mailboxes not prefixed with the user keyword are shared and accessible by all users. Access to mailboxes is controlled by access control lists. At creation time the user gets all the rights on their mailboxes but the admin does not. So before deleting a mailbox, administration rights must be granted to the cyrus admin. The other access rights are :&lt;br /&gt;
&lt;br /&gt;
 l   Lookup (visible to LIST/LSUB/UNSEEN)&lt;br /&gt;
 r   Read (SELECT, CHECK, FETCH, PARTIAL, SEARCH, COPY source)&lt;br /&gt;
 s   Seen (STORE \SEEN)&lt;br /&gt;
 w   Write flags other than \SEEN and \DELETED&lt;br /&gt;
 i   Insert (APPEND, COPY destination)&lt;br /&gt;
 p   Post (send mail to mailbox)&lt;br /&gt;
 c   Create and Delete mailbox (CREATE new sub-mailboxes, RENAME or DELETE mailbox)&lt;br /&gt;
 d   Delete (STORE \DELETED, EXPUNGE)&lt;br /&gt;
 a   Administer (SETACL)&lt;br /&gt;
&lt;br /&gt;
Here is how you create a mailbox and subfolders and quota, create and delete a mailbox. &amp;lt;u&amp;gt;Note&amp;lt;/u&amp;gt; : the access rights need to be changed before you actually delete a mailbox as postmater.&lt;br /&gt;
&lt;br /&gt;
 # cyradm --user postmaster --auth plain localhost&lt;br /&gt;
 Password:&lt;br /&gt;
 Localhost&amp;gt; cm user.myUser&lt;br /&gt;
 Localhost&amp;gt; cm user.myUser.Drafts&lt;br /&gt;
 Localhost&amp;gt; cm user.myUser.Junk&lt;br /&gt;
 Localhost&amp;gt; cm user.myUser.Sent&lt;br /&gt;
 Localhost&amp;gt; cm user.myUser.Trash&lt;br /&gt;
 Localhost&amp;gt; sq user.myUser 307200&lt;br /&gt;
 Localhost&amp;gt; cm user.myErrorUser&lt;br /&gt;
 Localhost&amp;gt; sam user.myErrorUser postmaster c&lt;br /&gt;
 Localhost&amp;gt; dm user.myErrorUser&lt;br /&gt;
 Localhost&amp;gt; quit&lt;br /&gt;
&lt;br /&gt;
== Sendmail interlock ==&lt;br /&gt;
&lt;br /&gt;
Generate a sendmail configuration file which delivers local mail to the IMAP server. Generate sendmail.cf, copy sendmail.mc and sendmail.cf to '''/etc/mail'''.&lt;br /&gt;
&lt;br /&gt;
 # cd /usr/local/sendmail*/cf/cf&lt;br /&gt;
 # vi sendmail.mc&lt;br /&gt;
 a&lt;br /&gt;
 define(`confLOCAL_MAILER', `cyrusv2')dnl&lt;br /&gt;
 MAILER(`cyrusv2')dnl&lt;br /&gt;
 # m4 ../m4/cf.m4 sendmail.mc &amp;gt; sendmail.cf&lt;br /&gt;
 # cp sendmail.mc /etc/mail&lt;br /&gt;
 # cp sendmail.cf /etc/mail&lt;br /&gt;
 # /etc/rc.d/rc.sendmail restart&lt;br /&gt;
&lt;br /&gt;
Last open the required ports in file '''/etc/rc.d/rc.firewall''' then restart the firewall service :&lt;br /&gt;
&lt;br /&gt;
 iptables -A INPUT -p tcp -j ACCEPT --dport 143 -m state --state NEW -s 192.168.0.0/24&lt;br /&gt;
 # /etc/rc.d/rc.firewall restart&lt;br /&gt;
&lt;br /&gt;
You should now be able to configure pop and imap mail accounts in a mail client to test the service. To solve issues, check the firewall logs and '''/var/log/maillog'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{pFoot|[[Sendmail]]|[[Main Page]]|[[SpamAssassin]]}}&lt;/div&gt;</summary>
		<author><name>Wikislax</name></author>	</entry>

	</feed>