Jun-ichiro itojun Hagino, IIJ labs. Files: smtpd/smtpd_check.c,
dns/dns_lookup.c.
+20020718
+
+ Bugfix: unnecessary lookups for extended addresses by the
+ virtual8_maps_find() routine. Victor Duchovni. His patch
+ did not work, nor did my own, but the present version should
+ be OK. File: global/virtual8_maps_find.c.
+
Open problems:
Medium: should permit_mx_backup defer delivery if DNS
mail_addr_map mail_date maps mynetworks mypwd namadr_list \
off_cvt quote_822_local rec2stream recdump resolve_clnt \
resolve_local rewrite_clnt stream2rec string_list tok822_parse \
- quote_821_local mail_conf_time mime_state strip_addr
+ quote_821_local mail_conf_time mime_state strip_addr \
+ virtual8_maps_find
LIBS = ../../lib/libutil.a
LIB_DIR = ../../lib
$(CC) -DTEST $(CFLAGS) -o $@ $@.c $(LIB) $(LIBS) $(SYSLIBS)
mv junk $@.o
+virtual8_maps_find: $(LIB) $(LIBS)
+ mv $@.o junk
+ $(CC) -DTEST $(CFLAGS) -o $@ $@.c $(LIB) $(LIBS) $(SYSLIBS)
+ mv junk $@.o
+
tests: tok822_test mime_test mime_nest mime_8bit mime_dom mime_trunc \
- strip_addr_test tok822_limit_test
+ strip_addr_test tok822_limit_test virtual8_test
tok822_test: tok822_parse tok822_parse.in tok822_parse.ref
./tok822_parse <tok822_parse.in >tok822_parse.tmp
diff tok822_limit.ref tok822_limit.tmp
rm -f tok822_limit.tmp
+strip_addr_test: strip_addr strip_addr.ref
+ ./strip_addr 2>strip_addr.tmp
+ diff strip_addr.ref strip_addr.tmp
+ rm -f strip_addr.tmp
+
+virtual8_test: virtual8_maps_find virtual8_map virtual8.in virtual8.ref \
+ ../postmap/postmap
+ ../postmap/postmap hash:virtual8_map
+ ./virtual8_maps_find <virtual8.in hash:virtual8_map >virtual8.tmp
+ diff virtual8.ref virtual8.tmp
+ rm -f virtual8.tmp virtual8_map.db
+
printfck: $(OBJS) $(PROG)
rm -rf printfck
mkdir printfck
set -e; for i in *.c; do printfck -f .printfck $$i >printfck/$$i; done
cd printfck; make "INC_DIR=../../../include" `cd ..; ls *.o`
-strip_addr_test: strip_addr strip_addr.ref
- ./strip_addr 2>strip_addr.tmp
- diff strip_addr.ref strip_addr.tmp
- rm -f strip_addr.tmp
lint:
lint $(DEFS) $(SRCS) $(LINTFIX)
* Patches change the patchlevel and the release date. Snapshots change the
* release date only, unless they include the same bugfix as a patch release.
*/
-#define MAIL_RELEASE_DATE "20020717"
+#define MAIL_RELEASE_DATE "20020718"
#define VAR_MAIL_VERSION "mail_version"
#define DEF_MAIL_VERSION "1.1.11-" MAIL_RELEASE_DATE
--- /dev/null
+aaa@domain.tld
+aaa+xxx@domain.tld
+bbb@domain.tld
+bbb+yyy@domain.tld
+ccc@domain.tld
+ccc+zzz@domain.tld
+aaa@domain.ttt
+aaa+bbb@domain.ttt
--- /dev/null
+aaa@domain.tld -> aaa
+aaa+xxx@domain.tld -> aaa
+bbb@domain.tld -> bbb
+bbb+yyy@domain.tld -> bbb
+ccc@domain.tld -> catchall
+ccc+zzz@domain.tld -> catchall
+aaa@domain.ttt -> (none)
+aaa+bbb@domain.ttt -> (none)
--- /dev/null
+@domain.tld catchall
+aaa@domain.tld aaa
+bbb@domain.tld bbb
{
const char *ratsign;
const char *result;
- char *bare;
+ char *bare = 0;
/*
* Look up the address minus the optional extension. This is done first,
/*
* Look up the full address.
*/
- result = maps_find(maps, recipient, DICT_FLAG_FIXED);
- if (result != 0 || dict_errno != 0)
- return (result);
+ if (bare == 0) {
+ result = maps_find(maps, recipient, DICT_FLAG_FIXED);
+ if (result != 0 || dict_errno != 0)
+ return (result);
+ }
/*
* Look up the @domain catch-all.
return (0);
return (maps_find(maps, ratsign, DICT_FLAG_FIXED));
}
+
+#ifdef TEST
+
+#include <vstream.h>
+#include <vstring.h>
+#include <vstring_vstream.h>
+
+#define STR(x) vstring_str(x)
+
+int main(int argc, char **argv)
+{
+ VSTRING *buffer;
+ MAPS *maps;
+ const char *result;
+
+ if (argc != 2)
+ msg_fatal("usage: %s mapname", argv[0]);
+
+ var_rcpt_delim = "+";
+ var_double_bounce_sender = DEF_DOUBLE_BOUNCE;
+
+ maps = maps_create("testmap", argv[1], DICT_FLAG_LOCK);
+ buffer = vstring_alloc(1);
+
+ while (vstring_fgets_nonl(buffer, VSTREAM_IN)) {
+ result = virtual8_maps_find(maps, STR(buffer));
+ vstream_printf("%s -> %s\n", STR(buffer), result ? result : "(none)");
+ vstream_fflush(VSTREAM_OUT);
+ }
+ maps_free(maps);
+ vstring_free(buffer);
+ return (0);
+}
+
+#endif