

Ask HN: Scriptable IMAP/SMTP servers? - ceejayoz

I&#x27;m looking to build a mail system that can be accessed via normal IMAP&#x2F;SMTP clients (mobile devices, Apple Mail&#x2F;Thunderbird&#x2F;Outlook, etc.) but with a decent scripting ability. The goal is to have inbound and outbound emails to be reviewed by a third party before they&#x27;re delivered. Googling has revealed a number of dead tries at making a Node IMAP server, a long-dead Lua-scriptable IMAP server, but nothing particularly usable.
======
mindcrash
Sieve ([http://sieve.info/](http://sieve.info/)) could get you pretty far for
anything IMAP related scripting. I believe Pigeonhole
([http://pigeonhole.dovecot.org/](http://pigeonhole.dovecot.org/)), the
implementation for Dovecot, also allows external applications to be run for
advanced scenarios.

------
madhouse
I remember [http://lamsonproject.org/](http://lamsonproject.org/) being a
python SMTP server library thing. It may be possible to piece together
something based on it. That covers the SMTP part.

Mind you, the git repo looks dead, with the last commit being over two years
old.

------
stephenr
Why reinvent the wheel. Setup mail delivery routing so mail goes to a
different mail handling system first, if it's approved send it on to the final
recipient.

------
alanhoff
Take a look at this [https://haraka.github.io/](https://haraka.github.io/)

~~~
ceejayoz
Yeah, I'm evaluating that for the SMTP side. The IMAP side seems to be more
complex.

