email2xml
From VxOware
Email2XML Service
1 Specification
User sends an email to
username@emailaccount.com
Service monitors an email account (username and password are specified in an XML config file). When a new email appears in the account with the To: line containing
TOSTRING
or From: line containing
FROMSTRING
The service downloads the email and its attachement and puts it into an XML file of the form (based on [1])
<fromaddress/> <toaddress/> <cc/> <contenttext> </contenttext> <attachments> <attachment> <filename/> <filetype/> <filedata64/> </attachments>
I suppose there should be an option for specifying the From: line too. Perhaps the config file should have these options in XML:
USERNAME ACCOUNT PASSWORD TOSTRING FROMSTRING POLLINTERVAL DELETEAFTER OUTPUTFOLDERROOT
This XML file is dropped into a directory that is based on the string ACCOUNT, and the filename has the form
USERNAME/ACCOUNT/YYYY-MM-DDTHH:MM:SS-SubjectLineString.xml
Based on this xml file, these files should be created
- USERNAME/ACCOUNT/YYYY-MM-DDTHH:MM:SS-SubjectLineString-NoMIME.xml
- USERNAME/ACCOUNT/YYYY-MM-DDTHH:MM:SS-attachments/file1.png
- USERNAME/ACCOUNT/YYYY-MM-DDTHH:MM:SS-attachments/file2.png
where file1.png and file2.png are the file names derived from the original email.
2 User Interface
- Go to http://vxoware.org/email2xml
- Enter USERNAME, ACCOUNT (SMTP address), PASSWORD, TOPATTERN, FROMPATTERN, POLLINTERVAL
- Go to http://vxoware.org/email2xml/USERNAME to see the directory of files that have been created.
3 References
This looks most promising:
- http://java.sun.com/products/javamail/JavaMail-1.4.pdf
- http://java.sun.com/developer/onlineTraining/JavaMail/contents.html
Others:
- http://www.email-standards.org/
- http://tools.elit.nl/mbox2xml.php
- http://www.example-code.com/vcpp/SaveToXml.asp
- http://www.javaworld.com/javaworld/jw-10-2001/jw-1026-javamail.html
- http://www.email2db.com/ (does a lot of what I want, but requires Windows. Will take as much time to install as creating a simple version using JavaMail?)
To discuss - what context to run it in:
- Run from CRON job (own JVM) - lots of cpu for start up
- http://exist-db.org/building.html#war - Info
- Nailgun?
