[erlang-questions] Communicating with SpamAssassin from Erlang

Magnus Henoch magnus.henoch@REDACTED
Mon Mar 7 13:48:22 CET 2011


----- "Atilla Erdődi" <atilla.erdodi@REDACTED> 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,
Magnus


More information about the erlang-questions mailing list