mirror of
https://github.com/vdukhovni/postfix
synced 2025-08-31 06:05:37 +00:00
postfix-1.1.11-20020718
This commit is contained in:
committed by
Viktor Dukhovni
parent
1289303582
commit
330ffa18b5
@@ -6700,6 +6700,13 @@ Apologies for any names omitted.
|
|||||||
Jun-ichiro itojun Hagino, IIJ labs. Files: smtpd/smtpd_check.c,
|
Jun-ichiro itojun Hagino, IIJ labs. Files: smtpd/smtpd_check.c,
|
||||||
dns/dns_lookup.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:
|
Open problems:
|
||||||
|
|
||||||
Medium: should permit_mx_backup defer delivery if DNS
|
Medium: should permit_mx_backup defer delivery if DNS
|
||||||
|
@@ -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 \
|
mail_addr_map mail_date maps mynetworks mypwd namadr_list \
|
||||||
off_cvt quote_822_local rec2stream recdump resolve_clnt \
|
off_cvt quote_822_local rec2stream recdump resolve_clnt \
|
||||||
resolve_local rewrite_clnt stream2rec string_list tok822_parse \
|
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
|
LIBS = ../../lib/libutil.a
|
||||||
LIB_DIR = ../../lib
|
LIB_DIR = ../../lib
|
||||||
@@ -226,8 +227,13 @@ strip_addr: $(LIB) $(LIBS)
|
|||||||
$(CC) -DTEST $(CFLAGS) -o $@ $@.c $(LIB) $(LIBS) $(SYSLIBS)
|
$(CC) -DTEST $(CFLAGS) -o $@ $@.c $(LIB) $(LIBS) $(SYSLIBS)
|
||||||
mv junk $@.o
|
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 \
|
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_test: tok822_parse tok822_parse.in tok822_parse.ref
|
||||||
./tok822_parse <tok822_parse.in >tok822_parse.tmp
|
./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
|
diff tok822_limit.ref tok822_limit.tmp
|
||||||
rm -f 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)
|
printfck: $(OBJS) $(PROG)
|
||||||
rm -rf printfck
|
rm -rf printfck
|
||||||
mkdir printfck
|
mkdir printfck
|
||||||
@@ -272,10 +290,6 @@ printfck: $(OBJS) $(PROG)
|
|||||||
set -e; for i in *.c; do printfck -f .printfck $$i >printfck/$$i; done
|
set -e; for i in *.c; do printfck -f .printfck $$i >printfck/$$i; done
|
||||||
cd printfck; make "INC_DIR=../../../include" `cd ..; ls *.o`
|
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:
|
||||||
lint $(DEFS) $(SRCS) $(LINTFIX)
|
lint $(DEFS) $(SRCS) $(LINTFIX)
|
||||||
|
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
* Patches change the patchlevel and the release date. Snapshots change the
|
* Patches change the patchlevel and the release date. Snapshots change the
|
||||||
* release date only, unless they include the same bugfix as a patch release.
|
* 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 VAR_MAIL_VERSION "mail_version"
|
||||||
#define DEF_MAIL_VERSION "1.1.11-" MAIL_RELEASE_DATE
|
#define DEF_MAIL_VERSION "1.1.11-" MAIL_RELEASE_DATE
|
||||||
|
8
postfix/src/global/virtual8.in
Normal file
8
postfix/src/global/virtual8.in
Normal 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
|
8
postfix/src/global/virtual8.ref
Normal file
8
postfix/src/global/virtual8.ref
Normal 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)
|
3
postfix/src/global/virtual8_map
Normal file
3
postfix/src/global/virtual8_map
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
@domain.tld catchall
|
||||||
|
aaa@domain.tld aaa
|
||||||
|
bbb@domain.tld bbb
|
@@ -63,7 +63,7 @@ const char *virtual8_maps_find(MAPS *maps, const char *recipient)
|
|||||||
{
|
{
|
||||||
const char *ratsign;
|
const char *ratsign;
|
||||||
const char *result;
|
const char *result;
|
||||||
char *bare;
|
char *bare = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Look up the address minus the optional extension. This is done first,
|
* 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.
|
* Look up the full address.
|
||||||
*/
|
*/
|
||||||
result = maps_find(maps, recipient, DICT_FLAG_FIXED);
|
if (bare == 0) {
|
||||||
if (result != 0 || dict_errno != 0)
|
result = maps_find(maps, recipient, DICT_FLAG_FIXED);
|
||||||
return (result);
|
if (result != 0 || dict_errno != 0)
|
||||||
|
return (result);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Look up the @domain catch-all.
|
* Look up the @domain catch-all.
|
||||||
@@ -92,3 +94,38 @@ const char *virtual8_maps_find(MAPS *maps, const char *recipient)
|
|||||||
return (0);
|
return (0);
|
||||||
return (maps_find(maps, ratsign, DICT_FLAG_FIXED));
|
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
|
||||||
|
Reference in New Issue
Block a user