** Description changed:

- Every now and then postfix installed on my laptop stops delivering
- mails. I detect this problem after wandering about no answers to my
- emails, or by checking the current mail queue, which should be empty
- when I am at the office.
+ [SRU Justification]
+ Race condition between resolvconf and postfix on startup leaves postfix with 
a different DNS server configuration in its chroot than is used on the host 
system, which may cause it to experience DNS resolution errors.
+ 
+ [Test case]
+ 1. Install postfix on a machine or container (not chroot) in the default 
configuration.
+ 2. Run 'sudo mkdir -p /etc/systemd/system/systemd-resolved.service.d ; echo 
-e '[Service]\nExecStartPre=/bin/sleep 20' | sudo tee 
/etc/systemd/system/systemd-resolved.service.d/lp1519331.conf'
+ 3. Reboot
+ 4. Confirm that /etc/resolv.conf and /var/spool/postfix/etc/resolv.conf 
differ.
+ 5. Install postfix from -proposed
+ 6. Reboot
+ 7. Confirm that /etc/resolv.conf and /var/spool/postfix/etc/resolv.conf match.
+ 8 Run 'sudo rm -f 
/etc/systemd/system/systemd-resolved.service.d/lp1519331.conf && sudo rmdir -p 
/etc/systemd/system/systemd-resolved.service.d'
+ 
+ [Regression potential]
+ Because we are changing the order of service initialization at boot, if there 
are other packages which have undeclared dependencies on postfix (or 
generically, on a running SMTP server), these services may now fail a race with 
postfix startup where they succeeded before.  This is highly unlikely, as a 
hard dependency on an SMTP service is unusual.
+ 
+ Because the postfix service will now depend on network-online.target, if
+ the system fails to reach this target postfix will not start, which
+ would be a serious regression.  Analysis shows that network-
+ online.target should always be reached at boot, regardless of whether
+ using ifupdown, network-manager, or networkd, and the only difference is
+ that postfix startup will be delayed a short while until the network is
+ fully configured.
+ 
+ 
+ [Original report]
+ Every now and then postfix installed on my laptop stops delivering mails. I 
detect this problem after wandering about no answers to my emails, or by 
checking the current mail queue, which should be empty when I am at the office.
  
  I use postfix to deliver all sent mail to the company SMTP server. The
  local postfix does not receive outside mail.
  
  The mail queue shows errors of the type:
  
  (Host or domain name not found. Name service error for name=XXXXXXXX
  type=AAAA: Host not found, try again)
  
  When I manually check host name resolution, it works fine. It seems,
  postfix either does not retry name resolution, or somehow name
  resolution fails for postfix, but not other programs. Network
  connectivity is fine when this problem occurs (I read my mail via IMAP
  w/o local message body cache from the same server used as smart host,
  use SSH to other hosts, and surf the web -- I never noticed network
  problems when the postfix mail delivery did not work).
  
  To remedy the situation I can just restart postfix and flush the mail
  queue. But I need to detect the problem, and postfix should™ recover on
  its own.
  
  I am using IPv6 privacy extensions (Ubuntu default) in a dual stack IPv4
  and IPv6 network. Both local (company) and remote servers are accessible
  via IPv6, thus I am actively using IPv6 for many connections. I have no
  idea if this is related to the problem, but the error shows a failure to
  resolve a quad A record.
  
  Mandatory information:
  1)
  $ lsb_release -rd
  Description:  Ubuntu 14.04.3 LTS
  Release:      14.04
  
  2)
  $ apt-cache policy postfix
  postfix:
-   Installed: 2.11.0-1ubuntu1
-   Candidate: 2.11.0-1ubuntu1
-   Version table:
-  *** 2.11.0-1ubuntu1 0
-         500 http://ftp.uni-kl.de/pub/linux/ubuntu/ trusty-updates/main amd64 
Packages
-         100 /var/lib/dpkg/status
-      2.11.0-1 0
-         500 http://ftp.uni-kl.de/pub/linux/ubuntu/ trusty/main amd64 Packages
+   Installed: 2.11.0-1ubuntu1
+   Candidate: 2.11.0-1ubuntu1
+   Version table:
+  *** 2.11.0-1ubuntu1 0
+         500 http://ftp.uni-kl.de/pub/linux/ubuntu/ trusty-updates/main amd64 
Packages
+         100 /var/lib/dpkg/status
+      2.11.0-1 0
+         500 http://ftp.uni-kl.de/pub/linux/ubuntu/ trusty/main amd64 Packages
  
  3)
  I expected postfix to deliver the queued mail. If there was a (temporary, 
perhaps very short) network problem, postfix should recover automatically after 
the problem was resolved.
  
  4)
  Postfix stopped delivering mails.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1519331

Title:
  Postfix cannot resolve DNS if network was unavailable when it was
  started, such as on a laptop

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/postfix/+bug/1519331/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to