[nmh-workers] localhost anomaly

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[nmh-workers] localhost anomaly

Ronald F. Guilmette-2
My apologies for posting here without actually being an NHM "worker".
I hope you folks won't begrudge me too much for doing so, even though
this may turn out to be a "support" type question.

've recently been upgrading an ancinet old FreeBSD 9.1 system to FreeBSD
12.0.  In the process, I am installing all fresh new and updated binaries
for everything, of course.  In the process, many small things have broken.
This is just one of those.

I installed the nmh-1.7.1 pre-built package on this new FreeBSD 12.0
system, and mostly everything just works, with one small but glaring
exception.

When I sent to diddle my /usr/local/etc/nmh/mts.conf file, I elected
to leave things pretty much as they had been on my old system. In
particular, I left the following two settings, which have worked for
me for years, in place:

mts: smtp
servers: localhost

Note that I have the FreeBSD pre-built package called postfix-3.3.4,1
installed, configured, and (arpparently) running well already.  (I am
sending this email through it.)  I also checked to make sure that my
installed and running instance of Postfix is properly accepting the
following

    telnet 127.0.0.1 25

It *is* doing so.  I get the expencetd SMTP greeting banner.

Nontheless, for reasons that are beyond me, when I tried to use nmh to
send an outbound email, I consistantly got errors telling me that nmh
had experienced a failure when trying to connect to the SMTP server.

The exact errors are/were as follows:

post: problem initializing server; [BHST] Connection to "localhost" failed: Connection refused
send: message not delivered to anyone

I really can't figure this out and would appreciate some help getting to
the bottom of this.

For the time being, I have found that I can simply and easily work around
the problem by using instead: "mts: sendmail/pipe" however whenever I see
something not working that should be working, I usually like to get to the
bottom of it.  I almost always learn something, and usually it is something
that I, in my abundant ignorance, have done horribly wrong.  (So that is
always educational.)

If anybody can explain the errors I saw when using "mts: smtp" together
with "servers: localhost" I sure would appreciate it.


Regards,
rfg


P.S.  The output of the "getent hosts localhost" on this new/fresh FreeBSD
system is currently as follows:

::1               localhost
127.0.0.1         localhost  localhost.tristatelogic.com


Are the nmh components perhaps trying to connect to my smtp server via IPv6
in preference to IPv4?

If so, how do I disable that behavior? (I am not using IPv6 and I do not have
either any wish nor any real motivation to do so anytime soon.  Please do
not proselytize me about this.  I am already well aware of all the arguments,
both religious and otherwise.)


--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: localhost anomaly

Ralph Corderoy
Hi rfg,

> even though this may turn out to be a "support" type question.

Not a problem.  https://lists.nongnu.org/mailman/listinfo/nmh-workers
says

    All the chat amongst nmh users, new and old, happens here, as does
    discussion amongst the developers about the future direction of nmh.

> mts: smtp
> servers: localhost
...
> post: problem initializing server; [BHST] Connection to "localhost"
>     failed: Connection refused
> send: message not delivered to anyone

This error from post(8) could do with stating the attempted port.

It's a bit of a twisty path through the documentation.  mts.conf(5) says
for `servers'

    It is not possible to change the mail submission port number in the
    servers entry; see the -port switch to send(1) for this
    functionality.

send(1) lists `-port port-name/number' in the Synopsis but doesn't
define it.  You have to pick up on the

    Most of the features attributed to send are actually performed by
    post.

to read post(8) where you'll find

    The default server is set with servers in /etc/nmh/mts.conf, and the
    default port is submission, 587.

Port 587 is the `submission' port.  It sounds like your Postfix isn't
listening on that so you need a `post: -port 25' in your ~/.mh_profile.

The NEWS file in the source mentions the change.  Perhaps it's installed
somewhere by FreeBSD.

    $ grep 587 NEWS
    - post now defaults to port 587 on 'smtp' message submission.
    $

--
Cheers, Ralph.

--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: localhost anomaly

Ronald F. Guilmette-2
In message <[hidden email]>,
Ralph Corderoy <[hidden email]> wrote:

>Port 587 is the `submission' port.  It sounds like your Postfix isn't
>listening on that...

You're right,  That's it in a nutshell.  I confess that I didn't
even consider the possibility that nmh would be using 587 rather
than 25... although it is certainly more correct for it to use
587 when submitting.

Thanks!  I'll tweek Postix and turn on local submission via 587.

>so you need a `post: -port 25' in your ~/.mh_profile.

Or just get Postfix to open up 587.

Thanks again!


Regards,
rfg

--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: localhost anomaly

David Levine-3
In reply to this post by Ralph Corderoy

Ralph wrote:

so you need a `post: -port 25' in your ~/.mh_profile.

That should be `send: -port 25' !!

I know that Ralph knows, but for completeness: post doesn't read the profile.

DavidĀ 

--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: localhost anomaly

Ralph Corderoy
> Ralph wrote:
> > so you need a `post: -port 25' in your ~/.mh_profile.
>
> That should be `send: -port 25' !!

Thanks David.  You're right.  I think I'm always led astray by being in
post(8) by the time I read the option's description.  :-)

--
Cheers, Ralph.

--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: localhost anomaly

Ken Hornstein-2
In reply to this post by Ronald F. Guilmette-2
>>Port 587 is the `submission' port.  It sounds like your Postfix isn't
>>listening on that...
>
>You're right,  That's it in a nutshell.  I confess that I didn't
>even consider the possibility that nmh would be using 587 rather
>than 25... although it is certainly more correct for it to use
>587 when submitting.

You know, you're not the first person to have been bitten by this.  It
occurs to me that we should print the port number that we are using in
the error message, as that would provide a hint to people as to what is
going wrong.

--Ken

--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: localhost anomaly

Ronald F. Guilmette-2
In message <[hidden email]>,
Ken Hornstein <[hidden email]> wrote:

>>You're right,  That's it in a nutshell.  I confess that I didn't
>>even consider the possibility that nmh would be using 587 rather
>>than 25... although it is certainly more correct for it to use
>>587 when submitting.
>
>You know, you're not the first person to have been bitten by this.

I feel better already. :-)

>It
>occurs to me that we should print the port number that we are using in
>the error message, as that would provide a hint to people as to what is
>going wrong.

That would be (and would have been) most helpful.

Instead of saying failure to connect to "localhost" it would have been most
helpful if the message had said failure to connect to "localhost:587".

--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: localhost anomaly

Ken Hornstein-2
>>It
>>occurs to me that we should print the port number that we are using in
>>the error message, as that would provide a hint to people as to what is
>>going wrong.
>
>That would be (and would have been) most helpful.
>
>Instead of saying failure to connect to "localhost" it would have been most
>helpful if the message had said failure to connect to "localhost:587".

Here's the new message:

post: problem initializing server; [BHST] Connection to "localhost:587" failed: Connection refused

This code has been committed to the tree and will be in the next release.
I would note that the port number shows up now if you use -snoop, but it's
clear that people don't always use that switch.  If there are MULTIPLE
addresses that are being connected to then the error message suggests you
use -snoop for more detail, but I don't think it's worth doing that for
the ordinary case here.

--Ken

--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: localhost anomaly

Ronald F. Guilmette-2
In message <[hidden email]>,
Ken Hornstein <[hidden email]> wrote:

>Here's the new message:
>
>post: problem initializing server; [BHST] Connection to "localhost:587"
>failed: Connection refused

Looks good to me!

--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers