]>
Commit | Line | Data |
---|---|---|
719b785a | 1 | diff -uNr exim-3.31/exim-texinfo-3.30/doc/spec.texinfo exim-3.31-whoson/exim-texinfo-3.30/doc/spec.texinfo |
2 | --- exim-3.31/exim-texinfo-3.30/doc/spec.texinfo Thu Jul 19 18:41:19 2001 | |
3 | +++ exim-3.31-whoson/exim-texinfo-3.30/doc/spec.texinfo Thu Jul 19 18:40:46 2001 | |
4 | @@ -3586,6 +3586,7 @@ | |
5 | ||
6 | LOOKUP_DBM=yes | |
7 | LOOKUP_LSEARCH=yes | |
8 | +LOOKUP_WHOSON=yes | |
9 | @end example | |
10 | ||
11 | which means that only linear searching and DBM lookups are included by default. | |
12 | @@ -3758,6 +3759,17 @@ | |
13 | "More about dnsdb" below. | |
14 | ||
15 | @item | |
16 | +@dfn{whoson}: This is the lookup type that performs lookups for relay allowed | |
17 | +dialups using WHOSON (pop before smtp) service. You have to give it an IP | |
18 | +address of host in question. It returns username associated in WHOSON database | |
19 | +with queried IP address, or nothing, if given IP is unknown. Primary use is: | |
20 | + | |
21 | +@example | |
22 | + | |
23 | +host_relay_accept = localhost : net-whoson;$key | |
24 | +@end example | |
25 | + | |
26 | +@item | |
27 | @dfn{testdb}: This is a lookup type which is for use in debugging Exim. It is | |
28 | not likely to be useful in normal operation. | |
29 | @end itemize | |
30 | diff -uNr exim-3.31/scripts/MakeLinks exim-3.31-whoson/scripts/MakeLinks | |
31 | --- exim-3.31/scripts/MakeLinks Mon Jul 2 11:46:41 2001 | |
32 | +++ exim-3.31-whoson/scripts/MakeLinks Thu Jul 19 18:28:52 2001 | |
33 | @@ -79,6 +79,8 @@ | |
34 | ln -s ../../src/lookups/pgsql.c pgsql.c | |
35 | ln -s ../../src/lookups/testdb.h testdb.h | |
36 | ln -s ../../src/lookups/testdb.c testdb.c | |
37 | +ln -s ../../src/lookups/whoson.h whoson.h | |
38 | +ln -s ../../src/lookups/whoson.c whoson.c | |
39 | cd .. | |
40 | ||
41 | # Likewise for the code for the directors | |
42 | diff -uNr exim-3.31/src/EDITME exim-3.31-whoson/src/EDITME | |
43 | --- exim-3.31/src/EDITME Thu Jul 19 18:41:19 2001 | |
44 | +++ exim-3.31-whoson/src/EDITME Thu Jul 19 18:28:52 2001 | |
45 | @@ -578,3 +578,5 @@ | |
46 | # USE_TCP_WRAPPERS=yes | |
47 | ||
48 | # End of EDITME | |
49 | + | |
50 | +LOOKUP_WHOSON=yes | |
51 | diff -uNr exim-3.31/src/config.h.defaults exim-3.31-whoson/src/config.h.defaults | |
52 | --- exim-3.31/src/config.h.defaults Mon Jul 2 11:46:41 2001 | |
53 | +++ exim-3.31-whoson/src/config.h.defaults Thu Jul 19 18:28:52 2001 | |
54 | @@ -106,3 +106,5 @@ | |
55 | #define ROOT_UID 0 | |
56 | ||
57 | /* End of config.h.defaults */ | |
58 | + | |
59 | +#define LOOKUP_WHOSON | |
60 | diff -uNr exim-3.31/src/drtables.c exim-3.31-whoson/src/drtables.c | |
61 | --- exim-3.31/src/drtables.c Mon Jul 2 11:46:42 2001 | |
62 | +++ exim-3.31-whoson/src/drtables.c Thu Jul 19 18:28:52 2001 | |
63 | @@ -75,6 +75,10 @@ | |
64 | #include "lookups/testdb.h" | |
65 | #endif | |
66 | ||
67 | +#ifdef LOOKUP_WHOSON | |
68 | +#include "lookups/whoson.h" | |
69 | +#endif | |
70 | + | |
71 | ||
72 | /* The second field in each item below is a set of bit flags: | |
73 | ||
74 | @@ -325,6 +329,19 @@ | |
75 | NULL, /* no close function */ | |
76 | NULL, /* no tidy function */ | |
77 | NULL /* no quoting function */ | |
78 | + }, | |
79 | +#endif | |
80 | + | |
81 | +#ifdef LOOKUP_WHOSON | |
82 | + { | |
83 | + "whoson", /* lookup name */ | |
84 | + lookup_querystyle, /* query-style lookup */ | |
85 | + whoson_open, /* open function */ | |
86 | + NULL, /* check function */ | |
87 | + whoson_find, /* find function */ | |
88 | + NULL, /* no close function */ | |
89 | + NULL, /* no tidy function */ | |
90 | + NULL /* no quoting function */ | |
91 | }, | |
92 | #endif | |
93 | ||
94 | diff -uNr exim-3.31/src/lookups/Makefile exim-3.31-whoson/src/lookups/Makefile | |
95 | --- exim-3.31/src/lookups/Makefile Mon Jul 2 11:46:43 2001 | |
96 | +++ exim-3.31-whoson/src/lookups/Makefile Thu Jul 19 18:28:52 2001 | |
97 | @@ -4,7 +4,7 @@ | |
98 | # defined, dummy modules get compiled. | |
99 | ||
100 | OBJ = cdb.o dbmdb.o dnsdb.o ldap.o lsearch.o mysql.o nis.o nisplus.o pgsql.o \ | |
101 | - testdb.o | |
102 | + testdb.o whoson.o | |
103 | ||
104 | lookups.a: $(OBJ) | |
105 | /bin/rm -f lookups.a | |
106 | @@ -25,5 +25,6 @@ | |
107 | nisplus.o: $(HDRS) nisplus.c nisplus.h | |
108 | pgsql.o: $(HDRS) pgsql.c pgsql.h | |
109 | testdb.o: $(HDRS) testdb.c testdb.h | |
110 | +whoson.o: $(HDRS) whoson.c whoson.h | |
111 | ||
112 | # End | |
113 | diff -uNr exim-3.31/src/lookups/whoson.c exim-3.31-whoson/src/lookups/whoson.c | |
114 | --- exim-3.31/src/lookups/whoson.c Thu Jan 1 01:00:00 1970 | |
115 | +++ exim-3.31-whoson/src/lookups/whoson.c Thu Jul 19 18:28:52 2001 | |
116 | @@ -0,0 +1,57 @@ | |
117 | +/************************************************* | |
118 | +* Exim - an Internet mail transport agent * | |
119 | +*************************************************/ | |
120 | + | |
121 | +/* Copyright (c) University of Cambridge 1995 - 2001 */ | |
122 | +/* See the file NOTICE for conditions of use and distribution. */ | |
123 | + | |
124 | +#include <whoson.h> | |
125 | + | |
126 | +#include "../exim.h" | |
127 | +#include "whoson.h" | |
128 | + | |
129 | + | |
130 | +/************************************************* | |
131 | +* Open entry point * | |
132 | +*************************************************/ | |
133 | + | |
134 | +/* See local README for interface description. */ | |
135 | + | |
136 | +void * | |
137 | +whoson_open(char *filename, char **errmsg) | |
138 | +{ | |
139 | +filename = filename; /* Keep picky compilers happy */ | |
140 | +errmsg = errmsg; | |
141 | +return (void *)(1); /* Just return something non-null */ | |
142 | +} | |
143 | + | |
144 | + | |
145 | + | |
146 | +/************************************************* | |
147 | +* Find entry point * | |
148 | +*************************************************/ | |
149 | + | |
150 | +/* See local README for interface description. */ | |
151 | + | |
152 | +int | |
153 | +whoson_find(void *handle, char *filename, char *query, int length, | |
154 | + char **result, char **errmsg) | |
155 | +{ | |
156 | +char buffer[80]; | |
157 | +handle = handle; /* Keep picky compilers happy */ | |
158 | +filename = filename; | |
159 | +length = length; | |
160 | +errmsg = errmsg; | |
161 | + | |
162 | +switch (wso_query(query,buffer,80)) { | |
163 | +case 0: | |
164 | + *result = string_copy(buffer); | |
165 | + return OK; | |
166 | +case -1: | |
167 | + return DEFER; | |
168 | +default: | |
169 | + return FAIL; | |
170 | +} | |
171 | +} | |
172 | + | |
173 | +/* End of lookups/whoson.c */ | |
174 | diff -uNr exim-3.31/src/lookups/whoson.h exim-3.31-whoson/src/lookups/whoson.h | |
175 | --- exim-3.31/src/lookups/whoson.h Thu Jan 1 01:00:00 1970 | |
176 | +++ exim-3.31-whoson/src/lookups/whoson.h Thu Jul 19 18:28:52 2001 | |
177 | @@ -0,0 +1,13 @@ | |
178 | +/************************************************* | |
179 | +* Exim - an Internet mail transport agent * | |
180 | +*************************************************/ | |
181 | + | |
182 | +/* Copyright (c) University of Cambridge 1995 - 2001 */ | |
183 | +/* See the file NOTICE for conditions of use and distribution. */ | |
184 | + | |
185 | +/* Header for the whoson lookup */ | |
186 | + | |
187 | +extern void *whoson_open(char *, char **); | |
188 | +extern int whoson_find(void *, char *, char *, int, char **, char **); | |
189 | + | |
190 | +/* End of lookups/whoson.h */ |