$NetBSD: patch-af,v 1.3 2000/09/03 10:31:14 wiz Exp $
--- sendmail/recipient.c-	Sat Aug 19 00:40:04 2000
+++ sendmail/recipient.c	Sat Aug 19 00:42:11 2000
@@ -29,8 +29,9 @@
 static ADDRESS **chainlast;
 
 void
-make_rcpt_hash(sendq)
+make_rcpt_hash(sendq, e)
 	register ADDRESS **sendq;
+	register ENVELOPE *e;
 {
 	ADDRESS **pq, *q;
 	int hfunc;
@@ -40,8 +41,14 @@
 
 	for (pq = sendq; (q = *pq) != NULL; pq = &q->q_next)
 	{
-		char *p = q->q_paddr;
+		char *p;
+		ADDRESS *a;
 
+		a = parseaddr(q->q_paddr, NULLADDR, RF_COPYALL, '\0', NULL, e);
+		if (a == NULL)
+			p = "";
+		else
+			p = a->q_user;
 		hfunc = 0;
 		while (*p != '\0')
 		{
@@ -561,9 +568,15 @@
 	if (use_hash)
 	{
 		/* get hash entry */
-		char *p = a->q_paddr;
-		hfunc = 0;
+		char *p;
+		register ADDRESS *b;
 
+		b = parseaddr(a->q_paddr, NULLADDR, RF_COPYALL, '\0', NULL, e);
+		if (b == NULL)
+			p = "";
+		else
+			p = b->q_user;
+		hfunc = 0;
 		while (*p != '\0')
 		{
 			int c = *p++;
@@ -1588,7 +1601,7 @@
 	ctladdr->q_flags &= ~QSELFREF;
 	nincludes = 0;
 #if RCPT_HASH
-	make_rcpt_hash(sendq);
+	make_rcpt_hash(sendq, e);
 #endif
 	while (fgets(buf, sizeof buf, fp) != NULL && !maxreached)
 	{
@@ -1605,7 +1618,14 @@
 			    isascii(p[-1]) && isspace(p[-1]) &&
 			    (p[3] == '\0' || (isascii(p[3]) && isspace(p[3]))))
 			{
+#if 1
+				p--;
+				while (p > buf && isspace(p[-1]))
+					p--;
+				p[0] = '\0';
+#else
 				p[-1] = '\0';
+#endif
 				break;
 			}
 		}