Courier: Difference between revisions

From miki
Jump to navigation Jump to search
(Redirecting to IMAP)
 
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''[http://www.courier-mta.org/imap/ Courier IMAP]''' is a fast, scalable, enterprise IMAP server that uses Maildirs.
#REDIRECT [[IMAP]]

== References ==
* [http://www.courier-mta.org/imap/ Courier IMAP homepage]
** [http://www.courier-mta.org/maildir.html maildir - E-mail directory]
** [http://www.courier-mta.org/FAQ.html Courier FAQ]
* On ''openSUSE'':
** Package doc at <tt>/usr/share/doc/packages/courier-authlib</tt> and <tt>/usr/share/doc/packages/courier-imap</tt>.
* On ''Ubuntu'':
** https://help.ubuntu.com/community/Courier
* Manpages & package documentation:
** [http://www.courier-mta.org/maildirmake.html maildirmake(1)]
** couriertcpd(1)
** imapd(8)
** userdb(8)
** makeuserdb(8)
** <tt>/usr/share/doc/courier-doc</tt> (on Ubuntu, with package '''courier-doc''' installed)

== Install ==
=== Ubuntu ===

To install Courier IMAP:
* Install the required packages:
<source lang="bash">sudo apt-get install courier-imap courier-doc courier-imap-ssl</source>
* Create '''/etc/courier/userdb.dat'''
<source lang="bash">
sudo su
pw2userdb >/etc/courier/userdb
chmod 600 /etc/courier/userdb
makeuserdb
</source>
* Make sure all users have directory {{file|~/Maildir}}:
<source lang="bash">
maildirmake /etc/skel/Maildir # Create Maildir directory for all new users
</source>
:repeat for all existing user (eg. ''root''):
<source lang="bash">
maildirmake /root/Maildir
</source>

To use the password from '''<tt>/etc/courier/userdb</tt>''' (and not from '''PAM''') (as root):
* Edit the file <tt>/etc/courier/authdaemonrc</tt>, and change it as follows:
<source lang="text">authmodulelist="authuserdb"</source>
* Restart the daemon:
<source lang="bash">/etc/init.d/courier-authdaemon restart</source>
* Change the password for user '''$USER''' and commit the changes
<source lang="bash">
/usr/sbin/userdbpw -md5 | sudo userdb $USER set systempw
sudo makeuserdb
</source>
* Test the new password with
<source lang="bash">
nc imapserver 143
01 LOGIN username password
02 LOGOUT
</source>

;Add a new user
* Let's create a new Linux user:
<source lang="bash">
sudo adduser foo
</source>
* Now, we add it to userdb and set the password:
<source lang="bash">
sudo su -
pw2userdb | grep -w foo >> /etc/courier/userdb
/usr/sbin/userdbpw -md5 | userdb foo set systempw
makeuserdb
</source>

=== Debian ===

Install (no ssl package):
<source lang=bash>
sudo apt-get install courier-imap courier-doc
</source>

To fix FAM/Gamin issues:
<source lang="bash">
sudo apt install gamin
</source>

== Troubleshooting ==

=== Fix FAM/Gamin library issue ===
On Debian, we get the following error message when connecting to the server.
Filesystem notification initialization error — contact your mail administrator (check for configuration errors with the FAM/Gamin library)

The error seems due to the FAM library not working correctly on Debian [https://www.faqforge.com/linux/fix-for-courier-imap-error-check-for-configuration-errors-with-the-famgamin-library/], [https://www.ghanei.net/courier-mail-fam-gamin/]. It can be replaced by Gamin:

<source lang="bash">
sudo apt install gamin
</source>

=== OpenSUSE ===
* Uninstall the default IMAP server (''UW IMAP'') packages, or they'll create a conflict
* Install ''Courier IMAP'' package (packages <tt>courier-authlib</tt> and <tt>courier-imap</tt>).

=== Cygwin ===
See the page dedicated to [[Courier Cygwin]].

Latest revision as of 06:53, 15 March 2019

Courier IMAP is a fast, scalable, enterprise IMAP server that uses Maildirs.

References

Install

Ubuntu

To install Courier IMAP:

  • Install the required packages:
sudo apt-get install courier-imap courier-doc courier-imap-ssl
  • Create /etc/courier/userdb.dat
sudo su
pw2userdb >/etc/courier/userdb
chmod 600 /etc/courier/userdb
makeuserdb
  • Make sure all users have directory ~/Maildir:
maildirmake /etc/skel/Maildir            # Create Maildir directory for all new users
repeat for all existing user (eg. root):
maildirmake /root/Maildir

To use the password from /etc/courier/userdb (and not from PAM) (as root):

  • Edit the file /etc/courier/authdaemonrc, and change it as follows:
authmodulelist="authuserdb"
  • Restart the daemon:
/etc/init.d/courier-authdaemon restart
  • Change the password for user $USER and commit the changes
/usr/sbin/userdbpw -md5 | sudo userdb $USER set systempw
sudo makeuserdb
  • Test the new password with
nc imapserver 143
01 LOGIN username password
02 LOGOUT
Add a new user
  • Let's create a new Linux user:
sudo adduser foo
  • Now, we add it to userdb and set the password:
sudo su -
pw2userdb | grep -w foo >> /etc/courier/userdb
/usr/sbin/userdbpw -md5 | userdb foo set systempw
makeuserdb

Debian

Install (no ssl package):

sudo apt-get install courier-imap courier-doc

To fix FAM/Gamin issues:

sudo apt install gamin

Troubleshooting

Fix FAM/Gamin library issue

On Debian, we get the following error message when connecting to the server.

Filesystem notification initialization error — contact your mail administrator (check for configuration errors with the FAM/Gamin library)

The error seems due to the FAM library not working correctly on Debian [1], [2]. It can be replaced by Gamin:

sudo apt install gamin

OpenSUSE

  • Uninstall the default IMAP server (UW IMAP) packages, or they'll create a conflict
  • Install Courier IMAP package (packages courier-authlib and courier-imap).

Cygwin

See the page dedicated to Courier Cygwin.