PDA

View Full Version : Lua and IMAP


bule
10-03-2006, 10:08 AM
What are the odds to create an app to connect to and query
an email server using IMAP protocol in APMS (LUA5)?

(Excange server to be more precise...)

Buffman
10-03-2006, 11:04 AM
Hi Bule,

I worked on a project a few months ago that did exactly what you were trying to do. I originally planned on it being coded in AMS, but it turned out to be a headache. Lua doesn't natively have support for the IMAP protocol and writing functions for every IMAP command would be a pain. I ended up just writing something in perl and was done with it.

That being said, check out LuaSocket. That may be a good direction to start if you still want to do it in AMS. IMAPFilter (http://imapfilter.hellug.gr/) also uses the Lua language for configuration, so it might be useful. You can also open a telnet session to an IMAP server using the IMAP port, and send raw IMAP commands to do the job (it was my original approach, but couldn't find anything helpful for lua & telnet). Take a look at the IMAP RFC here - http://www.faqs.org/rfcs/rfc2060.html

I'm pretty experienced with IMAP, so feel free to hit me up if you have any questions!