* [gentoo-user] Sendmail confused by network change
@ 2017-09-20 9:45 Bas Zoutendijk
2017-09-20 11:05 ` John Covici
2017-09-20 15:23 ` [gentoo-user] " Ian Zimmerman
0 siblings, 2 replies; 7+ messages in thread
From: Bas Zoutendijk @ 2017-09-20 9:45 UTC (permalink / raw
To: gentoo-user
Dear Gentoo Users,
On my new Gentoo laptop installation I recently installed Sendmail in
order to receive messages from Cron on the root account. I noticed that
when I connect my laptop to a different network than the one I connected
to during booting, Sendmail does not know what to do with the Cron mail
any more.
For the purpose of clarity, let’s say the host name of this laptop is
‘hostname’. I did not configure the domain part of the host name
because of the mobile nature of this machine.
When I boot at home, Cron sends mail to root@hostname.homedomain.
‘homedomain’ is automatically added to all host names on my home network
by the router. It can only be resolved inside the network; it is not a
registered domain name. I can receive mail from Cron just fine.
When I boot at work, Cron sends mail to root@hostname. Note that the
domain name ‘workdomain’ is not added to the host name. I can still
receive Cron mail. However, when I take the laptop home without
rebooting and connect to the home network, Sendmail is unable to deliver
the Cron mail for root@hostname.homedomain and sends notifications of
this to root@hostname.homedomain, which somehow do seem to arrive
without problems. The error message is “config error: mail loops back
to me”.
Based on what I can find about this error on the internet, it looks like
Sendmail does not know where hostname.homedomain is and asks my router
to resolve that. When it finds out it is localhost, it thinks something
is wrong and does not deliver the mail. A possible solution is to
register hostname.homedomain as an alias of hostname or localhost, but I
would rather not do that, since hard coding domain names on a laptop
seems kludgy to me.
Does anyone know a more elegant solution? Some way to inform Sendmail
about changes to the domain name, or configure it to check for these
changes? I would rather not have to reboot. Restarting Sendmail is
acceptable, I guess, but perhaps not the most elegant solution.
Sincerely,
Bas
--
Sebastiaan L. Zoutendijk | slzoutendijk@gmail.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] Sendmail confused by network change
2017-09-20 9:45 [gentoo-user] Sendmail confused by network change Bas Zoutendijk
@ 2017-09-20 11:05 ` John Covici
2017-09-20 16:50 ` Bas Zoutendijk
2017-09-20 15:23 ` [gentoo-user] " Ian Zimmerman
1 sibling, 1 reply; 7+ messages in thread
From: John Covici @ 2017-09-20 11:05 UTC (permalink / raw
To: gentoo-user
On Wed, 20 Sep 2017 05:45:07 -0400,
Bas Zoutendijk wrote:
>
> Dear Gentoo Users,
>
> On my new Gentoo laptop installation I recently installed Sendmail in
> order to receive messages from Cron on the root account. I noticed that
> when I connect my laptop to a different network than the one I connected
> to during booting, Sendmail does not know what to do with the Cron mail
> any more.
>
> For the purpose of clarity, let’s say the host name of this laptop is
> ‘hostname’. I did not configure the domain part of the host name
> because of the mobile nature of this machine.
>
> When I boot at home, Cron sends mail to root@hostname.homedomain.
> ‘homedomain’ is automatically added to all host names on my home network
> by the router. It can only be resolved inside the network; it is not a
> registered domain name. I can receive mail from Cron just fine.
>
> When I boot at work, Cron sends mail to root@hostname. Note that the
> domain name ‘workdomain’ is not added to the host name. I can still
> receive Cron mail. However, when I take the laptop home without
> rebooting and connect to the home network, Sendmail is unable to deliver
> the Cron mail for root@hostname.homedomain and sends notifications of
> this to root@hostname.homedomain, which somehow do seem to arrive
> without problems. The error message is “config error: mail loops back
> to me”.
>
> Based on what I can find about this error on the internet, it looks like
> Sendmail does not know where hostname.homedomain is and asks my router
> to resolve that. When it finds out it is localhost, it thinks something
> is wrong and does not deliver the mail. A possible solution is to
> register hostname.homedomain as an alias of hostname or localhost, but I
> would rather not do that, since hard coding domain names on a laptop
> seems kludgy to me.
>
> Does anyone know a more elegant solution? Some way to inform Sendmail
> about changes to the domain name, or configure it to check for these
> changes? I would rather not have to reboot. Restarting Sendmail is
> acceptable, I guess, but perhaps not the most elegant solution.
Restarting sendmail seems fine with me, if you want to have something
that works everywhere, why not get a domain name from ddns or
somewhere and use a full fqdn all the time -- you can put your home
machine on another host in that domain and you will be good to go.
--
Your life is like a penny. You're going to lose it. The question is:
How do
you spend it?
John Covici
covici@ccs.covici.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* [gentoo-user] Re: Sendmail confused by network change
2017-09-20 9:45 [gentoo-user] Sendmail confused by network change Bas Zoutendijk
2017-09-20 11:05 ` John Covici
@ 2017-09-20 15:23 ` Ian Zimmerman
2017-09-20 17:02 ` Bas Zoutendijk
1 sibling, 1 reply; 7+ messages in thread
From: Ian Zimmerman @ 2017-09-20 15:23 UTC (permalink / raw
To: gentoo-user
On 2017-09-20 11:45, Bas Zoutendijk wrote:
> When I boot at home, Cron sends mail to root@hostname.homedomain.
> ‘homedomain’ is automatically added to all host names on my home
> network by the router. It can only be resolved inside the network; it
> is not a registered domain name. I can receive mail from Cron just
> fine.
>
> When I boot at work, Cron sends mail to root@hostname. Note that the
> domain name ‘workdomain’ is not added to the host name. I can still
> receive Cron mail. However, when I take the laptop home without
> rebooting and connect to the home network, Sendmail is unable to
> deliver the Cron mail for root@hostname.homedomain and sends
> notifications of this to root@hostname.homedomain, which somehow do
> seem to arrive without problems. The error message is “config error:
> mail loops back to me”.
According to crontab(5), you can configure where the mail is sent, by
setting the MAILTO variable in the crontab file. [This is for cronie, I
am not sure if other cron variants do this.] So, you could tell it to
send to <me@localhost>; presumably this would solve the problem.
Despite being one of the retro/traditionalist guys on this list, I have
to say installing sendmail just for this purpose doesn't seem
proportionate. Even if you don't want to look into the smallish MTA
packages (nullmailer etc.), you can make /usr/sbin/sendmail to be a
pretty trivial script (or a link to one) that just locks the destination
mailbox and appends the input to it. Heck, procmail could do that.
--
Please don't Cc: me privately on mailing lists and Usenet,
if you also post the followup to the list or newsgroup.
Do obvious transformation on domain to reply privately _only_ on Usenet.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] Sendmail confused by network change
2017-09-20 11:05 ` John Covici
@ 2017-09-20 16:50 ` Bas Zoutendijk
2017-09-20 17:02 ` J. Roeleveld
0 siblings, 1 reply; 7+ messages in thread
From: Bas Zoutendijk @ 2017-09-20 16:50 UTC (permalink / raw
To: gentoo-user
Dear John,
On Wed 20 Sep 2017 at 07:05:11 -0400, John Covici wrote:
> Restarting sendmail seems fine with me, if you want to have something
> that works everywhere, why not get a domain name from ddns or
> somewhere and use a full fqdn all the time -- you can put your home
> machine on another host in that domain and you will be good to go.
Thank you for this suggestion. I added ‘.localdomain’ to my host name
and now Sendmail uses this domain name on all networks. Cron mail
arrives again at home.
I did not want to try a ‘real’ domain name, as this could make the
system accessible from outside the local network, if I understand
correctly. Right now it is hidden behind the router and only has a
local IP address. I would like to keep it that way, because then I do
not have to worry about network security settings. Nevertheless you led
me to a solution.
Thank you,
Bas
--
Sebastiaan L. Zoutendijk | slzoutendijk@gmail.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] Re: Sendmail confused by network change
2017-09-20 15:23 ` [gentoo-user] " Ian Zimmerman
@ 2017-09-20 17:02 ` Bas Zoutendijk
0 siblings, 0 replies; 7+ messages in thread
From: Bas Zoutendijk @ 2017-09-20 17:02 UTC (permalink / raw
To: gentoo-user
Dear Ian,
On Wed 20 Sep 2017 at 08:23:33 -0700, Ian Zimmerman wrote:
> Despite being one of the retro/traditionalist guys on this list, I have
> to say installing sendmail just for this purpose doesn't seem
> proportionate. Even if you don't want to look into the smallish MTA
> packages (nullmailer etc.), you can make /usr/sbin/sendmail to be a
> pretty trivial script (or a link to one) that just locks the destination
> mailbox and appends the input to it. Heck, procmail could do that.
I appreciate your opinion. I normally seek to avoid unnecessary
complication and find the right tool for the job. Since this is my
first Gentoo install, this is the first time I had to pick an MTA by
myself. Not knowing much about MTAs I though Sendmail was a
common/traditional choice and would therefore probably serve my need.
I will check out nullmailer and other MTAs to see if they better fit my
need without adding extra complexity. As I wrote John I was able to
resolve the issue so I can take my time now.
Thank you,
Bas
--
Sebastiaan L. Zoutendijk | slzoutendijk@gmail.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] Sendmail confused by network change
2017-09-20 16:50 ` Bas Zoutendijk
@ 2017-09-20 17:02 ` J. Roeleveld
2017-09-20 17:12 ` Bas Zoutendijk
0 siblings, 1 reply; 7+ messages in thread
From: J. Roeleveld @ 2017-09-20 17:02 UTC (permalink / raw
To: gentoo-user
On Wednesday, September 20, 2017 6:50:54 PM CEST Bas Zoutendijk wrote:
> Dear John,
>
> On Wed 20 Sep 2017 at 07:05:11 -0400, John Covici wrote:
> > Restarting sendmail seems fine with me, if you want to have something
> > that works everywhere, why not get a domain name from ddns or
> > somewhere and use a full fqdn all the time -- you can put your home
> > machine on another host in that domain and you will be good to go.
>
> Thank you for this suggestion. I added ‘.localdomain’ to my host name
> and now Sendmail uses this domain name on all networks. Cron mail
> arrives again at home.
Glad it works now.
> I did not want to try a ‘real’ domain name, as this could make the
> system accessible from outside the local network, if I understand
> correctly.
To say it bluntly, you don't :)
> Right now it is hidden behind the router and only has a
> local IP address. I would like to keep it that way, because then I do
> not have to worry about network security settings. Nevertheless you led
> me to a solution.
This is how it works.
To clarify:
The IP-address determines how it is accessible. If the IP is not accessible
from the rest of the world, then you don't have to worry too much about
securing your mailserver.
The domain name is only an address-book entry. Unless it is fully entered into
the public one, noone will see the IP you are using. And as mentioned above,
even if they can, the IP is sitting behind a router and is most likely in a
private range.
--
Joost
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] Sendmail confused by network change
2017-09-20 17:02 ` J. Roeleveld
@ 2017-09-20 17:12 ` Bas Zoutendijk
0 siblings, 0 replies; 7+ messages in thread
From: Bas Zoutendijk @ 2017-09-20 17:12 UTC (permalink / raw
To: gentoo-user
On Wed 20 Sep 2017 at 19:02:52 +0200, J. Roeleveld wrote:
> To clarify:
> The IP-address determines how it is accessible. If the IP is not accessible
> from the rest of the world, then you don't have to worry too much about
> securing your mailserver.
>
> The domain name is only an address-book entry. Unless it is fully entered into
> the public one, noone will see the IP you are using. And as mentioned above,
> even if they can, the IP is sitting behind a router and is most likely in a
> private range.
Good to know, thanks.
Sincerely,
Bas
--
Sebastiaan L. Zoutendijk | slzoutendijk@gmail.com
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-09-20 17:12 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-20 9:45 [gentoo-user] Sendmail confused by network change Bas Zoutendijk
2017-09-20 11:05 ` John Covici
2017-09-20 16:50 ` Bas Zoutendijk
2017-09-20 17:02 ` J. Roeleveld
2017-09-20 17:12 ` Bas Zoutendijk
2017-09-20 15:23 ` [gentoo-user] " Ian Zimmerman
2017-09-20 17:02 ` Bas Zoutendijk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox