Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is it possible to setup a mailbox (using MS Exchange) to receive emails and store them as a text file on the server?

A developer has asked if this is possible so he can then build it into his application.

Any help is always appreciated

---EDIT---

Speaking to the developer who's requested this, he's explained in more detail what he needs.

He basically wants users to be able to email site@example.com and to some how get those emails in text format into an SQL database.

Has anyone had any experience with this before or know of any application that can do this? .

Thanks

Elliott

share|improve this question
add comment

4 Answers

Although it could probably be done it's not a straightforward or standard thing for Exchange. I would suggest the developer use POP3 or IMAP to fetch the messages from Exchange and then do whatever he needs to do with them. It's much easier and more portable than trying to make Exchange do something it wasn't meant to do. As POP3 is particularly easy to program this should be quite trivial for an experienced programmer.

share|improve this answer
add comment

Short answer: Sorta.

Long Answer: Exchange allows you to export messages and mailboxes with the Export-Mail command, but, of course, it only lets you export it to Microsoft's crappy PST format. From there you have a number of utilities that can break down the pst to text. It's guaranteed to be extremely tedious.

John is absolutely correct. You'd be much better off downloading the mail programmatically using POP or IMAP.

share|improve this answer
add comment

I'm not familiar with MS Exchange, but for me it would be more natural connect to server via IMAP and walk thru inbox directly. Because I don't think that running developed application on the same email server is good idea (which is mandatory for accessing files). And sharing folder with text emails to be accessible from network? Not a good idea either..

Regards, Martin.

share|improve this answer
add comment

To add to the other excellent answers:

We had to do just this on a project I worked on.

We just let the admin enable IMAP access on the Exchange server, then used the JavaMail library to download the mails via IMAP (it was a Java project).

Worked like a charm, so I'd definitely recommend it. There's tons of IMAP libraries around for just about any language.

Using IMAP instead of text files also allows for other nifty tricks. You could for example move emails to other folders on the server after processing them (such as "processed", "wrong format", ...). All these folders can be viewed as regular folders using any email program (including, but not limited to Outlook), and users can directly see all the mails before and after processing, maybe even queue a mail for reprocessing simply by moving it back into the inbox.

We used that to give users a simple way to control the mail processing.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.