IMAP Mail Copy
--------------

This ZIP contains two scripts: 

CP2IMAP.CMD
  Copies a single email message file to the directory ..\IMAP (relative
  to the script directory).  This is intended to be run as a filter 
  within PMMail/2.  

IMAPADD.CMD
  Logs onto an IMAP mail server and adds all email messages in the 
  specified directory to the remote inbox.  Intended to be called on
  schedule at regular intervals (e.g. every 15 minutes).

Together, these two scripts form a solution for copying emails from PMMail/2
to a remote IMAP mail account.

To use:
1. Place the two scripts in PMMail/2's Accounts\user_tools directory.
2. Create the subdirectory IMAP under PMMail's Accounts directory.
3. Create a filter in PMMail with action "user hook (background)" that
   runs CP2IMAP.CMD.  
4. Open PMMail's global settings and go to the Secure Transfer tab.
   Create a new channel definition (called 'IMAP' or something similar).
   Set the server name and port to your IMAP server's address and port, 
   and make sure the local port number is 993.  Set the protocol to
   'imap' (probably not necessary), and leave the CA file blank.
   
Now, to copy all incoming emails to an IMAP account, set the filter 
trigger "incoming/post-MC".  This will cause all incoming emails to get 
copied to the ..\IMAP directory.

Also check the "manual" trigger if you want to be able to copy individual
messages to the IMAP account using the right-click menu.

Next, create a scheduled program (independently of PMMail), perhaps using
DTProgram or CRON, running IMAPADD.CMD at a regular interval like 15 or 30 
minutes.  Make sure that IMAPADD.CMD is passed the full path to the 
Accounts\IMAP directory as a parameter.

This assumes that your IMAP server supports LOGIN over SSL (most do).

