* internet_addressing.c: added. (Internet address to Citadel mapping)
[citadel.git] / citadel / internet_addressing.c
1 /*
2  * $Id$
3  *
4  * This file contains functions which handle the mapping of Internet addresses
5  * to users on the Citadel system.
6  */
7
8 #include "sysdep.h"
9 #include <stdlib.h>
10 #include <unistd.h>
11 #include <stdio.h>
12 #include <fcntl.h>
13 #include <signal.h>
14 #include <pwd.h>
15 #include <errno.h>
16 #include <sys/types.h>
17 #include <sys/time.h>
18 #include <sys/wait.h>
19 #include <string.h>
20 #include <limits.h>
21 #include "citadel.h"
22 #include "server.h"
23 #include <time.h>
24 #include "sysdep_decls.h"
25 #include "citserver.h"
26 #include "support.h"
27 #include "config.h"
28 #include "tools.h"
29 #include "internet_addressing.h"
30
31 /*
32  * Return 0 if a given string fuzzy-matches a Citadel user account
33  *
34  * FIX ... this needs to be updated to match any and all ways of addressing
35  *         a user.  It may even be appropriate to move this out of SMTP and
36  *         into the server core.
37  */
38 int fuzzy_match(struct usersupp *us, char *matchstring) {
39         int a;
40
41         for (a=0; a<strlen(us->fullname); ++a) {
42                 if (!strncasecmp(&us->fullname[a],
43                    matchstring, strlen(matchstring))) {
44                         return 0;
45                 }
46         }
47         return -1;
48 }
49
50