Installation notes for the Mailbox-plugin and c-client-library
==============================================================

This file contains some information about installing the Mailbox-plugin
for VDR and the c-client-library.

Unfortunately there are significant differences on how the various Linux-
distributors build their packages and the author is not able to test all
these distributions himself.

If you are using a distribution which isn't mentioned in this release, use
a newer version of a mentioned distribution or if you find some errors or
inaccuracies in the following description please send an e-mail to the author
containing the following information:

- Linux distribution and version number
- c-client package name and version (or compiled from source)
- used settings for IMAPINCDIR and IMAPLFLAGS

Most of the following distribution dependent notes are outdated. Therefore
the author needs your feedback to provide up-to-date information.

Thank you for your support!

Contents:
=========

1.  General notes

2.  Distribution notes
2.1   Gentoo
2.2   Debian
2.3   RedHat
2.4   SuSE
2.5   Compile the c-client-library from source

3.  Installation of the plugin

4.  Troubleshooting
4.1   Compilation
4.1.1   "linkage.c" not found
4.2   Execution
4.2.1   unresolved externals when starting VDR with the plugin

1. General notes
================

The Mailbox-plugin relies on c-client-library to access the mail accounts
on the server.

Version 2004 of the c-client library is required. The plugin was developed
with version 2004a of the library (contained in imap-2004a.tar.Z). The
current version 2004g may work too, but was not tested by the author.

To install the necessary header- and library-files you could use (in most
cases) the packages of your distribution. If this is not possible you will
have to compile c-client yourself.

Note: The plugin needs the c-client-library and headers; there is no need
to install the UW IMAP server on your VDR PC.

The Makefile of the Mailbox-plugin expects two variables pointing to the
place where the c-client-files are located and the linker flags needed
for the c-client library.

These two variables are:

  IMAPINCDIR
  IMAPLFLAGS

You could set these variables in the Makefile of the plugin or in the
Make.config in the root directory of VDR. If you set the variables in
Make.config you do not have to modify the plugin Makefile each time
you install a new version of the plugin.

2. Distribution notes
=====================
2.1 Gentoo
----------

Simply emerge c-client to install the package 'net-libs/c-client' and set
the variables to the following values:

  IMAPINCDIR = /usr/include/imap
  IMAPLFLAGS = -lc-client -lssl -lpam

2.2 Debian
----------

Note: this information is outdated; please send an update to the the author.

The Debian packages for c-client are:

  'libc-client2001' and 'libc-client2001-dev'

In this case the two variables should have the following values:

  IMAPINCDIR = /usr/include/c-client
  IMAPLFLAGS = -lc-client

Alternative: It is possible to install the packages

  'libc-client-ssl2001' and 'libc-client-ssl2001-dev'

In this case the two variables should have the following values:

  IMAPINCDIR = /usr/include/c-client
  IMAPLFLAGS = -lc-client -lssl

Some users reported to use the following packages with Debian testing:

  'libc-client2002ddebian' and 'libc-client-dev'

2.3 RedHat
----------

Note: this information is outdated; please send an update to the the author.

RedHat 7.3
----------

Install package 'imap-devel' (eg from ftp.redhat.com) and set the variables
to the following values:

IMAPINCDIR = /usr/include/imap
IMAPLFLAGS = -lc-client -lssl -lpam -L/usr/kerberos/lib -lgssapi_krb5

2.4 SuSE
--------

Note: this information is outdated; please send an update to the the author.

SuSE 8.2/9.0
------------

Install the RPMs 'imap-lib' and 'imap-devel' and set the variables  to the
following values:

  IMAPINCDIR = /usr/include/imap
  IMAPLFLAGS = -lc-client -lssl -lpam

SuSE 8.1 and before
-------------------

The file "linkage.c" from the c-client-library is missing in the imap-RPMs
and therefore cannot be used (see 4.1.1).

You will have to compile the c-client-library from the sources (see 2.5).

(One user reported to have successfully installed the src rpm from SuSE 8.2
on a 8.0 installation, rebuilt the RPM's and then installed the packages
'imap-lib-2002-36' and 'imap-devel-2002-36').


2.5 Compile the c-client-library from source
--------------------------------------------

Get the sources from <http://www.washington.edu/imap/> and install the
c-client-library as described in the contained installation instructions.

Set the variables in $VDRDIR/Make.config or in the Makefile of the plugin
to the following values:

  IMAPDIR    = /usr/local/src/imap/c-client
  IMAPINCDIR = $(IMAPDIR)
  IMAPLFLAGS = $(IMAPDIR)/c-client.a -lssl -lpam

Don't forget to adjust the value in IMAPDIR to point to the directory
where you installed the imap sources.

3. Installation of the plugin
=============================

If you set the two variables in the file Make.config in the VDR directory
the plugin can be installed like any other plugin:

$ cd $VDRDIR/PLUGINS/src
$ tar xzf vdr-mailbox-<version>.tgz
$ ln -s mailbox-<version> mailbox

$ cd $VDRDIR
$ make plugins


4.  Troubleshooting
===================
4.1   Compilation
-----------------
4.1.1   "linkage.c" not found
-----------------------------
The compiler complains about a missing file "linkage.c" while compiling the
plugin.

The file "linkage.c" is generated during the build-process of the c-client
library and therefore depends on the configuration during the build-process.

If the binary/development package of your distribution doesn't contain
"linkage.c" you will have to install c-client from sources.

4.2 Execution
-------------
4.2.1 unresolved externals when starting VDR with the plugin
------------------------------------------------------------
If you get an unresolved external error when starting VDR with the plugin
you will have to add some libraries to the IMAPLFLAGS variable.

vdr[..]: loading plugin: /usr/../VDR/PLUGINS/lib/libvdr-mailbox.so.1.4.0
vdr[..]: ERROR: /usr/../VDR/PLUGINS/lib/libvdr-mailbox.so.1.4.0: undefined symbol: <symbolname>

If <symbolname> is
- 'crypt' -> add '-lcrypt' to IMAPLDFLAGS
