[pfx] Re: Problem with /var/spool/postfix/etc/resolv.conf after removing systemd-resolved

2024-06-04 Thread Fred Morris via Postfix-users

On Tue, 4 Jun 2024, Chris Green via Postfix-users wrote:

I run dnsmasq instead of systemd-resolved on all my systems.


You need to make sure you've disabled it and whatever associated 
scaffolding edits resolv.conf or that you understand the mechanism.



[...]
It turned out that the file /var/spool/postfix/etc/resolv.conf was:-

   nameserver 127.0.0.53


That's an artifact of systemd-resolved and the distributions which ship 
it.


You may also need to understand why postfix is using 
/var/spool/postfix/etc/resolv.conf instead of /etc/resolv.conf. Maybe it's 
copying it from /etc/resolv.conf. You might use that behavior to your 
advantage by having it copy from some other location which you maintain.


--

Fred Morris

___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: Problem with /var/spool/postfix/etc/resolv.conf after removing systemd-resolved

2024-06-04 Thread Wietse Venema via Postfix-users
Chris Green via Postfix-users:
> I run dnsmasq instead of systemd-resolved on all my systems.
> 
> I recently moved my dekstop server to new hardware running xubuntu
> 24.04 replacing my previous system that was running xubuntu 22.04.
> 
> I installed dnsmasq and removed systemd-resolved and all seemed well
> until I noticed I couldn't send E-Mail, I run a postfix 3.8.6 server
> which sends outgoing E-Mail via my ISP's smarthost.
> 
> In the mail.log I was seeing lots of messages like:-
> 
> 2024-06-02T00:10:30.652648+01:00 q957 postfix/smtp[8733]: 9763C3542024: 
> to=, relay=none, delay=8729, delays =8729/0.02/0/0, 
> dsn=4.4.3, status=deferred (Host or domain name not found. Name service error 
> for name=smtp-auth.mythic-beasts.com type=A: Host not found, try again)
> 
> But running 'host smtp-auth.mythic-beasts.com' returned a perfectly OK
> address.
> 
> It turned out that the file /var/spool/postfix/etc/resolv.conf was:-
> 
> nameserver 127.0.0.53
> options edns0 trust-ad
> search zbmc.eu
> 
> Changing it to:-
> 
> nameserver 127.0.0.53
> options edns0 trust-ad
> search zbmc.eu
> 
> Has fixed the problem.

Those two sets of lines are identical.

> However I'm sure this isn't the 'right' way to do this.  How do I get
> postfix to pick up the resolv.conf file that is used/created by dnsmasq?

Postfix does not import system files under /var/spool/postfix
(the list of files needed is OS-specific).

Those files are normally copied by OS-specific scripts that start
Postfix.

Wietse
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: Problem with /var/spool/postfix/etc/resolv.conf after removing systemd-resolved

2024-06-04 Thread Matus UHLAR - fantomas via Postfix-users

On 04.06.24 10:00, Chris Green via Postfix-users wrote:

I run dnsmasq instead of systemd-resolved on all my systems.

I recently moved my dekstop server to new hardware running xubuntu
24.04 replacing my previous system that was running xubuntu 22.04.

I installed dnsmasq and removed systemd-resolved and all seemed well
until I noticed I couldn't send E-Mail, I run a postfix 3.8.6 server
which sends outgoing E-Mail via my ISP's smarthost.

In the mail.log I was seeing lots of messages like:-

   2024-06-02T00:10:30.652648+01:00 q957 postfix/smtp[8733]: 9763C3542024: 
to=, relay=none, delay=8729, delays =8729/0.02/0/0, 
dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for 
name=smtp-auth.mythic-beasts.com type=A: Host not found, try again)

But running 'host smtp-auth.mythic-beasts.com' returned a perfectly OK
address.

It turned out that the file /var/spool/postfix/etc/resolv.conf was:-

   nameserver 127.0.0.53
   options edns0 trust-ad
   search zbmc.eu

Changing it to:-

   nameserver 127.0.0.53
   options edns0 trust-ad
   search zbmc.eu

Has fixed the problem.


they look the same, didn't you set nameserver to 127.0.0.1 instead?


However I'm sure this isn't the 'right' way to do this.  How do I get
postfix to pick up the resolv.conf file that is used/created by dnsmasq?


restarting postfix does set up proper environment, should apply on Ubuntu.
After changing resolv.conf restarting postfix should fix this.
--
Matus UHLAR - fantomas, uh...@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Support bacteria - they're the only culture some people have.
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: Problem with /var/spool/postfix/etc/resolv.conf after removing systemd-resolved

2024-06-04 Thread Chris Green via Postfix-users
On Tue, Jun 04, 2024 at 10:00:28AM +0100, Chris Green via Postfix-users wrote:
> I run dnsmasq instead of systemd-resolved on all my systems.
> 
> I recently moved my dekstop server to new hardware running xubuntu
> 24.04 replacing my previous system that was running xubuntu 22.04.
> 
> I installed dnsmasq and removed systemd-resolved and all seemed well
> until I noticed I couldn't send E-Mail, I run a postfix 3.8.6 server
> which sends outgoing E-Mail via my ISP's smarthost.
> 
> In the mail.log I was seeing lots of messages like:-
> 
> 2024-06-02T00:10:30.652648+01:00 q957 postfix/smtp[8733]: 9763C3542024: 
> to=, relay=none, delay=8729, delays =8729/0.02/0/0, 
> dsn=4.4.3, 
> status=deferred (Host or domain name not found. Name service error for 
> name=smtp-auth.mythic-beasts.com type=A: Host not found, try again) 
> 
> But running 'host smtp-auth.mythic-beasts.com' returned a perfectly OK
> address.
> 
> It turned out that the file /var/spool/postfix/etc/resolv.conf was:-
> 
> nameserver 127.0.0.53
> options edns0 trust-ad
> search zbmc.eu
> 
> Changing it to:-
> 
> nameserver 127.0.0.53
> options edns0 trust-ad
> search zbmc.eu
> 
> Has fixed the problem.
> 
> However I'm sure this isn't the 'right' way to do this.  How do I get
> postfix to pick up the resolv.conf file that is used/created by dnsmasq?
> 
Ooops!!!

That should be Changing it to:-

 nameserver 127.0.0.1
 options edns0 trust-ad
 search zbmc.eu

of course!


On investigating further it seems that on older systems where I have
done this (moved from systemd-resolved to dnsmasq) I have simply
hand-edited /etc/resolv.conf and then postfix copies that version to
/var/spool/postfix/etc/resolv.conf and all is well.

So, is that as it should be?

-- 
Chris Green
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org