CLENotes README

As of 18.12.2015, no longer updated. CLENotes is now in GitHub: https://github.com/OpenNTF/CommandLineEmailClient.

Command Line Email Client for IBM Notes v5.1.3

Copyright (c) 2002, 2015 IBM Corp.

Licensed under the Apache License, Version 2.0.

Introduction

Command Line Email Client for IBM Notes (CLENotes or NotesCLI) is a command line tool to access IBM Notes
email.

Functions include reading mail, sending mail, listing mail and searching mail.

Requirements

Command Line Email Client for IBM Notes v5.1.3 has following requirements:

  • Java 6.0 or later installed and PATH must include path to Java-executable.
  • IBM Notes 8.0.2 or later installed locally.
  • IBM Domino 8.x mail server.

Command Line Email Client for IBM Notes v5.1.3 was developed using IBM Notes 89.0.1, Java 1.7.0_67
and Windows 7.

CLENotes may also work on other platforms where IBM Notes 8.0.2 or later is supported
(please check clenotes.cmd for Java syntax).

Installation

  1. The first thing to do is to add IBM Notes directory to system PATH environment variable.
    Otherwise, executing clenotes.cmd will give error:java.lang.UnsatisfiedLinkError: no nlsxbe in java.library.path

    so make sure that IBM Notes directory included in PATH.

  2. Unzip CLENotes.zip to a directory of your choosing.
  3. Windows: See the help using clenotes.cmd –help and start using the program.
  4. Linux and other platforms: Open clenotes.cmd in a text editor to see the Java syntax and start using the program.
  5. When executing CLENotes for the first time, the program checks Notes Java classes availability.If classes are not present, CLENotes asks to install them and tries to automatically find
    IBM Notes Java classes by searching commonly used Notes installation directories and then extracting
    it’s contents to classes-directory.

    If CLENotes doesn’t find Notes.jar, user is prompted for it’s location.

Source code

CLENotes has been developed with Xtend-language, a dialect of Java that compiles in the Java-code. Development is done using Eclipse IDE.

Source code of the application is in src/xtend-directory and and generated Java-code is in src/java-directory.

Usage

Usage: Usage: clenotes.cmd [OPTIONS] [CMD [CMD-OPTIONS] [CMD …] ]. See sample commands.

Commands include:

  • send, Send mail.
  • today, Read todays mail.
  • replicate, Replicate mail database.
  • search, Search mail.
  • read, Read latest mail or specific mail when listing mail with today.
  • list, List mail in mail database.
  • maildbinfo, Show mail database information.
  • notes-version, Show Notes, Java and OS version.

Use command “clenotes.cmd help” or “clenotes.cmd –help” to list available commands and options:

Command Line Email Client for IBM Notes v5.1.3
Copyright (C) 2002, 2015 by IBM Corporation.
Licensed under the Apache License v2.0.

Usage: clenotes.cmd [global-options] [cmd [cmd-options]]

Global options (common for one or more commands):
  --help=ARG                List options and commands. Optional 
                            argument is command name to get help or 
                            "!" to list command names only.
  --log                     Enabled logging for current session.
  --noheader                Do not print header.
  --version                 Version info.
  --password=ARG            Users Notes ID password
  --replica-id=ARG          Select local database by specifying 
                            replica ID of the local database. Use 
                            "maildbinfo" command to get replica ID of 
                            local mail database.
  --local                   Use local mail database.
  --output-format=ARG       Custom output format string when listing 
                            emails. Formatting options: "d=Date", 
                            "t=time", "Z=timezone", "g=GMT time", 
                            "s=subject", "f=from", "I=from (inet 
                            address)", "m=mailer", "D=message id", 
                            "S=message size", "!=do not print index 
                            number", "a=list attachments". For 
                            example: --output-format=dts print email 
                            date, time and subject in one line.
  --tab                     Use tab as delimiter when using 
                            output-format option.
  --delim=ARG               Custom delimiter when formatting mail with 
                            --output-format option. Default delimiter 
                            is ';'
  --adjust-day=ARG          Adjust cutoff day. Use integer value 
                            (1=mail today and yesterday, 2=mail from 
                            day before yesterday until today, and so 
                            on). No cutoff date means either "no 
                            cutoff date" or "today only" and it 
                            depends on command context.
  --exec-time               Display elapsed time of the program 
                            execution. Does not include Java start-up 
                            time.
  --no-striphtmltags        Do not strip HTML tags when reading HTML 
                            emails.
  --all-mime-texts          Print all MIME text parts when reading 
                            emails. By default prints only the first 
                            mime text part, usually text/plain.
  --server-name=ARG         Domino server name where database is 
                            located.
  --database-name=ARG       Name of the database to be opened.
  --dxl=ARG                 Exports mail as DXL. Optional value is 
                            file name where DXL is exported.
  --dxli=ARG                Import DXL as mail database to be used.

