	       Notes on using Alpine on the Nokia N800

Acknowlegement: Thanks to Denis DeLaRoca for doing the initial work in
porting to the N800 and for helping me get set up with a development
environment.  Most of these notes come from him.


Step 1:

The following packages must be installed first.
     osso-xterm		       (currently version 0.13.mh24bora1)
     ncurses-base	       (currently version 5.5-1mh2)

Alpine runs in an xterm window, and needs ncurses to provide the
requisite termcap entries needed when launching Alpine from within
Osso-Xterm.


Step 2:

Make sure that whatever directory you will install Alpine to is in the
default path.  The instructions below assume that you will install to
~/bin (which in most cases will be /home/user/bin).  The following
~/.profile file will set up the path:

-------------------------------Cut-Here-------------------------------
# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f ~/.bashrc ]; then
    . ~/.bashrc
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d ~/bin ] ; then
    PATH=~/bin:"${PATH}"
fi

# hack so that Alpine can do execv() ok
if [ -z "$SHELL" ] ; then
   SHELL=/bin/sh
   export SHELL
fi
-------------------------------Cut-Here-------------------------------


Step 3:

Copy the bin directory in this distribution to ~/bin on your N800.  The
files in the extras directory are included for completeness, but are not
necessary for running Alpine.

The difference between the alpine and alpine-with-pwdfile-support
binaries is that the latter implements saving of passwords on your
system.  This is a security risk and is normally disabled in UNIX
Alpine, but may be convenient on the N800.


Step 4:

You are now ready to configure Alpine.

Under IT OS the default user account is "user".  This can't be
changed.  Both Pine and Alpine will try to use this as the default
user account for login into the mail server.  You either fill in the
desired userid prompt at login time or you hardcode it in the
definition of your email server, e.g.,

     Inbox Path = {mail.example.com/tls/user=userid}INBOX

Again, because the default userid is "user", Pine and Alpine both
generate outgoing email with FROM: headers using this userid.  To
overcome this, use the Customized Headers option to customize your
From: header as necessary, e.g.,

     Customized Headers = From: Joe Citizen <userid@example.com>

Also make sure to set the Alternate Addresses option with this
address.  This affects the Index Display of folders containing
outgoing mail messages.

An alternative (and more advance) way to do this is by the use of Roles.

To set up the outgoing mail connection use the SMTP Server
configuration option.  The example below configures a secure SMTP
server.  The novalidate-cert option (hack) is to get around cert
validation problems.

     SMTP Server (for sending) = smtp.example.com/submit/tls/novalidate-cert/user=userid

To configure Nokia's Osso-Browser as the default browser, define:

     URL-Viewers = /home/user/bin/call-browser

For Alpine to be able to successfully execv() this script, SHELL must
be set to the current shell -- see sample .profile script above. Note
that if a URL is explicitly written in a email message then it
suffices to Tap and Hold on the URL to invoke Osso-Xterm's menu and
from there click on Open URL.

You can configure an Image Viewer, but not Nokia's Image-Viewer
as it can't be launched with a parameter.  Mirage will work:

   Image Viewer = /usr/bin/mirage

but its use is limited as Alpine and the image viewer end up fighting
for the temporary file created in /var/tmp.

Alpine can be driven very nicely by point and click by setting the
"Enable Mouse in Xterm" configuration option.  However, doing so
disables text copy since the stylus clicks are captured by Alpine.
Disabling the option restores text copy but then one must rely
entirely on the virtual keyboard and Osso-Xterm's terminal controls.
To alleviate this situation, use the command "^\" (Ctrl-\) to toggle
mouse control on|off to enable use of text copy.  In osso-xterm, a
shortcut key such as "<ctrl>backslash" could be defined to help with
this.


Step 5:

In order to get SSL/TLS certificate matching to work, you need to
have CA certificates installed.  The N800's libcrypto looks for them
on /usr/lib/ssl/certs but that directory does not exist.  The certs.tar
file contains a certs/ directory with common CA certificates.  So, as
root, create /usr/lib/ssl then unpack the certs.tar into that directory.
