Configuration with cyrus

Environment

This has been tested with cyrus 2.2 on linux debian, openldap directory. It is supposed that you already have a ldap directory running (and jsmtpd plugged in). Refer to manual to do so. You must also have special mail schema loaded.

(replace 22 with 21 in packages names for debian stable below )

Install Cyrus

apt-get install cyrus22-admin cyrus22-common cyrus22-imapd libsasl2 sasl2-bin

Edit /etc/default/saslauthd, mine looks like :

START=yes
MECHANISMS="ldap"
CONFIG_FILE="/etc/saslauthd.conf"

Create the file /etc/saslauthd.conf :

ldap_servers: ldap://127.0.0.1
ldap_bind_dn: cn=admin,dc=jsmtpd,dc=org
ldap_password: secret_password
ldap_search_base: ou=people,dc=jsmtpd,dc=org

bind_dn is the dn of ldap DSA admin account (ACL=read everything).

Change the file /etc/init.d/saslauth

#old
#PARAMS="${PARAMS} -a ${MECHANISMS}"

PARAMS="${PARAMS} -a ${MECHANISMS} -O ${CONFIG_FILE}"

Now you should have your sasl working :

testsaslauth -u a_ldap_user_name -p ldap_password_of_the_user
0: OK "Succes."

Read man pages for troubleshoting.

Now, edit /etc/imapd.conf, be sure to have :

allowplaintext: yes
sasl_pwcheck_method: saslauthd

Now, edit /etc/cyrus.conf. Change the lmtp related line to something like :

lmtp		cmd="lmtpd -a" listen="127.0.0.1:lmtp" prefork=0 maxchild=20

Be sure to have the lmtp service defined in /etc/services. It seems to be 24 by default. Start the daemons (saslauthd and cyrus). the "-a" option to lmtpd disables authentication. Be sure to protect env.

Jsmtpd Configuration

During the last step, we defined a lmtp port. Cyrus will start a small daemon listening to mail feed. We will use a SMTPRelay like configuration for local delivery. Edit your etc/jsmtpd-plugin-config.xml to something like :

        <LocalDeliveryService name="LMTP" class="org.jsmtpd.plugins.deliveryServices.SMTPRelay">
		<propertyset name="relay" value="127.0.0.1"/>
		<propertyset name="smtpPort" value="24"/>
		<propertyset name="lmtp" value="true"/>
	</LocalDeliveryService>

LMTP is a lightweight protocol for local mail transfer. It looks like SMTP simplified, so with minor modifications it can use the existing smtp delivery code.