Sami Salkosuo is the developer, Niklas Heidloff only the committer.
Latest version v4.2.2
Following changes in 4.2.2:
- Added --sincedate option to appointments command.
- Added --required and --optional options to appointments command to list appointment participants.
- Moved appointments-command to Mail.py.
- Some bug fixes.
Introduction
Command Line Email Client for Lotus Notes (CLENotes or NotesCLI) is a command line tool to access Lotus Notes email. Functions include reading mail, sending mail, listing mail and searching mail. Tool is also extensible using Jython.
Requirements
Command Line Email Client for Lotus Notes v4.0.0 has following requirements:
-
Java 6.0 or later installed and PATH must include path to Java-executable.
-
Lotus Notes 8.0.2 installed locally.
-
Lotus Domino 8.x mail server. Command Line Email Client for Lotus Notes v4.0.0 was developed using Lotus Notes 8.0.2, Java 1.6.0_11 and Windows XP.
Program may also work on other platforms where Lotus Notes 8.0.2 is supported (please check clenotes.cmd for Java syntax). Note: In addition to Notes 8.0.2, the program was successfully tested with clean install of Lotus Notes 8.5.
Note 2: Users have used NotesCLI with Notes 8.5 on Linux.
User known by nickname Costantino76 modified start up script for Linux:
CWD=`dirname $0`
JYTHON_HOME="$CWD"
LIB_DIR="$JYTHON_HOME/lib"
NOTES_HOME=/opt/ibm/lotus/notes/
PATH="$PATH:$NOTES_HOME"
export PATH
java -cp "$LIB_DIR" -jar "$LIB_DIR/jython.jar" -Djython.home="$CWD" -Dpython.path="$LIB_DIR:$CWD/ext" -Djava.library.path="$NOTES_HOME" "$LIB_DIR/clenotes/clenotes.py" $*
In addition, Notes directory should be included in PATH and LD_LIBRARY_PATH environment variables.
See also this forum thread.
Installation
-
The first thing to do is to add Lotus 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 Lotus Notes directory is PATH.
-
Unzip CLENotes package to a directory. Please avoid directory names that have spaces. Application has following directory structure:
+config (configuration file)
+ext (extend functionality using External.py in this directory)
+lib (required Java libs)
+log
CHANGES
clenotes.cmd
Jython_LICENSE
LICENSE
NOTICE
README.html
-
Find Notes.jar file in Notes installation directory (typically found in directory c:/notes/jvm/lib/ext). Extract contents of the jar file to lib-directory where you unzipped the program. Jar-file is actually zip-file so you can use any unzip-program to extract the contents.
-
Start program by executing clenotes.cmd.
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. See below for help command:
Command Line Email Client for Lotus Notes v4.0.0
Copyright (C) 2002, 2010 by IBM Corporation.
Licensed under the Apache License v2.0.
Usage: clenotes.cmd [OPTIONS] [CMD [CMD-OPTIONS] [CMD ...] ]
Options (common for one or more commands):
--help This help.
--server-name=ARG Domino server name where database is located.
--exec-time Display elapsed time of the program execution. Does not include Java start-up time.
--replica-id=ARG Select local mail database by specifying replica ID of the local mail database. Use "maildbinfo" command to get replica ID.
--delim=ARG Custom delimiter when formatting mail with --output-format option. Default delimiter is ';'
--tab Use tab as delimiter when using output-format option.
--password=ARG Users Notes ID password
--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". For example: --output-format=dts print email date, time and subject in one line.
--version Version info.
--noheader Do not print header.
--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.
--database-name=ARG Name of the database name to be opened.
Commands:
read Read latest mail or use with today or search commands
Options:
--detach-file=ARG Detach specified attachment to current directory or directory specified with --detach-dir option.
--move-to-folder=ARG Move mail to specified folder.
--delete Delete mail.
--body=ARG Body in reply mail.
--dxl Exports specific mail as DXL.
--no-body Do not print mail body.
--all Reply email to all recipients.
--detach-dir=ARG Specify directory for detached attachments.
--detach-all Detach all attachment to current directory.
--no-confirmation Do not confirm mail delete.
--reply Reply email to sender.
notes-version The release of Domino the session is running on.
send Send mail.
Options:
--bcc=ARG Comma separated list of BCC recipients. For example: --bcc=="recp1@com,recp2@another.com"
--sign Sign mail.
--file-body=ARG Mail body read from specified text file.
--subject=ARG Mail subject.
--file-bcc=ARG Path to text file that includes comma separated list of BCC recipients.
--file-cc=ARG Path to text file that includes comma separated list of CC recipients.
--attach=ARG Command separated list of files to be attached.
--file-to=ARG Path to text file that includes comma separated list of recipients.
--html Send mail as HTML.
--cc=ARG Comma separated list of CC recipients. For example: --cc=="recp1@com,recp2@another.com"
--to=ARG Comma separated list of recipients. For example: --to=="recp1@com,recp2@another.com"
--replyto=ARG Set reply-to parameter to email.
--urgent Send mail as urgent.
--body=ARG Mail body.
--encrypt Encrypt mail.
--signature=ARG Add signature to email.
--nosave Do not save mail.
--file-signature=ARG Add signature to email from specified file.
--principal=ARG Override email sender. Remember to add Notes domain after email, for example: sender@somewhere.com@NotesDomain.
replicate Replicate mail database.
Options:
--server=ARG Specify server for replication.
help This help.
list List all mail in mail database.
Options:
--folder=ARG Specify mail folder to be used. Default is inbox.
--read=ARG Read specific mail (given as index, or '*' for all mails) from result set. See also read-command options.
--end=ARG End index when listing mail.
--start=ARG Start index when listing mail.
appointments Shows future appointments.
Options:
--today List only todays appointments.
--week List appointments in next 7 days.
today Read todays mail.
Options:
--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.
maildbinfo Mail database information.
search Search mail.
Options:
--formula=ARG Search mails using Notes formula.
--fulltext=ARG Search mails using full text.
--read=ARG Read specific mail (given as index, or '*' for all mails) from result set. See also read-command options.
--from=ARG Search mails with sender address.
--list List mail from result set. See also list-command options.
--subject=ARG Search mails with subject.
Sample Commands
Some sample commands to get started:
-
Get help: clenotes.cmd --help.
-
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
-
Get todays mail using local replica and your password: clenotes.cmd --replica-id=E22957FEBC4AA6FA --password=mypassword today.
You get list of todays mail similar to this:
Command Line Email Client for Lotus Notes v3.0.0
Copyright (C) 2002, 2008 by IBM Corporation.
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
-
Replicate your mail database: clenotes.cmd --replica-id=E22957FEBC4AA6FA --password=mypassword replicate.
-
Search mail from specific sender: clenotes.cmd --replica-id=E22957FEBC4AA6FA --password=mypassword search --from=yetanothersender.
This search results something like this:
Command Line Email Client for Lotus Notes v4.0.0
Copyright (C) 2002, 2008 by IBM Corporation.
Licensed under the Apache License v2.0.
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.
-
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.
-
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.
-
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
-
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.
Extensibility
Extensibility is done using Jython language. In the ext-directory there is Jython file External.py. Extensions are added to this file.
Note: Extension file External.py is created (if it does not exist) after the first start up of CLENotes.
All extension functions must be in following format:
def commandNameHere(session,config,opts,args):
#use Output.println() or Output.print() to print to system out. Or just use Python 'print'.
Output.println()
Output.println("Notes version: %s" % session.getNotesVersion())
Output.println("Java version : %s" % System.getProperty('java.version'))
Output.println("OS version : %s, %s, %s" % (System.getProperty('os.name'),System.getProperty('os.version'),System.getProperty('os.arch')) )
#return code of your function. 0=success.
return 0
Function has following parameters:
-
session, instance of NotesSession Java-class.
-
config, Jython configuration object. This holds configuration from file config/clenotes.cfg.
-
opts, command line options.
-
args, command line arguments after the command (command name not included).
Before function is called, user has already been logged in using Notes ID and password.
When function is ready new command is added to config/clenotes.cfg file. New configuration item is added to commands-section and it has following entry:
commandNameHere.cmd: Function description here.|External.functionNameHere
If you want to use your own command line options they are in the args-variable and you can parse it in the function code.