Can't configure network interface to listen on
I followed the instructions to set up mailin, and I can get it to listen on localhost:
$ telnet localhost 25
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 localhost ESMTP Mailin Smtp Server
But it isn't listening on my actual public IP:
$ telnet 54.97.96.117 25
Trying 54.97.96.117...
telnet: Unable to connect to remote host: Connection refused
Perhaps I configured it wrong. But I've also noticed that my server is perhaps configured to think that is name is localhost:
$ echo $HOSTNAME
localhost
Is there something to do to fix my server config? Can't I just tell mailin "Hey, listen on interface eth0!"?
I suspect it to be due to some network configuration issue rather than to mailin. Is your machine behind any router? To be sure it holds this public IP, can you post the output of ifconfig?
Le 28 décembre 2015 10:15:04 UTC+01:00, Michael Toomim [email protected] a écrit :
I followed the instructions to set up mailin, and I can get it to listen on localhost:
$ telnet localhost 25 Trying ::1... Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. 220 localhost ESMTP Mailin Smtp ServerBut it isn't listening on my actual public IP:
$ telnet 54.97.96.117 25 Trying 54.97.96.117... telnet: Unable to connect to remote host: Connection refusedPerhaps I configured it wrong. But I've also noticed that my server is perhaps configured to think that is name is localhost:
$ echo $HOSTNAME localhostIs there something to do to fix my server config? Can't I just tell mailin "Hey, listen on interface eth0!"?
Reply to this email directly or view it on GitHub: https://github.com/Flolagale/mailin/issues/75
Thanks, but there was no problem in the network. The problem was, in fact, that mailin was listening on the wrong interface.
I fixed this by looking at the source code, finding where mailin tells smtp-server which network interface to listen on, and seeing that you can configure this with the host parameter in:
mailin.start({
host: "54.97.96.117",
port: 25,
// etc...
})
This host parameter should go in the documentation.
The same problem. Mailin starts on the local interface, instead external.
@pomeo, did you read the fix?
On Dec 29, 2015, at 7:07 AM, Sergey Ovechkin [email protected] wrote:
The same problem. Mailin starts on the local interface, instead external.
— Reply to this email directly or view it on GitHub.
@toomim Yes. Only from the command line it doesn't work. Because there is no --host. Not from the command line of course works with "host:"
+1 Had trouble with this after updating to the latest release also, as it is an undocumented change and also breaks the example in the readme. Used to work without any configuration.
+1 same here, I'm using it from the command line and it's binding the 127.0.0.1 ip I can't get it to bind the 0.0.0.0 from the command line so until a fix is release to add a --host The only solution I see is to embed mailin into an small app to be able to configure the host like @toomim did...
Created a pull request which should restore the functionality of the previous version, while allowing the host configuration to be set if required. This also adds the functionality to the cli.
@janbialostok, it looks like it was a host issue (in relation to #77 )
@tomforster provided a fix by allowing the host configuration to be set from the command line. It is published as [email protected].