Line 5: |
Line 5: |
| How to install and use cyrus-imap on sme7 | | How to install and use cyrus-imap on sme7 |
| | | |
− | Beware !
| + | Beware ! |
| | | |
− | You'll be modifying the SME7 and some actions will required from time to time when updates are reacting with this modification.
| + | You'll be modifying the SME7 and some actions will required from time to time when updates are reacting with this modification. If you are new to SME7 and linux, it might be advisable to try this on a test machine. |
− | If you are new to SME7 and linux, it might be advisable to try this on a test machine.
| |
| | | |
| Cyrus-imap enables folder sharing of mail items. Coupled with the Toltec connector, it can replace many functions of the Exchange Server with mail client Outlook. | | Cyrus-imap enables folder sharing of mail items. Coupled with the Toltec connector, it can replace many functions of the Exchange Server with mail client Outlook. |
Line 16: |
Line 15: |
| The cyrus-imap web site is at http://cyrusimap.web.cmu.edu/ | | The cyrus-imap web site is at http://cyrusimap.web.cmu.edu/ |
| | | |
− | Summary:
| |
| | | |
− | 1. Credits
| + | =Credits |
− | 2. Installation
| |
− | 3. Administration
| |
− | 4. Mail accounts
| |
− | 5. Quotas
| |
− | 6. Shared folders
| |
− | 7. Toltec's Outlook Connector
| |
− | 8. CLI actions
| |
− | | |
− | Last modification 2008-03-17, 2008-05-17
| |
− | Credits | |
| | | |
| The original scripts were developped by Mr. Lionel Debrus for SME6. Then, Jon Roberts from WestCountryBusiness adapted them for SME7. Since, Jon has switched to a different solution and might not be available to provide updates. | | The original scripts were developped by Mr. Lionel Debrus for SME6. Then, Jon Roberts from WestCountryBusiness adapted them for SME7. Since, Jon has switched to a different solution and might not be available to provide updates. |
Line 37: |
Line 25: |
| * Note: these packages don't have rpms. Only install/uninstall scripts. | | * Note: these packages don't have rpms. Only install/uninstall scripts. |
| | | |
− | INSTALLATION | + | =INSTALLATION |
| | | |
| Some services (imap, imaps, pop, pops) are disabled and replaced. After the installation of needed RPMS, templates are created and expanded, and newly replaced services are enabled. Finally, a panel is added to the server-manager menu. | | Some services (imap, imaps, pop, pops) are disabled and replaced. After the installation of needed RPMS, templates are created and expanded, and newly replaced services are enabled. Finally, a panel is added to the server-manager menu. |
Line 43: |
Line 31: |
| Note that POP and IMAP are rendered inaccessible from the Internet with these changes. It better to leave that so since vulnerabilities with this cyrus-imap implementation are not managed and investigated by the dev-team. | | Note that POP and IMAP are rendered inaccessible from the Internet with these changes. It better to leave that so since vulnerabilities with this cyrus-imap implementation are not managed and investigated by the dev-team. |
| | | |
− | Beware!
| |
− |
| |
− | The script uses password "%imapmail%" that needs to be set to something else!
| |
− |
| |
− | Files:
| |
− |
| |
− | * ./create-accounts
| |
− | * /etc/e-smith/templates-custom/etc/hosts.deny/00startup
| |
− | * /etc/e-smith/templates-custom/etc/cyrus.conf/cyrus
| |
− | * /etc/e-smith/templates-custom/etc/cyrus.conf/template-begin
| |
− | * /etc/e-smith/templates-custom/etc/cyrus.conf/template-end
| |
− | * /etc/e-smith/templates-custom/etc/imapd.conf/imapd
| |
− | * /etc/e-smith/templates-custom/etc/imapd.conf/template-begin
| |
− | * /etc/e-smith/templates-custom/etc/imapd.conf/template-end
| |
− | * /usr/lib/perl5/site_perl/5.8.5/Net/Telnet.pm
| |
− | * /etc/e-smith/events/actions/user-create-cyrus
| |
− | * /etc/e-smith/events/actions/user-delete-cyrus
| |
− | * /etc/e-smith/templates-user-custom/.qmail/90local
| |
− | * /etc/e-smith/templates-custom/etc/services/30cyrus-imap
| |
− | * /etc/e-smith/web/functions/sherwood/sherwood70
| |
− |
| |
− | Script for installation:
| |
− |
| |
− | #!/bin/sh
| |
− |
| |
− | #
| |
− | # =========================================================================
| |
− | # Prepare files to use a different password
| |
− | cyrus_password=<password_required>
| |
− | # =========================================================================
| |
− | mv -f sherwood70 sherwood70.old
| |
− | mv -f user-create-unix user-create-unix.old
| |
− | mv -f user-delete-unix user-delete-unix.old
| |
− | mv -f user-create-cyrus user-create-cyrus.old
| |
− | mv -f user-delete-cyrus user-delete-cyrus.old
| |
− | mv -f create-accounts create-accounts.old
| |
− |
| |
− | sed "s/%imapmail%/$cyrus_password/" create-accounts.old > create-accounts
| |
− | sed "s/%imapmail%/$cyrus_password/" sherwood70.old > sherwood70
| |
− | sed "s/%imapmail%/$cyrus_password/" user-create-unix.old > user-create-unix
| |
− | sed "s/%imapmail%/$cyrus_password/" user-create-cyrus.old > user-create-cyrus
| |
− | sed "s/%imapmail%/$cyrus_password/" user-delete-cyrus.old > user-delete-cyrus
| |
− | sed "s/%imapmail%/$cyrus_password/" sherwood70.old > sherwood70
| |
− |
| |
− | =========================================================================
| |
− | # PHASE # 1
| |
− | # =========================================================================
| |
− |
| |
− | # Save current files
| |
− | cp /etc/e-smith/events/actions/user-create-unix uninstall/user-create-unix-b4cyrus
| |
− | cp /etc/e-smith/events/actions/user-delete-unix uninstall/user-delete-unix-b4cyrus
| |
− |
| |
− | #Stopping existing services (if running):
| |
− |
| |
− | /etc/rc.d/init.d/saslauthd stop
| |
− | /etc/rc.d/init.d/xinetd stop
| |
− | service imap stop
| |
− | service imaps stop
| |
− |
| |
− | #Disabling existing IMAP & POP services:
| |
− |
| |
− | /sbin/e-smith/config setprop imap status disabled
| |
− | /sbin/e-smith/config setprop imaps status disabled
| |
− | /sbin/e-smith/config setprop pop3 status disabled
| |
− | /sbin/e-smith/config setprop pop3s status disabled
| |
− |
| |
− | #Activating new services :
| |
− |
| |
− | /sbin/e-smith/config set saslauthd service InitscriptOrder 70 access private status enabled
| |
− | /sbin/e-smith/config set cyrus-imapd service InitscriptOrder 71 access private status enabled
| |
− |
| |
− | # Initialisation des fichiers de configuration grace aux patrons
| |
− | # Donne Acces au service cyrus imap qui ne demarre pas avec Xinetd
| |
− |
| |
− | #Installing custom-templates:
| |
− |
| |
− | mkdir -p /etc/e-smith/templates-custom/etc/hosts.deny/
| |
− | cp ./00startup /etc/e-smith/templates-custom/etc/hosts.deny/
| |
− |
| |
− | # =========================================================================
| |
− | # PHASE # 2
| |
− | # =========================================================================
| |
− |
| |
− | #Installation des RPMs
| |
− |
| |
− | yum -y install \
| |
− | cyrus-imapd \
| |
− | cyrus-imapd \
| |
− | cyrus-imapd-devel \
| |
− | cyrus-imapd-murder \
| |
− | cyrus-imapd-nntp \
| |
− | cyrus-imapd-utils \
| |
− | cyrus-sasl-devel \
| |
− | cyrus-sasl-gssapi \
| |
− | cyrus-sasl-ntlm \
| |
− | cyrus-sasl-plain \
| |
− | perl-Cyrus \
| |
− | cyrus-sasl \
| |
− | cyrus-sasl-md5
| |
− |
| |
− | # =========================================================================
| |
− | # PHASE # 3
| |
− | # =========================================================================
| |
− |
| |
− | # Configure Custom Templates
| |
− |
| |
− | #Configuration de Cyrus
| |
− |
| |
− | mkdir -p /etc/e-smith/templates-custom/etc/cyrus.conf/
| |
− | cp ./cyrus /etc/e-smith/templates-custom/etc/cyrus.conf/
| |
− | cp ./template-begin /etc/e-smith/templates-custom/etc/cyrus.conf/
| |
− | cp ./template-end /etc/e-smith/templates-custom/etc/cyrus.conf/
| |
− |
| |
− | mkdir -p /etc/e-smith/templates-custom/etc/imapd.conf/
| |
− | cp ./imapd /etc/e-smith/templates-custom/etc/imapd.conf/
| |
− | cp ./template-begin /etc/e-smith/templates-custom/etc/imapd.conf/
| |
− | cp ./template-end /etc/e-smith/templates-custom/etc/imapd.conf/
| |
− |
| |
− | # On ajoute un script Perl pour gerer les connexions Telnet
| |
− | # dont nous avons besoin pour ajouter/supprimer des comptes IMAP
| |
− |
| |
− | mkdir /usr/lib/perl5/site_perl/5.8.5/Net
| |
− | cp ./Telnet.pm /usr/lib/perl5/site_perl/5.8.5/Net/
| |
− | cp ./user-create-cyrus /etc/e-smith/events/actions/
| |
− | cp ./user-delete-cyrus /etc/e-smith/events/actions/
| |
− |
| |
− | chmod 554 /etc/e-smith/events/actions/user-create-cyrus
| |
− | chmod 554 /etc/e-smith/events/actions/user-delete-cyrus
| |
− |
| |
− | ln -s /etc/e-smith/events/actions/user-create-cyrus /etc/e-smith/events/user-create/S95user-create-cyrus
| |
− | ln -s /etc/e-smith/events/actions/user-delete-cyrus /etc/e-smith/events/user-delete/S05user-delete-cyrus
| |
− |
| |
− | # Create symlinks for starting & stopping services
| |
− |
| |
− | #Configuring start up services
| |
− |
| |
− | ln -s /etc/rc.d/init.d/e-smith-service /etc/rc.d/rc7.d/S71cyrus-imapd
| |
− | ln -s /etc/rc.d/init.d/cyrus-imapd /etc/rc.d/rc0.d/K71cyrus-imap
| |
− | ln -s /etc/rc.d/init.d/saslauthd /etc/rc.d/rc7.d/S71saslauthd
| |
− | ln -s /etc/rc.d/init.d/saslauthd /etc/rc.d/rc0.d/K71saslauthd
| |
− |
| |
− | # Configuring Qmail
| |
− | # The original script changes permissions like this:
| |
− | # chmod 4755 /var/qmail/bin/preline
| |
− | # chmod 4755 /var/qmail/bin/sendmail
| |
− | # ... but the standard permissions are already set to 0755 for files that exist.
| |
− | # ... so why change?
| |
− | chmod o+x /usr/lib/cyrus-imapd/deliver
| |
− | # this sticky bit is used to allow a called process
| |
− | # to inherit/assume the user credentials of the calling process.
| |
− |
| |
− | mkdir /etc/e-smith/templates-user-custom/.qmail/
| |
− | cp ./90local /etc/e-smith/templates-user-custom/.qmail/
| |
− |
| |
− | mkdir -p /etc/e-smith/templates-custom/etc/services
| |
− | cp ./30cyrus-imap /etc/e-smith/templates-custom/etc/services/
| |
− |
| |
− | # On remet a jour les fichiers de configuration a partir des templates.
| |
− |
| |
− | #Expanding Templates
| |
− |
| |
− | /sbin/e-smith/expand-template /etc/hosts.deny
| |
− | /sbin/e-smith/expand-template /etc/xinetd.conf
| |
− | /sbin/e-smith/expand-template /etc/cyrus.conf
| |
− | /sbin/e-smith/expand-template /etc/imapd.conf
| |
− | /sbin/e-smith/expand-template /etc/services
| |
− |
| |
− | #Restarting services
| |
− |
| |
− | /etc/rc.d/init.d/xinetd start
| |
− | /etc/rc.d/init.d/saslauthd start
| |
− | /etc/rc.d/init.d/cyrus-imapd start
| |
− |
| |
− | #Configuring Server Manager
| |
− |
| |
− | cp ./sherwood70 /etc/e-smith/web/functions/sherwood
| |
− | chown root:admin /etc/e-smith/web/functions/sherwood
| |
− | chmod 4750 /etc/e-smith/web/functions/sherwood
| |
− |
| |
− | ln -s /etc/e-smith/web/functions/sherwood /etc/e-smith/web/panels/manager/cgi-bin/sherwood
| |
− |
| |
− | #Setting IMAP administration password
| |
− | # The cyrus user was created by rpm (?)
| |
− | # Change password for cyrus using the variable set at the beginning
| |
− | echo $cyrus_password | `passwd cyrus --stdin >/dev/null 2>&1`
| |
− |
| |
− | # create cyrus-imap individual account based on user names
| |
− |
| |
− | chmod 750 create-accounts
| |
− | ./create-accounts
| |
− | /sbin/e-smith/db /home/e-smith/db/navigation/navigation.en set sherwood panel Description "cyrus-IMAP" DescriptionWeight 6750 Heading Configuration HeadingWeight 6000
| |
− | #/sbin/e-smith/db /home/e-smith/db/navigation/navigation.fr set sherwood panel Description "Gestion Des comptes Imap" DescriptionWeight 8555 Heading Sherwood HeadingWeight 8000
| |
− | #/sbin/e-smith/db /home/e-smith/db/navigation/navigation.fr-ca set sherwood panel Description "Gestion Des comptes Imap" DescriptionWeight 8555 Heading Sherwood HeadingWeight 8000
| |
− |
| |
− | # Apply changes
| |
− |
| |
− | signal-event email-update</nowiki>
| |
− |
| |
− | ----
| |
− | '''Uninstallation'''
| |
| <nowiki> | | <nowiki> |
− | Uninstall with the script 'uninstall/uninstall'
| |
− | The script must be a sub-folder named "uninstall"
| |
| | | |
− | #!/bin/sh
| |
− |
| |
− | # Uninstall script
| |
− | #Uninstall RPMs
| |
− | rpm -e cyrus-imapd-murder
| |
− | rpm -e cyrus-imapd-devel
| |
− | rpm -e cyrus-imapd-nntp
| |
− | rpm -e cyrus-imapd-utils
| |
− | rpm -e cyrus-imapd
| |
− | rpm -e perl-Cyrus
| |
− | rpm -e cyrus-sasl-plain
| |
− | rpm -e cyrus-sasl-devel
| |
− | rpm -e cyrus-sasl-gssapi
| |
− | rpm -e cyrus-sasl-ntlm
| |
− | rpm -e cyrus-sasl-sql
| |
− |
| |
− | #Remove files
| |
− | rm /etc/rc.d/rc7.d/S71cyrus-imapd
| |
− | rm /etc/rc.d/rc0.d/K71cyrus-imap
| |
− | rm /etc/rc.d/rc7.d/S71saslauthd
| |
− | rm /etc/rc.d/rc0.d/K71saslauthd
| |
− | rm /usr/lib/perl5/site_perl/5.8.5/Net/Telnet.pm
| |
− | rmdir /usr/lib/perl5/site_perl/5.8.5/Net
| |
− | rm -f /etc/e-smith/events/user-create/S95user-create-cyrus
| |
− | rm -f /etc/e-smith/events/user-delete/S05user-delete-cyrus
| |
− | rm -f /etc/e-smith/events/actions/user-create-cyrus
| |
− | rm -f /etc/e-smith/events/actions/user-delete-cyrus
| |
− |
| |
− | # Reconfigure Custom Templates
| |
− | rm -f /etc/e-smith/templates-custom/etc/cyrus.conf/*
| |
− | rmdir /etc/e-smith/templates-custom/etc/cyrus.conf/
| |
− |
| |
− | rm -f /etc/e-smith/templates-custom/etc/imapd.conf/*
| |
− | rmdir /etc/e-smith/templates-custom/etc/imapd.conf/
| |
− |
| |
− | # Rebuild Templates
| |
− | rm -f /etc/e-smith/templates-custom/etc/hosts.deny/00startup
| |
− | rm -f /etc/e-smith/templates-user-custom/.qmail/*
| |
− | rmdir /etc/e-smith/templates-user-custom/.qmail
| |
− | rm -f /etc/e-smith/templates-custom/etc/services/30cyrus-imap
| |
− |
| |
− | # Expand Templates
| |
− | /sbin/e-smith/expand-template /etc/hosts.deny
| |
− | /sbin/e-smith/expand-template /etc/xinetd.conf
| |
− | /sbin/e-smith/expand-template /etc/services
| |
− |
| |
− | # Remove Server-Manger Panel
| |
− | rm /etc/e-smith/web/functions/sherwood
| |
− | rm /etc/e-smith/web/panels/manager/cgi-bin/sherwood
| |
− |
| |
− | /sbin/e-smith/db /home/e-smith/db/navigation/navigation.en delete sherwood
| |
− | /sbin/e-smith/db /home/e-smith/db/navigation/navigation.fr delete sherwood
| |
− | /sbin/e-smith/db /home/e-smith/db/navigation/navigation.fr-ca delete sherwood
| |
− |
| |
− | # Reinstall Original Service settings
| |
− | /sbin/e-smith/config delete saslauthd
| |
− | /sbin/e-smith/config delete cyrus-imapd
| |
− | /sbin/e-smith/config setprop imap status enabled
| |
− | /sbin/e-smith/config setprop imaps status enabled
| |
− | /sbin/e-smith/config setprop pop3 status enabled
| |
− | /sbin/e-smith/config setprop pop3s status enabled
| |
− | /etc/rc.d/init.d/saslauthd stop >/dev/null 2>&1
| |
− | /etc/rc.d/init.d/xinetd restart >/dev/null 2>&1
| |
− |
| |
− | # Note: the script does not remove user "cyrus"
| |
− | # if it was not delete when removing RPMs then delete it:
| |
− | # userdel -r cyrus
| |
− |
| |
− | service imap start
| |
− | signal-event email-update</nowiki>
| |
| | | |
| ---- | | ---- |
− | This script will reset to %imapmail%, all occurences of password:
| |
− |
| |
− | <nowiki>#!/bin/sh
| |
− |
| |
− | cyrus_password=<password_to_be_reset>
| |
− |
| |
− | rm -f *.old
| |
− |
| |
− | mv -f sherwood70 sherwood70.old
| |
− | mv -f user-create-unix user-create-unix.old
| |
− | mv -f user-delete-unix user-delete-unix.old
| |
− | mv -f user-create-cyrus user-create-cyrus.old
| |
− | mv -f user-delete-cyrus user-delete-cyrus.old
| |
− | mv -f create-accounts create-accounts.old
| |
− |
| |
− | sed "s/$cyrus_password/%imapmail%/" create-accounts.old > create-accounts
| |
− | sed "s/$cyrus_password/%imapmail%/" sherwood70.old > sherwood70
| |
− | sed "s/$cyrus_password/%imapmail%/" user-create-unix.old > user-create-unix
| |
− | sed "s/$cyrus_password/%imapmail%/" user-create-cyrus.old > user-create-cyrus
| |
− | sed "s/$cyrus_password/%imapmail%/" user-delete-cyrus.old > user-delete-cyrus
| |
− | sed "s/$cyrus_password/%imapmail%/" sherwood70.old > sherwood70</nowiki>
| |
| | | |
| ---- | | ---- |
Line 432: |
Line 127: |
| | | |
| Reconstruct: /usr/lib/cyrus-imapd/reconstruct -r -f user.username | | Reconstruct: /usr/lib/cyrus-imapd/reconstruct -r -f user.username |
| + | [[Image:Example.jpg]] |