特殊:Badtitle/NS100:Cyrus
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/Cyrus }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/af | • {{#if: UbuntuHelp:Cyrus|Afrikaans| [[::Cyrus/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/ar | • {{#if: UbuntuHelp:Cyrus|العربية| [[::Cyrus/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/az | • {{#if: UbuntuHelp:Cyrus|azərbaycanca| [[::Cyrus/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/bcc | • {{#if: UbuntuHelp:Cyrus|جهلسری بلوچی| [[::Cyrus/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/bg | • {{#if: UbuntuHelp:Cyrus|български| [[::Cyrus/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/br | • {{#if: UbuntuHelp:Cyrus|brezhoneg| [[::Cyrus/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/ca | • {{#if: UbuntuHelp:Cyrus|català| [[::Cyrus/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/cs | • {{#if: UbuntuHelp:Cyrus|čeština| [[::Cyrus/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/de | • {{#if: UbuntuHelp:Cyrus|Deutsch| [[::Cyrus/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/el | • {{#if: UbuntuHelp:Cyrus|Ελληνικά| [[::Cyrus/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/es | • {{#if: UbuntuHelp:Cyrus|español| [[::Cyrus/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/fa | • {{#if: UbuntuHelp:Cyrus|فارسی| [[::Cyrus/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/fi | • {{#if: UbuntuHelp:Cyrus|suomi| [[::Cyrus/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/fr | • {{#if: UbuntuHelp:Cyrus|français| [[::Cyrus/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/gu | • {{#if: UbuntuHelp:Cyrus|ગુજરાતી| [[::Cyrus/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/he | • {{#if: UbuntuHelp:Cyrus|עברית| [[::Cyrus/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/hu | • {{#if: UbuntuHelp:Cyrus|magyar| [[::Cyrus/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/id | • {{#if: UbuntuHelp:Cyrus|Bahasa Indonesia| [[::Cyrus/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/it | • {{#if: UbuntuHelp:Cyrus|italiano| [[::Cyrus/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/ja | • {{#if: UbuntuHelp:Cyrus|日本語| [[::Cyrus/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/ko | • {{#if: UbuntuHelp:Cyrus|한국어| [[::Cyrus/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/ksh | • {{#if: UbuntuHelp:Cyrus|Ripoarisch| [[::Cyrus/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/mr | • {{#if: UbuntuHelp:Cyrus|मराठी| [[::Cyrus/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/ms | • {{#if: UbuntuHelp:Cyrus|Bahasa Melayu| [[::Cyrus/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/nl | • {{#if: UbuntuHelp:Cyrus|Nederlands| [[::Cyrus/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/no | • {{#if: UbuntuHelp:Cyrus|norsk| [[::Cyrus/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/oc | • {{#if: UbuntuHelp:Cyrus|occitan| [[::Cyrus/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/pl | • {{#if: UbuntuHelp:Cyrus|polski| [[::Cyrus/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/pt | • {{#if: UbuntuHelp:Cyrus|português| [[::Cyrus/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/ro | • {{#if: UbuntuHelp:Cyrus|română| [[::Cyrus/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/ru | • {{#if: UbuntuHelp:Cyrus|русский| [[::Cyrus/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/si | • {{#if: UbuntuHelp:Cyrus|සිංහල| [[::Cyrus/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/sq | • {{#if: UbuntuHelp:Cyrus|shqip| [[::Cyrus/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/sr | • {{#if: UbuntuHelp:Cyrus|српски / srpski| [[::Cyrus/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/sv | • {{#if: UbuntuHelp:Cyrus|svenska| [[::Cyrus/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/th | • {{#if: UbuntuHelp:Cyrus|ไทย| [[::Cyrus/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/tr | • {{#if: UbuntuHelp:Cyrus|Türkçe| [[::Cyrus/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/vi | • {{#if: UbuntuHelp:Cyrus|Tiếng Việt| [[::Cyrus/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/yue | • {{#if: UbuntuHelp:Cyrus|粵語| [[::Cyrus/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/zh | • {{#if: UbuntuHelp:Cyrus|中文| [[::Cyrus/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/zh-hans | • {{#if: UbuntuHelp:Cyrus|中文(简体)| [[::Cyrus/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Cyrus | UbuntuHelp:Cyrus | {{#if: | :}}Cyrus}}/zh-hant | • {{#if: UbuntuHelp:Cyrus|中文(繁體)| [[::Cyrus/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:Cyrus|:Cyrus|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :Cyrus/zh | | {{#ifexist: Cyrus/zh | | {{#ifeq: {{#titleparts:Cyrus|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:Cyrus|1|-1|}} | zh | | }}
Introduction
Cyrus is one of the most widely used IMAP/POP servers. Cyrus is apreciated for virtualisation of mailboxes and cool stuff like server side filtering (sieve) or shared folders. It is frequently used in universities. In this howto, a basic installation of Cyrus with authentication on PAM will be explained.
Installation
Cyrus is in the main repository of Ubuntu (and as a consequence benefit from canonical security support). Install the following packages: cyrus21-admin cyrus21-clients cyrus21-imapd sasl2-bin
(see InstallingSoftware).
If you dot not have a MTA yet, this step will install postfix
. Please refer to the UbuntuHelp:Postfix page for details.
Configuration
Cyrus
Cyrus configuration is done in two configurations files: /etc/imapd.conf
and /etc/cyrus.conf
.
First, edit the /etc/cyrus.conf
to activate the protocols you want. Here, imap and imaps will be activated:
8<---------------------------------------- SERVICES { # --- Normal cyrus spool, or Murder backends --- # add or remove based on preferences imap cmd="imapd -U 30" listen="imap" prefork=0 maxchild=100 imaps cmd="imapd -s -U 30" listen="imaps" prefork=0 maxchild=100 #pop3 cmd="pop3d -U 30" listen="pop3" prefork=0 maxchild=50 #pop3s cmd="pop3d -s -U 30" listen="pop3s" prefork=0 maxchild=50 8<----------------------------------------
Then edit /etc/imapd.conf
(do not believe the name, it concerns general Cyrus stuff configuration). Only some parameters will be focused as most of options will match most of the needs.
8<---------------------------------------- unixhierarchysep: no 8<----------------------------------------
By default, unixhierarchysep if set to no
which means that the separator is "." and not "/". You will have to turn in to yes
if you want your mailbox to contains "." for example if you use mail addresses for naming your mailboxes.
8<---------------------------------------- admins: cyrus 8<----------------------------------------
This parameter define an administrator for all the services. It will be require for administration operations like mailbox creation.
8<---------------------------------------- sasl_pwcheck_method: saslauthd 8<----------------------------------------
Indicates the method used for user authentication. saslauthd
can also be used for Postfix authentication, as detailed in UbuntuHelp:Postfix page.
Last, change the /etc/default/saslauthd
:
START=yes MECHANISMS="pam"
Your authentication will be based on PAM. Probabily PAM is correctly setup on your machine.
Just launch saslauthd
daemon:
Mail Transfert Agent
You have to configure your mail transfert agent to deliver your messages in your cyrus mailbox. In this howto, Postfix MTA will be presented. Feel free to add you favorite MTA.
Postfix
With postfix, there are two ways of delivering messages in you mailbox: with a special transport named cyrus, or via lmtp (which is a protocol more or less similar to smtp). Choose the one you prefer. The cyrus
transport is the simplest, lmtp
is the most powerfull (you can communicate with lmtp between machines).
cyrus transport
In your postfix main.cf
configuration file, add the following line:
mailbox_transport = cyrus
On Ubuntu installation, the transport cyrus
is NOT already configured in /etc/postfix/master.cf
. You must add manually at the end of master.cf
the following lines:
cyrus unix - n n - - pipe flags=R user=cyrus argv=/usr/sbin/cyrdeliver -e -m "${extension}" ${user}
lmtp
In your postfix main.cf
configuration file, add the following line:
mailbox_transport = lmtp:unix:/var/run/lmtp
By default, on Ubuntu, the Unix socket lmtp is opened. Make sure the socket matches the socket specified in your /etc/cyrus.conf
and /etc/imapd.conf
.
In your postfix master.cf
configuration file, edit the following line:
lmtp unix - - - - - lmtp
to
lmtp unix - - n - - lmtp
Otherwise, "No such file or directory" errors will be logged in the /var/log/mail.log
as postfix tries to look for the socket in a chrooted environment.
Mailbox creation
First, you have define a "password" for the user admin for the cyrusadm. With root make this:
Password: TYPE YOUR CYRUS PASSWORD HERE Again (for verification): RETYPE YOUR CYRUS PASSWORD
You also have to create the mailboxes for the users. User the cyradm
utility for that:
cyradm --user cyrus localhost IMAP Password: localhost>
You can have the full description of the commands available by typing help
. We will give more details in the section Administration & Maintenance.
Mailbox creation is done like this:
localhost>cm user.toto
Dot not forget the prefix user.
or the mailbox created will be considered as a shared mailbox.
Test
Test that your installation works correctly:
Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. * OK hostname Cyrus IMAP4 v2.1.18-IPv6-Debian-2.1.18-2ubuntu2 server ready imap login user password imap OK User logged in
Where user and password are your login and password on the server. If it does not work check /var/log/mail.log
for evidence.
Administration / Maintenance
Links
Postfix Cyrus Web cyradm HOWTO