Code Monkey home page Code Monkey logo

inotes-exporter's Introduction

iNotes-exporter

This project reads a Lotus Domino iNotes 8.5 webmail and exports the data as POP3(S), mbox and/or maildir.
SEO keywords: IBM Lotus Notes Domino iNotes POP3 mbox maildir export
This is a command-line application. For a web front-end, see iNotes-exporter-web. For exporting local email .nsf files, see NSF-exporter.

Requirements

  • Lotus iNotes (the Lotus Notes webmail) credentials (tested with version 8.5.3)
  • Java 6
  • Maven 3 for compiling

Configuration

Personal credentials and preferences: src/main/resources/iNotes.properties (can be overriden on command-line: -D<key>=<value>)
logging: src/main/resources/simplelogger.properties

If you need to use an HTTP/SOCKS proxy, you can also use the usual Java Networking System properties.

Compiling

(after configuration!)

mvn -Dmaven.test.skip clean assembly:single

Running

In addition to exposing a Notes INBOX as a POP3 server, iNotes exporter supports exporting either 1 mailbox or all Notes server emails, to different formats:

  • single mailbox
    • mbox: traditional UNIX mailbox format; single file contains multiple messages.
      Multiple variants exist:
      • mboxo (deprecated)
      • mboxrd
      • MMDF
    • maildir: one file contains one message
  • multiple mailboxes
    • MH (deprecated)
    • EML
    • maildir++

List available iNotes folders

java [-Dinotes.server=...] [-Dnotes.user=...] [-Dnotes.password=...] -jar target/iNotes-exporter-1.8-jar-with-dependencies.jar listfolders

Display iNotes quota

java [-Dinotes.server=...] [-Dnotes.user=...] [-Dnotes.password=...] -jar target/iNotes-exporter-1.8-jar-with-dependencies.jar quota

Single mailbox export (mbox / maildir)

java [-Dinotes.server=...] [-Dnotes.user=...] [-Dnotes.password=...] [-Dnotes.folder.id=($Inbox)] -jar target/iNotes-exporter-1.8-jar-with-dependencies.jar (mboxrd|maildir) <output_file|output_dir> [start date: yyyy-MM-dd'T'HH:mm [end date: yyyy-MM-dd'T'HH:mm [--delete]]]

where

  • <output_file> will be overwritten if no start date is given. Otherwise, the newest email data is appended to it.
  • yyyy-MM-dd'T'HH:mm is the date of the oldest message to export
    • if none provided, and output_file does not exists, exports all messages
    • if none provided, and output_file exists, do an incremental export since last time this tool was run
  • yyyy-MM-dd'T'HH:mm is the date of the newest message to export
  • --delete: delete messages from the Notes server after exporting

examples:

  • java -jar target/iNotes-exporter-1.8-jar-with-dependencies.jar maildir ~/Maildir 2012-01-20T20:00
    • will export all messages after 2012-01-20T20:00 from iNotes server's INBOX to the ~/Maildir maildir
  • java -jar target/iNotes-exporter-1.8-jar-with-dependencies.jar mboxrd ~/archive_2012.gz 2012-01-01T00:00 2013-01-01T00:00 --delete
    • will export all 2012 messages from iNotes server's INBOX to the (compressed) ~/archive_2012.mboxrd.gz mailbox file, deleting messages from the server

If you don't know which mbox format to choose (mboxo, mboxrd, mboxcl, mboxcl2, MMDF, maildir), use mboxrd.

Specifying a .gz extension for a mailbox file name is specifically made for Dovecot which can read compressed mbox archives. Please note that any kind of export to an existing compressed mbox is not allowed, as this would corrupt the mbox file!

The (incremental) last export date is stored in the Java Preferences (~/.java/ for Linux / *BSD, ~/Library/Preferences/fr.cedrik.inotes.plist for Mac OS X, and the Registry for Windows).

If running unattended, please have a process monitor the output for all ERROR's that could occur!

All mailboxes export (maildir++)

java [-Dinotes.server=...] [-Dnotes.user=...] [-Dnotes.password=...] -jar target/iNotes-exporter-1.8-jar-with-dependencies.jar maildirpp <output_dir>

example:

  • java -jar target/iNotes-exporter-1.8-jar-with-dependencies.jar maildirpp ~/Maildir
    • will (incrementally) export all messages to the ~/Maildir maildir++

If you don't know which maildir format to choose (MH, EML, maildir++), use maildir++.

The (incremental) last export date is stored in the Java Preferences (~/.java/ for Linux / *BSD, ~/Library/Preferences/fr.cedrik.inotes.plist for Mac OS X, and the Registry for Windows).

