[erlang-questions] Communicating with SpamAssassin from Erlang

Magnus Henoch <>
Mon Mar 7 13:48:22 CET 2011

----- "Atilla Erdődi" <> wrote:

> port_command(Port, <<4>>), %EOT

This doesn't do what you think it does: when you hit Ctrl-D in a
terminal to terminate input to some program, the terminal actually
intercepts the Ctrl-D and never sends it to the program, but closes the
input file descriptor.

As far as I know, there is no way to close the input file descriptor
of a port from Erlang, so you'll have to do it in some other way.
(Write the message to a file and redirect it from there, experiment
with spamc's -B option, write a port driver or a NIF, etc.)

Hope this helps,

More information about the erlang-questions mailing list