[email protected]:
> Everything runs normal as long as the mymilter container is online.
> If I stop mymilter postfix refuses to accept smtp connections with for 
> example the following errors.
..
> As far as I can tell the network-alias gets removed from dockers 
> internal DNS server on container stop which triggers the postfix fatal 
> error.
> However shouldn't a failed DNS request also evoke the default policy of 
> "accept" for this milter?
> Is this a postfix bug or am I missing something? Can I somehow add "DNS 
> not Working" to the "it's Ok"-List for this milter?

I guess Postfix pre-dates containers that come and go at any
point in time. Does this patch work for you?

        Wietse

--- /var/tmp/postfix-3.8-20220403/src/util/inet_connect.c       2021-08-14 
18:32:16.000000000 -0400
+++ src/util/inet_connect.c     2022-04-04 09:54:03.227300357 -0400
@@ -101,9 +101,13 @@
     if ((parse_err = host_port(buf, &host, "localhost", &port, (char *) 0)) != 
0)
        msg_fatal("%s: %s", addr, parse_err);
     if ((aierr = hostname_to_sockaddr(host, port, SOCK_STREAM, &res0)) != 0)
-       msg_fatal("host or service %s not found: %s",
-                 addr, MAI_STRERROR(aierr));
+       msg_warn("host or service %s not found: %s",
+                addr, MAI_STRERROR(aierr));
     myfree(buf);
+    if (aierr) {
+       errno = EADDRNOTAVAIL;                  /* for up-stream "%m" */
+       return (-1);
+    }
 
     proto_info = inet_proto_info();
     for (sock = -1, found = 0, res = res0; res != 0; res = res->ai_next) {

Reply via email to