Commands:
  today                     Read todays mail.
    --all                   Print all todays documents, not only 
                            mails.
    --read=ARG              Read specific mail (given as index, or '*' 
                            for all mails) from result set. See also 
                            read-command options.
    --list                  List mail from result set. See also 
                            list-command options.
  search                    Search mail.
    --subject=ARG           Search mails with subject.
    --from=ARG              Search mails with sender address.
    --formula=ARG           Search mails using Notes formula.
    --formula-file=ARG      Search mails using Notes formula in 
                            specified file.
    --fulltext=ARG          Search mails using full text.
    --view=ARG              Search mails from specified View. Only 
                            --fulltext search is available and 
                            --adjust-day is ignored.
    --read=ARG              Read specific mail (given as index, or '*' 
                            for all mails) from result set. See also 
                            read-command options.
    --list                  List mail from result set. See also 
                            list-command options.
  read                      Read latest mail or use with today, list 
                            or search commands
    --linelen               Line length of mail to be read. Works only 
                            for Notes RichText mails.
    --fields                Print all fields and their types in mail 
                            document.
    --fieldvalues=ARG       Print value(s) of given field.
    --no-body               Do not print mail body.
    --detach-file=ARG       Detach specified attachment to current 
                            directory or directory specified with 
                            --detach-dir option.
    --detach-all            Detach all attachment to current 
                            directory.
    --detach-dir=ARG        Specify directory for detached 
                            attachments.
    --replace               Replace attached file, if it already 
                            exists. By default, if file exists, a 
                            sequence number is appended to file name.
    --move-to-folder=ARG    Move mail to specified folder.
    --source-folder=ARG     Source folder of mail to be moved. If not 
                            specified, default is "$Inbox".
    --delete                Delete mail.
    --no-confirmation       Do not confirm mail delete.
    --reply                 Reply email to sender.
    --all                   Reply email to all recipients.
    --body=ARG              Body in reply mail.
  replicate                 Replicate local database to server.
    --server=ARG            Specify server for replication. Default is 
                            mail database server.
    --database=ARG          Specify local database file path for 
                            replication. Default is mail database.
    --replica-id=ARG        Replica ID of database. Default is mail 
                            database replica ID.
  send                      Send mail.
    --to=ARG                Comma separated list of recipients. For 
                            example: 
                            --to=="recp1@com,recp2@another.com"
    --file-to=ARG           Path to text file that includes comma 
                            separated list of recipients.
    --cc=ARG                Comma separated list of CC recipients. For 
                            example: 
                            --cc=="recp1@com,recp2@another.com"
    --file-cc=ARG           Path to text file that includes comma 
                            separated list of CC recipients.
    --bcc=ARG               Comma separated list of BCC recipients. 
                            For example: 
                            --bcc=="recp1@com,recp2@another.com"
    --file-bcc=ARG          Path to text file that includes comma 
                            separated list of BCC recipients.
    --attach=ARG            Comma separated list of files to be 
                            attached.
    --subject=ARG           Mail subject.
    --body=ARG              Mail body.
    --file-body=ARG         Mail body read from specified text file.
    --charset=ARG           Charset of --file-body file. Default is 
                            UTF-8.
    --html                  Send mail as HTML.
    --urgent                Send mail as urgent.
    --encrypt               Encrypt mail.
    --sign                  Sign mail.
    --nosave                Do not save mail.
    --replyto=ARG           Set reply-to parameter to email.
    --principal=ARG         Override email sender. Remember to add 
                            Notes domain after email, for example: 
                            sender@somewhere.com@NotesDomain.
    --signature=ARG         Add signature to email.
    --file-signature=ARG    Add signature to email from specified 
                            file.
  list                      List all mail in mail database.
    --all                   List all documents, not only mails.
    --read=ARG              Read specific mail (given as index, or '*' 
                            for all mails) from result set. See also 
                            read-command options.
    --start=ARG             Start index when listing mail.
    --end=ARG               End index when listing mail.
    --sortorder=ARG         Sort mails. Use value ASC or DESC. Default 
                            is ASC
    --sortfield=ARG         Sort mails by field. Use values DATE, 
                            SUBJECT or FROM. Default is DATE.
    --folder=ARG            Specify mail folder to be used. Default is 
                            inbox ($Inbox).
  maildbinfo                Mail database information. Use 
                            --server-name, --replica-id or 
                            --database-name to specify database other 
                            than mail database.
  notes-version             The release of Domino the session is 
                            running on.
  appointments              Show appointments.
    --today                 List only todays appointments.
    --week                  List appointments in next 7 days.
    --sincedate=ARG         List appointments since specified date. 
                            Date format is "DD/MM/YYYY".
    --desc                  Show appointment description.
    --required              List required participants.
    --optional              List optional participants.
  shell                     Command line email shell, like v1.0 in the 
                            old days.

Sample Commands

