2
0
mirror of https://github.com/vdukhovni/postfix synced 2025-08-30 13:48:06 +00:00

postfix-1.1.11-20020718

This commit is contained in:
Wietse Venema 2002-07-18 00:00:00 -05:00 committed by Viktor Dukhovni
parent 1289303582
commit 330ffa18b5
7 changed files with 88 additions and 11 deletions

View File

@ -6700,6 +6700,13 @@ Apologies for any names omitted.
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

View File

@ -73,7 +73,8 @@ TESTPROG= domain_list dot_lockfile mail_addr_crunch mail_addr_find \
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
@ -226,8 +227,13 @@ strip_addr: $(LIB) $(LIBS)
$(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
@ -264,6 +270,18 @@ tok822_limit_test: tok822_parse tok822_limit.in tok822_limit.ref
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
@ -272,10 +290,6 @@ printfck: $(OBJS) $(PROG)
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)

View File

@ -20,7 +20,7 @@
* 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

View File

@ -0,0 +1,8 @@
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

View File

@ -0,0 +1,8 @@
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)

View File

@ -0,0 +1,3 @@
@domain.tld catchall
aaa@domain.tld aaa
bbb@domain.tld bbb

View File

@ -63,7 +63,7 @@ const char *virtual8_maps_find(MAPS *maps, const char *recipient)
{
const char *ratsign;
const char *result;
char *bare;
char *bare = 0;
/*
* Look up the address minus the optional extension. This is done first,
@ -81,9 +81,11 @@ const char *virtual8_maps_find(MAPS *maps, const char *recipient)
/*
* 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.
@ -92,3 +94,38 @@ const char *virtual8_maps_find(MAPS *maps, const char *recipient)
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