0

I am working on one framework which is hosted on Linux machine. I have to enable the functionality to read mail and it's content send by Email client which is hosted on other machine.

So 1. Do i require to install Email Server on Linux machine? If yes,Which are the Mail server on Linux which can communicate with Java API so that it can read the content of mail which is received on that Email Server

2.Is there any way or jars available so that my framework will act as Email Server and can process the mail got from Email client?

3.Any other solution on How to read mail send from Email Client installed on other machine which only have to specify the ip address of Email server where it has to send the mail and from where it has to process mail using java to read content

iRunner
  • 1,472
  • 6
  • 25
  • 40
  • This question appears to be off-topic because it is about looking for recommendations for [SMTP](http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol), [IMAP](http://en.wikipedia.org/wiki/Internet_Message_Access_Protocol) and/or [POP](http://en.wikipedia.org/wiki/Post_Office_Protocol) servers (and not focused on a specific issue with software implementation). – Elliott Frisch Apr 04 '14 at 13:03
  • Actually I m stuck in this scenario. Is it possible to configure mail server on linux ? – iRunner Apr 04 '14 at 13:07
  • Yes. You seem to be asking us to document setting up SMTP, IMAP and/or POP as I said. – Elliott Frisch Apr 04 '14 at 13:11
  • 1
    On Redhat linux login as root and issue this command, yum groupinstall 'E-mail server' – Jay Apr 04 '14 at 13:12
  • Apache James would be a Java based solution. Mime4j would be the part for processing the messages. – Wolfgang Fahl Jul 19 '14 at 11:36

3 Answers3

1
read mail and it's content send by Email client which is hosted on other machine

So you are already reading these without JAVA ?

If so why do you need a Linux Mail client?

Sounds like you need a mail parsing system that connects to depending on your local Mail confirm i.e. if port 25 POP3 then a pop3 java Parser

point 3. Again refer to above once you parse the email content you can parse out where it was sent from?

Java Email message Parser?

Reading / parsing email / mail with Java directly from a filesystem in standard RFC mail format

http://www.java-forums.org/blogs/java-mail/977-how-get-e-mail-java.html

E2A

http://mike-java.blogspot.co.uk/2008/03/simple-pop3-client-in-java-tutorial.html This blog shows how to go about making a pop3 client in Java - and gives the source

I think this is what you will need and from that you can expand on what else is part of your own requirement i.e. which IP it comes from - to do what with etc

Here is another example of SMTP (sending) POP3 (collecting) in Java http://inetjava.sourceforge.net/lectures/part1_sockets/InetJava-1.8-Email-Examples.html

Community
  • 1
  • 1
V H
  • 8,382
  • 2
  • 28
  • 48
1

There are some pretty obvious choices:

  1. Have a MDA deliver your email into a standard mailbox format such as the mbox format (used e.g. by Thunderbird) and access it using libraries for the mbox format. This can be a bit tricky, as you will need to lock and unlock the mailbox correctly.

  2. Deliver the messages into a POP3 or IMAP server, and access them using the POP3 or IMAP protocols. This is somewhat nicer, as you can rely on the mail server to perform correct locking (so you don't lose emails).

Has QUIT--Anony-Mousse
  • 76,138
  • 12
  • 138
  • 194
0

If you just able to connect to internet and if you use Java mail, you can read/send emails, if you are using public mail servers like gmail.

Jay
  • 9,189
  • 12
  • 56
  • 96