[erlang-questions] Communicating with SpamAssassin from Erlang

Matt Stancliff <>
Tue Mar 8 03:25:27 CET 2011

On Mar 7, 2011, at 3:27 AM, Atilla Erdődi wrote:

> I'm trying to use SpamAssassin to check the spam score of a mail from
> Erlang using a port.  I've experimented with several options for
> open_port, different message formats, but haven't managed to get any
> reply from spamc, so it times out. Apparently it doesn't notice the
> end of the transmission. Hopefully the solution is something trivial,
> I've missed so far.

   You've run into a very common problem of erlang ports being unable  
to close stdin.

> The simplified code is below:

   I fixed it a few weeks ago for good: https://github.com/mattsta/erlang-stdinout-pool

   erlang-stdinout-pool includes a port with the ability to close  
stdin on your external process and send stdout back to erlang.

-Matt, the self proclaimed master of stdin/stdout.
Matt Stancliff                    San Jose, CA
@mattsta                  iPhone: 678-591-9337
"The best way to predict the future is to invent it." --Alan Kay

More information about the erlang-questions mailing list