If running unattended, please have a process monitor the output for all ERROR's that could occur!

POP3 / POP3S server

POP3

java [-Dpop3.port=110] [-Dpop3.shutdown=now!] [-Dinotes.server=...] [-Dnotes.folder.id=($Inbox)] -jar target/iNotes-exporter-1.8-jar-with-dependencies.jar pop3server

Use as pop3 user login: username@https://webmail.example.com

This POP3 server has a user and IP lock out mechanism if there are too many failed authentication attempts in a given period of time. It achieves this by recording all failed logins, including those for users that do not exist. To prevent a DOS by deliberating making requests with invalid users (and hence causing this cache to grow) the size of the list of users and IPs that have failed authentication is limited. (Configurable in iNotes.properties)

POP3S

POP3 communication is clear-text. For extra security, you can add an SSL/TLS transport to POP3.
You will need to generate and configure a certificate. For example:

$JAVA_HOME/bin/keytool -genkey -alias pop3s -keyalg RSA -keysize 2048 -validity 3650 -keystore /opt/iNotes-keystore -storepass b92kqmp -keypass changeit -dname "cn=<your_FQN_server_name>, o=cedrik.fr, l=Paris, s=Ile-de-France, c=FR"

which will then be configured in iNotes.properties as:

pop3s.port=995
pop3s.keyStoreName=/opt/iNotes-keystore
pop3s.keyStorePassword=b92kqmp
pop3s.keyStoreType=jks
pop3s.keyPassword=changeit

As an alternative to configuring POP3S, you can also use stunnel.

Note: to disable the POP3 connector and only keep the secure POP3S version, set pop3.port=-1.

Additional (non-standard) POP3 commands

The following POP3 commands are not RFC standard, but can help manage your iNotes account:

  • SHUTDOWN <secret>: to shutdown the POP3 server (set the secret in iNotes.properties)
  • QUOTA: gives information on quota usage
  • FOLDER: list available iNotes folders
  • FOLDER <id>: change current folder
  • LOGGER: get loggers levels
  • LOGGER <logger_id> <level>: set logger level

inotes-exporter's People

Contributors

javabean avatar kalw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

inotes-exporter's Issues

404 error logging in

I'm trying to use iNotes-exporter with iNotes 8.5.3 FP6 but am getting a 404 Not Found error while authenticating. Any suggestions on how to resolve this?

null pointer

Hi there,

i'm a bit confused regarding the execution of all this wonderful bunch of code.

Any help on this one ? =)

When i trigger :

mvn assembly:assembly -DdescriptorId=jar-with-dependencies -DskipTests

i got a :

coincoin:iNotes-exporter despresr$ java -jar target/iNotes-exporter-0.1-SNAPSHOT- ../test
iNotes-exporter-0.1-SNAPSHOT-jar-with-dependencies.jar  iNotes-exporter-0.1-SNAPSHOT-sources.jar                
coincoin:iNotes-exporter despresr$ java -cp target/iNotes-exporter-0.1-SNAPSHOT-jar-with-dependencies.jar fr.cedrik.inotes.mbox.MBoxrd ../test
755 INFO Session - Authentication successful for user "rdespres"
[Fatal Error] :1:43: Premature end of file.
898 ERROR XMLConverter - 
org.xml.sax.SAXParseException: Premature end of file.
    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:249)
    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
    at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124)
    at fr.cedrik.inotes.XMLConverter.convertXML(XMLConverter.java:42)
    at fr.cedrik.inotes.Session.getMessagesMetaData(Session.java:195)
    at fr.cedrik.inotes.mbox.BaseMBox.run(BaseMBox.java:71)
    at fr.cedrik.inotes.mbox.MBoxrd.main(MBoxrd.java:39)
Exception in thread "main" java.lang.NullPointerException
    at fr.cedrik.inotes.Session.getMessagesMetaData(Session.java:199)
    at fr.cedrik.inotes.mbox.BaseMBox.run(BaseMBox.java:71)
    at fr.cedrik.inotes.mbox.MBoxrd.main(MBoxrd.java:39)

Messed up Date =)

Hi there,

regarding the "fecth from date" facility, i'm facing a strange behavior :

1/ i fetch all mails once
2/ i look @ the last mail arrival date
3/ i fetch once more with date args, corresponding to the date in point 2

the result is :

1/ next mail appended to file is actually more or less two hours behind the date in args
2/ mail date is shifted two hours before it's real date of arrival

Regards,

Regis A. Despres

strange java -jar behavior

Hey there,

I'm strugled with this :

