summaryrefslogtreecommitdiff
path: root/mail
diff options
context:
space:
mode:
authormef <mef>2015-03-15 15:07:47 +0000
committermef <mef>2015-03-15 15:07:47 +0000
commit09ce41f6a762241ab3a36be0a83e4928a067f704 (patch)
tree70a2a4f0bdcacc42372af31aeecbde2ef052332c /mail
parent9408ce0e14ba228fb241fbccd094cb0223609d4c (diff)
downloadpkgsrc-09ce41f6a762241ab3a36be0a83e4928a067f704.tar.gz
(pkgsrc)
- patch-aa was used to edit Makefile. Now it edits Makefile.in instead - patch-a[cefh] are removed, equivalent fix applied - patch-dns.c is added to silent prototype warning (upstream) - Update 1.20 to 1.23 ------------------- 1.23: Feb.17,2015: dns.c, smtp.c: typo fixed: INET6 should be AF_INET6 1.22: Jun.9,2012: smtp.c: logging whole message in multi-lined SMTP response. 1.21: Jun.7,2012: smtp.c, common.h, main.c: '-2' option added to avoid piggybacking among domains. (to support spec change on GoogleApps service) dns.c: definitions of functions with "static" are moved outside to avoid "invalid strage class" errors. *.c, extern.h: log() is renamed to logg() to avoid conflict.
Diffstat (limited to 'mail')
-rw-r--r--mail/smtpfeed/Makefile4
-rw-r--r--mail/smtpfeed/distinfo25
-rw-r--r--mail/smtpfeed/patches/patch-aa12
-rw-r--r--mail/smtpfeed/patches/patch-ac143
-rw-r--r--mail/smtpfeed/patches/patch-ad26
-rw-r--r--mail/smtpfeed/patches/patch-ae1094
-rw-r--r--mail/smtpfeed/patches/patch-af99
-rw-r--r--mail/smtpfeed/patches/patch-ag74
-rw-r--r--mail/smtpfeed/patches/patch-ah25
-rw-r--r--mail/smtpfeed/patches/patch-ai102
-rw-r--r--mail/smtpfeed/patches/patch-al905
-rw-r--r--mail/smtpfeed/patches/patch-am198
-rw-r--r--mail/smtpfeed/patches/patch-dns.c42
13 files changed, 149 insertions, 2600 deletions
diff --git a/mail/smtpfeed/Makefile b/mail/smtpfeed/Makefile
index e403ab4147e..067840f2074 100644
--- a/mail/smtpfeed/Makefile
+++ b/mail/smtpfeed/Makefile
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.36 2012/10/08 12:19:31 asau Exp $
+# $NetBSD: Makefile,v 1.37 2015/03/15 15:07:47 mef Exp $
-DISTNAME= smtpfeed-1.20
+DISTNAME= smtpfeed-1.23
CATEGORIES= mail
MASTER_SITES= ftp://sh.wide.ad.jp/WIDE/free-ware/smtpfeed/
diff --git a/mail/smtpfeed/distinfo b/mail/smtpfeed/distinfo
index 95f1bb5d161..a4d50699c9d 100644
--- a/mail/smtpfeed/distinfo
+++ b/mail/smtpfeed/distinfo
@@ -1,18 +1,15 @@
-$NetBSD: distinfo,v 1.9 2014/09/25 14:14:47 jperkin Exp $
+$NetBSD: distinfo,v 1.10 2015/03/15 15:07:47 mef Exp $
-SHA1 (smtpfeed-1.20.tar.gz) = f055984526865200339557e5fa809f968decbcfd
-RMD160 (smtpfeed-1.20.tar.gz) = aa3c586f2c5b2907caa0d7a50257c4e5273cc25d
-Size (smtpfeed-1.20.tar.gz) = 141144 bytes
-SHA1 (patch-aa) = e0ba34dd816d349ecedbc2a76cef9e70b396c655
-SHA1 (patch-ac) = d5b33823fa1ad9910ec97719f47c4265acf1dccc
-SHA1 (patch-ad) = 4ecd4ae9ba72997ed617158862e8801a9977472a
-SHA1 (patch-ae) = 7e97d0bcfb76221a1b0d4a2264eba8169ce8687c
-SHA1 (patch-af) = 2fd2dfa124a0ab842b739e85998e4b4a32e5eb71
-SHA1 (patch-ag) = a0956209ee563f73f3398d0fc0ee69cb57240cd5
-SHA1 (patch-ah) = d53b829ff765b7d555a6dda743a9496497679aa7
-SHA1 (patch-ai) = 2e29b595c1a946ea68186886a80bd5371b697e4e
+SHA1 (smtpfeed-1.23.tar.gz) = 42b3f7ce55dc9f932de8573477d3497b4670e7b1
+RMD160 (smtpfeed-1.23.tar.gz) = 5411b3a363673052e92fbbc218ac55469cc4b061
+Size (smtpfeed-1.23.tar.gz) = 152178 bytes
+SHA1 (patch-aa) = 32d1850db968c28190346c90653d1fa2f55aebbc
+SHA1 (patch-ad) = 1523e0e55798c3868a48a86218597a785cebe850
+SHA1 (patch-ag) = fdf0caff3d90d0b1de8f0dc558e0410aa08be0f1
+SHA1 (patch-ai) = 915b1b68d081deec4fd68735729a5dd548bfd47c
SHA1 (patch-aj) = f26af3988350e0df29fa7e97ea7c308ac6699125
SHA1 (patch-ak) = 206286eb6872876fc4b67a6ad413229124b8bb80
-SHA1 (patch-al) = 9a4674777b1a7fef6f29c6e5aa1b7e04c1eb2f87
-SHA1 (patch-am) = 63c35492d1cd9f01e9de901b7816e6f5d3e28c91
+SHA1 (patch-al) = d01080e3debb3e2f756a5f33cf20fa6320905d09
+SHA1 (patch-am) = 56241227527f674bc1237bb3ac2c5ffb3f76db37
SHA1 (patch-configure) = 61f92773f797660e7b51f6b70ea88f3f949c5191
+SHA1 (patch-dns.c) = eb72a165e5d00f1e594764e2310e10ca519941aa
diff --git a/mail/smtpfeed/patches/patch-aa b/mail/smtpfeed/patches/patch-aa
index 9c4ef532244..387893e74b9 100644
--- a/mail/smtpfeed/patches/patch-aa
+++ b/mail/smtpfeed/patches/patch-aa
@@ -1,10 +1,14 @@
-$NetBSD: patch-aa,v 1.2 2000/02/22 01:31:26 dmcmahill Exp $
+$NetBSD: patch-aa,v 1.3 2015/03/15 15:07:47 mef Exp $
---- Makefile.in.orig Mon Feb 21 20:24:39 2000
-+++ Makefile.in Mon Feb 21 20:29:43 2000
-@@ -68,5 +68,4 @@
+Don't need backup in DESTDIR
+
+--- Makefile~ 2012-06-08 10:32:25.000000000 +0900
++++ Makefile.in 2015-03-11 13:41:58.000000000 +0900
+@@ -69,7 +69,6 @@ clean:
+ ${RM} -f ${OBJS} ${OBJADDS} ${TARGET}
install:
- -mv -f ${DEST}/${TARGET} ${DEST}/${TARGET}.old
${INSTALL} ${TARGET} ${DEST}
+ gcc2-lint:
diff --git a/mail/smtpfeed/patches/patch-ac b/mail/smtpfeed/patches/patch-ac
deleted file mode 100644
index fc0cd543ceb..00000000000
--- a/mail/smtpfeed/patches/patch-ac
+++ /dev/null
@@ -1,143 +0,0 @@
-$NetBSD: patch-ac,v 1.1 2006/07/23 15:00:41 taca Exp $
-
---- address.c.orig 2002-01-20 23:19:42.000000000 +0900
-+++ address.c
-@@ -42,6 +42,8 @@
- # include "extern.h"
- # include "smtp.h"
-
-+static void dnsstatus P((struct recipient *, int, char *));
-+
- int
- addmyalias(name)
- char *name;
-@@ -58,12 +60,12 @@
- ha = (struct hostalias *)MALLOC(sizeof(struct hostalias));
- if (ha == NULL)
- {
-- log(LOG_NOTICE, "out of memory (addmyalias)");
-+ mylog(LOG_NOTICE, "out of memory (addmyalias)");
- return -1;
- }
- /* bzero(ha, sizeof(struct hostalias)); */
- if (cnf.debug & DEBUG_ADDRESS)
-- log(LOG_DEBUG, "adding alias: %s", name);
-+ mylog(LOG_DEBUG, "adding alias: %s", name);
- len = strlen(name);
- /* strip trailing dot */
- while (len > 0 && name[len-1] == '.')
-@@ -114,7 +116,7 @@
- hostp = (struct host *)MALLOC(sizeof(struct host));
- if (hostp == NULL)
- {
-- log(LOG_NOTICE,
-+ mylog(LOG_NOTICE,
- "out of memory (addinetaddress)");
- return -1;
- }
-@@ -153,7 +155,7 @@
- if (addr == NULL) /* just link from mxp */
- {
- if (cnf.debug & DEBUG_ADDRESS)
-- log(LOG_DEBUG, "address info for %s linked", mxp->name);
-+ mylog(LOG_DEBUG, "address info for %s linked", mxp->name);
- return 0;
- }
-
-@@ -170,13 +172,13 @@
- {
- case AF_INET:
- bcopy(addr, &sin, sizeof(sin));
-- log(LOG_INFO, "got new address %s for %s, state reset",
-+ mylog(LOG_INFO, "got new address %s for %s, state reset",
- inet_ntoa(sin), mxp->name);
- break;
- #if INET6
- case AF_INET6:
- inet_ntop(AF_INET6, addr, buf, sizeof(buf));
-- log(LOG_INFO, "got new address %s for %s, state reset",
-+ mylog(LOG_INFO, "got new address %s for %s, state reset",
- buf, mxp->name);
-
- break;
-@@ -193,19 +195,19 @@
- {
- case AF_INET:
- bcopy(addr, &sin, sizeof(sin));
-- log(LOG_DEBUG, "DNS: registering %s=%s",
-+ mylog(LOG_DEBUG, "DNS: registering %s=%s",
- mxp->name, inet_ntoa(sin));
- break;
- #if INET6
- case AF_INET6:
- inet_ntop(AF_INET6, addr, buf, sizeof(buf));
-- log(LOG_DEBUG, "DNS: registering %s=%s",
-+ mylog(LOG_DEBUG, "DNS: registering %s=%s",
- mxp->name, buf);
-
- break;
- #endif
- default:
-- log(LOG_NOTICE,
-+ mylog(LOG_NOTICE,
- "DNS: invalid inet_domain %d at addinetaddress",
- inet_domain);
- }
-@@ -226,7 +228,7 @@
- iap = (struct inetaddr *)MALLOC(sizeof(struct inetaddr));
- if (iap == NULL)
- {
-- log(LOG_NOTICE, "out of memory (addinetaddress)");
-+ mylog(LOG_NOTICE, "out of memory (addinetaddress)");
- return -1;
- }
- bzero(iap, sizeof(struct inetaddr));
-@@ -235,7 +237,7 @@
- iap->address = (char *)MALLOC(len);
- if (iap->address == NULL)
- {
-- log(LOG_NOTICE, "out of memory (addinetaddress)");
-+ mylog(LOG_NOTICE, "out of memory (addinetaddress)");
- return -1;
- }
- bcopy(addr, iap->address, len);
-@@ -462,12 +464,12 @@
- struct domain *d, **hashp;
-
- if (cnf.debug & DEBUG_LMTP)
-- log(LOG_DEBUG, "RCPT TO: %s notify=%s orcpt=%s", addr,
-+ mylog(LOG_DEBUG, "RCPT TO: %s notify=%s orcpt=%s", addr,
- (notify == NULL)?"":notify, (orcpt == NULL)?"":orcpt);
- rcpt = (struct recipient *)MALLOC(sizeof(struct recipient));
- if (rcpt == NULL)
- {
-- log(LOG_NOTICE, "out of memory (addrecipient)");
-+ mylog(LOG_NOTICE, "out of memory (addrecipient)");
- return -1;
- }
- bzero(rcpt, sizeof(struct recipient));
-@@ -493,7 +495,7 @@
- if (d == NULL)
- {
- if (cnf.debug & DEBUG_LMTP)
-- log(LOG_DEBUG, "new domain: %s", domain);
-+ mylog(LOG_DEBUG, "new domain: %s", domain);
- rcpt->domain = (struct domain *)MALLOC(sizeof(struct domain));
- bzero(rcpt->domain, sizeof(struct domain));
- rcpt->domain->name = newstr(domain);
-@@ -540,13 +542,13 @@
- return 0;
- }
-
--void
-+static void
- dnsstatus(rcpt, rcode, response)
- struct recipient *rcpt;
- int rcode;
- char *response;
- {
-- log(LOG_INFO, "(%d+%d+%d+%d/%d) relay=%s to=%s proto=%s delay=%d code=%d (%s)",
-+ mylog(LOG_INFO, "(%d+%d+%d+%d/%d) relay=%s to=%s proto=%s delay=%d code=%d (%s)",
- sti.nsent, sti.ndeferred, sti.nnsfailed,
- sti.nsmtpfailed, sti.nrcpt, "unknown",
- rcpt->address, "unknown", 0, rcode,
diff --git a/mail/smtpfeed/patches/patch-ad b/mail/smtpfeed/patches/patch-ad
index 427b655f0a2..8a54858b07c 100644
--- a/mail/smtpfeed/patches/patch-ad
+++ b/mail/smtpfeed/patches/patch-ad
@@ -1,8 +1,26 @@
-$NetBSD: patch-ad,v 1.1 2006/07/23 15:00:41 taca Exp $
+$NetBSD: patch-ad,v 1.2 2015/03/15 15:07:47 mef Exp $
---- common.h.orig 2002-01-20 23:20:44.000000000 +0900
-+++ common.h
-@@ -425,3 +425,9 @@
+--- common.h.orig 2012-06-07 14:45:48.000000000 +0900
++++ common.h 2015-03-12 11:27:47.000000000 +0900
+@@ -253,7 +253,7 @@ struct host_map {
+ struct domain {
+ char *name; /* domain part of mail addr */
+ int stat; /* error status for MX query */
+- char *response; /* error response */
++ const char *response; /* error response */
+ struct mx *firstmx; /* first MX */
+ struct mx *curmx; /* working MX */
+ int checked; /* temporary local flag */
+@@ -284,7 +284,7 @@ struct recipient {
+ int stat; /* current status */
+ int result; /* final result */
+ int again; /* try the same MX again */
+- char *response; /* final response */
++ const char *response; /* final response */
+ struct domain *domain; /* domain part */
+ struct host *final;
+ struct recipient *next; /* next recipient */
+@@ -427,3 +427,9 @@ union SockAddrUnion {
#endif
};
typedef union SockAddrUnion SockAddr;
diff --git a/mail/smtpfeed/patches/patch-ae b/mail/smtpfeed/patches/patch-ae
deleted file mode 100644
index 69f42f46be1..00000000000
--- a/mail/smtpfeed/patches/patch-ae
+++ /dev/null
@@ -1,1094 +0,0 @@
-$NetBSD: patch-ae,v 1.2 2012/07/10 09:09:11 mef Exp $
-
-(1) Add some prototype for static functions
-(2) convert log -> mylog
- - log(LOG_DEBUG, "start getting MXRRs with caching");
- + mylog(LOG_DEBUG, "start getting MXRRs with caching");
-
---- dns.c.orig 2003-08-20 14:13:03.000000000 +0900
-+++ dns.c 2012-06-28 18:39:20.000000000 +0900
-@@ -79,6 +79,19 @@
- # define RES_INSECURE1 0x00000400 /* type 1 security disabled */
- #endif
-
-+static int query_domain P((char *, int));
-+static int process_query P((int));
-+static int make_query P((struct dns_stat *, int));
-+#if INET6
-+static int whichserver P((const SockAddr *));
-+#else
-+static int whichserver P((const struct sockaddr_in *));
-+#endif
-+static void got_answer P((struct query_chain *, u_char *, int));
-+static void remove_query P((struct query_chain *));
-+static struct mx* newmx P((char *, int, int, struct domain *, long));
-+static void show_query P((u_char *, u_char *, u_char *));
-+
- int
- pregetmx(dl)
- struct domain *dl;
-@@ -87,7 +100,6 @@
- char **map_arg;
- long stime, etime;
- int n;
-- static int query_domain(), process_query();
- #ifdef INET6
- SockAddr dsin; /* dummy */
- #endif
-@@ -109,7 +121,7 @@
- }
- }
-
-- log(LOG_DEBUG, "start getting MXRRs with caching");
-+ mylog(LOG_DEBUG, "start getting MXRRs with caching");
- n = 0;
- stime = time(NULL);
- if (env.queueid != NULL)
-@@ -120,7 +132,7 @@
- if (cnf.pgateway != NULL)
- {
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "pregetting A of protocol gateway: %s",
-+ mylog(LOG_DEBUG, "pregetting A of protocol gateway: %s",
- cnf.pgateway);
- #ifdef INET6
- if (cnf.inetdom & SMTP_V4)
-@@ -144,7 +156,7 @@
- if (cnf.fallbackmx != NULL)
- {
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "pregetting A of fallbackmx: %s",
-+ mylog(LOG_DEBUG, "pregetting A of fallbackmx: %s",
- cnf.fallbackmx);
- #ifdef INET6
- if (cnf.inetdom & SMTP_V4)
-@@ -185,7 +197,7 @@
- #endif
- {
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG,
-+ mylog(LOG_DEBUG,
- "pregetting A of sourceIP: %s", p);
- #ifdef INET6
- if (cnf.inetdom & SMTP_V4)
-@@ -243,7 +255,7 @@
- || (strcasecmp(*map_arg, "MX?") == 0))
- {
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "pregetting MX: %s", dp->name);
-+ mylog(LOG_DEBUG, "pregetting MX: %s", dp->name);
- if (query_domain(dp->name, T_MX) < 0)
- return -1;
- n++;
-@@ -251,7 +263,7 @@
- else if (strcasecmp(*map_arg, "A") == 0)
- {
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "pregetting A: %s", dp->name);
-+ mylog(LOG_DEBUG, "pregetting A: %s", dp->name);
- #ifdef INET6
- if (cnf.inetdom & SMTP_V4)
- {
-@@ -272,7 +284,7 @@
- else if (**map_arg != '[')
- {
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "pregetting MX: %s", *map_arg);
-+ mylog(LOG_DEBUG, "pregetting MX: %s", *map_arg);
- if (query_domain(*map_arg, T_MX) < 0)
- return -1;
- n++;
-@@ -291,7 +303,7 @@
- goto skip_preget_a;
-
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG,
-+ mylog(LOG_DEBUG,
- "pregetting A of sourceIP: %s",
- (*map_arg) + 1);
- #ifdef INET6
-@@ -333,16 +345,16 @@
- else
- setproctitle("syncing MX: %d", n);
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "syncing responses of MXRRs");
-+ mylog(LOG_DEBUG, "syncing responses of MXRRs");
- if (process_query(1) < 0) /* sync */
- return -1;
- etime = time(NULL);
-- log(LOG_DEBUG, "got MXRRs: %d MXs in %d seconds",
-+ mylog(LOG_DEBUG, "got MXRRs: %d MXs in %d seconds",
- n, etime - stime);
- }
- else
- {
-- log(LOG_DEBUG, "no MXRRs to sync");
-+ mylog(LOG_DEBUG, "no MXRRs to sync");
- }
- return 0;
- }
-@@ -353,7 +365,6 @@
- int type;
- {
- struct dns_stat *qrp, **hashp;
-- static int make_query();
-
- qrp = hash_query_lookup(name, &hashp);
- if (qrp == NULL) {
-@@ -361,7 +372,7 @@
- bzero(qrp, sizeof(struct dns_stat));
- if (qrp == NULL)
- {
-- log(LOG_NOTICE, "out of memory (dns_query)");
-+ mylog(LOG_NOTICE, "out of memory (dns_query)");
- return -1;
- }
- qrp->name = newstr(name);
-@@ -375,7 +386,7 @@
- case T_AAAA:
- break;
- default:
-- log(LOG_NOTICE, "query_domain: unknown query type: %d", type);
-+ mylog(LOG_NOTICE, "query_domain: unknown query type: %d", type);
- return 0;
- }
-
-@@ -396,7 +407,6 @@
- u_char buf[MAXPACKET];
- int n;
- struct query_chain *qchain;
-- static int process_query();
-
- switch (type) {
- case T_MX:
-@@ -419,7 +429,7 @@
- {
- /* already got */
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "ignore request n=%s t=%d",
-+ mylog(LOG_DEBUG, "ignore request n=%s t=%d",
- qrp->name, type);
- return 0;
- }
-@@ -439,18 +449,18 @@
- {
- /* already in processing */
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "skip request n=%s t=%d", qrp->name, type);
-+ mylog(LOG_DEBUG, "skip request n=%s t=%d", qrp->name, type);
- return 0;
- }
-
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "res_mkquery n=%s t=%d", qrp->name, type);
-+ mylog(LOG_DEBUG, "res_mkquery n=%s t=%d", qrp->name, type);
- n = res_mkquery(QUERY, qrp->name, C_IN, type, NULL, 0, NULL,
- buf, sizeof(buf));
- if (n <= 0)
- {
- /* error */
-- log(LOG_NOTICE, "res_mkquery failed for %s type %d",
-+ mylog(LOG_NOTICE, "res_mkquery failed for %s type %d",
- qrp->name, type);
- return -1;
- }
-@@ -459,7 +469,7 @@
- if (qchain == NULL)
- {
- /* error */
-- log(LOG_NOTICE, "out of memory (make_query)");
-+ mylog(LOG_NOTICE, "out of memory (make_query)");
- return -1;
- }
- bzero(qchain, sizeof(struct query_chain));
-@@ -469,7 +479,7 @@
- if (qchain->request == NULL)
- {
- /* error */
-- log(LOG_NOTICE, "out of memory (make_query)");
-+ mylog(LOG_NOTICE, "out of memory (make_query)");
- return -1;
- }
- bcopy(buf, qchain->request, n);
-@@ -492,7 +502,7 @@
- qchain->prev = NULL;
- query_chain_count++;
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "DNS: query concurrency = %d", query_chain_count);
-+ mylog(LOG_DEBUG, "DNS: query concurrency = %d", query_chain_count);
- if (sti.maxcquery < query_chain_count)
- sti.maxcquery = query_chain_count;
-
-@@ -501,10 +511,10 @@
- {
- struct query_chain *qcp;
-
-- log(LOG_DEBUG, "Chain after linked:");
-+ mylog(LOG_DEBUG, "Chain after linked:");
- for (qcp = QueryChain; qcp != NULL; qcp = qcp->next)
- {
-- log(LOG_DEBUG, " %s", qcp->stat->name);
-+ mylog(LOG_DEBUG, " %s", qcp->stat->name);
- }
- }
- #endif
-@@ -514,7 +524,7 @@
- return 0;
- }
-
--int
-+static int
- whichserver(inp)
- #if INET6
- const SockAddr *inp;
-@@ -591,14 +601,12 @@
- char nbuf[MAXDNAME+1];
- struct dns_stat *qrp;
- int pending;
-- static void got_answer();
-- static void remove_query();
-
- if (sync == 0 && cnf.cquery_max != 0
- && query_chain_count >= cnf.cquery_max)
- {
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "reached to max concurrency (%d)....syncing",
-+ mylog(LOG_DEBUG, "reached to max concurrency (%d)....syncing",
- query_chain_count);
- sync = -1;
- }
-@@ -612,7 +620,7 @@
- s = socket(AF_INET, SOCK_DGRAM, PF_UNSPEC);
- if (s < 0) {
- /* error */
-- log(LOG_NOTICE,
-+ mylog(LOG_NOTICE,
- "socket failed (process_query)");
- return -1;
- }
-@@ -622,7 +630,7 @@
- s6 = socket(AF_INET6, SOCK_DGRAM, PF_UNSPEC);
- if (s6 < 0) {
- /* error */
-- log(LOG_NOTICE,
-+ mylog(LOG_NOTICE,
- "socket(INET6) failed (process_query)");
- return -1;
- }
-@@ -633,7 +641,7 @@
- s = socket(AF_INET, SOCK_DGRAM, PF_UNSPEC);
- if (s < 0) {
- /* error */
-- log(LOG_NOTICE, "socket failed (process_query)");
-+ mylog(LOG_NOTICE, "socket failed (process_query)");
- return -1;
- }
- }
-@@ -663,14 +671,14 @@
- nextqcp = qcp->next;
- remove_query(qcp);
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "DNS: no valid ns, removing %s type %d",
-+ mylog(LOG_DEBUG, "DNS: no valid ns, removing %s type %d",
- qcp->stat->name, qcp->type);
- qcp = nextqcp;
- continue;
- }
- qcp->try++;
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "DNS: retry count=%d", qcp->try);
-+ mylog(LOG_DEBUG, "DNS: retry count=%d", qcp->try);
- }
- }
- if (qcp->try >= (u_char)_res.retry)
-@@ -680,7 +688,7 @@
- nextqcp = qcp->next;
- remove_query(qcp);
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "DNS: no valid ns, removing %s type %d",
-+ mylog(LOG_DEBUG, "DNS: no valid ns, removing %s type %d",
- qcp->stat->name, qcp->type);
- qcp = nextqcp;
- continue;
-@@ -689,7 +697,7 @@
- {
- itvl = _res.retrans << qcp->try;
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "DNS: waiting %d sec.", itvl);
-+ mylog(LOG_DEBUG, "DNS: waiting %d sec.", itvl);
- if (qcp->try > 0)
- itvl /= _res.nscount;
- if (itvl <= 0)
-@@ -700,7 +708,7 @@
- if (nsap->in.sin_family == AF_INET)
- {
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "send query n=%s t=%d (s=%s)",
-+ mylog(LOG_DEBUG, "send query n=%s t=%d (s=%s)",
- qcp->stat->name, qcp->type,
- inet_ntoa(nsap->in.sin_addr));
-
-@@ -711,7 +719,7 @@
- {
- qcp->badns |= 1<<qcp->ns;
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "sendto failed: invalid ns (%s)", strerror(errno));
-+ mylog(LOG_DEBUG, "sendto failed: invalid ns (%s)", strerror(errno));
- }
- }
- if (nsap->in6.sin6_family == AF_INET6)
-@@ -722,7 +730,7 @@
- {
- inet_ntop(AF_INET6, &nsap->in6.sin6_addr,
- buf, sizeof(buf));
-- log(LOG_DEBUG, "send query n=%s t=%d (s=%s)",
-+ mylog(LOG_DEBUG, "send query n=%s t=%d (s=%s)",
- qcp->stat->name, qcp->type, buf);
- }
-
-@@ -733,13 +741,13 @@
- {
- qcp->badns |= 1<<qcp->ns;
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "sendto failed: invalid ns (%s)", strerror(errno));
-+ mylog(LOG_DEBUG, "sendto failed: invalid ns (%s)", strerror(errno));
- }
- }
- #else
- nsap = &NSADDR_LIST(qcp->ns);
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "send query n=%s t=%d (s=%s)",
-+ mylog(LOG_DEBUG, "send query n=%s t=%d (s=%s)",
- qcp->stat->name, qcp->type,
- inet_ntoa(nsap->sin_addr));
-
-@@ -749,7 +757,7 @@
- {
- qcp->badns |= 1<<qcp->ns;
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "sendto failed: invalid ns");
-+ mylog(LOG_DEBUG, "sendto failed: invalid ns");
- }
- #endif
- sti.nqueries++;
-@@ -793,7 +801,7 @@
- timeout.tv_usec = 0;
- }
- if ((cnf.debug & DEBUG_DNS) && (timeout.tv_sec > 0))
-- log(LOG_DEBUG, "DNS: waiting %d sec in %s mode",
-+ mylog(LOG_DEBUG, "DNS: waiting %d sec in %s mode",
- timeout.tv_sec, sync?"sync":"nosync");
- FD_ZERO(&dsmask);
- #if INET6
-@@ -825,7 +833,7 @@
- resplen = recvfrom(s, &answer, anssiz, 0,
- (struct sockaddr *)&from, &fromlen);
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "DNS: got answer from %s",
-+ mylog(LOG_DEBUG, "DNS: got answer from %s",
- inet_ntoa(from.in.sin_addr));
- }
- else if (s6 >= 0 && FD_ISSET(s6, &dsmask))
-@@ -838,7 +846,7 @@
- {
- inet_ntop(AF_INET6, &from.in6.sin6_addr,
- buf, sizeof(buf));
-- log(LOG_DEBUG,
-+ mylog(LOG_DEBUG,
- "DNS: got answer from %s", buf);
- }
- }
-@@ -846,19 +854,20 @@
- resplen = recvfrom(s, &answer, anssiz, 0,
- (struct sockaddr *)&from, &fromlen);
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "DNS: got answer from %s",
-+ mylog(LOG_DEBUG, "DNS: got answer from %s",
- inet_ntoa(from.sin_addr));
- #endif
-
- if (0) {
- show_query("DNS: answer received",
-- &answer, &answer+resplen);
-+ (u_char *)&answer,
-+ (u_char *)&answer+resplen);
- }
- now = time(NULL);
-
- if (resplen <= 0) {
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "DNS: bad anssiz %d",
-+ mylog(LOG_DEBUG, "DNS: bad anssiz %d",
- resplen);
- continue; /* error */
- }
-@@ -870,7 +879,7 @@
- if (!(_res.options & RES_INSECURE1))
- {
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG,
-+ mylog(LOG_DEBUG,
- "DNS: not from our server");
- continue;
- }
-@@ -888,14 +897,15 @@
- GETSHORT(class, ap);
-
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "DNS: got answer for %s type %d",
-+ mylog(LOG_DEBUG, "DNS: got answer for %s type %d",
- nbuf, type);
-
- qrp = hash_query_lookup(nbuf, NULL);
- if (qrp == NULL)
- {
- show_query("DNS: no associated query sent",
-- &answer, &answer+resplen);
-+ (u_char *)&answer,
-+ (u_char *)&answer+resplen);
- continue; /* no associated request */
- }
- qcp = qrp->requests;
-@@ -904,7 +914,8 @@
- if (qcp == NULL)
- {
- show_query("DNS: no associated query",
-- &answer, &answer+resplen);
-+ (u_char *)&answer,
-+ (u_char *)&answer+resplen);
- continue; /* no associated request */
- }
-
-@@ -915,7 +926,7 @@
- {
- qcp->badns |= (1<<ns);
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "DNS: badnsF rcode=%d %x/%x",
-+ mylog(LOG_DEBUG, "DNS: badnsF rcode=%d %x/%x",
- hp->rcode,
- qcp->badns, (1<<_res.nscount)-1);
- if (qcp->badns != (1<<_res.nscount)-1)
-@@ -924,7 +935,7 @@
- qrp->rr_timeout |= qcp->need;
- remove_query(qcp);
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "DNS: TCP requested, removing %s type %d",
-+ mylog(LOG_DEBUG, "DNS: TCP requested, removing %s type %d",
- qcp->stat->name, qcp->type);
- continue;
- }
-@@ -933,7 +944,7 @@
- qrp->rr_timeout |= qcp->need;
- remove_query(qcp);
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "DNS: TCP requested, removing %s type %d",
-+ mylog(LOG_DEBUG, "DNS: TCP requested, removing %s type %d",
- qcp->stat->name, qcp->type);
- continue;
- }
-@@ -952,7 +963,7 @@
- if (sync != 0) {
- pending = 0;
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "DNS: sync: get nearest timeout from %d", now);
-+ mylog(LOG_DEBUG, "DNS: sync: get nearest timeout from %d", now);
- for (qcp = QueryChain; qcp != NULL;)
- {
- if (qcp->try >= (u_char)_res.retry)
-@@ -962,7 +973,7 @@
- nextqcp = qcp->next;
- remove_query(qcp);
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "DNS: sync timeout (n=%s, t=%d)",
-+ mylog(LOG_DEBUG, "DNS: sync timeout (n=%s, t=%d)",
- qcp->stat->name, qcp->type);
- qcp = nextqcp;
- continue;
-@@ -970,7 +981,7 @@
-
- pending++;
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "DNS: event timeout=%d", qcp->time);
-+ mylog(LOG_DEBUG, "DNS: event timeout=%d", qcp->time);
- qcp = qcp->next;
- }
- if (sync < 0)
-@@ -978,7 +989,7 @@
- if (pending)
- {
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "DNS: retry in sync mode");
-+ mylog(LOG_DEBUG, "DNS: retry in sync mode");
- /* sleep(1); * XXX */
- goto again;
- }
-@@ -989,12 +1000,12 @@
- nextqcp = qcp->next;
- remove_query(qcp);
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "DNS: final timeout (n=%s, t=%d)",
-+ mylog(LOG_DEBUG, "DNS: final timeout (n=%s, t=%d)",
- qcp->stat->name, qcp->type);
- qcp = nextqcp;
- }
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "DNS: closing socket");
-+ mylog(LOG_DEBUG, "DNS: closing socket");
- #if INET6
- if (s >= 0)
- {
-@@ -1038,10 +1049,10 @@
- #if 0
- if (cnf.debug & DEBUG_DNS)
- {
-- log(LOG_DEBUG, "Chain after removed:");
-+ mylog(LOG_DEBUG, "Chain after removed:");
- for (qcp = QueryChain; qcp != NULL; qcp = qcp->next)
- {
-- log(LOG_DEBUG, " %s", qcp->stat->name);
-+ mylog(LOG_DEBUG, " %s", qcp->stat->name);
- }
- }
- #endif
-@@ -1069,7 +1080,7 @@
- #endif
-
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "DNS: got answer, removing %s type %d",
-+ mylog(LOG_DEBUG, "DNS: got answer, removing %s type %d",
- qcp->stat->name, qcp->type);
-
- b = (u_char *) answer;
-@@ -1080,7 +1091,7 @@
- if (hp->aa == 0 && hp->ra == 0) {
- /* this nameserver does not support recursion */
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "non recursive ns=%d", qcp->ns);
-+ mylog(LOG_DEBUG, "non recursive ns=%d", qcp->ns);
- qcp->badns |= 1<<qcp->ns;
- return; /* keep waiting for a reply from other NS */
- }
-@@ -1098,7 +1109,7 @@
- {
- /* host not found */
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "DNS: host (any other data) not found");
-+ mylog(LOG_DEBUG, "DNS: host (any other data) not found");
-
- qcp->stat->rr_noex = RR_ALL;
- return;
-@@ -1109,7 +1120,7 @@
- {
- /* no data, other data exist */
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "DNS: no data for %d", qcp->type);
-+ mylog(LOG_DEBUG, "DNS: no data for %d", qcp->type);
-
- if (qcp->type == T_ANY)
- {
-@@ -1153,7 +1164,7 @@
- }
-
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "DNS: valid data");
-+ mylog(LOG_DEBUG, "DNS: valid data");
-
- while (qdcount--)
- {
-@@ -1161,7 +1172,7 @@
- ap += n;
- if (ap + INT16SZ*2 > eom)
- {
-- /* log(LOG_NOTICE, "corrupt DNS answer"); */
-+ /* mylog(LOG_NOTICE, "corrupt DNS answer"); */
- return;
- }
- GETSHORT(type, ap);
-@@ -1181,7 +1192,7 @@
- ap += n;
- if (ap + INT16SZ*3 + INT32SZ > eom)
- {
-- /* log(LOG_NOTICE, "corrupt DNS answer"); */
-+ /* mylog(LOG_NOTICE, "corrupt DNS answer"); */
- return;
- }
- GETSHORT(type, ap);
-@@ -1190,13 +1201,13 @@
- GETSHORT(n, ap);
- if (ap + n > eom)
- {
-- /* log(LOG_NOTICE, "corrupt DNS answer"); */
-+ /* mylog(LOG_NOTICE, "corrupt DNS answer"); */
- return;
- }
- if (class != C_IN)
- {
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "DNS: unexpected class %d in an", class);
-+ mylog(LOG_DEBUG, "DNS: unexpected class %d in an", class);
- ap += n;
- continue;
- }
-@@ -1230,7 +1241,7 @@
- return;
-
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "DNS: got MX for %s, %s p=%d",
-+ mylog(LOG_DEBUG, "DNS: got MX for %s, %s p=%d",
- nbuf, nbuf2, pref);
-
- qrp->rr_got |= RR_MX;
-@@ -1269,7 +1280,7 @@
- {
- addr_found = 1;
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "DNS: got AAAA for %s",
-+ mylog(LOG_DEBUG, "DNS: got AAAA for %s",
- qcp->stat->name);
-
- qcp->stat->rr_got |= RR_AAAA;
-@@ -1279,7 +1290,7 @@
- /* may be address for an alias */
- cname_found = 0;
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "DNS: got aliased (%s) AAAA for %s",
-+ mylog(LOG_DEBUG, "DNS: got aliased (%s) AAAA for %s",
- nbuf, qcp->stat->name);
- qrp = hash_query_lookup(nbuf, NULL);
- if (qrp == NULL)
-@@ -1310,7 +1321,7 @@
- {
- addr_found = 1;
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "DNS: got A for %s",
-+ mylog(LOG_DEBUG, "DNS: got A for %s",
- qcp->stat->name);
-
- qcp->stat->rr_got |= RR_A;
-@@ -1320,7 +1331,7 @@
- cname_found = 0;
- /* may be address for an alias */
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "DNS: got aliased (%s) A for %s",
-+ mylog(LOG_DEBUG, "DNS: got aliased (%s) A for %s",
- nbuf, qcp->stat->name);
- qrp = hash_query_lookup(nbuf, NULL);
- if (qrp == NULL)
-@@ -1343,13 +1354,13 @@
- return;
-
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "DNS: got CNAME %s for %s",
-+ mylog(LOG_DEBUG, "DNS: got CNAME %s for %s",
- nbuf2, nbuf);
-
- if (strcasecmp(nbuf, nbuf2) == 0)
- {
- /* CNAME points back itself, ignore it */
-- log(LOG_INFO,
-+ mylog(LOG_INFO,
- "CNAME %s points back itself (q=%d)",
- nbuf, qcp->type);
- return;
-@@ -1377,7 +1388,7 @@
- bzero(qrp2, sizeof(struct dns_stat));
- if (qrp2 == NULL)
- {
-- log(LOG_NOTICE,
-+ mylog(LOG_NOTICE,
- "out of memory (dns_query)");
- return;
- }
-@@ -1442,13 +1453,13 @@
- ap += INT16SZ + INT16SZ + INT32SZ;
- if (ap + INT16SZ > eom)
- {
-- /* log(LOG_NOTICE, "corrupt DNS answer"); */
-+ /* mylog(LOG_NOTICE, "corrupt DNS answer"); */
- return;
- }
- GETSHORT(n, ap);
- if (ap + n > eom)
- {
-- /* log(LOG_NOTICE, "corrupt DNS answer"); */
-+ /* mylog(LOG_NOTICE, "corrupt DNS answer"); */
- return;
- }
- ap += n;
-@@ -1461,13 +1472,13 @@
- ap += INT16SZ + INT16SZ + INT32SZ;
- if (ap + INT16SZ > eom)
- {
-- /* log(LOG_NOTICE, "corrupt DNS answer"); */
-+ /* mylog(LOG_NOTICE, "corrupt DNS answer"); */
- return;
- }
- GETSHORT(n, ap);
- if (ap + n > eom)
- {
-- /* log(LOG_NOTICE, "corrupt DNS answer"); */
-+ /* mylog(LOG_NOTICE, "corrupt DNS answer"); */
- return;
- }
- ap += n;
-@@ -1482,7 +1493,7 @@
- ap += n;
- if (ap + INT16SZ*3 + INT32SZ > eom)
- {
-- /* log(LOG_NOTICE, "corrupt DNS answer"); */
-+ /* mylog(LOG_NOTICE, "corrupt DNS answer"); */
- return;
- }
- GETSHORT(type, ap);
-@@ -1491,13 +1502,13 @@
- GETSHORT(addrsize, ap);
- if (ap + addrsize > eom)
- {
-- /* log(LOG_NOTICE, "corrupt DNS answer"); */
-+ /* mylog(LOG_NOTICE, "corrupt DNS answer"); */
- return;
- }
- if (class != C_IN)
- {
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "DNS: unexpected class %d in ar", class);
-+ mylog(LOG_DEBUG, "DNS: unexpected class %d in ar", class);
- ap += addrsize;
- continue;
- }
-@@ -1530,7 +1541,7 @@
- }
-
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "DNS: got additional Address RR for %s type=%d",
-+ mylog(LOG_DEBUG, "DNS: got additional Address RR for %s type=%d",
- nbuf, type);
-
- #if FAKE_AR_CHECK
-@@ -1546,7 +1557,7 @@
- if (!found)
- {
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "DNS: ignoring additional Address RR");
-+ mylog(LOG_DEBUG, "DNS: ignoring additional Address RR");
- ap += addrsize;
- continue;
- }
-@@ -1559,7 +1570,7 @@
- bzero(qrp, sizeof(struct dns_stat));
- if (qrp == NULL)
- {
-- log(LOG_NOTICE, "out of memory (dns_query)");
-+ mylog(LOG_NOTICE, "out of memory (dns_query)");
- return;
- }
- qrp->name = newstr(nbuf);
-@@ -1593,7 +1604,7 @@
- bzero(qrp, sizeof(struct dns_stat));
- if (qrp == NULL)
- {
-- log(LOG_NOTICE,
-+ mylog(LOG_NOTICE,
- "out of memory (dns_query)");
- return;
- }
-@@ -1606,20 +1617,20 @@
- if (cnf.inetdom & SMTP_V6 || cnf.v4v6fallback)
- {
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "DNS: getting AAAA RR for %s",
-+ mylog(LOG_DEBUG, "DNS: getting AAAA RR for %s",
- mxp->name);
- make_query(qrp, T_AAAA);
- }
- if (cnf.inetdom & SMTP_V4 || cnf.v4v6fallback)
- {
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "DNS: getting A RR for %s",
-+ mylog(LOG_DEBUG, "DNS: getting A RR for %s",
- mxp->name);
- make_query(qrp, T_A);
- }
- #else
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "DNS: getting A RR for %s",
-+ mylog(LOG_DEBUG, "DNS: getting A RR for %s",
- mxp->name);
- make_query(qrp, T_A);
- if (cnf.v4v6fallback)
-@@ -1654,7 +1665,7 @@
- continue;
-
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "getting MX for %s", dp->name);
-+ mylog(LOG_DEBUG, "getting MX for %s", dp->name);
-
- offset = 0;
- needfindaddr = 0;
-@@ -1702,15 +1713,15 @@
- {
- struct mx *mxp;
-
-- log(LOG_DEBUG, "final MX list for %s", dp->name);
-+ mylog(LOG_DEBUG, "final MX list for %s", dp->name);
- mxp = dp->firstmx;
- if (mxp == NULL)
- {
-- log(LOG_DEBUG, " NO MX!");
-+ mylog(LOG_DEBUG, " NO MX!");
- }
- while (mxp != NULL)
- {
-- log(LOG_DEBUG, " %s(%d, %d)", mxp->name,
-+ mylog(LOG_DEBUG, " %s(%d, %d)", mxp->name,
- mxp->pref, mxp->weight);
- mxp = mxp->next;
- }
-@@ -1734,12 +1745,12 @@
- int found = 0;
-
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "protocol gateway checking for %s",
-+ mylog(LOG_DEBUG, "protocol gateway checking for %s",
- dp->name);
- for (mxp = dp->firstmx; mxp != NULL; mxp = mxp->next)
- {
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "checking MX: %s", mxp->name);
-+ mylog(LOG_DEBUG, "checking MX: %s", mxp->name);
- if (mxp->host == NULL)
- {
- /* no hosts, try next MX */
-@@ -1751,7 +1762,7 @@
- {
- /*
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "proto: %d",
-+ mylog(LOG_DEBUG, "proto: %d",
- addrp->domain);
- */
- #ifdef INET6
-@@ -1764,10 +1775,9 @@
- #endif
- {
- struct mx *gwmxp;
-- static struct mx* newmx();
-
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "setting protocol gateway as first MX");
-+ mylog(LOG_DEBUG, "setting protocol gateway as first MX");
- if ((gwmxp = newmx(cnf.pgateway,
- -2, 0, dp, 0))
- == NULL)
-@@ -1818,7 +1828,7 @@
- if (mxpp == NULL)
- {
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "linking MX %s(%d) at the top",
-+ mylog(LOG_DEBUG, "linking MX %s(%d) at the top",
- newmxp->name, newmxp->pref);
-
- domp->firstmx = newmxp;
-@@ -1826,7 +1836,7 @@
- else
- {
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "linking MX %s(%d) after MX %s(%d)",
-+ mylog(LOG_DEBUG, "linking MX %s(%d) after MX %s(%d)",
- newmxp->name, newmxp->pref,
- mxpp->name, mxpp->pref);
-
-@@ -1857,14 +1867,14 @@
- {
- /* already registered, drop lower one */
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "duplicated MX %s(%d) found",
-+ mylog(LOG_DEBUG, "duplicated MX %s(%d) found",
- mxp->name, mxp->pref);
-
- if (mxp->pref > pref
- || (mxp->pref == pref && mxp->weight > weight))
- {
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "remove it and reuse");
-+ mylog(LOG_DEBUG, "remove it and reuse");
-
- if (mxp == dp->firstmx)
- dp->firstmx = mxp->next;
-@@ -1874,7 +1884,7 @@
- else
- {
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "leave it and ignore newer");
-+ mylog(LOG_DEBUG, "leave it and ignore newer");
-
- return mxp; /* do nothing */
- }
-@@ -1886,7 +1896,7 @@
- mxp = (struct mx*)MALLOC(sizeof(struct mx));
- if (mxp == NULL)
- {
-- log(LOG_NOTICE, "out of memory (newmx)");
-+ mylog(LOG_NOTICE, "out of memory (newmx)");
- return NULL;
- }
- bzero(mxp, sizeof(struct mx));
-@@ -1923,7 +1933,7 @@
- char msgbuf[MAXLINE], *mxname;
-
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "getmxrr(%s, %s) offset=%d opt=%x",
-+ mylog(LOG_DEBUG, "getmxrr(%s, %s) offset=%d opt=%x",
- name, dp->name, offset, opt);
-
- if (!query_mx)
-@@ -1962,7 +1972,7 @@
- if (mxp == NULL)
- return -1;
- addinetaddress(mxp, AF_INET, sizeof(nsin.in.sin_addr),
-- &nsin.in.sin_addr);
-+ (u_char *)&nsin.in.sin_addr);
- }
- #ifdef INET6
- else if (inet_pton(INET6, name + 1, &nsin.in6.sin6_addr) > 0)
-@@ -1974,7 +1984,7 @@
- return -1;
- addinetaddress(mxp, AF_INET6,
- sizeof(nsin.in6.sin6_addr),
-- &nsin.in6.sin6_addr);
-+ (u_char *)&nsin.in6.sin6_addr);
- }
- #endif
- else
-@@ -2000,7 +2010,7 @@
- qrp = qrp->cname;
-
- if (cnf.debug & DEBUG_DNS && cnamechain > 0)
-- log(LOG_DEBUG, "CNAME traced: %s", qrp->name);
-+ mylog(LOG_DEBUG, "CNAME traced: %s", qrp->name);
-
- if (cnamechain >= CNAMELOOPMAX)
- {
-@@ -2010,7 +2020,7 @@
- }
-
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "%s: timeout=%x noex=%x got=%x",
-+ mylog(LOG_DEBUG, "%s: timeout=%x noex=%x got=%x",
- qrp->name, qrp->rr_timeout, qrp->rr_noex, qrp->rr_got);
-
- if (qrp == NULL || qrp->rr_timeout & RR_MX) {
-@@ -2045,7 +2055,7 @@
- return -1;
- }
- else
-- log(LOG_INFO, "No MX/A on %s for %s; ignored",
-+ mylog(LOG_INFO, "No MX/A on %s for %s; ignored",
- name, dp->name);
- return 0;
- }
-@@ -2090,12 +2100,12 @@
- mxname = cmxp->name;
- #if 0
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "mx=%s pref=%d", mxname, cmxp->pref);
-+ mylog(LOG_DEBUG, "mx=%s pref=%d", mxname, cmxp->pref);
- #endif
- if (isamyalias(mxname))
- {
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "found localhost (%s) in MX list",
-+ mylog(LOG_DEBUG, "found localhost (%s) in MX list",
- mxname);
- if (!seenlocal || cmxp->pref < localpref)
- localpref = cmxp->pref;
-@@ -2137,13 +2147,13 @@
- /* already registered, drop lower one */
-
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "duplicated MX %s(%d) found",
-+ mylog(LOG_DEBUG, "duplicated MX %s(%d) found",
- mxp->name, mxp->pref);
-
- if (mxp->pref > offset + cmxp->pref)
- {
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "remove it for re-link");
-+ mylog(LOG_DEBUG, "remove it for re-link");
- mxp->pref = offset + cmxp->pref;
- if (mxp == dp->firstmx)
- dp->firstmx = mxp->next;
-@@ -2221,6 +2231,7 @@
- return 0;
- }
-
-+static void
- show_query(t, b, e)
- u_char *t, *b, *e;
- {
-@@ -2247,13 +2258,13 @@
- ap += n;
- if (ap + INT16SZ*2 > eom)
- {
-- /* log(LOG_NOTICE, "corrupt DNS answer"); */
-+ /* mylog(LOG_NOTICE, "corrupt DNS answer"); */
- return;
- }
- GETSHORT(class, ap);
- GETSHORT(type, ap);
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "%s: %s(%d,%d), rcode=%d",
-+ mylog(LOG_DEBUG, "%s: %s(%d,%d), rcode=%d",
- t, nbuf, class, type, ntohs(hp->rcode));
- }
-
-@@ -2268,7 +2279,7 @@
- ap += n;
- if (ap + INT16SZ*3 + INT32SZ > eom)
- {
-- /* log(LOG_NOTICE, "corrupt DNS answer"); */
-+ /* mylog(LOG_NOTICE, "corrupt DNS answer"); */
- return;
- }
- GETSHORT(class, ap);
-@@ -2277,13 +2288,13 @@
- GETSHORT(n, ap);
- if (ap + n > eom)
- {
-- /* log(LOG_NOTICE, "corrupt DNS answer"); */
-+ /* mylog(LOG_NOTICE, "corrupt DNS answer"); */
- return;
- }
- if (class != C_IN)
- {
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "DNS: unexpected class %d in an", class);
-+ mylog(LOG_DEBUG, "DNS: unexpected class %d in an", class);
- ap += n;
- continue;
- }
-@@ -2294,20 +2305,20 @@
- break;
- ap += n;
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "got MX pref=%d,host=(%s)", pref, nbuf);
-+ mylog(LOG_DEBUG, "got MX pref=%d,host=(%s)", pref, nbuf);
- #if 0 /* for debug */
- hep = gethostbyname(nbuf);
- if (hep == NULL) {
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "get A -- h_errno=%d", h_errno);
-+ mylog(LOG_DEBUG, "get A -- h_errno=%d", h_errno);
- } else {
- if (cnf.debug & DEBUG_DNS)
-- log(LOG_DEBUG, "get A -- OK");
-+ mylog(LOG_DEBUG, "get A -- OK");
- }
- #endif
- } else {
- ap += n;
-- /* log(LOG_DEBUG, "unexpected answer type: %d", type); */
-+ /* mylog(LOG_DEBUG, "unexpected answer type: %d", type); */
- }
- }
- }
diff --git a/mail/smtpfeed/patches/patch-af b/mail/smtpfeed/patches/patch-af
deleted file mode 100644
index 03f4394a1f9..00000000000
--- a/mail/smtpfeed/patches/patch-af
+++ /dev/null
@@ -1,99 +0,0 @@
-$NetBSD: patch-af,v 1.1 2006/07/23 15:00:41 taca Exp $
-
---- extern.h.orig 2002-01-20 23:20:46.000000000 +0900
-+++ extern.h 2006-07-18 13:14:05.000000000 +0900
-@@ -37,52 +37,55 @@
- */
-
--char *newstr();
--void strlower();
--char *parse_address();
--void setsender();
--int addrecipient();
--void addalias();
--int getmxrr();
--void init_log();
--int addmyalias();
--int isamyalias();
--void lmtp();
--void lmtp_data_response();
--void deliver();
--int pregetmx();
--int getmxlist();
--void finalstatus();
--int addinetaddress();
--void set_timeout();
--void resource_usage();
-+#ifdef __STDC__
-+#define P(c) c
-+#else
-+#define P(c)
-+#endif
-+
-+char *newstr P((char *));
-+void strlower P((char *));
-+char *parse_address P((char *, char **, char **, char **));
-+int addrecipient P((char *, char *, char *, char *));
-+int getmxrr P((char *, struct domain *, int, int, int, long));
-+void init_log P((void));
-+int addmyalias P((char *));
-+int isamyalias P((char *));
-+void lmtp P((void));
-+void lmtp_data_response P((int));
-+void deliver P((void));
-+int pregetmx P((struct domain *));
-+int getmxlist P((struct domain *));
-+void finalstatus P((void));
-+int addinetaddress P((struct mx *, int, int, u_char *));
-+void set_timeout P((char *));
-+void resource_usage P((char *));
- struct dns_stat *hash_query_lookup();
--struct domain *hash_domain_lookup();
--struct host *hash_host_lookup();
--struct host_map *hash_map_lookup();
--int host_map_load();
--char **host_map_lookup();
--int mxrand();
--int hash_domain_rcpts_lookup();
--void hash_domain_rcpts_enter();
--int isnumeric();
--int rcpts_def_load();
-+struct domain *hash_domain_lookup P((char *, struct domain ***));
-+struct host *hash_host_lookup P((char *, struct host ***));
-+struct host_map *hash_map_lookup P((char *, struct host_map ***));
-+int host_map_load P((void));
-+char **host_map_lookup P((char *));
-+int mxrand P((char *, char *));
-+int hash_domain_rcpts_lookup P((char *));
-+void hash_domain_rcpts_enter P((char *, struct domain_rcpts *));
-+int isnumeric P((char *));
-+int rcpts_def_load P((void));
-+
-+#if SPT_TYPE != SPT_BUILTIN
-+void initsetproctitle P((int, char **, char **));
-+void setproctitle P((const char *, ...));
-+#endif
-
--void initsetproctitle();
- #ifdef JAZ_HACK2
- void show_cache();
- #endif
--# ifdef __STDC__
--void log(int, const char *, ...);
--void setproctitle(const char *, ...);
--# else
--void log();
--void setproctitle();
--# endif
-+
-+void mylog P((int, const char *, ...));
-
- # if !HAVE_STRERROR
--char *strerror();
-+char *strerror P((int));
- # endif
- # if !HAVE_SNPRINTF
--int snprintf();
-+int snprintf P((char *, size_t, const char *, ...));
- # endif
-
diff --git a/mail/smtpfeed/patches/patch-ag b/mail/smtpfeed/patches/patch-ag
index 0d5364abf3e..a04aacbc61a 100644
--- a/mail/smtpfeed/patches/patch-ag
+++ b/mail/smtpfeed/patches/patch-ag
@@ -1,4 +1,4 @@
-$NetBSD: patch-ag,v 1.1 2006/07/23 15:00:41 taca Exp $
+$NetBSD: patch-ag,v 1.2 2015/03/15 15:07:47 mef Exp $
--- lmtp.c.orig 2002-01-20 23:19:42.000000000 +0900
+++ lmtp.c
@@ -26,75 +26,3 @@ $NetBSD: patch-ag,v 1.1 2006/07/23 15:00:41 taca Exp $
{
exit(EX_TEMPFAIL);
}
-@@ -116,7 +130,7 @@
- if (strcasecmp(lmtpbuf, cmdp->cmd) == 0) {
-
- if (cnf.debug & DEBUG_LMTP)
-- log(LOG_DEBUG, "LMTP input: %s %s", lmtpbuf,
-+ mylog(LOG_DEBUG, "LMTP input: %s %s", lmtpbuf,
- (p == NULL)?"":p);
- ret = (*cmdp->func)(p);
- fflush (LmtpOut);
-@@ -242,7 +256,7 @@
- return 0;
- }
- if (cnf.debug & DEBUG_LMTP)
-- log(LOG_DEBUG, "MAIL FROM: %s size=%s body=%s envid=%s ret=%s", addr,
-+ mylog(LOG_DEBUG, "MAIL FROM: %s size=%s body=%s envid=%s ret=%s", addr,
- (env.size == NULL)?"":env.size, (env.body == NULL)?"":env.body,
- (env.envid == NULL)?"":env.envid, (env.ret == NULL)?"":env.ret);
- fprintf (LmtpOut, "250 %s Sender ok\n", addr);
-@@ -358,7 +372,7 @@
- deliver(); /* delivery with SMTP */
- lmtp_data_response(1);
-
-- log(LOG_INFO, "nquery=%d/%d nconnect=%d/%d ntimeout=%d ntrans=%d/%d nsent=%d/%d ndeferred=%d nerror=%d+%d dnsmaxcq=%d maxsock=%d tmx=%d tdelivery=%d/%d maxdelay=%d tdelay=%d tsendmail=%d dns_i/o=%d/%d smtp_i/o=%d/%d mem=%d",
-+ mylog(LOG_INFO, "nquery=%d/%d nconnect=%d/%d ntimeout=%d ntrans=%d/%d nsent=%d/%d ndeferred=%d nerror=%d+%d dnsmaxcq=%d maxsock=%d tmx=%d tdelivery=%d/%d maxdelay=%d tdelay=%d tsendmail=%d dns_i/o=%d/%d smtp_i/o=%d/%d mem=%d",
- sti.nanswers, sti.nqueries, sti.nquitok, sti.nconnect,
- sti.ntimeout, sti.noktrans, sti.ntrans, sti.nsent, sti.nrcpt,
- sti.ndeferred, sti.nnsfailed, sti.nsmtpfailed,
-@@ -521,7 +535,7 @@
- if (strstr(rcptp->response, rcptp->address) == NULL)
- {
- if (cnf.debug & DEBUG_LMTP)
-- log(LOG_DEBUG, "%d %s... %s",
-+ mylog(LOG_DEBUG, "%d %s... %s",
- rcptp->result, rcptp->address,
- rcptp->response);
- fprintf (LmtpOut, "%d %s... %s\n",
-@@ -529,7 +543,7 @@
- rcptp->response);
- } else {
- if (cnf.debug & DEBUG_LMTP)
-- log(LOG_DEBUG, "%d %s",
-+ mylog(LOG_DEBUG, "%d %s",
- rcptp->result, rcptp->response);
- fprintf (LmtpOut, "%d %s\n",
- rcptp->result, rcptp->response);
-@@ -542,7 +556,7 @@
-
- sti.ndeferred++;
- if (cnf.debug & DEBUG_LMTP)
-- log(LOG_DEBUG, "%d %s... %s",
-+ mylog(LOG_DEBUG, "%d %s... %s",
- SMTP_TEMPFAIL(51), rcptp->address, msg);
- fprintf (LmtpOut, "%d %s... %s\n",
- SMTP_TEMPFAIL(51), rcptp->address, msg);
-@@ -709,7 +723,7 @@
- {
- msgp->data = (char *)MALLOC(CHUNKSIZE);
- if (cnf.debug & DEBUG_LMTP)
-- log(LOG_DEBUG, "new chunk %d", ++chunk_num);
-+ mylog(LOG_DEBUG, "new chunk %d", ++chunk_num);
- if (msgp->data == NULL)
- {
- outofmemory = 1;
-@@ -725,7 +739,7 @@
-
- if (outofmemory)
- {
-- log(LOG_NOTICE, "out of memory (LMTP data buffer allocation)");
-+ mylog(LOG_NOTICE, "out of memory (LMTP data buffer allocation)");
- return -1;
- }
- return 0;
diff --git a/mail/smtpfeed/patches/patch-ah b/mail/smtpfeed/patches/patch-ah
deleted file mode 100644
index 750725a6f5f..00000000000
--- a/mail/smtpfeed/patches/patch-ah
+++ /dev/null
@@ -1,25 +0,0 @@
-$NetBSD: patch-ah,v 1.1 2006/07/23 15:00:41 taca Exp $
-
---- log.c.orig 2002-01-20 23:19:43.000000000 +0900
-+++ log.c
-@@ -73,7 +73,7 @@
- {
- syslog_fd = fd_before;
- if (cnf.debug & DEBUG_TRANS)
-- log(LOG_DEBUG, "file descriptor for syslog: %d", syslog_fd);
-+ mylog(LOG_DEBUG, "file descriptor for syslog: %d", syslog_fd);
- }
- #endif
- }
-@@ -85,9 +85,9 @@
-
- void
- # ifdef __STDC__
--log(int level, const char *fmt, ...)
-+mylog(int level, const char *fmt, ...)
- # else
--log(level, fmt, va_alist)
-+mylog(level, fmt, va_alist)
- int level;
- char *fmt;
- va_dcl
diff --git a/mail/smtpfeed/patches/patch-ai b/mail/smtpfeed/patches/patch-ai
index 768f8b55c25..f3392e8a9a8 100644
--- a/mail/smtpfeed/patches/patch-ai
+++ b/mail/smtpfeed/patches/patch-ai
@@ -1,4 +1,4 @@
-$NetBSD: patch-ai,v 1.1 2006/07/23 15:00:41 taca Exp $
+$NetBSD: patch-ai,v 1.2 2015/03/15 15:07:47 mef Exp $
--- main.c.orig 2002-03-15 11:12:59.000000000 +0900
+++ main.c
@@ -34,103 +34,3 @@ $NetBSD: patch-ai,v 1.1 2006/07/23 15:00:41 taca Exp $
opterr = 0;
#ifdef INET6
-@@ -455,14 +461,14 @@
- switch (peername.in.sin_family)
- {
- case AF_INET:
-- log(LOG_INFO, "connected from %s",
-+ mylog(LOG_INFO, "connected from %s",
- inet_ntoa(peername.in.sin_addr));
- break;
- #ifdef INET6
- case AF_INET6:
- inet_ntop(AF_INET6, &peername.in6.sin6_addr,
- buf, sizeof(buf));
-- log(LOG_INFO, "connected from %s", buf);
-+ mylog(LOG_INFO, "connected from %s", buf);
- break;
- #endif
- }
-@@ -470,7 +476,7 @@
-
- if (cnf.sd_max > MAX_SOCK)
- {
-- log(LOG_INFO, "cnf.sd_max should not be greater than %d, recompile smtpfeed with greater FD_SETSIZE", MAX_SOCK);
-+ mylog(LOG_INFO, "cnf.sd_max should not be greater than %d, recompile smtpfeed with greater FD_SETSIZE", MAX_SOCK);
- cnf.sd_max = MAX_SOCK;
- }
- #ifdef RLIMIT_NOFILE
-@@ -478,14 +484,14 @@
- {
- if (limit.rlim_max - 1 < cnf.sd_max)
- {
-- log(LOG_INFO, "cnf.sd_max should be %d",
-+ mylog(LOG_INFO, "cnf.sd_max should be %d",
- limit.rlim_max - 1);
- cnf.sd_max = limit.rlim_max - 1;
- }
- limit.rlim_cur = limit.rlim_max; /* make soft limit the max */
- if (setrlimit(RLIMIT_NOFILE, &limit) == -1)
- {
-- log(LOG_NOTICE, "can't set max sd to %d",
-+ mylog(LOG_NOTICE, "can't set max sd to %d",
- limit.rlim_cur);
- }
- }
-@@ -494,18 +500,18 @@
- #if SHOW_UID
- uid = geteuid();
- #ifdef INET6
-- log(LOG_DEBUG, "%s (with IPv6) started (uid %d with %d descriptors)",
-+ mylog(LOG_DEBUG, "%s (with IPv6) started (uid %d with %d descriptors)",
- version, uid, cnf.sd_max);
- #else
-- log(LOG_DEBUG, "%s started (uid %d with %d descriptors)",
-+ mylog(LOG_DEBUG, "%s started (uid %d with %d descriptors)",
- version, uid, cnf.sd_max);
- #endif
- #else
- #ifdef INET6
-- log(LOG_DEBUG, "%s (with IPv6) started (with %d descriptors)",
-+ mylog(LOG_DEBUG, "%s (with IPv6) started (with %d descriptors)",
- version, cnf.sd_max);
- #else
-- log(LOG_DEBUG, "%s started (with %d descriptors)",
-+ mylog(LOG_DEBUG, "%s started (with %d descriptors)",
- version, cnf.sd_max);
- #endif
- #endif
-@@ -551,7 +557,7 @@
- }
- }
- if (strchr(myname, '.') == NULL)
-- log(LOG_INFO, "hostname (%s) is not a FQDN", myname);
-+ mylog(LOG_INFO, "hostname (%s) is not a FQDN", myname);
- }
- if (addmyalias(myname) < 0)
- {
-@@ -559,13 +565,13 @@
- }
- if (cnf.fallbackmx != NULL && isamyalias(cnf.fallbackmx))
- {
-- log(LOG_INFO, "ignoring fallbackmx (%s)", cnf.fallbackmx);
-+ mylog(LOG_INFO, "ignoring fallbackmx (%s)", cnf.fallbackmx);
- free(cnf.fallbackmx);
- cnf.fallbackmx = NULL;
- }
- if (cnf.pgateway != NULL && isamyalias(cnf.pgateway))
- {
-- log(LOG_INFO, "ignoring protocol gateway (%s)", cnf.pgateway);
-+ mylog(LOG_INFO, "ignoring protocol gateway (%s)", cnf.pgateway);
- free(cnf.pgateway);
- cnf.pgateway = NULL;
- }
-@@ -574,7 +580,7 @@
- {
- if(rcpts_def_load() < 0)
- {
-- log(LOG_INFO, "ignoring R option (%s)", cnf.rcpts_def);
-+ mylog(LOG_INFO, "ignoring R option (%s)", cnf.rcpts_def);
- free(cnf.rcpts_def);
- cnf.rcpts_def = NULL;
- }
diff --git a/mail/smtpfeed/patches/patch-al b/mail/smtpfeed/patches/patch-al
index 96e5675d46d..8aefdd371a5 100644
--- a/mail/smtpfeed/patches/patch-al
+++ b/mail/smtpfeed/patches/patch-al
@@ -1,8 +1,9 @@
-$NetBSD: patch-al,v 1.2 2012/07/10 09:09:11 mef Exp $
+$NetBSD: patch-al,v 1.3 2015/03/15 15:07:47 mef Exp $
---- smtp.c.orig 2003-08-21 16:04:44.000000000 +0900
-+++ smtp.c 2012-06-28 18:47:24.000000000 +0900
-@@ -49,32 +49,42 @@
+
+--- smtp.c.orig 2015-02-17 23:00:08.000000000 +0900
++++ smtp.c 2015-03-12 11:30:45.000000000 +0900
+@@ -49,8 +49,14 @@ static time_t Now;
static int FirstRead, FirstWrite;
static int Terminate, NewTransCheck, NeedTrimDomain, MoreFreeSlot;
@@ -14,77 +15,36 @@ $NetBSD: patch-al,v 1.2 2012/07/10 09:09:11 mef Exp $
+
static void
-sig_alarm()
-+sig_alarm(dummy)
-+ int dummy;
++sig_alarm(int dummy)
{
errno = ETIMEDOUT;
if (cnf.debug & DEBUG_EVENT)
-- log(LOG_DEBUG, "alarm clock");
-+ mylog(LOG_DEBUG, "alarm clock");
+@@ -58,21 +64,21 @@ sig_alarm()
}
static void
-sig_int()
-+sig_int(dummy)
-+ int dummy;
++sig_int(int dummy)
{
-- log(LOG_INFO, "SIGINT received: internal states dumped");
-+ mylog(LOG_INFO, "SIGINT received: internal states dumped");
+ logg(LOG_INFO, "SIGINT received: internal states dumped");
dump_internal();
}
static void
-sig_hup()
-+sig_hup(dummy)
-+ int dummy;
++sig_hup(int dummy)
{
-- log(LOG_INFO, "SIGHUP received: graceful termination");
-+ mylog(LOG_INFO, "SIGHUP received: graceful termination");
+ logg(LOG_INFO, "SIGHUP received: graceful termination");
forced_terminate();
}
static void
-sig_term()
-+sig_term(dummy)
-+ int dummy;
++sig_term(int dummy)
{
-- log(LOG_INFO, "SIGTERM received: semi graceful termination");
-+ mylog(LOG_INFO, "SIGTERM received: semi graceful termination");
+ logg(LOG_INFO, "SIGTERM received: semi graceful termination");
markstatus(env.rcpt_list, SMTP_TEMPFAIL(51),
- "Aborted by INT signal", 1);
- longjmp(jmp_env, 1);
-@@ -87,10 +97,10 @@
- int s;
-
- while((s = dup(0)) < 253);
-- log(LOG_DEBUG, "descriptor reserved till %d", s);
-+ mylog(LOG_DEBUG, "descriptor reserved till %d", s);
- #endif
-
-- log(LOG_INFO, "from=%s size=%d nrcpt=%d msgid=%s",
-+ mylog(LOG_INFO, "from=%s size=%d nrcpt=%d msgid=%s",
- env.sender, env.realsize, sti.nrcpt,
- (env.mid == NULL)?"none":env.mid);
-
-@@ -99,7 +109,7 @@
- FILE *fp;
-
- if (cnf.debug & DEBUG_TRANS)
-- log(LOG_DEBUG, "searching sender address %s in %s",
-+ mylog(LOG_DEBUG, "searching sender address %s in %s",
- env.sender, cnf.src_mod_path);
- if ((fp = fopen(cnf.src_mod_path, "r")) == NULL)
- {
-@@ -127,7 +137,7 @@
- fclose(fp);
- if (found)
- {
-- log(LOG_INFO,
-+ mylog(LOG_INFO,
- "recipients/transaction changed to 1");
- cnf.rcpts_trans = 1;
- }
-@@ -207,15 +217,53 @@
+@@ -207,15 +213,53 @@ deliver()
resource_usage("finalstatus done");
}
@@ -114,7 +74,7 @@ $NetBSD: patch-al,v 1.2 2012/07/10 09:09:11 mef Exp $
+
+static int new_transaction P((void));
+static void process_connection P((fd_set *, fd_set *, int, int));
-+static void markstatus P((struct recipient *, int, char *, int));
++static void markstatus P((struct recipient *, int, const char *, int));
+static struct connection *open_transaction P((struct recipient *));
+static void close_transaction P((struct connection *, int));
+static void trim_rcpts P((struct domain *));
@@ -145,351 +105,47 @@ $NetBSD: patch-al,v 1.2 2012/07/10 09:09:11 mef Exp $
time_t tout;
char *name;
} state_tbl[] = {
-@@ -357,13 +405,13 @@
- if (rcptp->domain == NULL)
- {
- rcptp->stat = RCPT_DONE;
-- log(LOG_NOTICE, "no domain for %s", rcptp->address);
-+ mylog(LOG_NOTICE, "no domain for %s", rcptp->address);
- continue;
- }
- if (rcptp->domain->firstmx == NULL)
- {
- rcptp->stat = RCPT_DONE;
-- log(LOG_NOTICE, "no MX for %s", rcptp->address);
-+ mylog(LOG_NOTICE, "no MX for %s", rcptp->address);
- continue;
- }
- }
-@@ -376,7 +424,7 @@
- if (domp->rcpt_top == NULL)
- continue;
- if (cnf.debug & DEBUG_TRANS)
-- log(LOG_DEBUG, "pick up domain: %s", domp->name);
-+ mylog(LOG_DEBUG, "pick up domain: %s", domp->name);
- if (wdomp == NULL)
- env.work_domain = domp;
- else
-@@ -396,7 +444,7 @@
- {
- /* all recipients had been processed */
- if (cnf.debug & DEBUG_CONNECT)
-- log(LOG_DEBUG, "closing all sockets");
-+ mylog(LOG_DEBUG, "closing all sockets");
- all_done = 1;
- for (i = 0; i < cnf.sd_max; i++)
- {
-@@ -425,7 +473,7 @@
- }
-
- if (cnf.debug & DEBUG_TRANS)
-- log(LOG_DEBUG, "in_use=%d, max_sock=%d, min_sock=%d",
-+ mylog(LOG_DEBUG, "in_use=%d, max_sock=%d, min_sock=%d",
- in_use, max_sock, sti.minsock);
-
- if (in_use > (max_sock - sti.minsock))
-@@ -440,7 +488,7 @@
- if (connwork[i].host->state != STAT_SENT)
- continue;
- if (cnf.debug & DEBUG_CONNECT)
-- log(LOG_DEBUG, "%d/%d: closing idle socket",
-+ mylog(LOG_DEBUG, "%d/%d: closing idle socket",
- connwork[i].seq,
- connwork[i].socket);
- smtp_quit_s(&connwork[i]);
-@@ -459,7 +507,7 @@
- if (!connwork[i].reuse)
- break;
- if (cnf.debug & DEBUG_CONNECT)
-- log(LOG_DEBUG, "%d/%d: closing idle socket",
-+ mylog(LOG_DEBUG, "%d/%d: closing idle socket",
- connwork[i].seq,
- connwork[i].socket);
- smtp_quit_s(&connwork[i]);
-@@ -480,7 +528,7 @@
- }
- #if 1
- if (cnf.debug & DEBUG_TRANS)
-- log(LOG_DEBUG, "new transaction: trans=%d, sock=%d",
-+ mylog(LOG_DEBUG, "new transaction: trans=%d, sock=%d",
- num_trans, num_sock);
- #endif
- if (new_transaction() < 0)
-@@ -515,7 +563,7 @@
- if (all_done && fds < 0)
- {
- if (cnf.debug & DEBUG_CONNECT)
-- log(LOG_DEBUG, "all sockets are closed");
-+ mylog(LOG_DEBUG, "all sockets are closed");
- #if 0
- dump_internal();
- #endif
-@@ -524,7 +572,7 @@
-
- if (fds < 0) /* XXX */
- {
-- log(LOG_INFO, "No active sockets");
-+ mylog(LOG_INFO, "No active sockets");
- if (bad_state++ > 5)
- {
- markstatus(env.rcpt_list, SMTP_TEMPFAIL(51),
-@@ -562,12 +610,12 @@
- {
- /* time up */
- forced_terminate();
-- log(LOG_INFO, "total processing timed out (%d sec)",
-+ mylog(LOG_INFO, "total processing timed out (%d sec)",
- cnf.t_timeout);
- }
- if (rc < 0)
- {
-- log(LOG_INFO, "select returns %d (fds=%d, errno=%d)",
-+ mylog(LOG_INFO, "select returns %d (fds=%d, errno=%d)",
- rc, fds, errno);
- sleep(1);
- }
-@@ -595,7 +643,7 @@
- {
- #if 1
- if (cnf.debug & DEBUG_TRANS)
-- log(LOG_DEBUG, "checking domain: %s", domp->name);
-+ mylog(LOG_DEBUG, "checking domain: %s", domp->name);
- #endif
- /* first time for the domain? */
- #if 1
-@@ -616,7 +664,7 @@
- || domp->curmx->host->addr == NULL))))
- {
- if (domp->curmx->host == NULL)
-- log(LOG_INFO, "skipping bad MX: %s for %s",
-+ mylog(LOG_INFO, "skipping bad MX: %s for %s",
- domp->curmx->name, domp->name);
- else
- {
-@@ -698,7 +746,7 @@
- }
- #if 1
- if (cnf.debug & DEBUG_TRANS)
-- log(LOG_DEBUG, "no new transaction");
-+ mylog(LOG_DEBUG, "no new transaction");
- #endif
- NewTransCheck = 0;
- return -1; /* no new transaction */
-@@ -722,7 +770,7 @@
-
- snprintf(msgbuf, sizeof(msgbuf),
- "No address known for %s", conn->host->name);
-- log(LOG_INFO, msgbuf, conn->host->name);
-+ mylog(LOG_INFO, msgbuf, conn->host->name);
-
- rcode = SMTP_TEMPFAIL(52);
- if (cnf.absentAok)
-@@ -799,7 +847,7 @@
- /* timeout! */
- sti.ntimeout++;
- if (cnf.debug & DEBUG_CONNECT)
-- log(LOG_DEBUG, "%d/%d: timeout (%s)", conn->seq,
-+ mylog(LOG_DEBUG, "%d/%d: timeout (%s)", conn->seq,
- conn->socket, STATE(st));
- if (st == STAT_DTERMSENT)
- {
-@@ -815,7 +863,7 @@
- if (FD_ISSET(conn->socket, w_fds))
- {
- if (cnf.debug & DEBUG_EVENT)
-- log(LOG_DEBUG, "%d/%d: writable (%s)",
-+ mylog(LOG_DEBUG, "%d/%d: writable (%s)",
- conn->seq, conn->socket, STATE(st));
- if (state_tbl[st].send != NULL)
- {
-@@ -826,14 +874,14 @@
- if (conn->host == NULL)
- {
- if (cnf.debug & DEBUG_EVENT)
-- log(LOG_DEBUG, "%d/%d: state %s -> NULL",
-+ mylog(LOG_DEBUG, "%d/%d: state %s -> NULL",
- conn->seq, conn->socket, STATE(st));
- }
- else if (st != conn->host->state)
- {
- conn->host->time = Now;
- if (cnf.debug & DEBUG_EVENT)
-- log(LOG_DEBUG, "%d/%d: state %s -> %s",
-+ mylog(LOG_DEBUG, "%d/%d: state %s -> %s",
- conn->seq, conn->socket, STATE(st),
- STATE(conn->host->state));
- }
-@@ -842,7 +890,7 @@
- if (FD_ISSET(conn->socket, r_fds))
- {
- if (cnf.debug & DEBUG_EVENT)
-- log(LOG_DEBUG, "%d/%d: readable (%s)",
-+ mylog(LOG_DEBUG, "%d/%d: readable (%s)",
- conn->seq, conn->socket, STATE(st));
- if (state_tbl[st].recv != NULL)
- {
-@@ -853,14 +901,14 @@
- if (conn->host == NULL)
- {
- if (cnf.debug & DEBUG_EVENT)
-- log(LOG_DEBUG, "%d/%d: state %s -> NULL",
-+ mylog(LOG_DEBUG, "%d/%d: state %s -> NULL",
- conn->seq, conn->socket, STATE(st));
- }
- else if (st != conn->host->state)
- {
- conn->host->time = Now;
- if (cnf.debug & DEBUG_EVENT)
-- log(LOG_DEBUG, "%d/%d: state %s -> %s",
-+ mylog(LOG_DEBUG, "%d/%d: state %s -> %s",
- conn->seq, conn->socket, STATE(st),
- STATE(conn->host->state));
- }
-@@ -885,7 +933,7 @@
- if (rcptp == NULL)
- {
- if (cnf.debug & DEBUG_TRANS)
-- log(LOG_DEBUG, "markstatus: rcptp is NULL");
-+ mylog(LOG_DEBUG, "markstatus: rcptp is NULL");
- return;
- }
-
-@@ -1047,7 +1095,7 @@
- {
- /* buffer may be full */
- strcat(addrbuf+addrlen, ",(more...)");
-- log(LOG_INFO, "(%d+%d+%d+%d/%d) relay=%s to=%s proto=%s delay=%d code=%d (%s)",
-+ mylog(LOG_INFO, "(%d+%d+%d+%d/%d) relay=%s to=%s proto=%s delay=%d code=%d (%s)",
- sti.nsent, sti.ndeferred, sti.nnsfailed,
- sti.nsmtpfailed, sti.nrcpt, hostname,
- addrbuf, proto, delay, rcode,
-@@ -1069,7 +1117,7 @@
- {
- rcptp->stat = RCPT_RETRY;
- if (cnf.debug & DEBUG_TRANS)
-- log(LOG_DEBUG, "tempfail; retry: %s",
-+ mylog(LOG_DEBUG, "tempfail; retry: %s",
- rcptp->address);
- }
- else if (!Terminate && mxp != NULL
-@@ -1079,7 +1127,7 @@
- {
- rcptp->stat = RCPT_RETRY;
- if (cnf.debug & DEBUG_TRANS)
-- log(LOG_DEBUG, "tempfail; next avail: %s",
-+ mylog(LOG_DEBUG, "tempfail; next avail: %s",
- rcptp->address);
- }
- else
-@@ -1087,7 +1135,7 @@
- sti.ndeferred++;
- rcptp->stat = RCPT_DONE;
- if (cnf.debug & DEBUG_TRANS)
-- log(LOG_DEBUG, "tempfail; done: %s",
-+ mylog(LOG_DEBUG, "tempfail; done: %s",
- rcptp->address);
- }
- }
-@@ -1116,7 +1164,7 @@
- }
- if (addrlen > 0)
- {
-- log(LOG_INFO, "(%d+%d+%d+%d/%d) relay=%s to=%s proto=%s delay=%d code=%d (%s)",
-+ mylog(LOG_INFO, "(%d+%d+%d+%d/%d) relay=%s to=%s proto=%s delay=%d code=%d (%s)",
- sti.nsent, sti.ndeferred, sti.nnsfailed,
- sti.nsmtpfailed, sti.nrcpt, hostname,
- addrbuf, proto, delay, rcode,
-@@ -1156,7 +1204,7 @@
-
- #if 1
- if (cnf.debug & DEBUG_TRANS)
-- log(LOG_DEBUG, "num_trans=%d, num_sock=%d, max_sock=%d, min_sock=%d",
-+ mylog(LOG_DEBUG, "num_trans=%d, num_sock=%d, max_sock=%d, min_sock=%d",
- num_trans, num_sock, max_sock, sti.minsock);
- #endif
- if (num_trans > (max_sock - sti.minsock))
-@@ -1171,7 +1219,7 @@
-
- #if 1
- if (cnf.debug & DEBUG_TRANS)
-- log(LOG_DEBUG, "open transaction for %s", rcptp->address);
-+ mylog(LOG_DEBUG, "open transaction for %s", rcptp->address);
- #endif
-
- if (rcptp->domain->curmx->host->state == STAT_SENT)
-@@ -1183,7 +1231,7 @@
- break;
+@@ -338,7 +382,7 @@ smtp()
+ int i, fds, rc, in_use, burst, true_terminate;
+ int all_done = 0;
+ int bad_state = 0;
+- char *msg;
++ const char *msg;
+
+ /* initialize work pointers */
+ for (rcptp = env.rcpt_list; rcptp != NULL; rcptp = rcptp->next)
+@@ -645,7 +689,7 @@ new_transaction()
}
- if (cnf.debug & DEBUG_TRANS)
-- log(LOG_DEBUG, "reusing: slot=%d", i);
-+ mylog(LOG_DEBUG, "reusing: slot=%d", i);
- }
- else
- {
-@@ -1203,7 +1251,7 @@
- {
- #if 0
- if (cnf.debug & DEBUG_TRANS)
-- log(LOG_DEBUG, "no free slot");
-+ mylog(LOG_DEBUG, "no free slot");
- #endif
- /* sleep (1); */
- return NULL; /* XXX socket slot is full */
-@@ -1212,7 +1260,7 @@
- sti.ntrans++;
-
- if (cnf.debug & DEBUG_TRANS)
-- log(LOG_DEBUG, "%d/-: open transaction for %s, slot=%d",
-+ mylog(LOG_DEBUG, "%d/-: open transaction for %s, slot=%d",
- sti.ntrans, rcptp->address, i);
-
- /* initialize transaction */
-@@ -1246,7 +1294,7 @@
- domp = mxp->domain;
- if (domp == NULL)
+ if (domp->curmx == NULL)
{
-- log(LOG_NOTICE, "Oops, mxp->domain for %s is NULL",
-+ mylog(LOG_NOTICE, "Oops, mxp->domain for %s is NULL",
- mxp->name);
- goto next_domain;
- }
-@@ -1269,7 +1317,7 @@
- if (rcpts + 1 > cnf.rcpts_trans)
- #else
- if (cnf.debug & DEBUG_TRANS)
-- log(LOG_DEBUG, "check count of rcpts (domain:%s, max rcpts:%d, count:%d)",
-+ mylog(LOG_DEBUG, "check count of rcpts (domain:%s, max rcpts:%d, count:%d)",
- rcptp2->domain->name,
- rcptp2->domain->rcpts,
- rcpts);
-@@ -1282,7 +1330,7 @@
- }
- rcpts++;
- if (cnf.debug & DEBUG_TRANS)
-- log(LOG_DEBUG, "%d/-: with %s",
-+ mylog(LOG_DEBUG, "%d/-: with %s",
- sti.ntrans, rcptp2->address);
- rcptp2->stat = RCPT_WORK;
- rcptp2->chain = NULL;
-@@ -1323,7 +1371,7 @@
- #endif
+- char *msg = domp->response;
++ const char *msg = domp->response;
- if (cnf.debug & DEBUG_TRANS)
-- log(LOG_DEBUG, "%d/%d: close transaction", conn->seq, conn->socket);
-+ mylog(LOG_DEBUG, "%d/%d: close transaction", conn->seq, conn->socket);
+ if (msg == NULL)
+ if (no_addr)
+@@ -869,15 +913,15 @@ int timeout_only, true_term;
+ }
- NewTransCheck = 1; /* do not skip new_transaction() */
- env.work_dom_ptr = NULL; /* retry from the top of list */
-@@ -1388,7 +1436,7 @@
- if (domp->curmx != NULL)
- {
- if (cnf.debug & DEBUG_TRANS)
-- log(LOG_DEBUG, "%d/-: switching to next MX: %s",
-+ mylog(LOG_DEBUG, "%d/-: switching to next MX: %s",
- conn->seq, domp->curmx->name);
- }
- }
-@@ -1429,7 +1477,7 @@
+ static void
+-markstatus(rcptp, rcode, response, tracechain)
+-struct recipient *rcptp;
+-int rcode;
+-char *response;
+-int tracechain;
++markstatus (struct recipient *rcptp,
++ int rcode,
++ const char *response,
++ int tracechain)
+ {
+ char hbuf[MAXLINE], rbuf[MAXLINE], pbuf[64];
+ char addrbuf[SYSLOG_BUFSIZE];
+- char *hostname, *proto, *responsep;
++ char *hostname, *proto;
++ const char *responsep;
+ struct host *hostp;
+ int delay, addrlen, estconst, estlen, n;
+ static int PrevPCT = -1;
+@@ -1434,7 +1478,7 @@ int next; /* true: forward MX for next t
num_trans--;
}
@@ -498,16 +154,7 @@ $NetBSD: patch-al,v 1.2 2012/07/10 09:09:11 mef Exp $
trim_rcpts(domp)
struct domain *domp;
{
-@@ -1446,7 +1494,7 @@
- {
- /* remove recipient from working chain */
- if (cnf.debug & DEBUG_TRANS)
-- log(LOG_DEBUG, "removing recipient: %s",
-+ mylog(LOG_DEBUG, "removing recipient: %s",
- rcptp->address);
- if (rcptp == domp->rcpt_top)
- {
-@@ -1469,7 +1517,7 @@
+@@ -1474,7 +1518,7 @@ struct domain *domp;
NeedTrimDomain = 1;
}
@@ -516,16 +163,7 @@ $NetBSD: patch-al,v 1.2 2012/07/10 09:09:11 mef Exp $
trim_domain()
{
struct domain *domp, *domtmp;
-@@ -1483,7 +1531,7 @@
- {
- /* remove from working domain chain */
- if (cnf.debug & DEBUG_TRANS)
-- log(LOG_DEBUG, "removing domain: %s",
-+ mylog(LOG_DEBUG, "removing domain: %s",
- domp->name);
- if (domp == env.work_domain)
- {
-@@ -1510,7 +1558,7 @@
+@@ -1515,7 +1559,7 @@ trim_domain()
return 0;
}
@@ -534,159 +172,7 @@ $NetBSD: patch-al,v 1.2 2012/07/10 09:09:11 mef Exp $
forced_terminate()
{
struct recipient *rcptp;
-@@ -1538,7 +1586,7 @@
-
- if (conn->host == NULL)
- {
-- log(LOG_NOTICE, "smtp_connect called with NULL host");
-+ mylog(LOG_NOTICE, "smtp_connect called with NULL host");
- return -1;
- }
-
-@@ -1552,7 +1600,7 @@
- }
-
- if (cnf.debug & DEBUG_CONNECT)
-- log(LOG_DEBUG, "%d/-: connecting to %s",
-+ mylog(LOG_DEBUG, "%d/-: connecting to %s",
- conn->seq, conn->host->name);
-
- bzero((char *)&rsin, sizeof(rsin));
-@@ -1589,7 +1637,7 @@
- socksize = sizeof(struct sockaddr_in);
-
- if (cnf.debug & DEBUG_CONNECT)
-- log(LOG_DEBUG, "%d/-: destination=%s/%d", conn->seq,
-+ mylog(LOG_DEBUG, "%d/-: destination=%s/%d", conn->seq,
- inet_ntoa(rsin.in.sin_addr), cnf.dst_port);
- found = 1;
- break;
-@@ -1619,7 +1667,7 @@
-
- inet_ntop(AF_INET6, &rsin.in6.sin6_addr,
- buf, sizeof(buf));
-- log(LOG_DEBUG, "%d/-: destination=%s/%d",
-+ mylog(LOG_DEBUG, "%d/-: destination=%s/%d",
- conn->seq, buf, cnf.dst_port);
- }
- found = 1;
-@@ -1657,7 +1705,7 @@
-
- if (sd > MAX_SOCK)
- {
-- log(LOG_NOTICE, "%d/%d: can not manage such a big file descriptor number with select()",
-+ mylog(LOG_NOTICE, "%d/%d: can not manage such a big file descriptor number with select()",
- conn->seq, sd);
- close(sd);
- if (max_sock > MAX_SOCK)
-@@ -1670,7 +1718,7 @@
-
- if (sd < 0){
- /* no more socket resource */
-- log(LOG_NOTICE, "socket allocation failed for %s: %s (may be max=%d, current=%d/%d/%d)",
-+ mylog(LOG_NOTICE, "socket allocation failed for %s: %s (may be max=%d, current=%d/%d/%d)",
- conn->host->name, smtpstrerror(errno), sti.maxsock,
- max_sock, num_sock, sti.minsock);
- if (max_sock > NOFILE)
-@@ -1689,14 +1737,14 @@
- }
-
- if (cnf.debug & DEBUG_CONNECT)
-- log(LOG_DEBUG, "%d/%d: socket allocated", conn->seq, sd);
-+ mylog(LOG_DEBUG, "%d/%d: socket allocated", conn->seq, sd);
-
- #ifdef SO_SNDBUF
- if (cnf.sendbufsize > 0)
- {
- if (setsockopt(sd, SOL_SOCKET, SO_SNDBUF,
- (char *)&cnf.sendbufsize, sizeof(cnf.sendbufsize)) < 0)
-- log(LOG_NOTICE, "%d/%d: setsockopt(SO_SNDBUF) failed for %s: %s",
-+ mylog(LOG_NOTICE, "%d/%d: setsockopt(SO_SNDBUF) failed for %s: %s",
- conn->seq, sd, conn->host->name,
- smtpstrerror(errno));
- /* ignore error */
-@@ -1761,7 +1809,7 @@
- case AF_INET:
- bcopy(addrp->address,
- &lsin.in.sin_addr, addrp->len);
-- log(LOG_INFO,
-+ mylog(LOG_INFO,
- "using %s as source IP address",
- inet_ntoa(lsin.in.sin_addr));
- break;
-@@ -1773,7 +1821,7 @@
-
- inet_ntop(AF_INET6, &lsin.in6.sin6_addr,
- buf, sizeof(buf));
-- log(LOG_INFO, "using %s as source IP address", buf);
-+ mylog(LOG_INFO, "using %s as source IP address", buf);
- break;
- #endif
- }
-@@ -1791,7 +1839,7 @@
- p = NULL;
- }
- if (!found)
-- log(LOG_INFO, "sourceIP (%s) ignored", cnf.sourceIP);
-+ mylog(LOG_INFO, "sourceIP (%s) ignored", cnf.sourceIP);
- }
- if (!found)
- {
-@@ -1840,7 +1888,7 @@
- {
- if (bind(sd, (struct sockaddr *)&lsin, socksize) < 0)
- {
-- log(LOG_NOTICE, "%d/%d: bind failed for %s: %s",
-+ mylog(LOG_NOTICE, "%d/%d: bind failed for %s: %s",
- conn->seq, sd, conn->host->name,
- smtpstrerror(errno));
- conn->host->state = STAT_FAIL;
-@@ -1857,7 +1905,7 @@
-
- if (ioctl (sd, FIONBIO, &res) < 0)
- {
-- log(LOG_NOTICE, "%d/%d: FIONBIO failed for %s: %s",
-+ mylog(LOG_NOTICE, "%d/%d: FIONBIO failed for %s: %s",
- conn->seq, sd, conn->host->name, smtpstrerror(errno));
- conn->host->state = STAT_FAIL;
- close (sd);
-@@ -1868,7 +1916,7 @@
- #else
- if ((res = fcntl(sd, F_GETFL, 0)) == -1)
- {
-- log(LOG_NOTICE, "%d/%d: F_GETFL failed for %s: %s",
-+ mylog(LOG_NOTICE, "%d/%d: F_GETFL failed for %s: %s",
- conn->seq, sd, conn->host->name, smtpstrerror(errno));
- conn->host->state = STAT_FAIL;
- close (sd);
-@@ -1883,7 +1931,7 @@
- # endif
- if (fcntl(sd, F_SETFL, res) == -1)
- {
-- log(LOG_NOTICE, "%d/%d: F_SETFL failed for %s: %s",
-+ mylog(LOG_NOTICE, "%d/%d: F_SETFL failed for %s: %s",
- conn->seq, sd, conn->host->name, smtpstrerror(errno));
- conn->host->state = STAT_FAIL;
- close (sd);
-@@ -1899,7 +1947,7 @@
- && errno != EINPROGRESS && errno != EINTR) /* XXX */
- {
- alarm(0);
-- log(LOG_DEBUG, "%d/%d: connect failed for %s: %s",
-+ mylog(LOG_DEBUG, "%d/%d: connect failed for %s: %s",
- conn->seq, sd, conn->host->name, smtpstrerror(errno));
- conn->host->current->stat = EX_TEMPFAIL;
- close (sd);
-@@ -1931,7 +1979,7 @@
- }
- sti.minsock = sd;
- if (cnf.debug & DEBUG_CONNECT)
-- log(LOG_DEBUG, "minsock=%d", sti.minsock);
-+ mylog(LOG_DEBUG, "minsock=%d", sti.minsock);
- }
- num_sock++;
- return 0;
-@@ -1951,11 +1999,11 @@
+@@ -1956,7 +2000,7 @@ struct connection *conn;
{
SockAddr cin;
int len = sizeof(SockAddr);
@@ -695,75 +181,7 @@ $NetBSD: patch-al,v 1.2 2012/07/10 09:09:11 mef Exp $
if (getpeername(conn->socket, (struct sockaddr *)&cin, &len) < 0)
{
-- log(LOG_INFO, "%d/%d: getpeername failed for %s: %s",
-+ mylog(LOG_INFO, "%d/%d: getpeername failed for %s: %s",
- conn->seq, conn->socket, conn->host->name,
- smtpstrerror(errno));
- if (conn->host->current != NULL) /* XXX for safe access */
-@@ -2004,7 +2052,7 @@
- conn->outlen = 0;
- if (conn->inbuf == NULL || conn->outbuf == NULL)
- {
-- log(LOG_NOTICE, "out of memory (SMTP buffer allocation)");
-+ mylog(LOG_NOTICE, "out of memory (SMTP buffer allocation)");
- if (conn->host->current != NULL) /* XXX for safe access */
- {
- conn->host->current->stat = EX_TEMPFAIL;
-@@ -2048,7 +2096,7 @@
- if (n == 0)
- {
- if (cnf.debug & DEBUG_CONNECT)
-- log(LOG_DEBUG, "%d/%d: closed by foreign host",
-+ mylog(LOG_DEBUG, "%d/%d: closed by foreign host",
- conn->seq, conn->socket);
- errno = E_SF_IO;
- return -1;
-@@ -2066,7 +2114,7 @@
- #endif
- return 0;
- default:
-- log(LOG_DEBUG, "%d/%d: read failed for %s: ret=%d, errno=%d",
-+ mylog(LOG_DEBUG, "%d/%d: read failed for %s: ret=%d, errno=%d",
- conn->seq, conn->socket,
- conn->host->name, n, errno);
- return n;
-@@ -2132,7 +2180,7 @@
- if (n == 0)
- {
- if (cnf.debug & DEBUG_CONNECT)
-- log(LOG_DEBUG,
-+ mylog(LOG_DEBUG,
- "%d/%d: closed by foreign host (%s)",
- conn->seq, conn->socket,
- conn->host->name);
-@@ -2152,7 +2200,7 @@
- #endif
- return 0;
- default:
-- log(LOG_DEBUG,
-+ mylog(LOG_DEBUG,
- "%d/%d: write failed for %s: ret=%d, errno=%d",
- conn->seq, conn->socket,
- conn->host->name, n, errno);
-@@ -2187,7 +2235,7 @@
- if (n == 0)
- {
- if (cnf.debug & DEBUG_CONNECT)
-- log(LOG_DEBUG,
-+ mylog(LOG_DEBUG,
- "%d/%d: closed by foreign host (%s)",
- conn->seq, conn->socket,
- conn->host->name);
-@@ -2205,7 +2253,7 @@
- #endif
- return size;
- default:
-- log(LOG_DEBUG,
-+ mylog(LOG_DEBUG,
- "%d/%d: write failed for %s: ret=%d, errno=%d",
- conn->seq, conn->socket,
- conn->host->name, n, errno);
-@@ -2256,7 +2304,7 @@
+@@ -2261,7 +2305,7 @@ struct connection *conn;
static int
smtp_get_reply(conn, func, firstline, size, rest)
struct connection *conn;
@@ -772,214 +190,3 @@ $NetBSD: patch-al,v 1.2 2012/07/10 09:09:11 mef Exp $
char firstline[];
int size;
int *rest;
-@@ -2301,7 +2349,7 @@
- cbuf[--len] = '\0';
- }
- if (cnf.debug & DEBUG_SMTP)
-- log(LOG_DEBUG, "%d/%d: >>> %s", conn->seq, conn->socket, cbuf);
-+ mylog(LOG_DEBUG, "%d/%d: >>> %s", conn->seq, conn->socket, cbuf);
- if (func != NULL)
- (*func)(conn, cbuf);
- if (!isdigit(cbuf[0]) || !isdigit(cbuf[1]) || !isdigit(cbuf[2])
-@@ -2358,7 +2406,7 @@
- int len = strlen(buf);
-
- if (cnf.debug & DEBUG_SMTP)
-- log(LOG_DEBUG, "%d/%d: <<< %s", conn->seq, conn->socket, buf);
-+ mylog(LOG_DEBUG, "%d/%d: <<< %s", conn->seq, conn->socket, buf);
- if (len + 2 < size)
- {
- strcat(buf, CRLF);
-@@ -2432,7 +2480,7 @@
- {
- char buf[MAXLINE];
- int rcode, savestate;
-- const char *errmsg;
-+ char *errmsg;
-
- errno = 0;
- savestate = conn->host->state;
-@@ -2473,7 +2521,7 @@
- errmsg = "Unexpected Error";
- break;
- }
-- log(LOG_INFO, "%d/%d: failed for %s: %s (%s)",
-+ mylog(LOG_INFO, "%d/%d: failed for %s: %s (%s)",
- conn->seq, conn->socket, conn->host->name,
- smtpstrerror(errno), STATE(savestate));
- if (conn->host->current != NULL) /* XXX for safe access */
-@@ -2620,7 +2668,7 @@
- {
- if (errno > 0)
- {
-- log(LOG_INFO, "%d/%d: failed for %s: %s (%s)",
-+ mylog(LOG_INFO, "%d/%d: failed for %s: %s (%s)",
- conn->seq, conn->socket, smtpstrerror(errno),
- conn->host->name, STATE(savestate));
- }
-@@ -2876,7 +2924,7 @@
- {
- if (errno > 0)
- {
-- log(LOG_INFO, "%d/%d: failed for %s: %s (%s)",
-+ mylog(LOG_INFO, "%d/%d: failed for %s: %s (%s)",
- conn->seq, conn->socket, conn->host->name,
- smtpstrerror(errno), STATE(savestate));
- }
-@@ -3056,7 +3104,7 @@
- {
- if (errno > 0)
- {
-- log(LOG_INFO, "%d/%d: failed for %s: %s (%s)",
-+ mylog(LOG_INFO, "%d/%d: failed for %s: %s (%s)",
- conn->seq, conn->socket, conn->host->name,
- smtpstrerror(errno), STATE(savestate));
- }
-@@ -3208,7 +3256,7 @@
- {
- if (errno > 0)
- {
-- log(LOG_INFO, "%d/%d: failed for %s: %s (%s)",
-+ mylog(LOG_INFO, "%d/%d: failed for %s: %s (%s)",
- conn->seq, conn->socket, conn->host->name,
- smtpstrerror(errno), STATE(savestate));
- }
-@@ -3323,7 +3371,7 @@
- len = strlen(altbuf);
- rcode = smtp_write(conn, altbuf, len, 0);
- if (rcode != len) /* XXX */
-- log(LOG_NOTICE,
-+ mylog(LOG_NOTICE,
- "Header of sent message will be corrupted: %s",
- altbuf);
- }
-@@ -3395,7 +3443,7 @@
- return 0;
-
- if (cnf.debug & DEBUG_CONNECT)
-- log(LOG_DEBUG, "reusability check: %s", conn->host->name);
-+ mylog(LOG_DEBUG, "reusability check: %s", conn->host->name);
-
- /* check possibility of reuse connection */
- for (rmxp = conn->host->mx_ref; rmxp != NULL; rmxp = rmxp->mx_ref)
-@@ -3417,7 +3465,7 @@
- }
- }
- if (cnf.debug & DEBUG_CONNECT)
-- log(LOG_DEBUG, "on domain: %s = %d", domp->name, reused);
-+ mylog(LOG_DEBUG, "on domain: %s = %d", domp->name, reused);
-
- if (reused == 0)
- continue;
-@@ -3429,7 +3477,7 @@
- if (mxp == rmxp)
- {
- if (cnf.debug & DEBUG_CONNECT)
-- log(LOG_DEBUG, "%d/%d: may be reused: %s",
-+ mylog(LOG_DEBUG, "%d/%d: may be reused: %s",
- conn->seq, conn->socket,
- conn->host->name);
- return 1;
-@@ -3455,7 +3503,7 @@
- {
- if (errno > 0)
- {
-- log(LOG_INFO, "%d/%d: failed for %s: %s (%s)",
-+ mylog(LOG_INFO, "%d/%d: failed for %s: %s (%s)",
- conn->seq, conn->socket, conn->host->name,
- smtpstrerror(errno), STATE(savestate));
- }
-@@ -3552,7 +3600,7 @@
- {
- if (errno > 0)
- {
-- log(LOG_INFO, "%d/%d: failed for %s: %s (%s)",
-+ mylog(LOG_INFO, "%d/%d: failed for %s: %s (%s)",
- conn->seq, conn->socket, conn->host->name,
- smtpstrerror(errno), STATE(savestate));
- }
-@@ -3629,7 +3677,7 @@
- {
- if (errno > 0)
- {
-- log(LOG_INFO, "%d/%d: failed for %s: %s (%s)",
-+ mylog(LOG_INFO, "%d/%d: failed for %s: %s (%s)",
- conn->seq, conn->socket, conn->host->name,
- smtpstrerror(errno), STATE(savestate));
- }
-@@ -3691,7 +3739,7 @@
- markstatus(conn->rcpt, SMTP_TEMPFAIL(52),
- newstr(buf), 1);
- else
-- log(LOG_INFO, "Trying next address of %s",
-+ mylog(LOG_INFO, "Trying next address of %s",
- conn->host->name);
- if (conn->host->current != NULL) /* XXX for safe access */
- conn->host->current = conn->host->current->next;
-@@ -3717,7 +3765,7 @@
- {
- conn->host->state = STAT_CLOSED;
- conn->host->current->stat = EX_TEMPFAIL;
-- log(LOG_INFO, "Trying next address of %s",
-+ mylog(LOG_INFO, "Trying next address of %s",
- conn->host->name);
- }
- else
-@@ -3744,17 +3792,17 @@
- struct recipient *rcptp;
- int i;
-
-- log(LOG_INFO, "=== dumping internal information ===");
-+ mylog(LOG_INFO, "=== dumping internal information ===");
-
- for (rcptp = env.rcpt_list; rcptp != NULL; rcptp = rcptp->next)
- {
- switch (rcptp->stat)
- {
- case RCPT_NOOP:
-- log(LOG_INFO, "rcpt=%s stat=noop", rcptp->address);
-+ mylog(LOG_INFO, "rcpt=%s stat=noop", rcptp->address);
- break;
- case RCPT_WORK:
-- log(LOG_INFO, "rcpt=%s stat=working mx=%s st=%s",
-+ mylog(LOG_INFO, "rcpt=%s stat=working mx=%s st=%s",
- rcptp->address,
- (rcptp->domain->curmx == NULL)?"none":
- rcptp->domain->curmx->name,
-@@ -3763,18 +3811,18 @@
- break;
- case RCPT_RETRY:
- if (rcptp->domain->curmx != NULL)
-- log(LOG_INFO,
-+ mylog(LOG_INFO,
- "rcpt=%s stat=retry code=%d mx=%s st=%s",
- rcptp->address, rcptp->result,
- rcptp->domain->curmx->name,
- STATE(rcptp->domain->curmx->host->state));
- else
-- log(LOG_INFO,
-+ mylog(LOG_INFO,
- "rcpt=%s stat=retry code=%d mx=none",
- rcptp->address, rcptp->result);
- break;
- case RCPT_DONE:
-- log(LOG_INFO, "rcpt=%s stat=done code=%d",
-+ mylog(LOG_INFO, "rcpt=%s stat=done code=%d",
- rcptp->address, rcptp->result);
- break;
- }
-@@ -3784,12 +3832,12 @@
- {
- if (connwork[i].host == NULL)
- continue;
-- log(LOG_INFO, "slot=%d host=%s stat=%s", i,
-+ mylog(LOG_INFO, "slot=%d host=%s stat=%s", i,
- connwork[i].host->name,
- STATE(connwork[i].host->state));
- }
-
-- log(LOG_INFO, "=== end of internal information ===");
-+ mylog(LOG_INFO, "=== end of internal information ===");
- }
-
- static char *
diff --git a/mail/smtpfeed/patches/patch-am b/mail/smtpfeed/patches/patch-am
index 83ac6de037b..8662764721c 100644
--- a/mail/smtpfeed/patches/patch-am
+++ b/mail/smtpfeed/patches/patch-am
@@ -1,8 +1,9 @@
-$NetBSD: patch-am,v 1.1 2006/07/23 15:00:41 taca Exp $
+$NetBSD: patch-am,v 1.2 2015/03/15 15:07:47 mef Exp $
---- util.c.orig 2002-01-20 23:19:44.000000000 +0900
-+++ util.c
-@@ -41,6 +41,11 @@
+
+--- util.c.orig 2012-06-07 16:51:49.000000000 +0900
++++ util.c 2015-03-11 13:54:18.000000000 +0900
+@@ -42,6 +42,11 @@ static char *_id_ = "$Id: util.c,v 1.23
# include "common.h"
# include "extern.h"
@@ -14,158 +15,7 @@ $NetBSD: patch-am,v 1.1 2006/07/23 15:00:41 taca Exp $
char *
newstr(str)
char *str;
-@@ -49,7 +54,7 @@
-
- ptr = (char *)MALLOC(strlen(str) + 1);
- if (ptr == NULL) {
-- log(LOG_NOTICE, "out of memory (newstr)");
-+ mylog(LOG_NOTICE, "out of memory (newstr)");
- return NULL;
- }
- strcpy(ptr, str);
-@@ -109,7 +114,7 @@
- tv_sub(&ct, &pt, &dt);
- d.ru_maxrss = c.ru_maxrss - p.ru_maxrss;
- d.ru_nivcsw = c.ru_nivcsw - p.ru_nivcsw;
-- log(LOG_INFO, "time=%d.%03d+%d.%03d/%d.%03d rss=%ld nivcsw=%ld (%s)",
-+ mylog(LOG_INFO, "time=%d.%03d+%d.%03d/%d.%03d rss=%ld nivcsw=%ld (%s)",
- d.ru_utime.tv_sec, d.ru_utime.tv_usec/1000,
- d.ru_stime.tv_sec, d.ru_stime.tv_usec/1000,
- dt.tv_sec, dt.tv_usec/1000,
-@@ -139,7 +144,7 @@
- }
-
- if (cnf.debug & DEBUG_HASH)
-- log(LOG_DEBUG, "hash_func(%s) = %d", name, val);
-+ mylog(LOG_DEBUG, "hash_func(%s) = %d", name, val);
-
- return val;
- }
-@@ -165,7 +170,7 @@
- if (strcasecmp(qp->name, name) == 0)
- {
- if (cnf.debug & DEBUG_HASH)
-- log(LOG_DEBUG, "query %s found in hash table", name);
-+ mylog(LOG_DEBUG, "query %s found in hash table", name);
- return qp;
- }
- qp = qp->next;
-@@ -194,7 +199,7 @@
- if (strcasecmp(domp->name, name) == 0)
- {
- if (cnf.debug & DEBUG_HASH)
-- log(LOG_DEBUG, "domain %s found in hash table", name);
-+ mylog(LOG_DEBUG, "domain %s found in hash table", name);
- return domp;
- }
- domp = domp->hash;
-@@ -211,7 +216,7 @@
- int idx = hash_func(name);
-
- if (cnf.debug & DEBUG_HASH)
-- log(LOG_DEBUG, "enter domain %s into hash table", name);
-+ mylog(LOG_DEBUG, "enter domain %s into hash table", name);
-
- newdomp->hash = hash_domain[idx];
- hash_domain[idx] = newdomp;
-@@ -228,21 +233,21 @@
- int idx = hash_func(name);
-
- if (cnf.debug & DEBUG_HASH)
-- log(LOG_DEBUG, "look up domain(%s) index(%d)", name, idx);
-+ mylog(LOG_DEBUG, "look up domain(%s) index(%d)", name, idx);
- dom_r_p = hash_domain_rcpts[idx];
- while (dom_r_p != NULL)
- {
- if (strcasecmp(dom_r_p->name, name) == 0)
- {
- if (cnf.debug & DEBUG_HASH)
-- log(LOG_DEBUG, "hit domain(%s) rcpts(%d) in hash table",
-+ mylog(LOG_DEBUG, "hit domain(%s) rcpts(%d) in hash table",
- name, dom_r_p->rcpts);
- return dom_r_p->rcpts;
- }
- dom_r_p = dom_r_p->hash;
- }
- if (cnf.debug & DEBUG_HASH)
-- log(LOG_DEBUG, "domain(%s) not found in hash table, return %d",
-+ mylog(LOG_DEBUG, "domain(%s) not found in hash table, return %d",
- name, cnf.rcpts_trans);
- return cnf.rcpts_trans;
- }
-@@ -255,7 +260,7 @@
- int idx = hash_func(name);
-
- if (cnf.debug & DEBUG_HASH)
-- log(LOG_DEBUG, "enter domain(%s) index(%d) rcpts(%d) into hash table",
-+ mylog(LOG_DEBUG, "enter domain(%s) index(%d) rcpts(%d) into hash table",
- name, idx, newdom_r_p->rcpts);
-
- newdom_r_p->hash = hash_domain_rcpts[idx];
-@@ -290,7 +295,7 @@
- fp = fopen(cnf.rcpts_def, "r");
- if (fp == NULL)
- {
-- log(LOG_NOTICE, "file %s not found", cnf.rcpts_def);
-+ mylog(LOG_NOTICE, "file %s not found", cnf.rcpts_def);
- return -1;
- }
- /* read cnf.rcpts_def */
-@@ -337,7 +342,7 @@
- dom_r_p = (struct domain_rcpts*) MALLOC(sizeof(struct domain_rcpts));
- if (dom_r_p == NULL)
- {
-- log(LOG_NOTICE, "out of memory (domain_rcpts)");
-+ mylog(LOG_NOTICE, "out of memory (domain_rcpts)");
- fclose(fp);
- return -1;
- }
-@@ -345,7 +350,7 @@
- dom_r_p->name = newstr(strp);
- if(dom_r_p->name == NULL)
- {
-- log(LOG_NOTICE, "out of memory (dom_r_p->name)");
-+ mylog(LOG_NOTICE, "out of memory (dom_r_p->name)");
- fclose(fp);
- return -1;
- }
-@@ -356,7 +361,7 @@
- fclose(fp);
- cnf.rcpts_trans = hash_domain_rcpts_lookup(DEFAULTRCPTS);
- if (cnf.debug & DEBUG_TRANS)
-- log(LOG_DEBUG, "set cnf.rcpts_trans = %d", cnf.rcpts_trans);
-+ mylog(LOG_DEBUG, "set cnf.rcpts_trans = %d", cnf.rcpts_trans);
- return 0;
- }
-
-@@ -381,7 +386,7 @@
- if (strcasecmp(hostp->name, name) == 0)
- {
- if (cnf.debug & DEBUG_HASH)
-- log(LOG_DEBUG, "host %s found in hash table", name);
-+ mylog(LOG_DEBUG, "host %s found in hash table", name);
- return hostp;
- }
- hostp = hostp->hash;
-@@ -398,7 +403,7 @@
- int idx = hash_func(name);
-
- if (cnf.debug & DEBUG_HASH)
-- log(LOG_DEBUG, "enter host %s into hash table", name);
-+ mylog(LOG_DEBUG, "enter host %s into hash table", name);
-
- newhostp->hash = hash_host[idx];
- hash_host[idx] = newhostp;
-@@ -426,7 +431,7 @@
- if (strcasecmp(mapp->name, name) == 0)
- {
- if (cnf.debug & DEBUG_HASH)
-- log(LOG_DEBUG, "map %s found in hash table", name);
-+ mylog(LOG_DEBUG, "map %s found in hash table", name);
- return mapp;
- }
- mapp = mapp->hash;
-@@ -434,7 +439,7 @@
+@@ -435,7 +440,7 @@ struct host_map ***ptr;
return NULL;
}
@@ -174,39 +24,3 @@ $NetBSD: patch-am,v 1.1 2006/07/23 15:00:41 taca Exp $
hash_map_enter(name, newmapp)
char *name;
struct host_map *newmapp;
-@@ -442,7 +447,7 @@
- int idx = hash_func(name);
-
- if (cnf.debug & DEBUG_HASH)
-- log(LOG_DEBUG, "enter map %s into hash table", name);
-+ mylog(LOG_DEBUG, "enter map %s into hash table", name);
-
- newmapp->hash = hash_map[idx];
- hash_map[idx] = newmapp;
-@@ -462,7 +467,7 @@
- fp = fopen(cnf.map, "r");
- if (fp == NULL)
- {
-- log(LOG_NOTICE, "map %s not found", cnf.map);
-+ mylog(LOG_NOTICE, "map %s not found", cnf.map);
- return -1; /* should be TEMPFAIL */
- }
- while (fgets(buf, sizeof(buf), fp) != NULL)
-@@ -580,7 +585,7 @@
- }
- argp++;
- }
-- log(LOG_DEBUG, "reading map: domain = %s, map = %s",
-+ mylog(LOG_DEBUG, "reading map: domain = %s, map = %s",
- mapp->name, tmpbuf);
- }
- }
-@@ -604,7 +609,7 @@
- while (p != NULL)
- {
- if (cnf.debug & DEBUG_MAP)
-- log(LOG_DEBUG, "searching host map for %s: %s", domain, p);
-+ mylog(LOG_DEBUG, "searching host map for %s: %s", domain, p);
-
- if ((mapp = hash_map_lookup(p, NULL)) != NULL)
- {
diff --git a/mail/smtpfeed/patches/patch-dns.c b/mail/smtpfeed/patches/patch-dns.c
new file mode 100644
index 00000000000..fadd838a1af
--- /dev/null
+++ b/mail/smtpfeed/patches/patch-dns.c
@@ -0,0 +1,42 @@
+$NetBSD: patch-dns.c,v 1.1 2015/03/15 15:07:47 mef Exp $
+
+show_query() returning nothing
+
+--- dns.c.orig 2015-02-17 23:01:03.000000000 +0900
++++ dns.c 2015-03-12 10:59:35.000000000 +0900
+@@ -48,6 +48,13 @@ static char *_id_ = "$Id: dns.c,v 1.90 2
+ #define MAXPACKET 1024
+ #endif
+
++union answer_t {
++ HEADER qb1;
++ const char qb2[MAXPACKET];
++};
++void show_query(u_char* t, union answer_t* b, union answer_t* e);
++
++
+ #ifdef ultrix
+ #define NSADDR_LIST(x) _res.ns_list[x].addr /* ultrix implementation is strange */
+ #endif
+@@ -585,10 +592,7 @@ int sync;
+ static int nsent = 0;
+ static fd_set dsmask;
+ int max, n, fromlen, resplen, ns;
+- union {
+- HEADER qb1;
+- char qb2[MAXPACKET];
+- } answer;
++ union answer_t answer;
+ int anssiz;
+ HEADER *qp, *hp;
+ u_char *eom, *ap;
+@@ -2222,8 +2226,7 @@ long opt; /* option described in map fil
+ return 0;
+ }
+
+-show_query(t, b, e)
+-u_char *t, *b, *e;
++void show_query(u_char* t, union answer_t* b, union answer_t* e)
+ {
+ char nbuf[MAXDNAME+1];
+ register int n;