This is the Cygwin port of Pine, maintained by 
Eduardo Chappa <chappa@math.washington.edu>.

Please, please, please send all questions/suggestions/bug reports 
about this package to the cygwin mailing list at: <cygwin@cygwin.com>.

This document can also be found in the web. There is a link to the most
current version at

http://www.math.washington.edu/~chappa/pine/info/cygwin.html

Please make sure that you read that document to find out corrections or
additions to this document (I normally post the document for the next
release of Pine there).

********************************************************************************

This document contains

 1. Build Instructions.
 2. How to run Pine under Cygwin <-- READ THIS!!!!
 3. Known Bugs
 4. Log of updates.

****************************
**** Build Instructions ****
****************************

In order to build this package all you need to do is to go to the 
directory that contains the source code of Pine and issue the command

./build cyg

Notice that you need to have installed the crypto library, which can be 
obtained from the setup program by clicking on

  libs -> crypto


This is known to compile correctly with the  1.0-1 version of crypto.

If you want to build a secure version of Pine (one that supports SSL), you 
need the openssl library, which can be obtained from the setup package by 
clicking on

  devel -> openssl-devel


This version is known to build with version 0.9.7

  The default configuration of Pine is that it will use the TERMCAP
database to determine the capabilities of your terminal and run on it. If
you want to use TERMINFO, you will have to edit the file pico/os-cyg.h and
make the change in the corresponding line. You will also need to modify
the file pico/osdep/os-cyg.ic and change term.cap by term.inf. This
version builds with termcap as distributed in Cygwin. In order to use this
version of TERMCAP, simply follow

  libs -> termcap

  I've tried to build Pine using the "curses" and "ncurses" library
instead, but using colors gives too much trouble (much more than building
with old termcap!). However, I recommend to use these libraries to build
Pine instead if you are only going to use Pine without colors. If you want
to link with "curses" or "ncurses", you need to edit the files
"pico/makefile.cyg" and "pine/makefile.cyg" and change "-ltermcap" to
either one of "-lcurses" or "-lncurses". I am working on trying to
understand the issues involved here, and have a version of Pine built with
a library that won't give troubles. I am using the library that gives me
the least trouble right now.

  The current version was built wit LDAP support, as outlined in the
README file in the source code of Pine. Please see more complete details
there.

*************************************************************************
****************** How to run Pine under Cygwin *************************
*************************************************************************

  Note that some of the instructions below assume that you have an 
installation like mine. In particular it is assumed that Cygwin is 
installed in the C:\Cygwin directory. If this is not true in your case, 
customized as needed.

 - If you are running the bash shell and you plan to use filters in 
   Pine (display and send filters) or the pipe command, or execute any 
   type of external program (a speller, a web browser, pgp, etc) you must
   configure your shell in either one of the following forms:

   a) You can either export the SHELL variable, which is not exported 
      automatically by bash. This is done by adding the following line

		export SHELL

      to either of your /etc/profile, /etc/profile.d/local.sh, or
      your personal ~/.bash_profile file: 


      Additionally, the following variables are not exported by bash
      and need to be exported if you want to use them in any program:

      HOME, PATH, TERM, HOSTNAME, HOSTTYPE, MACHTYPE, OSTYPE.

      If you decide to do this and decide to put a shortcut in your 
      desktop to open Pine by double-clicking on that shortcut, you must
      modify the contents of the shortcut file as explained below, and 
      change the line

		bash -c /bin/startpine

      to

		bash --login -c /bin/startpine

      The above comment does not apply to you if you are running Pine from 
      a shell.


   b) Another option that you have is that you can execute the following 
      command:

		ln -s /bin/bash.exe /bin/csh.exe

      The reason for doing this is that whenever Pine can not find the
      value of SHELL, it uses csh as its shell. Therefore linking csh to
      your shell is a quick work around.

   The above is a way to correct a problem with the bash shell, this has
   nothing to do with Pine.


 - You can run Pine under the "cygwin" terminal, if you find any problems
   please report them to the cygwin mailing list. Remember that you can
   always run pine under rxvt. If you install rxvt, you may run Pine using
   the command:

		rxvt -fn 11x16 -e pine

   See "man rxvt" for more options.

 - If you feel like being fancy, you can create a shortcut in your desktop 
   so that double clicking on that shortcut will start Pine without going 
   through cygwin. Here are the steps to do so:

   a) Create a file in the /bin directory called "startpine". This file
      should contain the following text (if you want to use rxvt)

      #!/bin/sh
      /bin/rxvt -fn 11x16 -e /bin/pine

   b) Create (using notepad) a file called "pine.bat", in C:\Cygwin. The 
      contents of this file should be the following (customize as needed):

      @echo off
      c:
      chdir \Cygwin\bin
      bash -c /bin/startpine

   c) Create shortcut to pine.bat. Note that you can change the 
      icon by using the right button of the mouse over the icon, and 
      following:

      properties -> change Icon

     and selecting the new icon (possibly using a different dll).

  - If you want to use Netscape or Internet Explorer as your web browser, 
    I would recommend the following procedure (exemplified with Netscape).

     a) Create a script called "startnetscape" in the /bin directory
	which contains the following instruction:

   #!/bin/sh
   /cygdrive/c/Program\ Files/Netscape/Communicator/Programs/netscape.exe $1

     b) Define your url-viewers variable to be:

   url-viewers="/bin/startnetscape _URL_ &"

  - Here's an example of how to use your .mailcap and .mime files and use
    your Windows programs to open attachments. The example is given with a 
    word document.

    a) First make sure that the TMP variable is set to C:\Cygwin\tmp. You 
       can do this, by doing a right click on "My Computer" choose 
       "Properties", then click on the "Advanced" tab. Replace, if 
	necessary the value of TMP to be C:\Cygwin\tmp.

    b) Make sure that your .mime-types file contains the following entry:
	Application/MSWORD	doc

    c) Make sure that your .mailcap file contains the following entry:
	Application/MSWORD; /bin/word -p %s

    d) Enter the full path to your .mime-types and .mailcap files in
	your .pinerc file.

    e) Create a script, called "word" in the /bin directory. Below is an
	example of one script which you can use. Notice that the script 
	does not check for viruses, you may want to add a line to it that 
	does so. Use carefully!!!

