--- contrib/sendmail/src/sendmail.h.orig 2008-11-05 14:50:21.000000000 +0700 +++ contrib/sendmail/src/sendmail.h 2008-11-05 14:50:41.000000000 +0700 @@ -1212,6 +1212,7 @@ short map_specificity; /* specificity of aliases */ MAP *map_stack[MAXMAPSTACK]; /* list for stacked maps */ short map_return[MAXMAPACTIONS]; /* return bitmaps for stacked maps */ + char *map_napp; /* to append to "notfound" matches */ }; --- contrib/sendmail/src/map.c.orig 2008-11-05 14:51:13.000000000 +0700 +++ contrib/sendmail/src/map.c 2008-11-05 14:56:01.000000000 +0700 @@ -204,6 +204,10 @@ map->map_app = ++p; break; + case 'F': + map->map_napp = ++p; + break; + case 'T': map->map_tapp = ++p; break; @@ -265,6 +269,8 @@ } if (map->map_app != NULL) map->map_app = newstr(map->map_app); + if (map->map_napp != NULL) + map->map_napp = newstr(map->map_napp); if (map->map_tapp != NULL) map->map_tapp = newstr(map->map_tapp); if (map->map_keycolnm != NULL) --- contrib/sendmail/src/parseaddr.c.orig 2008-11-05 14:53:11.000000000 +0700 +++ contrib/sendmail/src/parseaddr.c 2008-11-05 14:54:03.000000000 +0700 @@ -1875,6 +1875,25 @@ rwbuf); return rwbuf; } + if (status == EX_NOTFOUND && map->map_napp != NULL) + { + size_t i = strlen(key) + strlen(map->map_napp) + 1; + static char *rwbuf = NULL; + static size_t rwbuflen = 0; + + if (i > rwbuflen) + { + if (rwbuf != NULL) + sm_free(rwbuf); + rwbuflen = i; + rwbuf = (char *) sm_pmalloc_x(rwbuflen); + } + (void) sm_strlcpyn(rwbuf, rwbuflen, 2, key, map->map_napp); + if (tTd(60, 4)) + sm_dprintf("map_lookup notfound: returning \"%s\"\n", + rwbuf); + return rwbuf; + } return replac; } /*