views:

37

answers:

1

How could one go about accessing email without interfering in any way that would be visible to a user with standard email clients such as Thunderbird?

P.S: I've marked this as both java and language-agnostic so the approach can be described in general steps or detailled programatically.

+2  A: 

You would like to access the mail server directly over network programmatically. You only need to know the address (URL) of the mail server (usually in flavor of smtp.domain.com), the port number (usually 25) and the login username and password (the one of the existing mail account at the mail server).

In low-level, you need to know socket programming. In Java, there's the java.net.Socket API for this. Also see this tutorial. To communicate with a mail server you need to learn the SMTP or IMAP protocols, depending on what the mail server in question understands, to send/retrieve commands as bytes over the socket accordingly.

In high-level, you can use a more convenient API which doesn't require you to understand the low level specifics (which may be pretty complicated and verbose). In Java, you can use the JavaMail API for this. It has an excellent FAQ with a lot of code examples.

BalusC
Ok, that's a clear list of things to look through. I just need to figure out if it's possible to get an e-mail without it being flagged as having been consulted as this would be undesireable. This is to avoid the mail server removing an e-mail before it's been downloaded by a regular client. If it's not possible maybe there's a way to "listen" for incoming e-mails or interface with the mail client.
James P.
That's possible with JavaMail.
BalusC
Great. Just in case anyone is wondering, the idea isn't to eavesdrop on people's e-mails but to explore the possibility of using e-mail as a way to exchange raw information when other mediums aren't available.
James P.