Java application to access MAILBOX using MAPI - java

I am trying to establish a connection between my mail server and a java program to parse the mail using protocol MAPI.. now the connection is working fine with a mock mailbox using IMAPS..but my mail server does not support MAPI..So is thr any option like JMAPI..

It seems like Java Supports POP3 and IMAP very well out of the box.
But for other protocols you can use one of the vendors found at JavaMail API - Third Party Products.
I've had problems communicating with the Novell Groupwise Protocol, luckily they have a IMAP bridge I could have used instead.
The Moonrug Exchange Connector looks like the one you are looking for, but you will have to purchase.
OpenMAPI looks like a promising one, but it is still in development.

Related

Fastest way to get E-mail from Exchange Server for GWT application using IMAP or Exchange Web service?

I am trying to get emails from Microsoft Exchange server using EWSJ API which in terms uses Exchange Web Services; but I would like to know; will it be fast to fetch emails using IMAP?
Since we have GWT we cannot directly connect to Exchange from client side in either case; we want to minimize the turn around time of getting emails on server side and then passing those to client side using serialized POJOs.
Apache Hupa is a subproject of the Apache James project, and it is a webmail client developed with GWT, it uses a server side able to get messages from any IMAP enabled server (it uses the javax.mail api).
Although you can use directly Hupa to read and send emails using your email server (there is a properties file to define imap and smtp parameters), in your case you could get the server side to connect to your servers and use any GWT ajax mechanism to get the messages like Hupa client side does.
Here you have a live demo of Hupa.
From my experience IMAP seems to be the fastest at the moment. I used it once to create a small program that could fetch emails from GMail. A bonus is that you can mark emails as "read" from the IMAP interface.
If I had to choose I'd go for IMAP.

Implementing a IM platform in Java

If creating an IM platform in Java, which would be a better way to implement communications between the clients and server?
I was thinking either RMI or just a socket connection...
Advice please,
Thanks
I would use straight socket connection, using a well known protocol such as XMPP. You can use a library (like smack) to avoid implementing the whole protocol yourself.
The main advantage of XMPP over RMI or your self-made protocol is that is a well established protocol used for exactly that purpose: IM.
Some chat services already using XMPP include Google Chat (GTALK) and Facebook.
I already did this using Smack API, using XMPP protocol.
CometD has been specifically designed for use cases such as Chatrooms. Differently from other protocols, it works over HTTP port 80, which means (nearly) no hassles with Firewalls.
Listen to a recent podcast with Greg Wilkins about the project, which goes into some details of issues with implementing Chatrooms and how it gets handled by CometD.
I believe there is a Java client for CometD if you need to have client on both sides of conversation (normally frontend is JavaScript).

Sending mail from a java app without using an external SMTP server

JavaMail requires that you specify an external SMTP server when sending mail. I want to have my java app send email directly without having to use an external SMTP server such as postfix or sendmail.
Can anyone recommend a library which provides this kind of functionality?
Ive done some googling and have come up with nothing.
It's not trivial to send mail yourself. To start with, you have to deal with DNS (MX records), queuing, connection management and maybe signing (DKIM). So you wouldn't find any light-weight library like JavaMail to do this.
Your best bet is JAMES,
http://james.apache.org/

Sending Email using Java

I want my Java application to send out emails to users. But I cant get a good solution.
Now, I got some on Google but they use a SMTP server which I dont have. I was wondering if setting up one on my Linux machine would be easy?
So, I am using mailx now to send out emails but it sends emails from root which is definately not good. Is there any way to send out emails from a proper email using java? like you can do in php and other languages?
Use commons-email to send email from java in a simple, straightforward way (see the docs).
You need an SMTP server always - even in "php and other languages", but perhaps you don't know you need it, because it is bundled in your LAMP package.
One solution is to use google as an SMTP server. Either via your account, or via google apps. Otherwise setting up an smtp server (postfix for example) linux appears trivial, but isn't - you have to take into consideration many things - see this post by Jeff Atwood.
So ultimately, I'd suggest using the options provided by google.
if you'r looking to host your own mail server, then apache james is a pretty good option.
or other solution could be using a third-party mailservers such as gmail or yahoo; and use the JavaMail API to send emails.
If you don't have an SMTP server, Asprin is a send-only SMTP server, which is a pretty good fit. It suffers from the same problem any do-it-yourself SMTP server will, in that it will look more like a Spam source, so using a proper SMTP server used for e-mail should be done if possible.

Integration of an email server in a Java EE application

I am building a web application that has to be able to do the following:
Send emails to the (external) addresses registered by the users (say, Gmail, Yahoo Mail, etc).
Send/receive emails to local mailboxes that live in the application. These are more "messages" in that sense.
What are the potential open source technologies I could integrate with here? Thanks for your inputs.
So, you want a SMTP server? If you want to have it in Java, then I can suggest to pick Apache James. But in fact every decent SMTP server would suffice. You can just use JavaMail API, or the more convenienced Apache Commons Email which is built on top of JavaMail API, to talk with any SMTP server to send/read emails.
If you didn't already realize, you can also just make use of an existing SMTP server provided by your ISP or the web hosting. In this case only JavaMail or Commons Email would have been sufficient.
While Commons Email will help you get the sending part done, receiving email will require that you access mailboxes via IMAP or POP through the Java Mail API.
Java Mail is a little cumbersome to use, but this Stackoverflow question has a working IMAP sample to help you get started.
There is a JCA (Java Connector Architecture) adapter that makes your Java EE server open port 25 for receiving mails.
http://sourceforge.net/projects/mailra/
A quite old tutorial which is incomplete with some examples for IMAP watching can be found here:
https://community.jboss.org/wiki/InboundJavaMail
A general introduction to JCA can be found here:
http://www.adam-bien.com/roller/abien/entry/a_simple_transactional_file_jca

Categories

Resources