[kandor:~/Sites/iNotes-exporter] rdespres% mvn clean && mvn assembly:assembly -DdescriptorId=jar-with-dependencies -DskipTests
[snip]
[kandor:~/Sites/iNotes-exporter] rdespres% java -Xmx3G -jar target/iNotes-exporter-0.1-SNAPSHOT-jar-with-dependencies.jar ./test
Failed to load Main-Class manifest attribute from
target/iNotes-exporter-0.1-SNAPSHOT-jar-with-dependencies.jar

Any way to help on this one ? =)

Regis A. Despres

Session error: Can not find X-IBM-INOTES-NONCE

Hi, I dont know if the project is still active, but I'm having this problem:

 java -jar target/iNotes-exporter-1.8-jar-with-dependencies.jar listfolders
2021-10-13 12:54:20.191-0300 [main] DEBUG Session - POST 302 Found http://XXXXXXXXXXX/names.nsf?Login
2021-10-13 12:54:20.201-0300 [main] DEBUG Session - Initial authentication successful for user "xxxxxxxxxxxx"
2021-10-13 12:54:20.203-0300 [main] DEBUG Session - Redirect: http://XXXXXXXXXXX/XXXXXXXXXX.nsf
2021-10-13 12:54:20.224-0300 [main] DEBUG Session - GET 200 OK http://XXXXXXXXXXX/XXXXXXXXXX.nsf
2021-10-13 12:54:20.251-0300 [main] DEBUG Session - GET 200 OK http://XXXXXXXXXXX/mail/XXXXXXXXXXXX.nsf?OpenDatabase
2021-10-13 12:54:20.261-0300 [main] DEBUG Session - GET 200 OK http://XXXXXXXXXXX/mail/XXXXXXXXXXXX.nsf/iNotes/Proxy/?OpenDocument&Form=l_SessionFrame&l=es&gz&MX&TSF=20181119T200137,74Z&TS=20211013T145911,26Z&UNH=kucjj3l94fschq1sehlm4i5l9ng&charset=ISO-8859-1&KIC&pt
2021-10-13 12:54:20.342-0300 [main] DEBUG Session - GET 200 OK http://XXXXXXXXXXX/mail/XXXXXXXXXXXX.nsf/iNotes/Proxy/?OpenDocument&Form=f_SessionInfo&l=es&gz&MX&TSF=20181119T200137,74Z&TS=20211013T145910,77Z&KIC&pt&UNH=kucjj3l94fschq1sehlm4i5l9ng&charset=ISO-8859-1
2021-10-13 12:54:20.377-0300 [main] DEBUG Session - Found iNotes folder Folder (level 0, #5):	($Inbox)	Bandeja de entrada
2021-10-13 12:54:20.379-0300 [main] DEBUG Session - Found iNotes folder Folder (level 0, #7):	($Drafts)	Borradores
2021-10-13 12:54:20.380-0300 [main] DEBUG Session - Found iNotes folder Folder (level 0, #8):	($Sent)	Enviados
2021-10-13 12:54:20.380-0300 [main] DEBUG Session - Found iNotes folder Folder (level 0, #9):	($Follow-Up)	Seguimiento
2021-10-13 12:54:20.381-0300 [main] DEBUG Session - Found iNotes folder Folder (level 0, #10):	($All)	Todos los documentos
2021-10-13 12:54:20.382-0300 [main] DEBUG Session - Found iNotes folder Folder (level 1, #15.2):	fcaa7ef080b38c6383257bb100635d22	CustomFolder
2021-10-13 12:54:20.383-0300 [main] DEBUG Session - Found iNotes folder Folder (level 1, #15.3):	91ef8629fc7f482483257bb10069f895	CustomFolder2
2021-10-13 12:54:20.386-0300 [main] ERROR Session - Can not find X-IBM-INOTES-NONCE; aborting. ShimmerS cookie: ShimmerS=ET:20211014T035420%2c14Z&R:0&AT:M
2021-10-13 12:54:20.386-0300 [main] ERROR ListFolders - Can not login user xxxxxxxxxxxx!

Every command I try ends up with same error, Can not find X-IBM-INOTES-NONCE; aborting.

Any idea what could the problem ?

Edit: Removed the X-IBM-INOTES-NONCE check and it seems to be working. Closing issue

java.lang.NoClassDefFoundError

Hello,

One of the two last commit brought some noise =)

$ mvn clean
$ java -cp target/iNotes-exporter-1.0.jar fr.cedrik.inotes.mbox.MBoxrd ../test.mboxrd.`date +%Y-%m-%d` 
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/io/output/FileWriterWithEncoding
Caused by: java.lang.ClassNotFoundException: org.apache.commons.io.output.FileWriterWithEncoding
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.