@title;noquote@ @context;noquote@

@title@

These notes augment nsimap documentation at https://bitbucket.org/naviserver/nsimap.

Get imap from https://github.com/jonabbey/panda-imap

Build errors

If there are errors building panda-imap mentioning to use -fPIC. See its use in following OS specific examples.

nsimap.so installed?

nsimap.so may not be automatically added to the NAVISERVER install directory after a build.

Copy it to the NaviServer install directory's bin directory:

cp nsimap.so /usr/local/ns/bin/.

Replace '/usr/local/ns' with the value given in the build for the flag NAVISERVER=

Add nsimap section to NaviServer's config.tcl file

Instead of copy/pasting the nsimap parameters for the config.tcl file from the web instructions, insert this text snip along other module configurations in the config.tcl file: config-nsimap-part.txt

In the ${server}/modules section of the config.tcl file near the comment "These modules aren't used in standard OpenACS installs", have nsimap loaded by adding this line:

ns_param nsimap ${bindir}/nsimap.so

Tcl quoting mailbox value

For parsing to work in 'ns_imap open' avoid wrapping the mailbox value with double quotes. Quote with curly braces only.

This works:

    set mailbox {{localhost}/mail/INBOX}
    

These may not parse as expected:

    set mailbox "{localhost}/mail/INBOX"
    set mailbox "{{localhost}/mail/INBOX}"
  

Notes on installing nsimap on FreeBSD 10.3-STABLE

Build panda-imap with:

gmake bsf EXTRACFLAGS=-fPIC

Then build nsimap with:

gmake NAVISERVER=/usr/local/ns IMAPFLAGS=-I../../panda-imap/c-client/ "IMAPLIBS=../../panda-imap/c-client/c-client.a -L/usr/local/ns/lib -lpam -lgssapi_krb5 -lkrb5"

Note that NaviServer library is referenced in two places in that line, in case your local system locates NaviServer's installation directory elsewhere.

If there are errors during startup related to FD_SETSIZE and nsd crashing, try this to get nsd to not quit unexpectedly during startup:

In the startup script for nsd, add the following before invoking nsd:

    # aolserver4 recommends descriptors limit (FD_SETSIZE) to be set to 1024, 
    # which is standard for most OS distributions
    # For freebsd systems, uncomment following line:
    ulimit -n 1024
  

Note: This does not fix any problem associated with a crash, only makes problem evaporate for low volume traffic sites.

Notes on installing nsimap on Ubuntu 16.04 LTS

Install some development libraries:

apt-get install libssl-dev libpam-unix2 libpam0g-dev libkrb5-dev

Build panda-imap with:

make ldb EXTRACFLAGS=-fPIC

If your system requires ipv4 only, add the flags: IP=4 IP6=4 SSLTYPE=nopwd like this:

make ldb EXTRACFLAGS=-fPIC IP=4 IP6=4 SSLTYPE=nopwd

Some of these are defaults, but the defaults weren't recognized on the test system, so they had to be explicitly invoked in this case.

Then build nsimap with:

make NAVISERVER=/usr/local/ns IMAPFLAGS=-I../../panda-imap/c-client "IMAPLIBS=../../panda-imap/c-client/c-client.a -L/usr/local/ns/lib -lpam -lgssapi_krb5 -lkrb5"

Note that NaviServer library is referenced in two places in that line, in case your local system locates NaviServer's installation directory elsewhere.