#!/bin/sh
if [ "$1" = "-h" ]; then
  echo "Usage: word [-h] [-p] [file]"
  echo ""
  echo " -h	Prints this message"
  echo " -p	Use this option when you call $0 from another program"
  echo "[file]	Name of the file to edit  "
  echo ""
  exit
fi
if [ "$1" = "-p" ]; then
  FILE="C:/Cygwin$2"
else
  if [ "$1" != "" ]; then
     EXIST=`file $1`
  fi
  if [ "$EXIST" != "" ]; then
     FILE="$1"
  fi
fi
/cygdrive/c/Program\ Files/Microsoft\ Office/Office/winword.exe $FILE

  - The file browser of Pine (called Pilot) is a tool that users normally
    use to attach files, it has an easy to navigate screen. You can not
    use this browser to navigate outside of your cygwin directory, in
    particular, you can not attach arbitrary files in your computer,
    except those in the cygwin directory.

    Having said that, there are workarounds. Here there are three:

      * If you know the full windows path, you can write that in the
        attachment field, transformed using the /cygdrive/c/ trick. For
        example to attach C:\WINNT\System32\freecell.exe, you need to
        write /cygdrive/c/winnt/system32/freecell.exe.

      * If you do not know the full path to the file, you could try to use
        the browser to locate it (hey!, I said before you couldn't do
        this!). The trick consists in adding somewhere in the Cygwin
        directory a symbolic link to the C:\ directory (or other directory
        for that matter). The command to do this is:

           ln -s /cygdrive/c  C

        Now whenever you select the C directory in the browser, Pilot
        will open your C:\ directory.

      * Another workaround is to make sure that you enable the following
        feature

             [X] enable-goto-in-file-browser

        now every time that you are in Pilot, press "G" and enter
	/cygdrive/c. This command will take you to the root of your
        hard drive, C:\.

  - This version of Pine was compiled with password file support. What 
    this means is that if you create an empty file in your home directory 
    called "pine.pwd", and you start Pine, Pine will use that file to 
    store your passwords. You can't disable this, but if you feel this
    is insecure, simply don't use it. 

    Also notice that you can start Pine with the option -passfile to
    specify the location of the passfile, so for example the command

          pine -passfile /usr/.pwd

    would use the file "/usr/.pwd" as your passwords file, instead of the
    file "pine.pwd".

*****************************
*******  Known Bugs *********
*****************************

WARNING: Set your default text file type to UNIX (from the setup program,
you can see this when you are choosing the Root Directory, before you even
download anything to your computer).

This version of Pine was compiled so that it would run well when you have
installed Cygwin with default text type set to UNIX. If you ignore this
warning, and set the default type to DOS, bad things will happen. For
starters, Pine will crash. Just to make things worse you will corrupt your
folders and addressbooks.

If you have problems handling attachemts add "disable-busy-alarm" under
feature-list in your .pinerc. If this does not solve your problem, please 
report it to the cygwin mailing list.

There are some problems reported that "pine can't find .pinerc". These 
problems seem to be due to some bug in Cygwin. This problem is normally 
fixed by executing the command "chmod 755 $HOME". I will do some more 
research on this problem to have it fixed.

*****************************
******* Log of updates ******
*****************************

   July 5, 2002.

    - Added LDAP support, as suggested by Jerry Boonstra 
					<Jerry.Boonstra@cnet.com>
    - Added a few patches that fix bugs found by several people:
	- Justification of paragraphs 
	  (by Jeff Franklin of the Pine team, <jpf@cac.washington.edu>)
	- Sort by Score makes pine crash
	  (by Chuck Goodhart <ceg+pine_info@psdg.jpl.nasa.gov>)
	- Adding a filter, may make Pine crash.
	  (by Eduardo Chappa <chappa@math.washington.edu>).
	- Fix a bug in the html filter (One character may disappear from
	  the screen, by Eduardo Chappa <chappa@math.washington.edu>)
	- Add location independence of password file support. Start
	  pine with the option "-passfile /full/path/to/passfile". See
	  "pine -h" for more help. 
	  (By Eduardo Chappa <chappa@math.washington.edu>).


  October 7, 2002

    - Added a patch to fix a problem in justification of paragraphs. Patch
      written by Jeff Franklin of the Pine team, <jpf@cac.washington.edu>)

    - Fixed a few problems that exist while running Pine under the Cygwin
      terminal. These problems where caused by the fact that the "cygwin"
      terminal scrolls when a character is written in the last cell of the
      screen, and this change makes Pine not to do that in this terminal.

  November 13, 2002

    - Fix a denial of service bug, triggered by an incorrect estimate in
      in the size of an array. Reported originally in Bugtraq. Patch by
      Eduardo Chappa <chappa@math.washington.edu>

  January 21, 2003

    - Updated version of Cygwin Pine to 4.53-1.

  Cinco de Mayo 2003

    - Updated version of Cygwin Pine to 4.55-1. It includes a patch
      by Marc Crispin to fix a minor bug in the c-client library.
