Wietse Venema:
> [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?
That patch as posted is for recent Postfix versions. Below is a version
that should with Postfix 3.4.
Wietse
--- /var/tmp/postfix-3.8-20220403/src/util/inet_connect.c
+++ src/util/inet_connect.c
@@ -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/service %s/%s not found: %s",
- host, port, 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) {