Some sample commands to get started:

    1. Get help: clenotes.cmd –help.
    2. Get mail database info including replica ID: clenotes.cmd maildbinfo. Program may ask your Notes ID password.You get something like this:
      Mail database information
      Title         : My Name
      Replica ID    : E22957FEBC4AA6FA
      File path     : maildir\mymail.NSF
      ODS version   : 43
      Server        : SERVER1/ORG
      Size (used %) : 720.75 MB (94.60%)
      Created       : 05.01.2006 13:41:59 GMT
      Modified      : 10.12.2008 08:05:26 GMT
      HTTP URL      :
      Notes URL     : notes://SERVER1@ORG/__E22957FEBC4AA6FA.nsf?OpenDatabase
      
      
    3. Get todays mail using local replica and your password: clenotes.cmd –local –password=mypassword today.You get list of todays mail similar to this:
      
      3 mails since yesterday.
      
      [0] 09.12.2008 02:50:29 ZE2
        From: sender@somewhere.org
        Subject: Re: responding mail
        Attachments:
      
      [1] 09.12.2008 04:36:20 ZE2
        From: another.sender@anywhere.org
        Subject: Question to you?
        Attachments:
      
      [2] 09.12.2008 01:24:42 ZE2
        From: yetanothersender@nowhere.org
        Subject: Fw: This is good stuff
        Attachments: FunnyStuffFromReliableSource.txt.vbs
      
    4. Replicate your mail database: clenotes.cmd –password=mypassword replicate.
    5. Search mail from specific sender: clenotes.cmd –password=mypassword search –from=yetanothersender.This search
      results something like this:

      
      Search returned 2 mails.
      
      [0] 17.11.2008 10:59:27 ZE2
        From: yetanothersender@nowhere.org
        Subject: Re: responding to your question
        Attachments: answerdocument.txt.vbs
      
      [1] 09.12.2008 01:24:42 ZE2
        From: yetanothersender@nowhere.org
        Subject: Fw: This is good stuff
        Attachments: FunnyStuffFromReliableSource.txt.vbs
       

      You can do search also by subject, formula or fulltext.

      Notes formula documentation is found in Notes InfoCenter

      Couple of samples of formulas:

      • –formula=”DeliveredDate > @Date(2013,11,1)”, returns mails received after December 1st, 2013.
      • –formula=”@Contains(From;\”UNIX\”)”, returns mails where sender address includes “UNIX”.
      • –formula=”DeliveredDate > @Date(2013,11,1) & @Contains(From;\”UNIX\”)”, returns mails where sender address includes “UNIX” and mail was received after December 1st, 2013.
    6. Read first mail from today: clenotes.cmd today –read=1. This reads mail with index=1
      in todays list. For example: in previous today-example mail index=1 would be mail from ‘another.sender@anywhere.org’.
      Read-command lists some mail headers and mail body as text.Read-option (and command) has many options. See help.
    7. List mail using command: clenotes.cmd list. This lists all mails in mail database.Use command-options start and end to limit results.

Send mail to specified recipient with attachment using command: clenotes.cmd send –to=recipient@org.org –subject=”Status change: Tracking ID 12345″ –body=”Your order ID 12345. Status changed to: COMPLETE.” –attach=orderReceipt.pdf.

  1. Use output-format option to format output when viewing listing mail: clenotes.cmd –output-format=dtm today.This command lists all mail in the mail database and prints date, time and mail program. Output is something like this:
    0;09.12.2008;02:50:29;Lotus Notes Release 8.0.1 HF105 April 10, 2008
    1;09.12.2008;04:36:20;Lotus Notes Build V85_M1_05262008 May 26, 2008
    2;09.12.2008;01:24:42;Lotus Notes Release 7.0 HF400 February 20, 2008
    

    The default delimiter is ‘;’. Option ‘–delim’ is used to specify custom delimiter.

    For example, clenotes.cmd –output-format=dtm –delim=” | ” today:

    0 | 09.12.2008 | 02:50:29 | Lotus Notes Release 8.0.1 HF105 April 10, 2008
    1 | 09.12.2008 | 04:36:20 | Lotus Notes Build V85_M1_05262008 May 26, 2008
    2 | 09.12.2008 | 01:24:42 | Lotus Notes Release 7.0 HF400 February 20, 2008
    
  2. Specify remote server and mail database using command: clenotes.cmd –server-name=”REMOTESRV/DIV/ORG” –database-name=”mail/otheruser.nsf” today.This command lists todays mail for user otheruser whose mail database is in server REMOTESRV.
  3. Search mails of specific sender and sort them by date in descending order: clenotes.cmd –local search –from=sender –sortorder=DESC.This command searches and lists mails from sender and lists them in descending order where mail number 0 is the latest. .

License

CLENotes is licensed under the Apache License, Version 2.0.

http://www.apache.org/licenses/

Leave a Reply

Your email address will not be published. Required fields are marked *